diff --git a/packages/google-devicesandservices-health/.eslintignore b/packages/google-devicesandservices-health/.eslintignore new file mode 100644 index 000000000000..cfc348ec4d11 --- /dev/null +++ b/packages/google-devicesandservices-health/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/packages/google-devicesandservices-health/.eslintrc.json b/packages/google-devicesandservices-health/.eslintrc.json new file mode 100644 index 000000000000..3e8d97ccb390 --- /dev/null +++ b/packages/google-devicesandservices-health/.eslintrc.json @@ -0,0 +1,4 @@ +{ + "extends": "./node_modules/gts", + "root": true +} diff --git a/packages/google-devicesandservices-health/README.md b/packages/google-devicesandservices-health/README.md index 59cdd45a9e48..35c82a903323 100644 --- a/packages/google-devicesandservices-health/README.md +++ b/packages/google-devicesandservices-health/README.md @@ -66,9 +66,20 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ | reconcile data points | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/data_points_service.reconcile_data_points.js) | | roll up data points | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/data_points_service.roll_up_data_points.js) | | update data point | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/data_points_service.update_data_point.js) | +| create subscriber | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.create_subscriber.js) | +| create subscription | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.create_subscription.js) | +| delete subscriber | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.delete_subscriber.js) | +| delete subscription | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.delete_subscription.js) | +| list subscribers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.list_subscribers.js) | +| list subscriptions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.list_subscriptions.js) | +| update subscriber | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.update_subscriber.js) | +| update subscription | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.update_subscription.js) | | get identity | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.get_identity.js) | +| get irn profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.get_irn_profile.js) | +| get paired device | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.get_paired_device.js) | | get profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.get_profile.js) | | get settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.get_settings.js) | +| list paired devices | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.list_paired_devices.js) | | update profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.update_profile.js) | | update settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.update_settings.js) | | devicesandservices | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/samples/generated/v4/snippet_metadata_google.devicesandservices.health.v4.json) | @@ -105,7 +116,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). Please note that this `README.md` and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) @@ -115,7 +126,7 @@ are generated from a central template. Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devicesandservices-health/LICENSE) +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project diff --git a/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/data_model.proto b/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/data_model.proto index 2bb2a9d69068..f39f8e48008e 100644 --- a/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/data_model.proto +++ b/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/data_model.proto @@ -19,6 +19,7 @@ package google.devicesandservices.health.v4; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/devicesandservices/health/v4/data_coordinates.proto"; +import "google/devicesandservices/health/v4/medical_device_info.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "google/type/date.proto"; @@ -49,6 +50,225 @@ enum HeartRateZoneType { PEAK = 4; } +// Enum representing the access level of a food item. +enum FoodAccessLevel { + // Unspecified food access level. + FOOD_ACCESS_LEVEL_UNSPECIFIED = 0; + + // Public food access level. + FOOD_ACCESS_LEVEL_PUBLIC = 1; + + // Private food access level. + FOOD_ACCESS_LEVEL_PRIVATE = 2; +} + +// Enum representing the meal type. +enum MealType { + // Unspecified meal type. + MEAL_TYPE_UNSPECIFIED = 0; + + // Value representing a meal before breakfast. + BEFORE_BREAKFAST = 1; + + // Value representing a breakfast. + BREAKFAST = 2; + + // Value representing a morning snack. + BEFORE_LUNCH = 3; + + // Value representing a lunch. + LUNCH = 4; + + // Value representing an afternoon snack. + BEFORE_DINNER = 5; + + // Value representing dinner. + DINNER = 6; + + // Value representing an evening snack. + AFTER_DINNER = 7; + + // Value representing any meal outside of the usual three meals per day. + SNACK = 8; + + // Value representing any time (legacy NA). + ANYTIME = 9; +} + +// Enum representing the unit of energy. +enum EnergyUnit { + // Unspecified energy unit. + ENERGY_UNIT_UNSPECIFIED = 0; + + // Value representing joule. + JOULE = 1; + + // Value representing kilojoule. + KILOJOULE = 2; + + // Value representing kilocalorie. + KILOCALORIE = 3; + + // Value representing small calorie. + SMALL_CALORIE = 4; + + // Value representing calorie. + CALORIE = 5; +} + +// Holds information about a user logged food. +enum Nutrient { + // Unspecified nutrient. + NUTRIENT_UNSPECIFIED = 0; + + // Value representing biotin nutrient. + BIOTIN = 1; + + // Value representing caffeine nutrient. + CAFFEINE = 2; + + // Value representing calcium nutrient. + CALCIUM = 3; + + // Value representing chloride nutrient. + CHLORIDE = 4; + + // Value representing carbohydrates nutrient. + CARBOHYDRATES = 5; + + // Value representing cholesterol nutrient. + CHOLESTEROL = 6; + + // Value representing chromium nutrient. + CHROMIUM = 7; + + // Value representing copper nutrient. + COPPER = 8; + + // Value representing dietary fiber nutrient. + DIETARY_FIBER = 9; + + // Value representing folic acid nutrient. + FOLIC_ACID = 10; + + // Value representing iodine nutrient. + IODINE = 11; + + // Value representing iron nutrient. + IRON = 12; + + // Value representing magnesium nutrient. + MAGNESIUM = 13; + + // Value representing manganese nutrient. + MANGANESE = 14; + + // Value representing molybdenum nutrient. + MOLYBDENUM = 15; + + // Value representing monounsaturated fat nutrient. + MONOUNSATURATED_FAT = 16; + + // Value representing niacin nutrient. + NIACIN = 17; + + // Value representing pantothenic acid nutrient. + PANTOTHENIC_ACID = 18; + + // Value representing phosphorus nutrient. + PHOSPHORUS = 19; + + // Value representing polyunsaturated fat nutrient. + POLYUNSATURATED_FAT = 20; + + // Value representing potassium nutrient. + POTASSIUM = 21; + + // Value representing protein nutrient. + PROTEIN = 22; + + // Value representing riboflavin nutrient. + RIBOFLAVIN = 23; + + // Value representing saturated fat nutrient. + SATURATED_FAT = 24; + + // Value representing selenium nutrient. + SELENIUM = 25; + + // Value representing sodium nutrient. + SODIUM = 26; + + // Value representing sugar nutrient. + SUGAR = 27; + + // Value representing thiamin nutrient. + THIAMIN = 28; + + // Value representing trans fat nutrient. + TRANS_FAT = 29; + + // Value representing unsaturated fat nutrient. + UNSATURATED_FAT = 30; + + // Value representing vitamin A nutrient. + VITAMIN_A = 31; + + // Value representing vitamin B12 nutrient. + VITAMIN_B12 = 32; + + // Value representing vitamin B6 nutrient. + VITAMIN_B6 = 33; + + // Value representing vitamin C nutrient. + VITAMIN_C = 34; + + // Value representing vitamin D nutrient. + VITAMIN_D = 35; + + // Value representing vitamin E nutrient. + VITAMIN_E = 36; + + // Value representing vitamin K nutrient. + VITAMIN_K = 37; + + // Value representing zinc nutrient. + ZINC = 38; + + // Value representing folate nutrient. + FOLATE = 39; +} + +// Enum representing the unit of weight. +enum WeightUnit { + // Unspecified weight unit. + WEIGHT_UNIT_UNSPECIFIED = 0; + + // Value representing gram. + GRAM = 1; + + // Value representing kilogram. + KILOGRAM = 2; + + // Value representing ounce. + OUNCE = 3; + + // Value representing pound. + POUND = 4; + + // Value representing stone. + STONE = 5; + + // Value representing milligram. + MILLIGRAM = 6; + + // Value representing microgram. + MICROGRAM = 7; + + // Value representing nanogram. + NANOGRAM = 8; +} + // Enum representing the unit of volume. enum VolumeUnit { // Unspecified volume unit. @@ -106,19 +326,20 @@ message ActiveZoneMinutes { // Required. Number of Active Zone Minutes earned in the given time interval. // Note: active_zone_minutes equals to 1 for low intensity (fat burn) zones or // 2 for high intensity zones (cardio, peak). - int64 active_zone_minutes = 3 [(google.api.field_behavior) = REQUIRED]; + optional int64 active_zone_minutes = 3 + [(google.api.field_behavior) = REQUIRED]; } // Represents the result of the rollup of the active zone minutes data type. message ActiveZoneMinutesRollupValue { // Active zone minutes in `HeartRateZone.CARDIO`. - int64 sum_in_cardio_heart_zone = 1; + optional int64 sum_in_cardio_heart_zone = 1; // Active zone minutes in `HeartRateZone.PEAK`. - int64 sum_in_peak_heart_zone = 2; + optional int64 sum_in_peak_heart_zone = 2; // Active zone minutes in `HeartRateZone.FAT_BURN`. - int64 sum_in_fat_burn_heart_zone = 3; + optional int64 sum_in_fat_burn_heart_zone = 3; } // Record of active minutes in a given time interval. @@ -129,7 +350,7 @@ message ActiveMinutes { ActivityLevel activity_level = 1 [(google.api.field_behavior) = REQUIRED]; // Required. Number of whole minutes spent in activity. - int64 active_minutes = 2 [(google.api.field_behavior) = REQUIRED]; + optional int64 active_minutes = 2 [(google.api.field_behavior) = REQUIRED]; } // Activity level. @@ -164,7 +385,7 @@ message ActiveMinutesRollupValue { ActiveMinutes.ActivityLevel activity_level = 1; // Number of whole minutes spent in activity. - int64 active_minutes_sum = 2; + optional int64 active_minutes_sum = 2; } // Active minutes by activity level. At most one record per activity level @@ -224,7 +445,7 @@ message Altitude { ObservationTimeInterval interval = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Altitude gain in millimeters over the observed interval. - int64 gain_millimeters = 3 [(google.api.field_behavior) = REQUIRED]; + optional int64 gain_millimeters = 3 [(google.api.field_behavior) = REQUIRED]; } // Number of calories burned due to basal metabolic rate (BMR) over a period of @@ -235,7 +456,7 @@ message BasalEnergyBurned { // Required. Number of calories burned due to basal metabolic rate in // kilocalories over the observed interval. - double kcal = 2 [(google.api.field_behavior) = REQUIRED]; + optional double kcal = 2 [(google.api.field_behavior) = REQUIRED]; } // Body fat measurement. @@ -245,13 +466,101 @@ message BodyFat { [(google.api.field_behavior) = REQUIRED]; // Required. Body fat percentage, in range [0, 100]. - double percentage = 3 [(google.api.field_behavior) = REQUIRED]; + optional double percentage = 3 [(google.api.field_behavior) = REQUIRED]; } // Represents the result of the rollup of the body fat data type. message BodyFatRollupValue { // Average body fat percentage. - double body_fat_percentage_avg = 1; + optional double body_fat_percentage_avg = 1; +} + +// Core body temperature measurement, distinct from peripheral body temperature, +// reflects the temperature of the body's internal organs. +message CoreBodyTemperature { + // Measurement location for core body temperature. + enum MeasurementLocation { + // Measurement location is unspecified. + MEASUREMENT_LOCATION_UNSPECIFIED = 0; + + // Other measurement location. + OTHER = 1; + + // Armpit measurement location. + ARMPIT = 2; + + // Body measurement location. + BODY = 3; + + // Ear measurement location. + EAR = 4; + + // Finger measurement location. + FINGER = 5; + + // Gastro-intestinal measurement location. + GASTRO_INTESTINAL = 6; + + // Mouth measurement location. + MOUTH = 7; + + // Rectum measurement location. + RECTUM = 8; + + // Toe measurement location. + TOE = 9; + + // Ear drum measurement location. + EAR_DRUM = 10; + + // Temporal artery measurement location. + TEMPORAL_ARTERY = 11; + + // Forehead measurement location. + FOREHEAD = 12; + + // Urinary bladder measurement location. + URINARY_BLADDER = 13; + + // Nasal measurement location. + NASAL = 14; + + // Nasopharyngeal measurement location. + NASOPHARYNGEAL = 15; + + // Wrist measurement location. + WRIST = 16; + + // Vagina measurement location. + VAGINA = 17; + } + + // Required. The time at which core body temperature was measured. + ObservationSampleTime sample_time = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The core body temperature in Celsius. + optional double temperature_celsius = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The location of the core body temperature measurement. + MeasurementLocation measurement_location = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The unique identifier of the core body temperature measurement. + string id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the result of the rollup of the core body temperature data type. +message CoreBodyTemperatureRollupValue { + // Average core body temperature in Celsius. + optional double temperature_celsius_avg = 1; + + // Maximum core body temperature in Celsius. + optional double temperature_celsius_max = 2; + + // Minimum core body temperature in Celsius. + optional double temperature_celsius_min = 3; } // Represents the result of the rollup of the calories in heart rate zone data @@ -263,7 +572,7 @@ message CaloriesInHeartRateZoneRollupValue { HeartRateZoneType heart_rate_zone = 1; // The amount of kilocalories burned in the specified heart rate zone. - double kcal = 2; + optional double kcal = 2; } // List of calories burned in each heart rate zone. @@ -280,10 +589,12 @@ message DailyHeartRateZones { [(google.api.field_behavior) = REQUIRED]; // Required. Minimum heart rate for this zone in beats per minute. - int64 min_beats_per_minute = 2 [(google.api.field_behavior) = REQUIRED]; + optional int64 min_beats_per_minute = 2 + [(google.api.field_behavior) = REQUIRED]; // Required. Maximum heart rate for this zone in beats per minute. - int64 max_beats_per_minute = 3 [(google.api.field_behavior) = REQUIRED]; + optional int64 max_beats_per_minute = 3 + [(google.api.field_behavior) = REQUIRED]; } // Required. Date (in user's timezone) of the heart rate zones record. @@ -336,7 +647,8 @@ message DailyRespiratoryRate { google.type.Date date = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The average number of breaths taken per minute. - double breaths_per_minute = 2 [(google.api.field_behavior) = REQUIRED]; + optional double breaths_per_minute = 2 + [(google.api.field_behavior) = REQUIRED]; } // A daily oxygen saturation (SpO2) record. @@ -348,19 +660,22 @@ message DailyOxygenSaturation { // Required. The average value of the oxygen saturation samples during the // sleep. - double average_percentage = 2 [(google.api.field_behavior) = REQUIRED]; + optional double average_percentage = 2 + [(google.api.field_behavior) = REQUIRED]; // Required. The lower bound of the confidence interval of oxygen saturation // samples during sleep. - double lower_bound_percentage = 3 [(google.api.field_behavior) = REQUIRED]; + optional double lower_bound_percentage = 3 + [(google.api.field_behavior) = REQUIRED]; // Required. The upper bound of the confidence interval of oxygen saturation // samples during sleep. - double upper_bound_percentage = 4 [(google.api.field_behavior) = REQUIRED]; + optional double upper_bound_percentage = 4 + [(google.api.field_behavior) = REQUIRED]; // Optional. Standard deviation of the daily oxygen saturation averages from // the past 7-30 days. - double standard_deviation_percentage = 5 + optional double standard_deviation_percentage = 5 [(google.api.field_behavior) = OPTIONAL]; } @@ -391,7 +706,7 @@ message DailyRestingHeartRate { google.type.Date date = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The resting heart rate value in beats per minute. - int64 beats_per_minute = 4 [(google.api.field_behavior) = REQUIRED]; + optional int64 beats_per_minute = 4 [(google.api.field_behavior) = REQUIRED]; // Optional. Metadata for the daily resting heart rate. DailyRestingHeartRateMetadata daily_resting_heart_rate_metadata = 5 @@ -406,17 +721,17 @@ message DailySleepTemperatureDerivations { // Required. The user's nightly skin temperature. It is the mean of skin // temperature samples taken from the user’s sleep. - double nightly_temperature_celsius = 2 + optional double nightly_temperature_celsius = 2 [(google.api.field_behavior) = REQUIRED]; // Optional. The user's baseline skin temperature. It is the median of the // user's nightly skin temperature over the past 30 days. - double baseline_temperature_celsius = 3 + optional double baseline_temperature_celsius = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. The standard deviation of the user’s relative nightly skin // temperature (temperature - baseline) over the past 30 days. - double relative_nightly_stddev_30d_celsius = 4 + optional double relative_nightly_stddev_30d_celsius = 4 [(google.api.field_behavior) = OPTIONAL]; } @@ -452,7 +767,7 @@ message DailyVO2Max { // Required. Daily VO2 max value measured as in ml consumed oxygen / kg of // body weight / min. - double vo2_max = 2 [(google.api.field_behavior) = REQUIRED]; + optional double vo2_max = 2 [(google.api.field_behavior) = REQUIRED]; // Optional. An estimated field is added to indicate when the confidence has // decreased sufficiently to consider the value an estimation. @@ -464,7 +779,8 @@ message DailyVO2Max { [(google.api.field_behavior) = OPTIONAL]; // Optional. The covariance of the VO2 max value. - double vo2_max_covariance = 5 [(google.api.field_behavior) = OPTIONAL]; + optional double vo2_max_covariance = 5 + [(google.api.field_behavior) = OPTIONAL]; } // Distance traveled over an interval of time. @@ -473,13 +789,97 @@ message Distance { ObservationTimeInterval interval = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Distance in millimeters over the observed interval. - int64 millimeters = 3 [(google.api.field_behavior) = REQUIRED]; + optional int64 millimeters = 3 [(google.api.field_behavior) = REQUIRED]; } // Result of the rollup of the user's distance. message DistanceRollupValue { // Sum of the distance in millimeters. - int64 millimeters_sum = 1; + optional int64 millimeters_sum = 1; +} + +// Represents an Electrocardiogram (ECG) measurement session. +// This data type is based on SaMD feature and any changes to it may require +// additional review. +message Electrocardiogram { + // The classification of the ECG reading rhythm. + enum ResultClassification { + // Unspecified result classification. + RESULT_CLASSIFICATION_UNSPECIFIED = 0; + + // Heart rhythm appears normal. Corresponds to result "Normal Sinus Rhythm". + NORMAL_SINUS_RHYTHM = 1; + + // Signs of Atrial Fibrillation detected. Corresponds to result "Atrial + // Fibrillation". + ATRIAL_FIBRILLATION = 2; + + // The reading is inconclusive as it could not be classified. Corresponds to + // result "Inconclusive". + INCONCLUSIVE = 3; + + // The reading is inconclusive as it could not be classified because + // heart rate is high (>120bpm). Corresponds to result "Inconclusive: High + // heart rate". + INCONCLUSIVE_HIGH_HEART_RATE = 4; + + // The reading is inconclusive as it could not be classified because + // heart rate is low (<50bpm). Corresponds to result "Inconclusive: Low + // heart rate". + INCONCLUSIVE_LOW_HEART_RATE = 5; + + // The reading is unreadable. + UNREADABLE = 6; + + // The reading was not analyzed. + NOT_ANALYZED = 7; + } + + // Required. Observed interval. + // + // NOTE: Historical ECG data lacks timezone offsets, so `start_utc_offset` + // and `end_utc_offset` will be missing or default to zero. As a result, + // the civil time fields within this interval will default to UTC. + // It is recommended to use physical time fields instead for accurate + // time referencing. + // + // NOTE: The `start_time` and `end_time` of the interval are equal, + // representing the reading time. + SessionTimeInterval interval = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Average heart rate recorded during ECG reading in beats per + // minute. + optional int64 beats_per_minute_avg = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The result classification of the ECG reading. + ResultClassification result_classification = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An array of voltage values representing lead I ECG values. + // Each sample represents voltage difference in ECG graph. + // The first value in array corresponds to the start of the reading. + repeated sint32 waveform_samples = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The sampling frequency of waveform samples in hertz. + optional int32 sampling_frequency_hertz = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The factor by which to divide waveform samples to get voltage in + // millivolts: millivolts = waveform_sample / millivolts_scaling_factor. + optional int32 millivolts_scaling_factor = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of leads used for ECG reading. + optional int32 lead_number = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The meta information for the compatible device used to conduct + // the measurement. + // + // ECG measurements typically populate `firmware_version`, `feature_version`, + // and `device_model`. + MedicalDeviceInfo medical_device_info = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // An exercise that stores information about a physical activity. @@ -579,7 +979,8 @@ message Exercise { message ExerciseMetadata { // Optional. Pool length in millimeters. Only present in the swimming // exercises. - int64 pool_length_millimeters = 1 [(google.api.field_behavior) = OPTIONAL]; + optional int64 pool_length_millimeters = 1 + [(google.api.field_behavior) = OPTIONAL]; // Optional. Whether the exercise had GPS tracking. bool has_gps = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -685,19 +1086,19 @@ message Floors { ObservationTimeInterval interval = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Number of floors in the recorded interval - int64 count = 4 [(google.api.field_behavior) = REQUIRED]; + optional int64 count = 4 [(google.api.field_behavior) = REQUIRED]; } // Represents the result of the rollup of the user's floors. message FloorsRollupValue { // Sum of the floors count. - int64 count_sum = 1; + optional int64 count_sum = 1; } // Represents the result of the rollup of the user's altitude. message AltitudeRollupValue { // Sum of the altitude gain in millimeters. - int64 gain_millimeters_sum = 1; + optional int64 gain_millimeters_sum = 1; } // A heart rate measurement. @@ -754,7 +1155,7 @@ message HeartRate { [(google.api.field_behavior) = REQUIRED]; // Required. The heart rate value in beats per minute. - int64 beats_per_minute = 4 [(google.api.field_behavior) = REQUIRED]; + optional int64 beats_per_minute = 4 [(google.api.field_behavior) = REQUIRED]; // Optional. Metadata about the heart rate sample. HeartRateMetadata metadata = 6 [(google.api.field_behavior) = OPTIONAL]; @@ -776,13 +1177,13 @@ message HeartRateRollupValue { // variability personal range. message RunVO2MaxRollupValue { // Minimum value of run VO2 max in the interval.. - double rate_min = 1; + optional double rate_min = 1; // Maximum value of run VO2 max in the interval. - double rate_max = 2; + optional double rate_max = 2; // Average value of run VO2 max in the interval. - double rate_avg = 3; + optional double rate_avg = 3; } // VO2 max value calculated based on the user's running activity. @@ -793,7 +1194,7 @@ message RunVO2Max { [(google.api.field_behavior) = REQUIRED]; // Required. Run VO2 max value in ml/kg/min. - double run_vo2_max = 2 [(google.api.field_behavior) = REQUIRED]; + optional double run_vo2_max = 2 [(google.api.field_behavior) = REQUIRED]; } // Represents the result of the rollup of the user's daily heart rate @@ -815,7 +1216,8 @@ message Height { [(google.api.field_behavior) = REQUIRED]; // Required. Height of the user in millimeters. - int64 height_millimeters = 2 [(google.api.field_behavior) = REQUIRED]; + optional int64 height_millimeters = 2 + [(google.api.field_behavior) = REQUIRED]; } // Captures user's heart rate variability (HRV) as measured by the root mean @@ -827,21 +1229,24 @@ message HeartRateVariability { [(google.api.field_behavior) = REQUIRED]; // Optional. The root mean square of successive differences between normal - // heartbeats. This is a measure of heart rate variability used by Fitbit. - double root_mean_square_of_successive_differences_milliseconds = 2 + // heartbeats. This is a measure of heart rate variability used by Google + // Health. + optional double root_mean_square_of_successive_differences_milliseconds = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The standard deviation of the heart rate variability measurement. - double standard_deviation_milliseconds = 3 + optional double standard_deviation_milliseconds = 3 [(google.api.field_behavior) = OPTIONAL]; } // Represents the volume quantity. message VolumeQuantity { // Required. Value representing the volume in milliliters. - double milliliters = 1 [(google.api.field_behavior) = REQUIRED]; + optional double milliliters = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. Value representing the user provided unit. + // Optional. Value representing the user provided unit, used only for + // user-facing input and display purposes. In the API format, all volume + // quantities are converted to milliliters. VolumeUnit user_provided_unit = 2 [(google.api.field_behavior) = OPTIONAL]; } @@ -859,7 +1264,8 @@ message HydrationLogRollupValue { // Rollup for volume quantity. message VolumeQuantityRollup { // Required. The sum of volume in milliliters. - double milliliters_sum = 1 [(google.api.field_behavior) = REQUIRED]; + optional double milliliters_sum = 1 + [(google.api.field_behavior) = REQUIRED]; // Optional. The user provided unit on the last element. VolumeUnit user_provided_unit_last = 2 @@ -870,6 +1276,99 @@ message HydrationLogRollupValue { VolumeQuantityRollup amount_consumed = 1; } +// Represents an Irregular Rhythm Notification alert, indicating a potential +// sign of atrial fibrillation (AFib). +// This data type is based on SaMD feature and any changes to it may require +// additional review. +message IrregularRhythmNotification { + // A single heart beat measurement. + message HeartBeat { + // Required. The time of the heart beat measurement. + google.protobuf.Timestamp physical_time = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The UTC offset of the user's timezone when the heart beat + // measurement occurred. + google.protobuf.Duration utc_offset = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Output only. The civil time in the timezone the subject is in + // at the time of the observation. + CivilDateTime civil_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The beats-per-minute value extrapolated from the time before + // the following heart beat. This is calculated as 60000 / rr, where rr is + // the gap between heart beats in milliseconds (IBI - Interbeat Interval). + optional int32 beats_per_minute = 4 + [(google.api.field_behavior) = REQUIRED]; + } + + // An analysis window evaluated for AFib. + // + // Note: The current version of the algorithm will only produce alerts if all + // windows are positive. So anything returned from the API will always have + // the positive bit set to true. Internally, windows can be negative, however. + // We never save "inconclusive" windows (they aren't produced by the + // algorithm). + message AlertWindow { + // Required. Observed interval. + // The start time of the analysis window. + google.protobuf.Timestamp start_time = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The UTC offset of the user's timezone when the analysis window + // started. + google.protobuf.Duration start_utc_offset = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The end time of the analysis window. + google.protobuf.Timestamp end_time = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The UTC offset of the user's timezone when the analysis window + // ended. + google.protobuf.Duration end_utc_offset = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Output only. Observed interval start time in civil time in the timezone + // the subject is in at the start of the observed interval + CivilDateTime civil_start_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Observed interval end time in civil time in the timezone the + // subject is in at the end of the observed interval + CivilDateTime civil_end_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Flag indicating whether the window was positive for AFib or + // not. A `true` value indicates that AFib was detected in this window. A + // `false` value means AFib was not detected, but does not guarantee the + // absence of AFib. + bool positive = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. All heart beats in the interval contained in this analysis + // window. + repeated HeartBeat heart_beats = 8 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. Observed interval. + SessionTimeInterval interval = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The overlapping analysis windows that were used to evaluate + // rhythm for potential AFib, containing specific information about the user's + // heart rhythm. + repeated AlertWindow alert_windows = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The meta information for the compatible device used to conduct + // the measurement. + // + // Irregular Rhythm Notification measurements typically populate + // `algorithm_version`, `service_version`, and `device_model`. + MedicalDeviceInfo medical_device_info = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // Summary metrics for an exercise. message MetricsSummary { // Time spent in each heart rate zone. @@ -968,6 +1467,256 @@ message MetricsSummary { [(google.api.field_behavior) = OPTIONAL]; } +// Represents the weight quantity. +message WeightQuantity { + // Required. Value representing the weight in grams. + optional double grams = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Value representing the user provided unit. + WeightUnit user_provided_unit = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the energy quantity. +message EnergyQuantity { + // Required. Value representing the energy in kilocalories. + optional double kcal = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Value representing the user provided unit. + EnergyUnit user_provided_unit = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the quantity of a nutrient. +message NutrientQuantity { + // Required. Value representing the quantity of the nutrient. + WeightQuantity quantity = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Value representing the nutrient. + Nutrient nutrient = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Holds information about a user logged food. +// +// There are two ways of creating a nutrition log based on the food type: +// 1. 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_name` will be populated +// based on the referenced food. +// 2. Anonymous food: Using the `food_display_name` field and setting +// the `nutrients`, `energy`, `energy_from_fat`, `total_carbohydrate`, +// `total_fat` fields manually. +// +// The identified food is preferred over the anonymous food. +// Nutrition logs created from anonymous food are not be editable. +message NutritionLog { + // Represents different properties and information about the serving of a + // specific food. + message Serving { + // Optional. Amount of food consumed, fractional values are supported. + optional double amount = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Food measurement unit + string food_measurement_unit = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "health.googleapis.com/DataPoint" + } + ]; + + // Output only. Legacy measurement unit for serving size in singular form + // (e.g. "piece", "gram"). + string food_measurement_unit_display_name = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Required. Observed interval. + SessionTimeInterval interval = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Value representing the nutrients of the nutrition log. + repeated NutrientQuantity nutrients = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. + EnergyQuantity energy = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + EnergyQuantity energy_from_fat = 5 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + WeightQuantity total_carbohydrate = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. + WeightQuantity total_fat = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Value representing the meal type of the nutrition log. + MealType meal_type = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Value representing the nutrition log serving. + Serving serving = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Represents the food ID. + string food = 15 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "health.googleapis.com/DataPoint" + } + ]; + + // 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. + string food_display_name = 16; +} + +// Represents a food item. +message Food { + // Represents different properties and information about the serving of a + // specific food. + message FoodServing { + // Optional. Amount of food consumed, fractional values are supported. + optional double amount = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Food measurement unit + string food_measurement_unit = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "health.googleapis.com/DataPoint" + } + ]; + + // Output only. Legacy measurement unit for serving size in singular form + // (e.g. "piece", "gram"). + string food_measurement_unit_display_name = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Legacy measurement unit for serving size in plural form + // (e.g. "pieces", "grams"). + string food_measurement_unit_display_name_plural = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Value representing the multiplier used to compute the energy + // when using this serving instead of the default serving. + double multiplier = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The display name of the food. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The brand of the food. + string brand = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The access level of the food. + FoodAccessLevel access_level = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the food. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The language code where the food is available in format xx-XX. + // Supported values are defined in + // [Settings.food_language_code][google.devicesandservices.health.v4.Settings.food_language_code]. + string language_code = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The meal type associated with this food. + MealType meal_type = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Value representing the nutrients of the food for the default + // serving. + repeated NutrientQuantity nutrients = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Value representing the energy from fat of the food for the + // default serving. + EnergyQuantity energy_from_fat = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Value representing the total carbohydrate of the food for the + // default serving. + WeightQuantity total_carbohydrate = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Value representing the total fat of the food for the default + // serving. + WeightQuantity total_fat = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Value representing the minimum energy of the food for the default + // serving. + EnergyQuantity energy_min = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Value representing the average energy of the food for the default + // serving. + EnergyQuantity energy_avg = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Value representing the maximum energy of the food for the default + // serving. + EnergyQuantity energy_max = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Value representing the default serving of the food. + FoodServing default_serving = 19 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The serving of the food. + repeated FoodServing servings = 20 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the result of the rollup of the nutrition log data type. +message NutritionLogRollupValue { + // Rollup for the weight. + message WeightQuantityRollup { + // Required. The sum of the weight in grams. + optional double grams_sum = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The user provided unit on the last element. + WeightUnit user_provided_unit_last = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Rollup for the energy quantity. + message EnergyQuantityRollup { + // Required. The sum of the energy in kilocalories. + optional double kcal_sum = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The user provided unit on the last element. + EnergyUnit user_provided_unit_last = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Nutrient quantity rollup. + message NutrientQuantityRollup { + // Required. Aggregated nutrient weight. + WeightQuantityRollup quantity = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Aggregated nutrient. + Nutrient nutrient = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // List of the nutrient roll-ups by the nutrient type. + repeated NutrientQuantityRollup nutrients = 1; + + // Energy rollup. + EnergyQuantityRollup energy = 2; + + // Value + // Energy from fat rollup. + EnergyQuantityRollup energy_from_fat = 3; + + // Total carbohydrate rollup. + WeightQuantityRollup total_carbohydrate = 4; + + // Total fat rollup. + WeightQuantityRollup total_fat = 5; +} + // Captures the user's instantaneous oxygen saturation percentage (SpO2). message OxygenSaturation { // Required. The time at which oxygen saturation was measured. @@ -975,7 +1724,7 @@ message OxygenSaturation { [(google.api.field_behavior) = REQUIRED]; // Required. The oxygen saturation percentage. Valid values are from 0 to 100. - double percentage = 2 [(google.api.field_behavior) = REQUIRED]; + optional double percentage = 2 [(google.api.field_behavior) = REQUIRED]; } // Represents the rollup value for the daily resting heart rate data type. @@ -987,19 +1736,33 @@ message RestingHeartRatePersonalRangeRollupValue { optional double beats_per_minute_max = 2; } +// Represents a food measurement unit. +message FoodMeasurementUnit { + // Required. The display name of the food measurement unit (e.g., "gram", + // "piece"). + string display_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The plural display name of the food measurement unit (e.g., + // "grams", "pieces"). + string plural_display_name = 2 [(google.api.field_behavior) = OPTIONAL]; +} + // Records respiratory rate details during sleep. // Can have multiple per day if the user sleeps multiple times. message RespiratoryRateSleepSummary { // Respiratory rate statistics for a given sleep stage. message RespiratoryRateSleepSummaryStatistics { // Required. Average breaths per minute. - double breaths_per_minute = 1 [(google.api.field_behavior) = REQUIRED]; + optional double breaths_per_minute = 1 + [(google.api.field_behavior) = REQUIRED]; // Optional. Standard deviation of the respiratory rate during sleep. - double standard_deviation = 2 [(google.api.field_behavior) = OPTIONAL]; + optional double standard_deviation = 2 + [(google.api.field_behavior) = OPTIONAL]; // Optional. How trustworthy the data is for the computation. - double signal_to_noise = 3 [(google.api.field_behavior) = OPTIONAL]; + optional double signal_to_noise = 3 + [(google.api.field_behavior) = OPTIONAL]; } // Required. The time at which respiratory rate was measured. @@ -1146,10 +1909,10 @@ message Sleep { SleepStageType type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Total duration in minutes of a sleep stage. - int64 minutes = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + optional int64 minutes = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Number of sleep stages segments. - int64 count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + optional int64 count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Output only. Delta between wake time and bedtime. It is the sum of all @@ -1257,13 +2020,13 @@ message Steps { ObservationTimeInterval interval = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Number of steps in the recorded interval. - int64 count = 4 [(google.api.field_behavior) = REQUIRED]; + optional int64 count = 4 [(google.api.field_behavior) = REQUIRED]; } // Represents the result of the rollup of the steps data type. message StepsRollupValue { // Total number of steps in the interval. - int64 count_sum = 1; + optional int64 count_sum = 1; } // Swim lengths data over the time interval. @@ -1293,13 +2056,13 @@ message SwimLengthsData { SwimStrokeType swim_stroke_type = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Number of strokes in the lap. - int64 stroke_count = 3 [(google.api.field_behavior) = REQUIRED]; + optional int64 stroke_count = 3 [(google.api.field_behavior) = REQUIRED]; } // Represents the result of the rollup of the swim lengths data type. message SwimLengthsDataRollupValue { // Total number of swim strokes in the interval. - int64 stroke_count_sum = 1; + optional int64 stroke_count_sum = 1; } // Time in heart rate zone record. It's an interval spent in specific heart @@ -1332,7 +2095,7 @@ message TimeInHeartRateZoneRollupValue { // Represents the result of the rollup of the user's total calories. message TotalCaloriesRollupValue { // Sum of the total calories in kilocalories. - double kcal_sum = 1; + optional double kcal_sum = 1; } // VO2 max measurement. @@ -1390,7 +2153,7 @@ message VO2Max { // Required. VO2 max value measured as in ml consumed oxygen / kg of body // weight / min. - double vo2_max = 2 [(google.api.field_behavior) = REQUIRED]; + optional double vo2_max = 2 [(google.api.field_behavior) = REQUIRED]; // Optional. The method used to measure the VO2 max value. MeasurementMethod measurement_method = 4 @@ -1404,7 +2167,7 @@ message Weight { [(google.api.field_behavior) = REQUIRED]; // Required. Weight of a user in grams. - double weight_grams = 3 [(google.api.field_behavior) = REQUIRED]; + optional double weight_grams = 3 [(google.api.field_behavior) = REQUIRED]; // Optional. Standard free-form notes captured at manual logging. string notes = 4 [(google.api.field_behavior) = OPTIONAL]; @@ -1413,7 +2176,124 @@ message Weight { // Represents the result of the rollup of the weight data type. message WeightRollupValue { // Average weight in grams. - double weight_grams_avg = 1; + optional double weight_grams_avg = 1; +} + +// Represents a blood glucose level measurement. +// LINT: LEGACY_NAMES +message BloodGlucose { + // The clinical method or tool used to measure the blood glucose level. + enum MeasurementSource { + // Unspecified measurement source. + MEASUREMENT_SOURCE_UNSPECIFIED = 0; + + // Self-monitoring of blood glucose (Blood glucose meter) + SELF_MONITORING_BLOOD_GLUCOSE = 1; + + // Continuous glucose monitoring device + CONTINUOUS_GLUCOSE_MONITORING = 2; + + // Laboratory test + LAB_TEST = 3; + } + + // Meal type associated with the measurement. + enum MealType { + // Unspecified meal type. + MEAL_TYPE_UNSPECIFIED = 0; + + // Breakfast. + BREAKFAST = 1; + + // Lunch. + LUNCH = 2; + + // Dinner. + DINNER = 3; + + // Snack. + SNACK = 4; + } + + // Timing of the measurement. + enum MeasurementTiming { + // Unspecified measurement timing. + MEASUREMENT_TIMING_UNSPECIFIED = 0; + + // Measurement taken after meal. + AFTER_MEAL = 1; + + // Measurement taken before meal. + BEFORE_MEAL = 2; + + // Measurement taken while fasting. + FASTING = 3; + + // General measurement (not associated with a meal or time of day). + GENERAL = 4; + + // Measurement taken before bed. + BEFORE_BED = 5; + + // Measurement taken over night. + OVER_NIGHT = 6; + } + + // Type of body fluid used to measure the blood glucose. + enum Specimen { + // Unspecified specimen. + SPECIMEN_UNSPECIFIED = 0; + + // Capillary blood. + CAPILLARY_BLOOD = 1; + + // Interstitial fluid. + INTERSTITIAL_FLUID = 2; + + // Plasma. + PLASMA = 3; + + // Serum. + SERUM = 4; + + // Tears. + TEARS = 5; + + // Whole blood. + WHOLE_BLOOD = 6; + } + + // Required. The time at which blood glucose was measured. + ObservationSampleTime sample_time = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Blood glucose level concentration in mg/dL. + optional double blood_glucose_milligrams_per_deciliter = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Source of the measurement. + MeasurementSource measurement_source = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Meal type of the measurement. + MealType meal_type = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Timing of the measurement. + MeasurementTiming measurement_timing = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of body fluid used to measure the blood glucose. + Specimen specimen = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Standard free-form notes captured at manual logging. + string notes = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the result of the rollup of the blood glucose data type. +// LINT: LEGACY_NAMES +message BloodGlucoseRollupValue { + // Average blood glucose level in mg/dL. + optional double blood_glucose_milligrams_per_deciliter_avg = 1; } // SedentaryPeriod @@ -1430,3 +2310,18 @@ message SedentaryPeriodRollupValue { // The total time user spent sedentary during the interval. google.protobuf.Duration duration_sum = 1; } + +// Energy burned as part of an activity, excluding the basal energy burn. +message ActiveEnergyBurned { + // Required. Observed interval + ObservationTimeInterval interval = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Energy burned during an activity, measured in kilocalories. + optional double kcal = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the result of the rollup of active energy burned. +message ActiveEnergyBurnedRollupValue { + // Output only. Sum of the active energy burned in kilocalories. + optional double kcal_sum = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/data_points.proto b/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/data_points.proto index b6f1e69cdb2c..64697a5a7ca3 100644 --- a/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/data_points.proto +++ b/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/data_points.proto @@ -133,8 +133,17 @@ service DataPointsService { // Exports exercise data in TCX format. // + // **IMPORTANT:** HTTP clients must append `?alt=media` to the + // request URL to download the raw TCX file. // - // Note: While the Authorization section below states that any one of the + // Example: + // `https://health.googleapis.com/v4/users/me/dataTypes/exercise/dataPoints/EXERCISE_ID:exportExerciseTcx?alt=media` + // + // Without `alt=media`, the server returns a JSON response + // (`ExportExerciseTcxResponse`) + // which is intended primarily for gRPC clients. + // + // **Note:** While the Authorization section below states that any one of the // listed scopes is accepted, this specific method requires the user to // provide both one of the `activity_and_fitness` scopes (`normal` or // `readonly`) AND one of the `location` scopes (`normal` or `readonly`) in @@ -162,6 +171,9 @@ message DataPoint { // These messages represent the data payload for each data type and are // embedded within the `DataPoint` resource. They are not standalone resources // themselves. + // Unless otherwise noted, data types will exclude data points that are + // identified as recorded by wearables in intervals when they were not + // actually worn. oneof data { // Optional. Data for points in the `steps` interval data type collection. Steps steps = 4 [(google.api.field_behavior) = OPTIONAL]; @@ -248,6 +260,20 @@ message DataPoint { // collection. DailyVO2Max daily_vo2_max = 28 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Data for points in the `nutrition-log` session data type + // collection. + NutritionLog nutrition_log = 29 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Data for points in the `irregular-rhythm-notification` session + // data type collection. + IrregularRhythmNotification irregular_rhythm_notification = 30 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Data for points in the `electrocardiogram` session data type + // collection. + Electrocardiogram electrocardiogram = 31 + [(google.api.field_behavior) = OPTIONAL]; + // Optional. Data for points in the `daily-heart-rate-zones` daily data type // collection. DailyHeartRateZones daily_heart_rate_zones = 32 @@ -257,6 +283,9 @@ message DataPoint { // collection. HydrationLog hydration_log = 33 [(google.api.field_behavior) = OPTIONAL]; + // Optional. The food details. + Food food = 34 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Data for points in the `time-in-heart-rate-zone` interval data // type collection. TimeInHeartRateZone time_in_heart_rate_zone = 35 @@ -288,6 +317,24 @@ message DataPoint { // collection. BasalEnergyBurned basal_energy_burned = 41 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Data for points in the `core-body-temperature` sample data type + // collection. + CoreBodyTemperature core_body_temperature = 42 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Data for points in the `active-energy-burned` interval data + // type collection. + ActiveEnergyBurned active_energy_burned = 44 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The food measurement unit details. + FoodMeasurementUnit food_measurement_unit = 45 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Data for points in the `blood-glucose` sample data type + // collection. + BloodGlucose blood_glucose = 46 [(google.api.field_behavior) = OPTIONAL]; } // Identifier. Data point name, only supported for the subset of identifiable @@ -323,6 +370,9 @@ message ReconciledDataPoint { // These messages represent the data payload for each data type and are // embedded within the `DataPoint` resource. They are not standalone resources // themselves. + // Unless otherwise noted, data types reconciliation algorithm will exclude + // data points that are identified as recorded by wearables in intervals + // when they were not actually worn. oneof data { // Data for points in the `steps` interval data type collection. Steps steps = 4; @@ -393,6 +443,9 @@ message ReconciledDataPoint { // Data for points in the `daily-vo2-max` daily data type collection. DailyVO2Max daily_vo2_max = 28; + // Data for points in the `nutrition-log` session data type collection. + NutritionLog nutrition_log = 29; + // Data for points in the `daily-heart-rate-zones` daily data type // collection. DailyHeartRateZones daily_heart_rate_zones = 32; @@ -424,6 +477,17 @@ message ReconciledDataPoint { // Data for points in the `basal-energy-burned` interval data type // collection. BasalEnergyBurned basal_energy_burned = 41; + + // Data for points in the `core-body-temperature` sample data type + // collection. + CoreBodyTemperature core_body_temperature = 42; + + // Data for points in the `active-energy-burned` interval data type + // collection. + ActiveEnergyBurned active_energy_burned = 44; + + // Data for points in the `blood-glucose` sample data type collection. + BloodGlucose blood_glucose = 46; } // Identifier. Data point name, only supported for the subset of identifiable @@ -449,7 +513,10 @@ message ReconciledDataPoint { string data_point_name = 1 [(google.api.field_behavior) = IDENTIFIER]; } -// Value of a rollup for a single physical time interval (aggregation window) +// Value of a rollup for a single physical time interval (aggregation window) of +// reconciled data points from all data sources, excluding those data points +// that are identified as recorded by wearables in intervals when they were not +// actually worn. message RollupDataPoint { // Outcome of a rollup of the requested data type. // @@ -460,7 +527,11 @@ message RollupDataPoint { // `{original_field_name}_{aggregation_function}`. For example: // `confidence_min`, `confidence_sum`. // - // If there were no data points in this interval, the value will not be set. + // If there were no manual, on-wrist data points in this interval, + // the value will not be set. When the value is set, but the data shows zero, + // e.g. `steps.count_sum = 0`, it means that a device was worn but it did not + // record any data points for this data type. + // // These messages represent the aggregated data payload for each data type // and are embedded within the `RollupDataPoint`. They are not standalone // resources themselves. @@ -530,6 +601,11 @@ message RollupDataPoint { // `activity-level` rollup type identifier. ActivityLevelRollupValue activity_level = 18; + // Returned by default when rolling up data points from the + // `nutrition-log` data type, or when requested explicitly using the + // `nutrition-log` rollup type identifier. + NutritionLogRollupValue nutrition_log = 19; + // Returned by default when rolling up data points from the // `hydration-log` data type, or when requested explicitly using the // `hydration-log` rollup type identifier. @@ -549,6 +625,19 @@ message RollupDataPoint { // `swim-lengths-data` data type, or when requested explicitly using the // `swim-lengths-data` rollup type identifier. SwimLengthsDataRollupValue swim_lengths_data = 23; + + // Returned by default when rolling up data points from the + // `core-body-temperature` data type, or when requested explicitly using + // the `core-body-temperature` rollup type identifier. + CoreBodyTemperatureRollupValue core_body_temperature = 24; + + // Returned by default when rolling up data points from the + // `active-energy-burned` data type. + ActiveEnergyBurnedRollupValue active_energy_burned = 25; + + // Returned by default when rolling up data points from the + // `blood-glucose` data type. + BloodGlucoseRollupValue blood_glucose = 26; } // Start time of the window this value aggregates over @@ -559,6 +648,9 @@ message RollupDataPoint { } // Value of a daily rollup for a single civil time interval (aggregation window) +// of reconciled data points from all data sources, excluding those data points +// that are identified as recorded by wearables in intervals when they were not +// actually worn. message DailyRollupDataPoint { // Outcome of a rollup of the requested roll-up type. // @@ -569,7 +661,11 @@ message DailyRollupDataPoint { // `{original_field_name}_{aggregation_function}`. For example: // `confidence_min`, `confidence_sum`. // - // If there were no data points in this interval, the value will not be set. + // If there were no manual, on-wrist data points in this interval, + // the value will not be set. When the value is set, but the data shows zero, + // e.g. `steps.count_sum = 0`, it means that a device was worn but it did not + // record any data points for this data type. + // // These messages represent the aggregated data payload for each data type // and are embedded within the `DailyRollupDataPoint`. They are not standalone // resources themselves. @@ -653,6 +749,11 @@ message DailyRollupDataPoint { // `activity-level` rollup type identifier. ActivityLevelRollupValue activity_level = 20; + // Returned by default when rolling up data points from the + // `nutrition-log` data type, or when requested explicitly using the + // `nutrition-log` rollup type identifier. + NutritionLogRollupValue nutrition_log = 21; + // Returned by default when rolling up data points from the // `hydration-log` data type, or when requested explicitly using the // `hydration-log` rollup type identifier. @@ -672,6 +773,19 @@ message DailyRollupDataPoint { // `swim-lengths-data` data type, or when requested explicitly using the // `swim-lengths-data` rollup type identifier. SwimLengthsDataRollupValue swim_lengths_data = 25; + + // Returned by default when rolling up data points from the + // `core-body-temperature` data type, or when requested explicitly using + // the `core-body-temperature` rollup type identifier. + CoreBodyTemperatureRollupValue core_body_temperature = 26; + + // Returned by default when rolling up data points from the + // `active-energy-burned` data type. + ActiveEnergyBurnedRollupValue active_energy_burned = 27; + + // Returned by default when rolling up data points from the + // `blood-glucose` data type. + BloodGlucoseRollupValue blood_glucose = 28; } // Start time of the window this value aggregates over @@ -782,11 +896,11 @@ message ListDataPointsRequest { // - Date literal expected in ISO 8601 `YYYY-MM-DD` format // - Supported logical operators: `AND` // - Example: - // - `daily_resting_heart_rate.date >= "2024-08-14"` // - `daily_heart_rate_variability.date < "2024-08-15"` // // - // - Session civil start time (**Excluding Sleep**): + // + // - Session civil start time (**Excluding Sleep and ECG**): // - Pattern: `{session_data_type}.interval.civil_start_time` // - Supported comparison operators: `>=`, `<` // - Date with optional time literal expected in ISO 8601 @@ -797,6 +911,16 @@ message ListDataPointsRequest { // exercise.interval.civil_start_time < "2023-11-25"` // - `exercise.interval.civil_start_time >= "2024-08-14T12:34:56"` // + // - Session start time (**ECG specific**): + // - Pattern: `electrocardiogram.interval.start_time` + // - Supported comparison operators: `>=` + // - Timestamp literal expected in RFC-3339 format + // - Example: + // - `electrocardiogram.interval.start_time >= "2024-08-14T12:34:56Z"` + // - Note: Only filtering by start time is supported for ECG. Filtering + // by end time (e.g., `electrocardiogram.interval.end_time`) is not + // supported. + // // - Session end time (**Sleep specific**): // - Pattern: `sleep.interval.end_time` // - Supported comparison operators: `>=`, `<` @@ -1139,5 +1263,9 @@ message ExportExerciseTcxRequest { // Represents a Response for exporting exercise data in TCX format. message ExportExerciseTcxResponse { // Contains the exported TCX data. + // + // This field is intended for gRPC clients, as media download integration + // is not supported for gRPC. HTTP clients should instead use the `alt=media` + // query parameter to download the raw binary TCX file. string tcx_data = 2; } diff --git a/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/data_subscription_service.proto b/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/data_subscription_service.proto new file mode 100644 index 000000000000..cb0e90ee1dfa --- /dev/null +++ b/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/data_subscription_service.proto @@ -0,0 +1,615 @@ +// 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/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +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 java_multiple_files = true; +option java_outer_classname = "DataSubscriptionServiceProto"; +option java_package = "com.google.devicesandservices.health.v4"; +option php_namespace = "Google\\DevicesAndServices\\Health\\V4"; +option ruby_package = "Google::DevicesAndServices::Health::V4"; + +// Data Subscription Service that allows clients (e.g., Fitbit 3P +// applications, internal Fitbit Services) to manage their subscriber endpoints. +// This service provides CRUD APIs for subscribers, +// and also offers functionalities for subscriber verification and statistics. +service DataSubscriptionService { + option (google.api.default_host) = "health.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Registers a new subscriber endpoint to receive notifications. + // A subscriber represents an application or service that wishes to receive + // data change notifications for users who have granted consent. + // + // **Endpoint Verification:** + // For a subscriber to be successfully created, the provided `endpoint_uri` + // must be a valid HTTPS endpoint and must pass an automated verification + // check. The backend will send two HTTP POST requests to the `endpoint_uri`: + // + // 1. **Verification with Authorization:** + // * **Headers:** Includes `Content-Type: application/json` and + // `Authorization` (with the exact value from + // `CreateSubscriberPayload.endpoint_authorization.secret`). + // * **Body:** `{"type": "verification"}` + // * **Expected Response:** HTTP `201 Created`. + // + // 2. **Verification without Authorization:** + // * **Headers:** Includes `Content-Type: application/json`. The + // `Authorization` header is OMITTED. + // * **Body:** `{"type": "verification"}` + // * **Expected Response:** HTTP `401 Unauthorized` or `403 Forbidden`. + // + // Both tests must pass for the subscriber creation to succeed. If + // verification fails, the operation will not be completed and an error will + // be returned. This process ensures the endpoint is reachable and correctly + // validates the `Authorization` header. + rpc CreateSubscriber(CreateSubscriberRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v4/{parent=projects/*}/subscribers" + body: "subscriber" + }; + option (google.api.method_signature) = "parent,subscriber,subscriber_id"; + option (google.longrunning.operation_info) = { + response_type: "Subscriber" + metadata_type: "CreateSubscriberMetadata" + }; + } + + // Lists all subscribers registered within the owned Google Cloud Project. + rpc ListSubscribers(ListSubscribersRequest) + returns (ListSubscribersResponse) { + option (google.api.http) = { + get: "/v4/{parent=projects/*}/subscribers" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the configuration of an existing subscriber, such as the + // endpoint URI or the data types it's interested in. + // + // **Endpoint Verification:** + // If the `endpoint_uri` or `endpoint_authorization` field is included in the + // `update_mask`, the backend will re-verify the endpoint. The verification + // process is the same as described in `CreateSubscriber`: + // + // 1. **Verification with Authorization:** POST to the new or existing + // `endpoint_uri` with the new or existing `Authorization` secret. Expects + // HTTP `201 Created`. + // 2. **Verification without Authorization:** POST to the `endpoint_uri` + // without the `Authorization` header. Expects HTTP `401 Unauthorized` or + // `403 Forbidden`. + // + // Both tests must pass using the potentially updated values for the + // subscriber update to succeed. If verification fails, the update will not + // be applied, and an error will be returned. + rpc UpdateSubscriber(UpdateSubscriberRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v4/{subscriber.name=projects/*/subscribers/*}" + body: "subscriber" + }; + option (google.api.method_signature) = "subscriber,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Subscriber" + metadata_type: "UpdateSubscriberMetadata" + }; + } + + // Deletes a subscriber registration. This will stop all notifications + // to the subscriber's endpoint. + rpc DeleteSubscriber(DeleteSubscriberRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v4/{name=projects/*/subscribers/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteSubscriberMetadata" + }; + } + + // Creates a subscription for a specific user to a specific subscriber. + // This method requires the subscriber to have a `SubscriptionCreatePolicy` + // set to `MANUAL` for the given data types. + rpc CreateSubscription(CreateSubscriptionRequest) returns (Subscription) { + option (google.api.http) = { + post: "/v4/{parent=projects/*/subscribers/*}/subscriptions" + body: "subscription" + }; + option (google.api.method_signature) = + "parent,subscription,subscription_id"; + } + + // Lists all active subscriptions for a given subscriber. This can be + // filtered, for example, by user or data type. + rpc ListSubscriptions(ListSubscriptionsRequest) + returns (ListSubscriptionsResponse) { + option (google.api.http) = { + get: "/v4/{parent=projects/*/subscribers/*}/subscriptions" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the data types for an existing user subscription. + rpc UpdateSubscription(UpdateSubscriptionRequest) returns (Subscription) { + option (google.api.http) = { + patch: "/v4/{subscription.name=projects/*/subscribers/*/subscriptions/*}" + body: "subscription" + }; + option (google.api.method_signature) = "subscription,update_mask"; + } + + // Deletes a specific user subscription, stopping notifications for this + // user to this subscriber. + rpc DeleteSubscription(DeleteSubscriptionRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v4/{name=projects/*/subscribers/*/subscriptions/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// -- Messages -- +// Request message for CreateSubscriber. +message CreateSubscriberRequest { + // Required. The parent resource where this subscriber will be created. + // Format: projects/{project} + // Example: projects/my-project-123 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "health.googleapis.com/Subscriber" + } + ]; + + // Required. The subscriber to create. + CreateSubscriberPayload subscriber = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The ID to use for the subscriber, which will become the final + // component of the subscriber's resource name. + // + // This value should be 4-36 characters, and valid characters + // are /[a-z]([a-z0-9-]{2,34}[a-z0-9])/. + string subscriber_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for ListSubscribers. +message ListSubscribersRequest { + // Required. The parent, which owns this collection of subscribers. + // Format: projects/{project} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "health.googleapis.com/Subscriber" + } + ]; + + // Optional. The maximum number of subscribers to return. The service may + // return fewer than this value. If unspecified, at most 50 subscribers will + // be returned. The maximum value is 1000; values above 1000 will be coerced + // to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListSubscribers` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListSubscribers` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListSubscribers. +message ListSubscribersResponse { + // Subscribers from the specified project. + repeated Subscriber subscribers = 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; + + // The total number of subscribers matching the request. + int32 total_size = 3; +} + +// Request message for UpdateSubscriber. +message UpdateSubscriberRequest { + // Required. The subscriber resource to update. Its 'name' field is mapped to + // the URI, and the value of the 'name' field should be of the form: + // "projects/{project}/subscribers/{subscriber_id}". + // The remaining fields of the Subscriber object represent the new values + // for the corresponding fields in the existing subscriber resource. + Subscriber subscriber = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A field mask that specifies which fields of the Subscriber + // message are to be updated. This allows for partial updates. Supported + // fields: + // - endpoint_uri + // - subscriber_configs + // - endpoint_authorization + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for DeleteSubscriber. +message DeleteSubscriberRequest { + // Required. The name of the subscriber to delete. + // Format: projects/{project}/subscribers/{subscriber} + // Example: projects/my-project/subscribers/my-subscriber-123 + // The {subscriber} ID is user-settable (4-36 characters, matching + // /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or system-generated if not provided + // during creation. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "health.googleapis.com/Subscriber" + } + ]; + + // Optional. If set to true, any child resources (e.g., subscriptions) will + // also be deleted. If false (default) and child resources exist, the request + // will fail. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for CreateSubscription. +message CreateSubscriptionRequest { + // Required. The parent subscriber. + // Format: projects/{project}/subscribers/{subscriber} + // The {subscriber} ID is user-settable (4-36 characters, matching + // /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or + // system-generated otherwise. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "health.googleapis.com/Subscription" + } + ]; + + // Optional. The {subscription_id} is user-settable + // (4-36 chars, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or system-generated + // otherwise. + // If provided, the ID must be unique within the parent subscriber. + string subscription_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The subscription to create. + CreateSubscriptionPayload subscription = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ListSubscriptions. +message ListSubscriptionsRequest { + // Required. The parent subscriber. + // Format: projects/{project}/subscribers/{subscriber} + // The {subscriber} ID is user-settable (4-36 characters, matching + // /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or + // system-generated otherwise. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "health.googleapis.com/Subscription" + } + ]; + + // Optional. A filter to apply to the list of subscriptions. + // The filter syntax is described in https://google.aip.dev/160. + // The filter can be applied to the following fields: + // - `user` + // - `data_type` + // + // The `user` identifier (e.g., `user1` in `users/user1`) refers to the public + // `healthUserId` + // + // Example: user = "users/user1" + // Example: user = "users/user1" OR user = "users/user2" + // Example: user = "users/user1" AND (data_type = "sleep" OR data_type = + // "weight") + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of subscriptions to return. The service may + // return fewer than this value. If unspecified, at most 50 subscriptions will + // be returned. The maximum value is 1000; values above 1000 will be coerced + // to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListSubscriptions` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListSubscriptions` must + // match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListSubscriptions. +message ListSubscriptionsResponse { + // The subscriptions from the specified subscriber. + repeated Subscription subscriptions = 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; +} + +// Request message for UpdateSubscription. +message UpdateSubscriptionRequest { + // Required. The subscription to update. + // The subscription's `name` field is used to identify the subscription to + // update. Format: + // projects/{project}/subscribers/{subscriber}/subscriptions/{subscription} + Subscription subscription = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for DeleteSubscription. +message DeleteSubscriptionRequest { + // Required. The resource name of the subscription to delete. + // Format: + // `projects/{project}/subscribers/{subscriber}/subscriptions/{subscription}` + // Example: + // `projects/my-project/subscribers/my-subscriber-123/subscriptions/my-subscription-456` + // The {subscriber} ID is user-settable (4-36 characters, matching + // /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or + // system-generated otherwise. The {subscription} ID is user-settable (4-36 + // characters, matching + // /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or system-generated if not provided + // during creation. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "health.googleapis.com/Subscription" + } + ]; +} + +// -- Resource Messages -- +// A subscriber receives notifications from Google Health API. +message Subscriber { + option (google.api.resource) = { + type: "health.googleapis.com/Subscriber" + pattern: "projects/{project}/subscribers/{subscriber}" + plural: "subscribers" + singular: "subscriber" + }; + + // The state of the subscriber. + enum State { + // Represents an unspecified subscriber state. + STATE_UNSPECIFIED = 0; + + // Represents an unverified subscriber. This is the initial state of the + // subscriber when it is created. The backend will verify the subscriber's + // endpoint_uri. + UNVERIFIED = 1; + + // Represents an active subscriber. The endpoint has been verified. + ACTIVE = 2; + + // Represents an inactive subscriber. + INACTIVE = 3; + } + + // Identifier. The resource name of the Subscriber. + // Format: projects/{project}/subscribers/{subscriber} + // The {project} ID is a Google Cloud Project ID or Project Number. + // The {subscriber} ID is user-settable (4-36 characters, matching + // /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or + // system-generated otherwise (e.g., a UUID). + // Example (User-settable subscriber ID): + // projects/my-project/subscribers/my-sub-123 + // Example (System-generated subscriber ID): + // projects/my-project/subscribers/a1b2c3d4-e5f6-7890-1234-567890abcdef + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The full HTTPS URI where update notifications will be sent. + // The URI must be a valid URL and use HTTPS as the scheme. + // This endpoint will be verified during CreateSubscriber and UpdateSubscriber + // calls. See RPC documentation for verification details. + string endpoint_uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The time at which the subscriber was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the subscriber was last updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Configuration for the subscriber. + repeated SubscriberConfig subscriber_configs = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Authorization mechanism for a subscriber endpoint. + // This is required to ensure the endpoint can be verified. + EndpointAuthorization endpoint_authorization = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Output only. The state of the subscriber. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A subscription to a data collection for a specific user, to be delivered to +// a subscriber. +message Subscription { + option (google.api.resource) = { + type: "health.googleapis.com/Subscription" + pattern: "projects/{project}/subscribers/{subscriber}/subscriptions/{subscription}" + plural: "subscriptions" + singular: "subscription" + }; + + // Identifier. The resource name of the Subscription. + // Format: + // `projects/{project}/subscribers/{subscriber}/subscriptions/{subscription}` + // Example: + // `projects/my-project/subscribers/my-subscriber-123/subscriptions/my-subscription-456` + // The {project} ID is mandatory + // (6-30 characters, matching /[a-z][a-z0-9-]{6,30}/) + // The {subscriber} ID is user-settable + // (4-36 characters, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided + // during creation, or system-generated otherwise. The {subscription} ID is + // user-settable (4-36 chars, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or + // system-generated otherwise. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. Data types subscribed to. + // 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". + repeated string data_types = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "health.googleapis.com/DataType" } + ]; + + // Immutable. The resource name of the user for whom this subscription is + // active. Format: `users/{user}` where `{user}` is the public `healthUserId` + // as returned by the `GetIdentity` action in the profile PAPI (see + // `google.devicesandservices.health.v4main.HealthProfileService.GetIdentity`). + string user = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { type: "health.googleapis.com/User" } + ]; +} + +// Configuration for a subscriber. +// A notification is sent to a subscription ONLY if the subscriber has a config +// for the data type. +message SubscriberConfig { + // Policy for subscription creation. + enum SubscriptionCreatePolicy { + // Represents an unspecified policy. + SUBSCRIPTION_CREATE_POLICY_UNSPECIFIED = 0; + + // When using `AUTOMATIC`, individual subscriptions are not created or + // stored. Instead, eligibility for notifications is computed dynamically. + // When a data update occurs for a given data type, notifications are sent + // to all subscribers with an `AUTOMATIC` policy for that data type, + // provided the user has granted the necessary consents. + // + // This means you do not need to call `CreateSubscription` for each user; + // notifications are managed automatically based on user consents. As + // `Subscription` resources are not stored, they cannot be retrieved or + // managed through `GetSubscription`, `ListSubscriptions`, + // `UpdateSubscription`, or `DeleteSubscription`. + AUTOMATIC = 1; + + // Requires subscriptions to be created manually for new users. + // The developer needs to call CreateSubscription for new users. + MANUAL = 2; + } + + // Required. See [Google Health API data + // types](https://developers.google.com/health/data-types) for the list of + // supported data types. Values should be in kebab-case. + repeated string data_types = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "health.googleapis.com/DataType" } + ]; + + // Required. Policy for subscription creation. + SubscriptionCreatePolicy subscription_create_policy = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Authorization mechanism for a subscriber endpoint. +// For all requests sent by the Webhooks service, the JSON payload is +// cryptographically signed. The signature is delivered in the +// `X-HEALTHAPI-SIGNATURE` HTTP header. This is an ECDSA (NIST P256) +// signature of the JSON payload. Clients must verify this signature using +// Google Health API's public key to confirm the payload was sent by the Health +// API. +message EndpointAuthorization { + // Required. Input only. Provides a client-provided secret that will be sent + // with each notification to the subscriber endpoint using the "Authorization" + // header. The value must include the authorization scheme, e.g., "Bearer + // " or "Basic ", as it will be used as the full + // Authorization header value. This secret is used by the API to test the + // endpoint during `CreateSubscriber` and `UpdateSubscriber` calls, and will + // be sent in the `Authorization` header for all subsequent webhook + // notifications to this endpoint. + string secret = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Output only. Whether the secret is set. + bool secret_set = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Payload for creating a subscriber. +message CreateSubscriberPayload { + // Required. The full HTTPS URI where update notifications will be sent. + // The URI must be a valid URL and use HTTPS as the scheme. + // This endpoint will be verified during the `CreateSubscriber` call. + // See CreateSubscriber RPC documentation for verification details. + string endpoint_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Configuration for the subscriber. + repeated SubscriberConfig subscriber_configs = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Authorization mechanism for the subscriber endpoint. + // The `secret` within this message is crucial for endpoint verification + // and for securing webhook notifications. + EndpointAuthorization endpoint_authorization = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Payload for creating a subscription. +message CreateSubscriptionPayload { + // Optional. Data types subscribed to. + repeated string data_types = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "health.googleapis.com/DataType" } + ]; + + // Required. Immutable. The resource name of the user for whom this + // subscription is active. Format: `users/{user}` where `{user}` is the public + // `healthUserId` as returned by the `GetIdentity` action in the profile PAPI + // (see + // `google.devicesandservices.health.v4main.HealthProfileService.GetIdentity`). + string user = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { type: "health.googleapis.com/User" } + ]; +} + +// Represents metadata for creating a subscriber. +message CreateSubscriberMetadata {} + +// Represents metadata for updating a subscriber. +message UpdateSubscriberMetadata {} + +// Represents metadata for deleting a subscriber. +message DeleteSubscriberMetadata {} diff --git a/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/health_profile.proto b/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/health_profile.proto index 88233db84441..9d73d147566b 100644 --- a/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/health_profile.proto +++ b/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/health_profile.proto @@ -22,6 +22,7 @@ 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"; @@ -37,7 +38,9 @@ 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"; @@ -86,6 +89,52 @@ service HealthProfileService { }; 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. @@ -165,6 +214,216 @@ message Profile { [(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) = { @@ -350,6 +609,15 @@ message Settings { // 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. @@ -397,6 +665,23 @@ message GetProfileRequest { ]; } +// 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. @@ -436,3 +721,49 @@ message GetIdentityRequest { (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; +} diff --git a/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/medical_device_info.proto b/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/medical_device_info.proto new file mode 100644 index 000000000000..0aa1db9fc852 --- /dev/null +++ b/packages/google-devicesandservices-health/protos/google/devicesandservices/health/v4/medical_device_info.proto @@ -0,0 +1,48 @@ +// 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/field_behavior.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 = "MedicalDeviceInfoProto"; +option java_package = "com.google.devicesandservices.health.v4"; +option php_namespace = "Google\\DevicesAndServices\\Health\\V4"; +option ruby_package = "Google::DevicesAndServices::Health::V4"; + +// Software as Medical Device (SaMD) metadata. +// Used to construct the Unique Device Identifier (UDI). +message MedicalDeviceInfo { + // Output only. The algorithm version used by the feature. + string algorithm_version = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The service version used by the feature. + string service_version = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The firmware version running on the compatible device used to + // collect the data. + string firmware_version = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The version of the feature/app running on the device. + string feature_version = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The model name or device type of the compatible device used to + // collect the data. + string device_model = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-devicesandservices-health/protos/protos.d.ts b/packages/google-devicesandservices-health/protos/protos.d.ts index 36cc843be0a6..ee7e4283c8f2 100644 --- a/packages/google-devicesandservices-health/protos/protos.d.ts +++ b/packages/google-devicesandservices-health/protos/protos.d.ts @@ -604,6 +604,94 @@ export namespace google { PEAK = 4 } + /** FoodAccessLevel enum. */ + enum FoodAccessLevel { + FOOD_ACCESS_LEVEL_UNSPECIFIED = 0, + FOOD_ACCESS_LEVEL_PUBLIC = 1, + FOOD_ACCESS_LEVEL_PRIVATE = 2 + } + + /** MealType enum. */ + enum MealType { + MEAL_TYPE_UNSPECIFIED = 0, + BEFORE_BREAKFAST = 1, + BREAKFAST = 2, + BEFORE_LUNCH = 3, + LUNCH = 4, + BEFORE_DINNER = 5, + DINNER = 6, + AFTER_DINNER = 7, + SNACK = 8, + ANYTIME = 9 + } + + /** EnergyUnit enum. */ + enum EnergyUnit { + ENERGY_UNIT_UNSPECIFIED = 0, + JOULE = 1, + KILOJOULE = 2, + KILOCALORIE = 3, + SMALL_CALORIE = 4, + CALORIE = 5 + } + + /** Nutrient enum. */ + enum Nutrient { + NUTRIENT_UNSPECIFIED = 0, + BIOTIN = 1, + CAFFEINE = 2, + CALCIUM = 3, + CHLORIDE = 4, + CARBOHYDRATES = 5, + CHOLESTEROL = 6, + CHROMIUM = 7, + COPPER = 8, + DIETARY_FIBER = 9, + FOLIC_ACID = 10, + IODINE = 11, + IRON = 12, + MAGNESIUM = 13, + MANGANESE = 14, + MOLYBDENUM = 15, + MONOUNSATURATED_FAT = 16, + NIACIN = 17, + PANTOTHENIC_ACID = 18, + PHOSPHORUS = 19, + POLYUNSATURATED_FAT = 20, + POTASSIUM = 21, + PROTEIN = 22, + RIBOFLAVIN = 23, + SATURATED_FAT = 24, + SELENIUM = 25, + SODIUM = 26, + SUGAR = 27, + THIAMIN = 28, + TRANS_FAT = 29, + UNSATURATED_FAT = 30, + VITAMIN_A = 31, + VITAMIN_B12 = 32, + VITAMIN_B6 = 33, + VITAMIN_C = 34, + VITAMIN_D = 35, + VITAMIN_E = 36, + VITAMIN_K = 37, + ZINC = 38, + FOLATE = 39 + } + + /** WeightUnit enum. */ + enum WeightUnit { + WEIGHT_UNIT_UNSPECIFIED = 0, + GRAM = 1, + KILOGRAM = 2, + OUNCE = 3, + POUND = 4, + STONE = 5, + MILLIGRAM = 6, + MICROGRAM = 7, + NANOGRAM = 8 + } + /** VolumeUnit enum. */ enum VolumeUnit { VOLUME_UNIT_UNSPECIFIED = 0, @@ -646,7 +734,7 @@ export namespace google { public heartRateZone: (google.devicesandservices.health.v4.ActiveZoneMinutes.HeartRateZone|keyof typeof google.devicesandservices.health.v4.ActiveZoneMinutes.HeartRateZone); /** ActiveZoneMinutes activeZoneMinutes. */ - public activeZoneMinutes: (number|Long|string); + public activeZoneMinutes?: (number|Long|string|null); /** * Creates a new ActiveZoneMinutes instance using the specified properties. @@ -760,13 +848,13 @@ export namespace google { constructor(properties?: google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue); /** ActiveZoneMinutesRollupValue sumInCardioHeartZone. */ - public sumInCardioHeartZone: (number|Long|string); + public sumInCardioHeartZone?: (number|Long|string|null); /** ActiveZoneMinutesRollupValue sumInPeakHeartZone. */ - public sumInPeakHeartZone: (number|Long|string); + public sumInPeakHeartZone?: (number|Long|string|null); /** ActiveZoneMinutesRollupValue sumInFatBurnHeartZone. */ - public sumInFatBurnHeartZone: (number|Long|string); + public sumInFatBurnHeartZone?: (number|Long|string|null); /** * Creates a new ActiveZoneMinutesRollupValue instance using the specified properties. @@ -974,7 +1062,7 @@ export namespace google { public activityLevel: (google.devicesandservices.health.v4.ActiveMinutes.ActivityLevel|keyof typeof google.devicesandservices.health.v4.ActiveMinutes.ActivityLevel); /** ActiveMinutesByActivityLevel activeMinutes. */ - public activeMinutes: (number|Long|string); + public activeMinutes?: (number|Long|string|null); /** * Creates a new ActiveMinutesByActivityLevel instance using the specified properties. @@ -1185,7 +1273,7 @@ export namespace google { public activityLevel: (google.devicesandservices.health.v4.ActiveMinutes.ActivityLevel|keyof typeof google.devicesandservices.health.v4.ActiveMinutes.ActivityLevel); /** ActiveMinutesRollupByActivityLevel activeMinutesSum. */ - public activeMinutesSum: (number|Long|string); + public activeMinutesSum?: (number|Long|string|null); /** * Creates a new ActiveMinutesRollupByActivityLevel instance using the specified properties. @@ -1607,7 +1695,7 @@ export namespace google { public interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); /** Altitude gainMillimeters. */ - public gainMillimeters: (number|Long|string); + public gainMillimeters?: (number|Long|string|null); /** * Creates a new Altitude instance using the specified properties. @@ -1710,7 +1798,7 @@ export namespace google { public interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); /** BasalEnergyBurned kcal. */ - public kcal: number; + public kcal?: (number|null); /** * Creates a new BasalEnergyBurned instance using the specified properties. @@ -1813,7 +1901,7 @@ export namespace google { public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); /** BodyFat percentage. */ - public percentage: number; + public percentage?: (number|null); /** * Creates a new BodyFat instance using the specified properties. @@ -1910,7 +1998,7 @@ export namespace google { constructor(properties?: google.devicesandservices.health.v4.IBodyFatRollupValue); /** BodyFatRollupValue bodyFatPercentageAvg. */ - public bodyFatPercentageAvg: number; + public bodyFatPercentageAvg?: (number|null); /** * Creates a new BodyFatRollupValue instance using the specified properties. @@ -1990,6 +2078,255 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a CoreBodyTemperature. */ + interface ICoreBodyTemperature { + + /** CoreBodyTemperature sampleTime */ + sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + + /** CoreBodyTemperature temperatureCelsius */ + temperatureCelsius?: (number|null); + + /** CoreBodyTemperature measurementLocation */ + measurementLocation?: (google.devicesandservices.health.v4.CoreBodyTemperature.MeasurementLocation|keyof typeof google.devicesandservices.health.v4.CoreBodyTemperature.MeasurementLocation|null); + + /** CoreBodyTemperature id */ + id?: (string|null); + } + + /** Represents a CoreBodyTemperature. */ + class CoreBodyTemperature implements ICoreBodyTemperature { + + /** + * Constructs a new CoreBodyTemperature. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.ICoreBodyTemperature); + + /** CoreBodyTemperature sampleTime. */ + public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + + /** CoreBodyTemperature temperatureCelsius. */ + public temperatureCelsius?: (number|null); + + /** CoreBodyTemperature measurementLocation. */ + public measurementLocation: (google.devicesandservices.health.v4.CoreBodyTemperature.MeasurementLocation|keyof typeof google.devicesandservices.health.v4.CoreBodyTemperature.MeasurementLocation); + + /** CoreBodyTemperature id. */ + public id: string; + + /** + * Creates a new CoreBodyTemperature instance using the specified properties. + * @param [properties] Properties to set + * @returns CoreBodyTemperature instance + */ + public static create(properties?: google.devicesandservices.health.v4.ICoreBodyTemperature): google.devicesandservices.health.v4.CoreBodyTemperature; + + /** + * Encodes the specified CoreBodyTemperature message. Does not implicitly {@link google.devicesandservices.health.v4.CoreBodyTemperature.verify|verify} messages. + * @param message CoreBodyTemperature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.ICoreBodyTemperature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CoreBodyTemperature message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CoreBodyTemperature.verify|verify} messages. + * @param message CoreBodyTemperature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.ICoreBodyTemperature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CoreBodyTemperature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CoreBodyTemperature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.CoreBodyTemperature; + + /** + * Decodes a CoreBodyTemperature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CoreBodyTemperature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.CoreBodyTemperature; + + /** + * Verifies a CoreBodyTemperature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CoreBodyTemperature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CoreBodyTemperature + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.CoreBodyTemperature; + + /** + * Creates a plain object from a CoreBodyTemperature message. Also converts values to other types if specified. + * @param message CoreBodyTemperature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.CoreBodyTemperature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CoreBodyTemperature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CoreBodyTemperature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CoreBodyTemperature { + + /** MeasurementLocation enum. */ + enum MeasurementLocation { + MEASUREMENT_LOCATION_UNSPECIFIED = 0, + OTHER = 1, + ARMPIT = 2, + BODY = 3, + EAR = 4, + FINGER = 5, + GASTRO_INTESTINAL = 6, + MOUTH = 7, + RECTUM = 8, + TOE = 9, + EAR_DRUM = 10, + TEMPORAL_ARTERY = 11, + FOREHEAD = 12, + URINARY_BLADDER = 13, + NASAL = 14, + NASOPHARYNGEAL = 15, + WRIST = 16, + VAGINA = 17 + } + } + + /** Properties of a CoreBodyTemperatureRollupValue. */ + interface ICoreBodyTemperatureRollupValue { + + /** CoreBodyTemperatureRollupValue temperatureCelsiusAvg */ + temperatureCelsiusAvg?: (number|null); + + /** CoreBodyTemperatureRollupValue temperatureCelsiusMax */ + temperatureCelsiusMax?: (number|null); + + /** CoreBodyTemperatureRollupValue temperatureCelsiusMin */ + temperatureCelsiusMin?: (number|null); + } + + /** Represents a CoreBodyTemperatureRollupValue. */ + class CoreBodyTemperatureRollupValue implements ICoreBodyTemperatureRollupValue { + + /** + * Constructs a new CoreBodyTemperatureRollupValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue); + + /** CoreBodyTemperatureRollupValue temperatureCelsiusAvg. */ + public temperatureCelsiusAvg?: (number|null); + + /** CoreBodyTemperatureRollupValue temperatureCelsiusMax. */ + public temperatureCelsiusMax?: (number|null); + + /** CoreBodyTemperatureRollupValue temperatureCelsiusMin. */ + public temperatureCelsiusMin?: (number|null); + + /** + * Creates a new CoreBodyTemperatureRollupValue instance using the specified properties. + * @param [properties] Properties to set + * @returns CoreBodyTemperatureRollupValue instance + */ + public static create(properties?: google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue): google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue; + + /** + * Encodes the specified CoreBodyTemperatureRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue.verify|verify} messages. + * @param message CoreBodyTemperatureRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CoreBodyTemperatureRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue.verify|verify} messages. + * @param message CoreBodyTemperatureRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CoreBodyTemperatureRollupValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CoreBodyTemperatureRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue; + + /** + * Decodes a CoreBodyTemperatureRollupValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CoreBodyTemperatureRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue; + + /** + * Verifies a CoreBodyTemperatureRollupValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CoreBodyTemperatureRollupValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CoreBodyTemperatureRollupValue + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue; + + /** + * Creates a plain object from a CoreBodyTemperatureRollupValue message. Also converts values to other types if specified. + * @param message CoreBodyTemperatureRollupValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CoreBodyTemperatureRollupValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CoreBodyTemperatureRollupValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a CaloriesInHeartRateZoneRollupValue. */ interface ICaloriesInHeartRateZoneRollupValue { @@ -2112,7 +2449,7 @@ export namespace google { public heartRateZone: (google.devicesandservices.health.v4.HeartRateZoneType|keyof typeof google.devicesandservices.health.v4.HeartRateZoneType); /** CaloriesInHeartRateZoneValue kcal. */ - public kcal: number; + public kcal?: (number|null); /** * Creates a new CaloriesInHeartRateZoneValue instance using the specified properties. @@ -2324,10 +2661,10 @@ export namespace google { public heartRateZoneType: (google.devicesandservices.health.v4.HeartRateZoneType|keyof typeof google.devicesandservices.health.v4.HeartRateZoneType); /** HeartRateZone minBeatsPerMinute. */ - public minBeatsPerMinute: (number|Long|string); + public minBeatsPerMinute?: (number|Long|string|null); /** HeartRateZone maxBeatsPerMinute. */ - public maxBeatsPerMinute: (number|Long|string); + public maxBeatsPerMinute?: (number|Long|string|null); /** * Creates a new HeartRateZone instance using the specified properties. @@ -2552,7 +2889,7 @@ export namespace google { public date?: (google.type.IDate|null); /** DailyRespiratoryRate breathsPerMinute. */ - public breathsPerMinute: number; + public breathsPerMinute?: (number|null); /** * Creates a new DailyRespiratoryRate instance using the specified properties. @@ -2664,16 +3001,16 @@ export namespace google { public date?: (google.type.IDate|null); /** DailyOxygenSaturation averagePercentage. */ - public averagePercentage: number; + public averagePercentage?: (number|null); /** DailyOxygenSaturation lowerBoundPercentage. */ - public lowerBoundPercentage: number; + public lowerBoundPercentage?: (number|null); /** DailyOxygenSaturation upperBoundPercentage. */ - public upperBoundPercentage: number; + public upperBoundPercentage?: (number|null); /** DailyOxygenSaturation standardDeviationPercentage. */ - public standardDeviationPercentage: number; + public standardDeviationPercentage?: (number|null); /** * Creates a new DailyOxygenSaturation instance using the specified properties. @@ -2779,7 +3116,7 @@ export namespace google { public date?: (google.type.IDate|null); /** DailyRestingHeartRate beatsPerMinute. */ - public beatsPerMinute: (number|Long|string); + public beatsPerMinute?: (number|Long|string|null); /** DailyRestingHeartRate dailyRestingHeartRateMetadata. */ public dailyRestingHeartRateMetadata?: (google.devicesandservices.health.v4.DailyRestingHeartRate.IDailyRestingHeartRateMetadata|null); @@ -3001,13 +3338,13 @@ export namespace google { public date?: (google.type.IDate|null); /** DailySleepTemperatureDerivations nightlyTemperatureCelsius. */ - public nightlyTemperatureCelsius: number; + public nightlyTemperatureCelsius?: (number|null); /** DailySleepTemperatureDerivations baselineTemperatureCelsius. */ - public baselineTemperatureCelsius: number; + public baselineTemperatureCelsius?: (number|null); /** DailySleepTemperatureDerivations relativeNightlyStddev_30dCelsius. */ - public relativeNightlyStddev_30dCelsius: number; + public relativeNightlyStddev_30dCelsius?: (number|null); /** * Creates a new DailySleepTemperatureDerivations instance using the specified properties. @@ -3119,7 +3456,7 @@ export namespace google { public date?: (google.type.IDate|null); /** DailyVO2Max vo2Max. */ - public vo2Max: number; + public vo2Max?: (number|null); /** DailyVO2Max estimated. */ public estimated: boolean; @@ -3128,7 +3465,7 @@ export namespace google { public cardioFitnessLevel: (google.devicesandservices.health.v4.DailyVO2Max.CardioFitnessLevel|keyof typeof google.devicesandservices.health.v4.DailyVO2Max.CardioFitnessLevel); /** DailyVO2Max vo2MaxCovariance. */ - public vo2MaxCovariance: number; + public vo2MaxCovariance?: (number|null); /** * Creates a new DailyVO2Max instance using the specified properties. @@ -3245,7 +3582,7 @@ export namespace google { public interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); /** Distance millimeters. */ - public millimeters: (number|Long|string); + public millimeters?: (number|Long|string|null); /** * Creates a new Distance instance using the specified properties. @@ -3342,7 +3679,7 @@ export namespace google { constructor(properties?: google.devicesandservices.health.v4.IDistanceRollupValue); /** DistanceRollupValue millimetersSum. */ - public millimetersSum: (number|Long|string); + public millimetersSum?: (number|Long|string|null); /** * Creates a new DistanceRollupValue instance using the specified properties. @@ -3422,6 +3759,160 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an Electrocardiogram. */ + interface IElectrocardiogram { + + /** Electrocardiogram interval */ + interval?: (google.devicesandservices.health.v4.ISessionTimeInterval|null); + + /** Electrocardiogram beatsPerMinuteAvg */ + beatsPerMinuteAvg?: (number|Long|string|null); + + /** Electrocardiogram resultClassification */ + resultClassification?: (google.devicesandservices.health.v4.Electrocardiogram.ResultClassification|keyof typeof google.devicesandservices.health.v4.Electrocardiogram.ResultClassification|null); + + /** Electrocardiogram waveformSamples */ + waveformSamples?: (number[]|null); + + /** Electrocardiogram samplingFrequencyHertz */ + samplingFrequencyHertz?: (number|null); + + /** Electrocardiogram millivoltsScalingFactor */ + millivoltsScalingFactor?: (number|null); + + /** Electrocardiogram leadNumber */ + leadNumber?: (number|null); + + /** Electrocardiogram medicalDeviceInfo */ + medicalDeviceInfo?: (google.devicesandservices.health.v4.IMedicalDeviceInfo|null); + } + + /** Represents an Electrocardiogram. */ + class Electrocardiogram implements IElectrocardiogram { + + /** + * Constructs a new Electrocardiogram. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IElectrocardiogram); + + /** Electrocardiogram interval. */ + public interval?: (google.devicesandservices.health.v4.ISessionTimeInterval|null); + + /** Electrocardiogram beatsPerMinuteAvg. */ + public beatsPerMinuteAvg?: (number|Long|string|null); + + /** Electrocardiogram resultClassification. */ + public resultClassification: (google.devicesandservices.health.v4.Electrocardiogram.ResultClassification|keyof typeof google.devicesandservices.health.v4.Electrocardiogram.ResultClassification); + + /** Electrocardiogram waveformSamples. */ + public waveformSamples: number[]; + + /** Electrocardiogram samplingFrequencyHertz. */ + public samplingFrequencyHertz?: (number|null); + + /** Electrocardiogram millivoltsScalingFactor. */ + public millivoltsScalingFactor?: (number|null); + + /** Electrocardiogram leadNumber. */ + public leadNumber?: (number|null); + + /** Electrocardiogram medicalDeviceInfo. */ + public medicalDeviceInfo?: (google.devicesandservices.health.v4.IMedicalDeviceInfo|null); + + /** + * Creates a new Electrocardiogram instance using the specified properties. + * @param [properties] Properties to set + * @returns Electrocardiogram instance + */ + public static create(properties?: google.devicesandservices.health.v4.IElectrocardiogram): google.devicesandservices.health.v4.Electrocardiogram; + + /** + * Encodes the specified Electrocardiogram message. Does not implicitly {@link google.devicesandservices.health.v4.Electrocardiogram.verify|verify} messages. + * @param message Electrocardiogram message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IElectrocardiogram, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Electrocardiogram message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Electrocardiogram.verify|verify} messages. + * @param message Electrocardiogram message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IElectrocardiogram, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Electrocardiogram message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Electrocardiogram + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Electrocardiogram; + + /** + * Decodes an Electrocardiogram message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Electrocardiogram + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Electrocardiogram; + + /** + * Verifies an Electrocardiogram message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Electrocardiogram message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Electrocardiogram + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Electrocardiogram; + + /** + * Creates a plain object from an Electrocardiogram message. Also converts values to other types if specified. + * @param message Electrocardiogram + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.Electrocardiogram, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Electrocardiogram to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Electrocardiogram + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Electrocardiogram { + + /** ResultClassification enum. */ + enum ResultClassification { + RESULT_CLASSIFICATION_UNSPECIFIED = 0, + NORMAL_SINUS_RHYTHM = 1, + ATRIAL_FIBRILLATION = 2, + INCONCLUSIVE = 3, + INCONCLUSIVE_HIGH_HEART_RATE = 4, + INCONCLUSIVE_LOW_HEART_RATE = 5, + UNREADABLE = 6, + NOT_ANALYZED = 7 + } + } + /** Properties of an Exercise. */ interface IExercise { @@ -3875,7 +4366,7 @@ export namespace google { constructor(properties?: google.devicesandservices.health.v4.Exercise.IExerciseMetadata); /** ExerciseMetadata poolLengthMillimeters. */ - public poolLengthMillimeters: (number|Long|string); + public poolLengthMillimeters?: (number|Long|string|null); /** ExerciseMetadata hasGps. */ public hasGps: boolean; @@ -3999,7 +4490,7 @@ export namespace google { public interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); /** Floors count. */ - public count: (number|Long|string); + public count?: (number|Long|string|null); /** * Creates a new Floors instance using the specified properties. @@ -4096,7 +4587,7 @@ export namespace google { constructor(properties?: google.devicesandservices.health.v4.IFloorsRollupValue); /** FloorsRollupValue countSum. */ - public countSum: (number|Long|string); + public countSum?: (number|Long|string|null); /** * Creates a new FloorsRollupValue instance using the specified properties. @@ -4193,7 +4684,7 @@ export namespace google { constructor(properties?: google.devicesandservices.health.v4.IAltitudeRollupValue); /** AltitudeRollupValue gainMillimetersSum. */ - public gainMillimetersSum: (number|Long|string); + public gainMillimetersSum?: (number|Long|string|null); /** * Creates a new AltitudeRollupValue instance using the specified properties. @@ -4299,7 +4790,7 @@ export namespace google { public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); /** HeartRate beatsPerMinute. */ - public beatsPerMinute: (number|Long|string); + public beatsPerMinute?: (number|Long|string|null); /** HeartRate metadata. */ public metadata?: (google.devicesandservices.health.v4.HeartRate.IHeartRateMetadata|null); @@ -4641,13 +5132,13 @@ export namespace google { constructor(properties?: google.devicesandservices.health.v4.IRunVO2MaxRollupValue); /** RunVO2MaxRollupValue rateMin. */ - public rateMin: number; + public rateMin?: (number|null); /** RunVO2MaxRollupValue rateMax. */ - public rateMax: number; + public rateMax?: (number|null); /** RunVO2MaxRollupValue rateAvg. */ - public rateAvg: number; + public rateAvg?: (number|null); /** * Creates a new RunVO2MaxRollupValue instance using the specified properties. @@ -4750,7 +5241,7 @@ export namespace google { public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); /** RunVO2Max runVo2Max. */ - public runVo2Max: number; + public runVo2Max?: (number|null); /** * Creates a new RunVO2Max instance using the specified properties. @@ -4956,7 +5447,7 @@ export namespace google { public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); /** Height heightMillimeters. */ - public heightMillimeters: (number|Long|string); + public heightMillimeters?: (number|Long|string|null); /** * Creates a new Height instance using the specified properties. @@ -5062,10 +5553,10 @@ export namespace google { public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); /** HeartRateVariability rootMeanSquareOfSuccessiveDifferencesMilliseconds. */ - public rootMeanSquareOfSuccessiveDifferencesMilliseconds: number; + public rootMeanSquareOfSuccessiveDifferencesMilliseconds?: (number|null); /** HeartRateVariability standardDeviationMilliseconds. */ - public standardDeviationMilliseconds: number; + public standardDeviationMilliseconds?: (number|null); /** * Creates a new HeartRateVariability instance using the specified properties. @@ -5165,7 +5656,7 @@ export namespace google { constructor(properties?: google.devicesandservices.health.v4.IVolumeQuantity); /** VolumeQuantity milliliters. */ - public milliliters: number; + public milliliters?: (number|null); /** VolumeQuantity userProvidedUnit. */ public userProvidedUnit: (google.devicesandservices.health.v4.VolumeUnit|keyof typeof google.devicesandservices.health.v4.VolumeUnit); @@ -5470,7 +5961,7 @@ export namespace google { constructor(properties?: google.devicesandservices.health.v4.HydrationLogRollupValue.IVolumeQuantityRollup); /** VolumeQuantityRollup millilitersSum. */ - public millilitersSum: number; + public millilitersSum?: (number|null); /** VolumeQuantityRollup userProvidedUnitLast. */ public userProvidedUnitLast: (google.devicesandservices.health.v4.VolumeUnit|keyof typeof google.devicesandservices.health.v4.VolumeUnit); @@ -5554,28 +6045,394 @@ export namespace google { } } - /** Properties of a MetricsSummary. */ - interface IMetricsSummary { + /** Properties of an IrregularRhythmNotification. */ + interface IIrregularRhythmNotification { - /** MetricsSummary caloriesKcal */ - caloriesKcal?: (number|null); + /** IrregularRhythmNotification interval */ + interval?: (google.devicesandservices.health.v4.ISessionTimeInterval|null); - /** MetricsSummary distanceMillimeters */ - distanceMillimeters?: (number|null); + /** IrregularRhythmNotification alertWindows */ + alertWindows?: (google.devicesandservices.health.v4.IrregularRhythmNotification.IAlertWindow[]|null); - /** MetricsSummary steps */ - steps?: (number|Long|string|null); + /** IrregularRhythmNotification medicalDeviceInfo */ + medicalDeviceInfo?: (google.devicesandservices.health.v4.IMedicalDeviceInfo|null); + } - /** MetricsSummary averageSpeedMillimetersPerSecond */ - averageSpeedMillimetersPerSecond?: (number|null); + /** Represents an IrregularRhythmNotification. */ + class IrregularRhythmNotification implements IIrregularRhythmNotification { - /** MetricsSummary averagePaceSecondsPerMeter */ - averagePaceSecondsPerMeter?: (number|null); + /** + * Constructs a new IrregularRhythmNotification. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IIrregularRhythmNotification); - /** MetricsSummary averageHeartRateBeatsPerMinute */ - averageHeartRateBeatsPerMinute?: (number|Long|string|null); + /** IrregularRhythmNotification interval. */ + public interval?: (google.devicesandservices.health.v4.ISessionTimeInterval|null); - /** MetricsSummary elevationGainMillimeters */ + /** IrregularRhythmNotification alertWindows. */ + public alertWindows: google.devicesandservices.health.v4.IrregularRhythmNotification.IAlertWindow[]; + + /** IrregularRhythmNotification medicalDeviceInfo. */ + public medicalDeviceInfo?: (google.devicesandservices.health.v4.IMedicalDeviceInfo|null); + + /** + * Creates a new IrregularRhythmNotification instance using the specified properties. + * @param [properties] Properties to set + * @returns IrregularRhythmNotification instance + */ + public static create(properties?: google.devicesandservices.health.v4.IIrregularRhythmNotification): google.devicesandservices.health.v4.IrregularRhythmNotification; + + /** + * Encodes the specified IrregularRhythmNotification message. Does not implicitly {@link google.devicesandservices.health.v4.IrregularRhythmNotification.verify|verify} messages. + * @param message IrregularRhythmNotification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IIrregularRhythmNotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IrregularRhythmNotification message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.IrregularRhythmNotification.verify|verify} messages. + * @param message IrregularRhythmNotification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IIrregularRhythmNotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IrregularRhythmNotification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IrregularRhythmNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.IrregularRhythmNotification; + + /** + * Decodes an IrregularRhythmNotification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IrregularRhythmNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.IrregularRhythmNotification; + + /** + * Verifies an IrregularRhythmNotification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IrregularRhythmNotification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IrregularRhythmNotification + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.IrregularRhythmNotification; + + /** + * Creates a plain object from an IrregularRhythmNotification message. Also converts values to other types if specified. + * @param message IrregularRhythmNotification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.IrregularRhythmNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IrregularRhythmNotification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IrregularRhythmNotification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IrregularRhythmNotification { + + /** Properties of a HeartBeat. */ + interface IHeartBeat { + + /** HeartBeat physicalTime */ + physicalTime?: (google.protobuf.ITimestamp|null); + + /** HeartBeat utcOffset */ + utcOffset?: (google.protobuf.IDuration|null); + + /** HeartBeat civilTime */ + civilTime?: (google.devicesandservices.health.v4.ICivilDateTime|null); + + /** HeartBeat beatsPerMinute */ + beatsPerMinute?: (number|null); + } + + /** Represents a HeartBeat. */ + class HeartBeat implements IHeartBeat { + + /** + * Constructs a new HeartBeat. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IrregularRhythmNotification.IHeartBeat); + + /** HeartBeat physicalTime. */ + public physicalTime?: (google.protobuf.ITimestamp|null); + + /** HeartBeat utcOffset. */ + public utcOffset?: (google.protobuf.IDuration|null); + + /** HeartBeat civilTime. */ + public civilTime?: (google.devicesandservices.health.v4.ICivilDateTime|null); + + /** HeartBeat beatsPerMinute. */ + public beatsPerMinute?: (number|null); + + /** + * Creates a new HeartBeat instance using the specified properties. + * @param [properties] Properties to set + * @returns HeartBeat instance + */ + public static create(properties?: google.devicesandservices.health.v4.IrregularRhythmNotification.IHeartBeat): google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat; + + /** + * Encodes the specified HeartBeat message. Does not implicitly {@link google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat.verify|verify} messages. + * @param message HeartBeat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IrregularRhythmNotification.IHeartBeat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HeartBeat message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat.verify|verify} messages. + * @param message HeartBeat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IrregularRhythmNotification.IHeartBeat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HeartBeat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HeartBeat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat; + + /** + * Decodes a HeartBeat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HeartBeat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat; + + /** + * Verifies a HeartBeat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HeartBeat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HeartBeat + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat; + + /** + * Creates a plain object from a HeartBeat message. Also converts values to other types if specified. + * @param message HeartBeat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HeartBeat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HeartBeat + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AlertWindow. */ + interface IAlertWindow { + + /** AlertWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** AlertWindow startUtcOffset */ + startUtcOffset?: (google.protobuf.IDuration|null); + + /** AlertWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** AlertWindow endUtcOffset */ + endUtcOffset?: (google.protobuf.IDuration|null); + + /** AlertWindow civilStartTime */ + civilStartTime?: (google.devicesandservices.health.v4.ICivilDateTime|null); + + /** AlertWindow civilEndTime */ + civilEndTime?: (google.devicesandservices.health.v4.ICivilDateTime|null); + + /** AlertWindow positive */ + positive?: (boolean|null); + + /** AlertWindow heartBeats */ + heartBeats?: (google.devicesandservices.health.v4.IrregularRhythmNotification.IHeartBeat[]|null); + } + + /** Represents an AlertWindow. */ + class AlertWindow implements IAlertWindow { + + /** + * Constructs a new AlertWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IrregularRhythmNotification.IAlertWindow); + + /** AlertWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** AlertWindow startUtcOffset. */ + public startUtcOffset?: (google.protobuf.IDuration|null); + + /** AlertWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** AlertWindow endUtcOffset. */ + public endUtcOffset?: (google.protobuf.IDuration|null); + + /** AlertWindow civilStartTime. */ + public civilStartTime?: (google.devicesandservices.health.v4.ICivilDateTime|null); + + /** AlertWindow civilEndTime. */ + public civilEndTime?: (google.devicesandservices.health.v4.ICivilDateTime|null); + + /** AlertWindow positive. */ + public positive: boolean; + + /** AlertWindow heartBeats. */ + public heartBeats: google.devicesandservices.health.v4.IrregularRhythmNotification.IHeartBeat[]; + + /** + * Creates a new AlertWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns AlertWindow instance + */ + public static create(properties?: google.devicesandservices.health.v4.IrregularRhythmNotification.IAlertWindow): google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow; + + /** + * Encodes the specified AlertWindow message. Does not implicitly {@link google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.verify|verify} messages. + * @param message AlertWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IrregularRhythmNotification.IAlertWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AlertWindow message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.verify|verify} messages. + * @param message AlertWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IrregularRhythmNotification.IAlertWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AlertWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AlertWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow; + + /** + * Decodes an AlertWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AlertWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow; + + /** + * Verifies an AlertWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AlertWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AlertWindow + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow; + + /** + * Creates a plain object from an AlertWindow message. Also converts values to other types if specified. + * @param message AlertWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AlertWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AlertWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a MetricsSummary. */ + interface IMetricsSummary { + + /** MetricsSummary caloriesKcal */ + caloriesKcal?: (number|null); + + /** MetricsSummary distanceMillimeters */ + distanceMillimeters?: (number|null); + + /** MetricsSummary steps */ + steps?: (number|Long|string|null); + + /** MetricsSummary averageSpeedMillimetersPerSecond */ + averageSpeedMillimetersPerSecond?: (number|null); + + /** MetricsSummary averagePaceSecondsPerMeter */ + averagePaceSecondsPerMeter?: (number|null); + + /** MetricsSummary averageHeartRateBeatsPerMinute */ + averageHeartRateBeatsPerMinute?: (number|Long|string|null); + + /** MetricsSummary elevationGainMillimeters */ elevationGainMillimeters?: (number|null); /** MetricsSummary activeZoneMinutes */ @@ -5956,438 +6813,571 @@ export namespace google { } } - /** Properties of an OxygenSaturation. */ - interface IOxygenSaturation { + /** Properties of a WeightQuantity. */ + interface IWeightQuantity { - /** OxygenSaturation sampleTime */ - sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + /** WeightQuantity grams */ + grams?: (number|null); - /** OxygenSaturation percentage */ - percentage?: (number|null); + /** WeightQuantity userProvidedUnit */ + userProvidedUnit?: (google.devicesandservices.health.v4.WeightUnit|keyof typeof google.devicesandservices.health.v4.WeightUnit|null); } - /** Represents an OxygenSaturation. */ - class OxygenSaturation implements IOxygenSaturation { + /** Represents a WeightQuantity. */ + class WeightQuantity implements IWeightQuantity { /** - * Constructs a new OxygenSaturation. + * Constructs a new WeightQuantity. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IOxygenSaturation); + constructor(properties?: google.devicesandservices.health.v4.IWeightQuantity); - /** OxygenSaturation sampleTime. */ - public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + /** WeightQuantity grams. */ + public grams?: (number|null); - /** OxygenSaturation percentage. */ - public percentage: number; + /** WeightQuantity userProvidedUnit. */ + public userProvidedUnit: (google.devicesandservices.health.v4.WeightUnit|keyof typeof google.devicesandservices.health.v4.WeightUnit); /** - * Creates a new OxygenSaturation instance using the specified properties. + * Creates a new WeightQuantity instance using the specified properties. * @param [properties] Properties to set - * @returns OxygenSaturation instance + * @returns WeightQuantity instance */ - public static create(properties?: google.devicesandservices.health.v4.IOxygenSaturation): google.devicesandservices.health.v4.OxygenSaturation; + public static create(properties?: google.devicesandservices.health.v4.IWeightQuantity): google.devicesandservices.health.v4.WeightQuantity; /** - * Encodes the specified OxygenSaturation message. Does not implicitly {@link google.devicesandservices.health.v4.OxygenSaturation.verify|verify} messages. - * @param message OxygenSaturation message or plain object to encode + * Encodes the specified WeightQuantity message. Does not implicitly {@link google.devicesandservices.health.v4.WeightQuantity.verify|verify} messages. + * @param message WeightQuantity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IOxygenSaturation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IWeightQuantity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OxygenSaturation message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.OxygenSaturation.verify|verify} messages. - * @param message OxygenSaturation message or plain object to encode + * Encodes the specified WeightQuantity message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.WeightQuantity.verify|verify} messages. + * @param message WeightQuantity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IOxygenSaturation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IWeightQuantity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OxygenSaturation message from the specified reader or buffer. + * Decodes a WeightQuantity message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OxygenSaturation + * @returns WeightQuantity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.OxygenSaturation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.WeightQuantity; /** - * Decodes an OxygenSaturation message from the specified reader or buffer, length delimited. + * Decodes a WeightQuantity message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OxygenSaturation + * @returns WeightQuantity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.OxygenSaturation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.WeightQuantity; /** - * Verifies an OxygenSaturation message. + * Verifies a WeightQuantity message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an OxygenSaturation message from a plain object. Also converts values to their respective internal types. + * Creates a WeightQuantity message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OxygenSaturation + * @returns WeightQuantity */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.OxygenSaturation; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.WeightQuantity; /** - * Creates a plain object from an OxygenSaturation message. Also converts values to other types if specified. - * @param message OxygenSaturation + * Creates a plain object from a WeightQuantity message. Also converts values to other types if specified. + * @param message WeightQuantity * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.OxygenSaturation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.WeightQuantity, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OxygenSaturation to JSON. + * Converts this WeightQuantity to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OxygenSaturation + * Gets the default type url for WeightQuantity * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RestingHeartRatePersonalRangeRollupValue. */ - interface IRestingHeartRatePersonalRangeRollupValue { + /** Properties of an EnergyQuantity. */ + interface IEnergyQuantity { - /** RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMin */ - beatsPerMinuteMin?: (number|null); + /** EnergyQuantity kcal */ + kcal?: (number|null); - /** RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMax */ - beatsPerMinuteMax?: (number|null); + /** EnergyQuantity userProvidedUnit */ + userProvidedUnit?: (google.devicesandservices.health.v4.EnergyUnit|keyof typeof google.devicesandservices.health.v4.EnergyUnit|null); } - /** Represents a RestingHeartRatePersonalRangeRollupValue. */ - class RestingHeartRatePersonalRangeRollupValue implements IRestingHeartRatePersonalRangeRollupValue { + /** Represents an EnergyQuantity. */ + class EnergyQuantity implements IEnergyQuantity { /** - * Constructs a new RestingHeartRatePersonalRangeRollupValue. + * Constructs a new EnergyQuantity. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue); + constructor(properties?: google.devicesandservices.health.v4.IEnergyQuantity); - /** RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMin. */ - public beatsPerMinuteMin?: (number|null); + /** EnergyQuantity kcal. */ + public kcal?: (number|null); - /** RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMax. */ - public beatsPerMinuteMax?: (number|null); + /** EnergyQuantity userProvidedUnit. */ + public userProvidedUnit: (google.devicesandservices.health.v4.EnergyUnit|keyof typeof google.devicesandservices.health.v4.EnergyUnit); /** - * Creates a new RestingHeartRatePersonalRangeRollupValue instance using the specified properties. + * Creates a new EnergyQuantity instance using the specified properties. * @param [properties] Properties to set - * @returns RestingHeartRatePersonalRangeRollupValue instance + * @returns EnergyQuantity instance */ - public static create(properties?: google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue): google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue; + public static create(properties?: google.devicesandservices.health.v4.IEnergyQuantity): google.devicesandservices.health.v4.EnergyQuantity; /** - * Encodes the specified RestingHeartRatePersonalRangeRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.verify|verify} messages. - * @param message RestingHeartRatePersonalRangeRollupValue message or plain object to encode + * Encodes the specified EnergyQuantity message. Does not implicitly {@link google.devicesandservices.health.v4.EnergyQuantity.verify|verify} messages. + * @param message EnergyQuantity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IEnergyQuantity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RestingHeartRatePersonalRangeRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.verify|verify} messages. - * @param message RestingHeartRatePersonalRangeRollupValue message or plain object to encode + * Encodes the specified EnergyQuantity message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.EnergyQuantity.verify|verify} messages. + * @param message EnergyQuantity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IEnergyQuantity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RestingHeartRatePersonalRangeRollupValue message from the specified reader or buffer. + * Decodes an EnergyQuantity message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RestingHeartRatePersonalRangeRollupValue + * @returns EnergyQuantity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.EnergyQuantity; /** - * Decodes a RestingHeartRatePersonalRangeRollupValue message from the specified reader or buffer, length delimited. + * Decodes an EnergyQuantity message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RestingHeartRatePersonalRangeRollupValue + * @returns EnergyQuantity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.EnergyQuantity; /** - * Verifies a RestingHeartRatePersonalRangeRollupValue message. + * Verifies an EnergyQuantity message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RestingHeartRatePersonalRangeRollupValue message from a plain object. Also converts values to their respective internal types. + * Creates an EnergyQuantity message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RestingHeartRatePersonalRangeRollupValue + * @returns EnergyQuantity */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.EnergyQuantity; /** - * Creates a plain object from a RestingHeartRatePersonalRangeRollupValue message. Also converts values to other types if specified. - * @param message RestingHeartRatePersonalRangeRollupValue + * Creates a plain object from an EnergyQuantity message. Also converts values to other types if specified. + * @param message EnergyQuantity * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.EnergyQuantity, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RestingHeartRatePersonalRangeRollupValue to JSON. + * Converts this EnergyQuantity to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RestingHeartRatePersonalRangeRollupValue + * Gets the default type url for EnergyQuantity * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RespiratoryRateSleepSummary. */ - interface IRespiratoryRateSleepSummary { + /** Properties of a NutrientQuantity. */ + interface INutrientQuantity { - /** RespiratoryRateSleepSummary sampleTime */ - sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + /** NutrientQuantity quantity */ + quantity?: (google.devicesandservices.health.v4.IWeightQuantity|null); - /** RespiratoryRateSleepSummary deepSleepStats */ - deepSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); + /** NutrientQuantity nutrient */ + nutrient?: (google.devicesandservices.health.v4.Nutrient|keyof typeof google.devicesandservices.health.v4.Nutrient|null); + } - /** RespiratoryRateSleepSummary lightSleepStats */ - lightSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); + /** Represents a NutrientQuantity. */ + class NutrientQuantity implements INutrientQuantity { - /** RespiratoryRateSleepSummary remSleepStats */ - remSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); + /** + * Constructs a new NutrientQuantity. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.INutrientQuantity); - /** RespiratoryRateSleepSummary fullSleepStats */ - fullSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); + /** NutrientQuantity quantity. */ + public quantity?: (google.devicesandservices.health.v4.IWeightQuantity|null); + + /** NutrientQuantity nutrient. */ + public nutrient: (google.devicesandservices.health.v4.Nutrient|keyof typeof google.devicesandservices.health.v4.Nutrient); + + /** + * Creates a new NutrientQuantity instance using the specified properties. + * @param [properties] Properties to set + * @returns NutrientQuantity instance + */ + public static create(properties?: google.devicesandservices.health.v4.INutrientQuantity): google.devicesandservices.health.v4.NutrientQuantity; + + /** + * Encodes the specified NutrientQuantity message. Does not implicitly {@link google.devicesandservices.health.v4.NutrientQuantity.verify|verify} messages. + * @param message NutrientQuantity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.INutrientQuantity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NutrientQuantity message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.NutrientQuantity.verify|verify} messages. + * @param message NutrientQuantity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.INutrientQuantity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NutrientQuantity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NutrientQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.NutrientQuantity; + + /** + * Decodes a NutrientQuantity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NutrientQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.NutrientQuantity; + + /** + * Verifies a NutrientQuantity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NutrientQuantity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NutrientQuantity + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.NutrientQuantity; + + /** + * Creates a plain object from a NutrientQuantity message. Also converts values to other types if specified. + * @param message NutrientQuantity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.NutrientQuantity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NutrientQuantity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NutrientQuantity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Represents a RespiratoryRateSleepSummary. */ - class RespiratoryRateSleepSummary implements IRespiratoryRateSleepSummary { + /** Properties of a NutritionLog. */ + interface INutritionLog { + + /** NutritionLog interval */ + interval?: (google.devicesandservices.health.v4.ISessionTimeInterval|null); + + /** NutritionLog nutrients */ + nutrients?: (google.devicesandservices.health.v4.INutrientQuantity[]|null); + + /** NutritionLog energy */ + energy?: (google.devicesandservices.health.v4.IEnergyQuantity|null); + + /** NutritionLog energyFromFat */ + energyFromFat?: (google.devicesandservices.health.v4.IEnergyQuantity|null); + + /** NutritionLog totalCarbohydrate */ + totalCarbohydrate?: (google.devicesandservices.health.v4.IWeightQuantity|null); + + /** NutritionLog totalFat */ + totalFat?: (google.devicesandservices.health.v4.IWeightQuantity|null); + + /** NutritionLog mealType */ + mealType?: (google.devicesandservices.health.v4.MealType|keyof typeof google.devicesandservices.health.v4.MealType|null); + + /** NutritionLog serving */ + serving?: (google.devicesandservices.health.v4.NutritionLog.IServing|null); + + /** NutritionLog food */ + food?: (string|null); + + /** NutritionLog foodDisplayName */ + foodDisplayName?: (string|null); + } + + /** Represents a NutritionLog. */ + class NutritionLog implements INutritionLog { /** - * Constructs a new RespiratoryRateSleepSummary. + * Constructs a new NutritionLog. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IRespiratoryRateSleepSummary); + constructor(properties?: google.devicesandservices.health.v4.INutritionLog); - /** RespiratoryRateSleepSummary sampleTime. */ - public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + /** NutritionLog interval. */ + public interval?: (google.devicesandservices.health.v4.ISessionTimeInterval|null); - /** RespiratoryRateSleepSummary deepSleepStats. */ - public deepSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); + /** NutritionLog nutrients. */ + public nutrients: google.devicesandservices.health.v4.INutrientQuantity[]; - /** RespiratoryRateSleepSummary lightSleepStats. */ - public lightSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); + /** NutritionLog energy. */ + public energy?: (google.devicesandservices.health.v4.IEnergyQuantity|null); - /** RespiratoryRateSleepSummary remSleepStats. */ - public remSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); + /** NutritionLog energyFromFat. */ + public energyFromFat?: (google.devicesandservices.health.v4.IEnergyQuantity|null); - /** RespiratoryRateSleepSummary fullSleepStats. */ - public fullSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); + /** NutritionLog totalCarbohydrate. */ + public totalCarbohydrate?: (google.devicesandservices.health.v4.IWeightQuantity|null); + + /** NutritionLog totalFat. */ + public totalFat?: (google.devicesandservices.health.v4.IWeightQuantity|null); + + /** NutritionLog mealType. */ + public mealType: (google.devicesandservices.health.v4.MealType|keyof typeof google.devicesandservices.health.v4.MealType); + + /** NutritionLog serving. */ + public serving?: (google.devicesandservices.health.v4.NutritionLog.IServing|null); + + /** NutritionLog food. */ + public food: string; + + /** NutritionLog foodDisplayName. */ + public foodDisplayName: string; /** - * Creates a new RespiratoryRateSleepSummary instance using the specified properties. + * Creates a new NutritionLog instance using the specified properties. * @param [properties] Properties to set - * @returns RespiratoryRateSleepSummary instance + * @returns NutritionLog instance */ - public static create(properties?: google.devicesandservices.health.v4.IRespiratoryRateSleepSummary): google.devicesandservices.health.v4.RespiratoryRateSleepSummary; + public static create(properties?: google.devicesandservices.health.v4.INutritionLog): google.devicesandservices.health.v4.NutritionLog; /** - * Encodes the specified RespiratoryRateSleepSummary message. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.verify|verify} messages. - * @param message RespiratoryRateSleepSummary message or plain object to encode + * Encodes the specified NutritionLog message. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLog.verify|verify} messages. + * @param message NutritionLog message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IRespiratoryRateSleepSummary, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.INutritionLog, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RespiratoryRateSleepSummary message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.verify|verify} messages. - * @param message RespiratoryRateSleepSummary message or plain object to encode + * Encodes the specified NutritionLog message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLog.verify|verify} messages. + * @param message NutritionLog message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IRespiratoryRateSleepSummary, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.INutritionLog, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RespiratoryRateSleepSummary message from the specified reader or buffer. + * Decodes a NutritionLog message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RespiratoryRateSleepSummary + * @returns NutritionLog * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.RespiratoryRateSleepSummary; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.NutritionLog; /** - * Decodes a RespiratoryRateSleepSummary message from the specified reader or buffer, length delimited. + * Decodes a NutritionLog message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RespiratoryRateSleepSummary + * @returns NutritionLog * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.RespiratoryRateSleepSummary; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.NutritionLog; /** - * Verifies a RespiratoryRateSleepSummary message. + * Verifies a NutritionLog message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RespiratoryRateSleepSummary message from a plain object. Also converts values to their respective internal types. + * Creates a NutritionLog message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RespiratoryRateSleepSummary + * @returns NutritionLog */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.RespiratoryRateSleepSummary; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.NutritionLog; /** - * Creates a plain object from a RespiratoryRateSleepSummary message. Also converts values to other types if specified. - * @param message RespiratoryRateSleepSummary + * Creates a plain object from a NutritionLog message. Also converts values to other types if specified. + * @param message NutritionLog * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.RespiratoryRateSleepSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.NutritionLog, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RespiratoryRateSleepSummary to JSON. + * Converts this NutritionLog to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RespiratoryRateSleepSummary + * Gets the default type url for NutritionLog * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace RespiratoryRateSleepSummary { + namespace NutritionLog { - /** Properties of a RespiratoryRateSleepSummaryStatistics. */ - interface IRespiratoryRateSleepSummaryStatistics { + /** Properties of a Serving. */ + interface IServing { - /** RespiratoryRateSleepSummaryStatistics breathsPerMinute */ - breathsPerMinute?: (number|null); + /** Serving amount */ + amount?: (number|null); - /** RespiratoryRateSleepSummaryStatistics standardDeviation */ - standardDeviation?: (number|null); + /** Serving foodMeasurementUnit */ + foodMeasurementUnit?: (string|null); - /** RespiratoryRateSleepSummaryStatistics signalToNoise */ - signalToNoise?: (number|null); + /** Serving foodMeasurementUnitDisplayName */ + foodMeasurementUnitDisplayName?: (string|null); } - /** Represents a RespiratoryRateSleepSummaryStatistics. */ - class RespiratoryRateSleepSummaryStatistics implements IRespiratoryRateSleepSummaryStatistics { + /** Represents a Serving. */ + class Serving implements IServing { /** - * Constructs a new RespiratoryRateSleepSummaryStatistics. + * Constructs a new Serving. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics); + constructor(properties?: google.devicesandservices.health.v4.NutritionLog.IServing); - /** RespiratoryRateSleepSummaryStatistics breathsPerMinute. */ - public breathsPerMinute: number; + /** Serving amount. */ + public amount?: (number|null); - /** RespiratoryRateSleepSummaryStatistics standardDeviation. */ - public standardDeviation: number; + /** Serving foodMeasurementUnit. */ + public foodMeasurementUnit: string; - /** RespiratoryRateSleepSummaryStatistics signalToNoise. */ - public signalToNoise: number; + /** Serving foodMeasurementUnitDisplayName. */ + public foodMeasurementUnitDisplayName: string; /** - * Creates a new RespiratoryRateSleepSummaryStatistics instance using the specified properties. + * Creates a new Serving instance using the specified properties. * @param [properties] Properties to set - * @returns RespiratoryRateSleepSummaryStatistics instance + * @returns Serving instance */ - public static create(properties?: google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics): google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics; + public static create(properties?: google.devicesandservices.health.v4.NutritionLog.IServing): google.devicesandservices.health.v4.NutritionLog.Serving; /** - * Encodes the specified RespiratoryRateSleepSummaryStatistics message. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify|verify} messages. - * @param message RespiratoryRateSleepSummaryStatistics message or plain object to encode + * Encodes the specified Serving message. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLog.Serving.verify|verify} messages. + * @param message Serving message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.NutritionLog.IServing, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RespiratoryRateSleepSummaryStatistics message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify|verify} messages. - * @param message RespiratoryRateSleepSummaryStatistics message or plain object to encode + * Encodes the specified Serving message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLog.Serving.verify|verify} messages. + * @param message Serving message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.NutritionLog.IServing, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RespiratoryRateSleepSummaryStatistics message from the specified reader or buffer. + * Decodes a Serving message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RespiratoryRateSleepSummaryStatistics + * @returns Serving * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.NutritionLog.Serving; /** - * Decodes a RespiratoryRateSleepSummaryStatistics message from the specified reader or buffer, length delimited. + * Decodes a Serving message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RespiratoryRateSleepSummaryStatistics + * @returns Serving * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.NutritionLog.Serving; /** - * Verifies a RespiratoryRateSleepSummaryStatistics message. + * Verifies a Serving message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RespiratoryRateSleepSummaryStatistics message from a plain object. Also converts values to their respective internal types. + * Creates a Serving message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RespiratoryRateSleepSummaryStatistics + * @returns Serving */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.NutritionLog.Serving; /** - * Creates a plain object from a RespiratoryRateSleepSummaryStatistics message. Also converts values to other types if specified. - * @param message RespiratoryRateSleepSummaryStatistics + * Creates a plain object from a Serving message. Also converts values to other types if specified. + * @param message Serving * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.NutritionLog.Serving, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RespiratoryRateSleepSummaryStatistics to JSON. + * Converts this Serving to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RespiratoryRateSleepSummaryStatistics + * Gets the default type url for Serving * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -6395,6791 +7385,11826 @@ export namespace google { } } - /** Properties of a Sleep. */ - interface ISleep { + /** Properties of a Food. */ + interface IFood { - /** Sleep interval */ - interval?: (google.devicesandservices.health.v4.ISessionTimeInterval|null); + /** Food displayName */ + displayName?: (string|null); - /** Sleep type */ - type?: (google.devicesandservices.health.v4.Sleep.SleepType|keyof typeof google.devicesandservices.health.v4.Sleep.SleepType|null); + /** Food brand */ + brand?: (string|null); - /** Sleep stages */ - stages?: (google.devicesandservices.health.v4.Sleep.ISleepStage[]|null); + /** Food accessLevel */ + accessLevel?: (google.devicesandservices.health.v4.FoodAccessLevel|keyof typeof google.devicesandservices.health.v4.FoodAccessLevel|null); - /** Sleep outOfBedSegments */ - outOfBedSegments?: (google.devicesandservices.health.v4.Sleep.IOutOfBedSegment[]|null); + /** Food description */ + description?: (string|null); - /** Sleep metadata */ - metadata?: (google.devicesandservices.health.v4.Sleep.ISleepMetadata|null); + /** Food languageCode */ + languageCode?: (string|null); - /** Sleep summary */ - summary?: (google.devicesandservices.health.v4.Sleep.ISleepSummary|null); + /** Food mealType */ + mealType?: (google.devicesandservices.health.v4.MealType|keyof typeof google.devicesandservices.health.v4.MealType|null); - /** Sleep createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** Food nutrients */ + nutrients?: (google.devicesandservices.health.v4.INutrientQuantity[]|null); - /** Sleep updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** Food energyFromFat */ + energyFromFat?: (google.devicesandservices.health.v4.IEnergyQuantity|null); + + /** Food totalCarbohydrate */ + totalCarbohydrate?: (google.devicesandservices.health.v4.IWeightQuantity|null); + + /** Food totalFat */ + totalFat?: (google.devicesandservices.health.v4.IWeightQuantity|null); + + /** Food energyMin */ + energyMin?: (google.devicesandservices.health.v4.IEnergyQuantity|null); + + /** Food energyAvg */ + energyAvg?: (google.devicesandservices.health.v4.IEnergyQuantity|null); + + /** Food energyMax */ + energyMax?: (google.devicesandservices.health.v4.IEnergyQuantity|null); + + /** Food defaultServing */ + defaultServing?: (google.devicesandservices.health.v4.Food.IFoodServing|null); + + /** Food servings */ + servings?: (google.devicesandservices.health.v4.Food.IFoodServing[]|null); } - /** Represents a Sleep. */ - class Sleep implements ISleep { + /** Represents a Food. */ + class Food implements IFood { /** - * Constructs a new Sleep. + * Constructs a new Food. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.ISleep); + constructor(properties?: google.devicesandservices.health.v4.IFood); - /** Sleep interval. */ - public interval?: (google.devicesandservices.health.v4.ISessionTimeInterval|null); + /** Food displayName. */ + public displayName: string; - /** Sleep type. */ - public type: (google.devicesandservices.health.v4.Sleep.SleepType|keyof typeof google.devicesandservices.health.v4.Sleep.SleepType); + /** Food brand. */ + public brand: string; - /** Sleep stages. */ - public stages: google.devicesandservices.health.v4.Sleep.ISleepStage[]; + /** Food accessLevel. */ + public accessLevel: (google.devicesandservices.health.v4.FoodAccessLevel|keyof typeof google.devicesandservices.health.v4.FoodAccessLevel); - /** Sleep outOfBedSegments. */ - public outOfBedSegments: google.devicesandservices.health.v4.Sleep.IOutOfBedSegment[]; + /** Food description. */ + public description: string; - /** Sleep metadata. */ - public metadata?: (google.devicesandservices.health.v4.Sleep.ISleepMetadata|null); + /** Food languageCode. */ + public languageCode: string; - /** Sleep summary. */ - public summary?: (google.devicesandservices.health.v4.Sleep.ISleepSummary|null); + /** Food mealType. */ + public mealType: (google.devicesandservices.health.v4.MealType|keyof typeof google.devicesandservices.health.v4.MealType); - /** Sleep createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** Food nutrients. */ + public nutrients: google.devicesandservices.health.v4.INutrientQuantity[]; - /** Sleep updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** Food energyFromFat. */ + public energyFromFat?: (google.devicesandservices.health.v4.IEnergyQuantity|null); + + /** Food totalCarbohydrate. */ + public totalCarbohydrate?: (google.devicesandservices.health.v4.IWeightQuantity|null); + + /** Food totalFat. */ + public totalFat?: (google.devicesandservices.health.v4.IWeightQuantity|null); + + /** Food energyMin. */ + public energyMin?: (google.devicesandservices.health.v4.IEnergyQuantity|null); + + /** Food energyAvg. */ + public energyAvg?: (google.devicesandservices.health.v4.IEnergyQuantity|null); + + /** Food energyMax. */ + public energyMax?: (google.devicesandservices.health.v4.IEnergyQuantity|null); + + /** Food defaultServing. */ + public defaultServing?: (google.devicesandservices.health.v4.Food.IFoodServing|null); + + /** Food servings. */ + public servings: google.devicesandservices.health.v4.Food.IFoodServing[]; /** - * Creates a new Sleep instance using the specified properties. + * Creates a new Food instance using the specified properties. * @param [properties] Properties to set - * @returns Sleep instance + * @returns Food instance */ - public static create(properties?: google.devicesandservices.health.v4.ISleep): google.devicesandservices.health.v4.Sleep; + public static create(properties?: google.devicesandservices.health.v4.IFood): google.devicesandservices.health.v4.Food; /** - * Encodes the specified Sleep message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.verify|verify} messages. - * @param message Sleep message or plain object to encode + * Encodes the specified Food message. Does not implicitly {@link google.devicesandservices.health.v4.Food.verify|verify} messages. + * @param message Food message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.ISleep, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IFood, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Sleep message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.verify|verify} messages. - * @param message Sleep message or plain object to encode + * Encodes the specified Food message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Food.verify|verify} messages. + * @param message Food message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.ISleep, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IFood, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Sleep message from the specified reader or buffer. + * Decodes a Food message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Sleep + * @returns Food * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Sleep; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Food; /** - * Decodes a Sleep message from the specified reader or buffer, length delimited. + * Decodes a Food message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Sleep + * @returns Food * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Sleep; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Food; /** - * Verifies a Sleep message. + * Verifies a Food message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Sleep message from a plain object. Also converts values to their respective internal types. + * Creates a Food message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Sleep + * @returns Food */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Sleep; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Food; /** - * Creates a plain object from a Sleep message. Also converts values to other types if specified. - * @param message Sleep + * Creates a plain object from a Food message. Also converts values to other types if specified. + * @param message Food * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.Sleep, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.Food, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Sleep to JSON. + * Converts this Food to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Sleep + * Gets the default type url for Food * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace Sleep { - - /** Properties of a SleepStage. */ - interface ISleepStage { - - /** SleepStage startTime */ - startTime?: (google.protobuf.ITimestamp|null); + namespace Food { - /** SleepStage startUtcOffset */ - startUtcOffset?: (google.protobuf.IDuration|null); + /** Properties of a FoodServing. */ + interface IFoodServing { - /** SleepStage endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** FoodServing amount */ + amount?: (number|null); - /** SleepStage endUtcOffset */ - endUtcOffset?: (google.protobuf.IDuration|null); + /** FoodServing foodMeasurementUnit */ + foodMeasurementUnit?: (string|null); - /** SleepStage type */ - type?: (google.devicesandservices.health.v4.Sleep.SleepStageType|keyof typeof google.devicesandservices.health.v4.Sleep.SleepStageType|null); + /** FoodServing foodMeasurementUnitDisplayName */ + foodMeasurementUnitDisplayName?: (string|null); - /** SleepStage createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** FoodServing foodMeasurementUnitDisplayNamePlural */ + foodMeasurementUnitDisplayNamePlural?: (string|null); - /** SleepStage updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** FoodServing multiplier */ + multiplier?: (number|null); } - /** Represents a SleepStage. */ - class SleepStage implements ISleepStage { + /** Represents a FoodServing. */ + class FoodServing implements IFoodServing { /** - * Constructs a new SleepStage. + * Constructs a new FoodServing. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.Sleep.ISleepStage); - - /** SleepStage startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** SleepStage startUtcOffset. */ - public startUtcOffset?: (google.protobuf.IDuration|null); + constructor(properties?: google.devicesandservices.health.v4.Food.IFoodServing); - /** SleepStage endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** FoodServing amount. */ + public amount?: (number|null); - /** SleepStage endUtcOffset. */ - public endUtcOffset?: (google.protobuf.IDuration|null); + /** FoodServing foodMeasurementUnit. */ + public foodMeasurementUnit: string; - /** SleepStage type. */ - public type: (google.devicesandservices.health.v4.Sleep.SleepStageType|keyof typeof google.devicesandservices.health.v4.Sleep.SleepStageType); + /** FoodServing foodMeasurementUnitDisplayName. */ + public foodMeasurementUnitDisplayName: string; - /** SleepStage createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** FoodServing foodMeasurementUnitDisplayNamePlural. */ + public foodMeasurementUnitDisplayNamePlural: string; - /** SleepStage updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** FoodServing multiplier. */ + public multiplier: number; /** - * Creates a new SleepStage instance using the specified properties. + * Creates a new FoodServing instance using the specified properties. * @param [properties] Properties to set - * @returns SleepStage instance + * @returns FoodServing instance */ - public static create(properties?: google.devicesandservices.health.v4.Sleep.ISleepStage): google.devicesandservices.health.v4.Sleep.SleepStage; + public static create(properties?: google.devicesandservices.health.v4.Food.IFoodServing): google.devicesandservices.health.v4.Food.FoodServing; /** - * Encodes the specified SleepStage message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepStage.verify|verify} messages. - * @param message SleepStage message or plain object to encode + * Encodes the specified FoodServing message. Does not implicitly {@link google.devicesandservices.health.v4.Food.FoodServing.verify|verify} messages. + * @param message FoodServing message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.Sleep.ISleepStage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.Food.IFoodServing, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SleepStage message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepStage.verify|verify} messages. - * @param message SleepStage message or plain object to encode + * Encodes the specified FoodServing message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Food.FoodServing.verify|verify} messages. + * @param message FoodServing message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.Sleep.ISleepStage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.Food.IFoodServing, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SleepStage message from the specified reader or buffer. + * Decodes a FoodServing message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SleepStage + * @returns FoodServing * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Sleep.SleepStage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Food.FoodServing; /** - * Decodes a SleepStage message from the specified reader or buffer, length delimited. + * Decodes a FoodServing message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SleepStage + * @returns FoodServing * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Sleep.SleepStage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Food.FoodServing; /** - * Verifies a SleepStage message. + * Verifies a FoodServing message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SleepStage message from a plain object. Also converts values to their respective internal types. + * Creates a FoodServing message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SleepStage + * @returns FoodServing */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Sleep.SleepStage; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Food.FoodServing; /** - * Creates a plain object from a SleepStage message. Also converts values to other types if specified. - * @param message SleepStage + * Creates a plain object from a FoodServing message. Also converts values to other types if specified. + * @param message FoodServing * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.Sleep.SleepStage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.Food.FoodServing, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SleepStage to JSON. + * Converts this FoodServing to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SleepStage + * Gets the default type url for FoodServing * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + } - /** Properties of an OutOfBedSegment. */ - interface IOutOfBedSegment { + /** Properties of a NutritionLogRollupValue. */ + interface INutritionLogRollupValue { - /** OutOfBedSegment startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** NutritionLogRollupValue nutrients */ + nutrients?: (google.devicesandservices.health.v4.NutritionLogRollupValue.INutrientQuantityRollup[]|null); - /** OutOfBedSegment startUtcOffset */ - startUtcOffset?: (google.protobuf.IDuration|null); + /** NutritionLogRollupValue energy */ + energy?: (google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup|null); - /** OutOfBedSegment endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** NutritionLogRollupValue energyFromFat */ + energyFromFat?: (google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup|null); - /** OutOfBedSegment endUtcOffset */ - endUtcOffset?: (google.protobuf.IDuration|null); + /** NutritionLogRollupValue totalCarbohydrate */ + totalCarbohydrate?: (google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup|null); + + /** NutritionLogRollupValue totalFat */ + totalFat?: (google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup|null); + } + + /** Represents a NutritionLogRollupValue. */ + class NutritionLogRollupValue implements INutritionLogRollupValue { + + /** + * Constructs a new NutritionLogRollupValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.INutritionLogRollupValue); + + /** NutritionLogRollupValue nutrients. */ + public nutrients: google.devicesandservices.health.v4.NutritionLogRollupValue.INutrientQuantityRollup[]; + + /** NutritionLogRollupValue energy. */ + public energy?: (google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup|null); + + /** NutritionLogRollupValue energyFromFat. */ + public energyFromFat?: (google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup|null); + + /** NutritionLogRollupValue totalCarbohydrate. */ + public totalCarbohydrate?: (google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup|null); + + /** NutritionLogRollupValue totalFat. */ + public totalFat?: (google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup|null); + + /** + * Creates a new NutritionLogRollupValue instance using the specified properties. + * @param [properties] Properties to set + * @returns NutritionLogRollupValue instance + */ + public static create(properties?: google.devicesandservices.health.v4.INutritionLogRollupValue): google.devicesandservices.health.v4.NutritionLogRollupValue; + + /** + * Encodes the specified NutritionLogRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.verify|verify} messages. + * @param message NutritionLogRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.INutritionLogRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NutritionLogRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.verify|verify} messages. + * @param message NutritionLogRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.INutritionLogRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NutritionLogRollupValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NutritionLogRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.NutritionLogRollupValue; + + /** + * Decodes a NutritionLogRollupValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NutritionLogRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.NutritionLogRollupValue; + + /** + * Verifies a NutritionLogRollupValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NutritionLogRollupValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NutritionLogRollupValue + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.NutritionLogRollupValue; + + /** + * Creates a plain object from a NutritionLogRollupValue message. Also converts values to other types if specified. + * @param message NutritionLogRollupValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.NutritionLogRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NutritionLogRollupValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NutritionLogRollupValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NutritionLogRollupValue { + + /** Properties of a WeightQuantityRollup. */ + interface IWeightQuantityRollup { + + /** WeightQuantityRollup gramsSum */ + gramsSum?: (number|null); + + /** WeightQuantityRollup userProvidedUnitLast */ + userProvidedUnitLast?: (google.devicesandservices.health.v4.WeightUnit|keyof typeof google.devicesandservices.health.v4.WeightUnit|null); } - /** Represents an OutOfBedSegment. */ - class OutOfBedSegment implements IOutOfBedSegment { + /** Represents a WeightQuantityRollup. */ + class WeightQuantityRollup implements IWeightQuantityRollup { /** - * Constructs a new OutOfBedSegment. + * Constructs a new WeightQuantityRollup. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.Sleep.IOutOfBedSegment); - - /** OutOfBedSegment startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** OutOfBedSegment startUtcOffset. */ - public startUtcOffset?: (google.protobuf.IDuration|null); + constructor(properties?: google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup); - /** OutOfBedSegment endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** WeightQuantityRollup gramsSum. */ + public gramsSum?: (number|null); - /** OutOfBedSegment endUtcOffset. */ - public endUtcOffset?: (google.protobuf.IDuration|null); + /** WeightQuantityRollup userProvidedUnitLast. */ + public userProvidedUnitLast: (google.devicesandservices.health.v4.WeightUnit|keyof typeof google.devicesandservices.health.v4.WeightUnit); /** - * Creates a new OutOfBedSegment instance using the specified properties. + * Creates a new WeightQuantityRollup instance using the specified properties. * @param [properties] Properties to set - * @returns OutOfBedSegment instance + * @returns WeightQuantityRollup instance */ - public static create(properties?: google.devicesandservices.health.v4.Sleep.IOutOfBedSegment): google.devicesandservices.health.v4.Sleep.OutOfBedSegment; + public static create(properties?: google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup): google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup; /** - * Encodes the specified OutOfBedSegment message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.OutOfBedSegment.verify|verify} messages. - * @param message OutOfBedSegment message or plain object to encode + * Encodes the specified WeightQuantityRollup message. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.verify|verify} messages. + * @param message WeightQuantityRollup message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.Sleep.IOutOfBedSegment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OutOfBedSegment message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.OutOfBedSegment.verify|verify} messages. - * @param message OutOfBedSegment message or plain object to encode + * Encodes the specified WeightQuantityRollup message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.verify|verify} messages. + * @param message WeightQuantityRollup message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.Sleep.IOutOfBedSegment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OutOfBedSegment message from the specified reader or buffer. + * Decodes a WeightQuantityRollup message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OutOfBedSegment + * @returns WeightQuantityRollup * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Sleep.OutOfBedSegment; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup; /** - * Decodes an OutOfBedSegment message from the specified reader or buffer, length delimited. + * Decodes a WeightQuantityRollup message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OutOfBedSegment + * @returns WeightQuantityRollup * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Sleep.OutOfBedSegment; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup; /** - * Verifies an OutOfBedSegment message. + * Verifies a WeightQuantityRollup message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an OutOfBedSegment message from a plain object. Also converts values to their respective internal types. + * Creates a WeightQuantityRollup message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OutOfBedSegment + * @returns WeightQuantityRollup */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Sleep.OutOfBedSegment; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup; /** - * Creates a plain object from an OutOfBedSegment message. Also converts values to other types if specified. - * @param message OutOfBedSegment + * Creates a plain object from a WeightQuantityRollup message. Also converts values to other types if specified. + * @param message WeightQuantityRollup * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.Sleep.OutOfBedSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OutOfBedSegment to JSON. + * Converts this WeightQuantityRollup to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OutOfBedSegment + * Gets the default type url for WeightQuantityRollup * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SleepMetadata. */ - interface ISleepMetadata { - - /** SleepMetadata stagesStatus */ - stagesStatus?: (google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState|keyof typeof google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState|null); - - /** SleepMetadata processed */ - processed?: (boolean|null); - - /** SleepMetadata nap */ - nap?: (boolean|null); + /** Properties of an EnergyQuantityRollup. */ + interface IEnergyQuantityRollup { - /** SleepMetadata manuallyEdited */ - manuallyEdited?: (boolean|null); + /** EnergyQuantityRollup kcalSum */ + kcalSum?: (number|null); - /** SleepMetadata externalId */ - externalId?: (string|null); + /** EnergyQuantityRollup userProvidedUnitLast */ + userProvidedUnitLast?: (google.devicesandservices.health.v4.EnergyUnit|keyof typeof google.devicesandservices.health.v4.EnergyUnit|null); } - /** Represents a SleepMetadata. */ - class SleepMetadata implements ISleepMetadata { + /** Represents an EnergyQuantityRollup. */ + class EnergyQuantityRollup implements IEnergyQuantityRollup { /** - * Constructs a new SleepMetadata. + * Constructs a new EnergyQuantityRollup. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.Sleep.ISleepMetadata); + constructor(properties?: google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup); - /** SleepMetadata stagesStatus. */ - public stagesStatus: (google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState|keyof typeof google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState); - - /** SleepMetadata processed. */ - public processed: boolean; + /** EnergyQuantityRollup kcalSum. */ + public kcalSum?: (number|null); - /** SleepMetadata nap. */ - public nap: boolean; + /** EnergyQuantityRollup userProvidedUnitLast. */ + public userProvidedUnitLast: (google.devicesandservices.health.v4.EnergyUnit|keyof typeof google.devicesandservices.health.v4.EnergyUnit); - /** SleepMetadata manuallyEdited. */ - public manuallyEdited: boolean; - - /** SleepMetadata externalId. */ - public externalId: string; - - /** - * Creates a new SleepMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns SleepMetadata instance - */ - public static create(properties?: google.devicesandservices.health.v4.Sleep.ISleepMetadata): google.devicesandservices.health.v4.Sleep.SleepMetadata; + /** + * Creates a new EnergyQuantityRollup instance using the specified properties. + * @param [properties] Properties to set + * @returns EnergyQuantityRollup instance + */ + public static create(properties?: google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup): google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup; /** - * Encodes the specified SleepMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepMetadata.verify|verify} messages. - * @param message SleepMetadata message or plain object to encode + * Encodes the specified EnergyQuantityRollup message. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup.verify|verify} messages. + * @param message EnergyQuantityRollup message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.Sleep.ISleepMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SleepMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepMetadata.verify|verify} messages. - * @param message SleepMetadata message or plain object to encode + * Encodes the specified EnergyQuantityRollup message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup.verify|verify} messages. + * @param message EnergyQuantityRollup message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.Sleep.ISleepMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SleepMetadata message from the specified reader or buffer. + * Decodes an EnergyQuantityRollup message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SleepMetadata + * @returns EnergyQuantityRollup * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Sleep.SleepMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup; /** - * Decodes a SleepMetadata message from the specified reader or buffer, length delimited. + * Decodes an EnergyQuantityRollup message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SleepMetadata + * @returns EnergyQuantityRollup * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Sleep.SleepMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup; /** - * Verifies a SleepMetadata message. + * Verifies an EnergyQuantityRollup message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SleepMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an EnergyQuantityRollup message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SleepMetadata + * @returns EnergyQuantityRollup */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Sleep.SleepMetadata; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup; /** - * Creates a plain object from a SleepMetadata message. Also converts values to other types if specified. - * @param message SleepMetadata + * Creates a plain object from an EnergyQuantityRollup message. Also converts values to other types if specified. + * @param message EnergyQuantityRollup * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.Sleep.SleepMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SleepMetadata to JSON. + * Converts this EnergyQuantityRollup to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SleepMetadata + * Gets the default type url for EnergyQuantityRollup * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace SleepMetadata { - - /** StagesState enum. */ - enum StagesState { - STAGES_STATE_UNSPECIFIED = 0, - REJECTED_COVERAGE = 1, - REJECTED_MAX_GAP = 2, - REJECTED_START_GAP = 3, - REJECTED_END_GAP = 4, - REJECTED_NAP = 5, - REJECTED_SERVER = 6, - TIMEOUT = 7, - SUCCEEDED = 8, - PROCESSING_INTERNAL_ERROR = 9 - } - } - - /** Properties of a SleepSummary. */ - interface ISleepSummary { - - /** SleepSummary minutesInSleepPeriod */ - minutesInSleepPeriod?: (number|Long|string|null); - - /** SleepSummary minutesAfterWakeUp */ - minutesAfterWakeUp?: (number|Long|string|null); + /** Properties of a NutrientQuantityRollup. */ + interface INutrientQuantityRollup { - /** SleepSummary minutesToFallAsleep */ - minutesToFallAsleep?: (number|Long|string|null); - - /** SleepSummary minutesAsleep */ - minutesAsleep?: (number|Long|string|null); - - /** SleepSummary minutesAwake */ - minutesAwake?: (number|Long|string|null); + /** NutrientQuantityRollup quantity */ + quantity?: (google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup|null); - /** SleepSummary stagesSummary */ - stagesSummary?: (google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary[]|null); + /** NutrientQuantityRollup nutrient */ + nutrient?: (google.devicesandservices.health.v4.Nutrient|keyof typeof google.devicesandservices.health.v4.Nutrient|null); } - /** Represents a SleepSummary. */ - class SleepSummary implements ISleepSummary { + /** Represents a NutrientQuantityRollup. */ + class NutrientQuantityRollup implements INutrientQuantityRollup { /** - * Constructs a new SleepSummary. + * Constructs a new NutrientQuantityRollup. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.Sleep.ISleepSummary); - - /** SleepSummary minutesInSleepPeriod. */ - public minutesInSleepPeriod?: (number|Long|string|null); - - /** SleepSummary minutesAfterWakeUp. */ - public minutesAfterWakeUp?: (number|Long|string|null); - - /** SleepSummary minutesToFallAsleep. */ - public minutesToFallAsleep?: (number|Long|string|null); - - /** SleepSummary minutesAsleep. */ - public minutesAsleep?: (number|Long|string|null); + constructor(properties?: google.devicesandservices.health.v4.NutritionLogRollupValue.INutrientQuantityRollup); - /** SleepSummary minutesAwake. */ - public minutesAwake?: (number|Long|string|null); + /** NutrientQuantityRollup quantity. */ + public quantity?: (google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup|null); - /** SleepSummary stagesSummary. */ - public stagesSummary: google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary[]; + /** NutrientQuantityRollup nutrient. */ + public nutrient: (google.devicesandservices.health.v4.Nutrient|keyof typeof google.devicesandservices.health.v4.Nutrient); /** - * Creates a new SleepSummary instance using the specified properties. + * Creates a new NutrientQuantityRollup instance using the specified properties. * @param [properties] Properties to set - * @returns SleepSummary instance + * @returns NutrientQuantityRollup instance */ - public static create(properties?: google.devicesandservices.health.v4.Sleep.ISleepSummary): google.devicesandservices.health.v4.Sleep.SleepSummary; + public static create(properties?: google.devicesandservices.health.v4.NutritionLogRollupValue.INutrientQuantityRollup): google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup; /** - * Encodes the specified SleepSummary message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.verify|verify} messages. - * @param message SleepSummary message or plain object to encode + * Encodes the specified NutrientQuantityRollup message. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup.verify|verify} messages. + * @param message NutrientQuantityRollup message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.Sleep.ISleepSummary, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.NutritionLogRollupValue.INutrientQuantityRollup, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SleepSummary message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.verify|verify} messages. - * @param message SleepSummary message or plain object to encode + * Encodes the specified NutrientQuantityRollup message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup.verify|verify} messages. + * @param message NutrientQuantityRollup message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.Sleep.ISleepSummary, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.NutritionLogRollupValue.INutrientQuantityRollup, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SleepSummary message from the specified reader or buffer. + * Decodes a NutrientQuantityRollup message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SleepSummary + * @returns NutrientQuantityRollup * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Sleep.SleepSummary; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup; /** - * Decodes a SleepSummary message from the specified reader or buffer, length delimited. + * Decodes a NutrientQuantityRollup message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SleepSummary + * @returns NutrientQuantityRollup * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Sleep.SleepSummary; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup; /** - * Verifies a SleepSummary message. + * Verifies a NutrientQuantityRollup message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SleepSummary message from a plain object. Also converts values to their respective internal types. + * Creates a NutrientQuantityRollup message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SleepSummary + * @returns NutrientQuantityRollup */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Sleep.SleepSummary; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup; /** - * Creates a plain object from a SleepSummary message. Also converts values to other types if specified. - * @param message SleepSummary + * Creates a plain object from a NutrientQuantityRollup message. Also converts values to other types if specified. + * @param message NutrientQuantityRollup * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.Sleep.SleepSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SleepSummary to JSON. + * Converts this NutrientQuantityRollup to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SleepSummary + * Gets the default type url for NutrientQuantityRollup * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + } - namespace SleepSummary { + /** Properties of an OxygenSaturation. */ + interface IOxygenSaturation { - /** Properties of a StageSummary. */ - interface IStageSummary { + /** OxygenSaturation sampleTime */ + sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); - /** StageSummary type */ - type?: (google.devicesandservices.health.v4.Sleep.SleepStageType|keyof typeof google.devicesandservices.health.v4.Sleep.SleepStageType|null); + /** OxygenSaturation percentage */ + percentage?: (number|null); + } - /** StageSummary minutes */ - minutes?: (number|Long|string|null); + /** Represents an OxygenSaturation. */ + class OxygenSaturation implements IOxygenSaturation { - /** StageSummary count */ - count?: (number|Long|string|null); - } + /** + * Constructs a new OxygenSaturation. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IOxygenSaturation); - /** Represents a StageSummary. */ - class StageSummary implements IStageSummary { + /** OxygenSaturation sampleTime. */ + public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); - /** - * Constructs a new StageSummary. - * @param [properties] Properties to set - */ - constructor(properties?: google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary); + /** OxygenSaturation percentage. */ + public percentage?: (number|null); - /** StageSummary type. */ - public type: (google.devicesandservices.health.v4.Sleep.SleepStageType|keyof typeof google.devicesandservices.health.v4.Sleep.SleepStageType); + /** + * Creates a new OxygenSaturation instance using the specified properties. + * @param [properties] Properties to set + * @returns OxygenSaturation instance + */ + public static create(properties?: google.devicesandservices.health.v4.IOxygenSaturation): google.devicesandservices.health.v4.OxygenSaturation; - /** StageSummary minutes. */ - public minutes: (number|Long|string); + /** + * Encodes the specified OxygenSaturation message. Does not implicitly {@link google.devicesandservices.health.v4.OxygenSaturation.verify|verify} messages. + * @param message OxygenSaturation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IOxygenSaturation, writer?: $protobuf.Writer): $protobuf.Writer; - /** StageSummary count. */ - public count: (number|Long|string); + /** + * Encodes the specified OxygenSaturation message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.OxygenSaturation.verify|verify} messages. + * @param message OxygenSaturation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IOxygenSaturation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new StageSummary instance using the specified properties. - * @param [properties] Properties to set - * @returns StageSummary instance - */ - public static create(properties?: google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary): google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary; + /** + * Decodes an OxygenSaturation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OxygenSaturation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.OxygenSaturation; - /** - * Encodes the specified StageSummary message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.verify|verify} messages. - * @param message StageSummary message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an OxygenSaturation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OxygenSaturation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.OxygenSaturation; - /** - * Encodes the specified StageSummary message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.verify|verify} messages. - * @param message StageSummary message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies an OxygenSaturation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a StageSummary message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StageSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary; + /** + * Creates an OxygenSaturation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OxygenSaturation + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.OxygenSaturation; - /** - * Decodes a StageSummary message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StageSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary; + /** + * Creates a plain object from an OxygenSaturation message. Also converts values to other types if specified. + * @param message OxygenSaturation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.OxygenSaturation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a StageSummary message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this OxygenSaturation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Creates a StageSummary message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StageSummary - */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary; - - /** - * Creates a plain object from a StageSummary message. Also converts values to other types if specified. - * @param message StageSummary - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StageSummary to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StageSummary - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** SleepType enum. */ - enum SleepType { - SLEEP_TYPE_UNSPECIFIED = 0, - CLASSIC = 1, - STAGES = 2 - } - - /** SleepStageType enum. */ - enum SleepStageType { - SLEEP_STAGE_TYPE_UNSPECIFIED = 0, - AWAKE = 1, - LIGHT = 2, - DEEP = 3, - REM = 4, - ASLEEP = 5, - RESTLESS = 6 - } + /** + * Gets the default type url for OxygenSaturation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Steps. */ - interface ISteps { + /** Properties of a RestingHeartRatePersonalRangeRollupValue. */ + interface IRestingHeartRatePersonalRangeRollupValue { - /** Steps interval */ - interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + /** RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMin */ + beatsPerMinuteMin?: (number|null); - /** Steps count */ - count?: (number|Long|string|null); + /** RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMax */ + beatsPerMinuteMax?: (number|null); } - /** Represents a Steps. */ - class Steps implements ISteps { + /** Represents a RestingHeartRatePersonalRangeRollupValue. */ + class RestingHeartRatePersonalRangeRollupValue implements IRestingHeartRatePersonalRangeRollupValue { /** - * Constructs a new Steps. + * Constructs a new RestingHeartRatePersonalRangeRollupValue. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.ISteps); + constructor(properties?: google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue); - /** Steps interval. */ - public interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + /** RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMin. */ + public beatsPerMinuteMin?: (number|null); - /** Steps count. */ - public count: (number|Long|string); + /** RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMax. */ + public beatsPerMinuteMax?: (number|null); /** - * Creates a new Steps instance using the specified properties. + * Creates a new RestingHeartRatePersonalRangeRollupValue instance using the specified properties. * @param [properties] Properties to set - * @returns Steps instance + * @returns RestingHeartRatePersonalRangeRollupValue instance */ - public static create(properties?: google.devicesandservices.health.v4.ISteps): google.devicesandservices.health.v4.Steps; + public static create(properties?: google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue): google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue; /** - * Encodes the specified Steps message. Does not implicitly {@link google.devicesandservices.health.v4.Steps.verify|verify} messages. - * @param message Steps message or plain object to encode + * Encodes the specified RestingHeartRatePersonalRangeRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.verify|verify} messages. + * @param message RestingHeartRatePersonalRangeRollupValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.ISteps, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Steps message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Steps.verify|verify} messages. - * @param message Steps message or plain object to encode + * Encodes the specified RestingHeartRatePersonalRangeRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.verify|verify} messages. + * @param message RestingHeartRatePersonalRangeRollupValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.ISteps, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Steps message from the specified reader or buffer. + * Decodes a RestingHeartRatePersonalRangeRollupValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Steps + * @returns RestingHeartRatePersonalRangeRollupValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Steps; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue; /** - * Decodes a Steps message from the specified reader or buffer, length delimited. + * Decodes a RestingHeartRatePersonalRangeRollupValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Steps + * @returns RestingHeartRatePersonalRangeRollupValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Steps; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue; /** - * Verifies a Steps message. + * Verifies a RestingHeartRatePersonalRangeRollupValue message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Steps message from a plain object. Also converts values to their respective internal types. + * Creates a RestingHeartRatePersonalRangeRollupValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Steps + * @returns RestingHeartRatePersonalRangeRollupValue */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Steps; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue; /** - * Creates a plain object from a Steps message. Also converts values to other types if specified. - * @param message Steps + * Creates a plain object from a RestingHeartRatePersonalRangeRollupValue message. Also converts values to other types if specified. + * @param message RestingHeartRatePersonalRangeRollupValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.Steps, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Steps to JSON. + * Converts this RestingHeartRatePersonalRangeRollupValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Steps + * Gets the default type url for RestingHeartRatePersonalRangeRollupValue * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a StepsRollupValue. */ - interface IStepsRollupValue { + /** Properties of a FoodMeasurementUnit. */ + interface IFoodMeasurementUnit { - /** StepsRollupValue countSum */ - countSum?: (number|Long|string|null); + /** FoodMeasurementUnit displayName */ + displayName?: (string|null); + + /** FoodMeasurementUnit pluralDisplayName */ + pluralDisplayName?: (string|null); } - /** Represents a StepsRollupValue. */ - class StepsRollupValue implements IStepsRollupValue { + /** Represents a FoodMeasurementUnit. */ + class FoodMeasurementUnit implements IFoodMeasurementUnit { /** - * Constructs a new StepsRollupValue. + * Constructs a new FoodMeasurementUnit. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IStepsRollupValue); + constructor(properties?: google.devicesandservices.health.v4.IFoodMeasurementUnit); - /** StepsRollupValue countSum. */ - public countSum: (number|Long|string); + /** FoodMeasurementUnit displayName. */ + public displayName: string; + + /** FoodMeasurementUnit pluralDisplayName. */ + public pluralDisplayName: string; /** - * Creates a new StepsRollupValue instance using the specified properties. + * Creates a new FoodMeasurementUnit instance using the specified properties. * @param [properties] Properties to set - * @returns StepsRollupValue instance + * @returns FoodMeasurementUnit instance */ - public static create(properties?: google.devicesandservices.health.v4.IStepsRollupValue): google.devicesandservices.health.v4.StepsRollupValue; + public static create(properties?: google.devicesandservices.health.v4.IFoodMeasurementUnit): google.devicesandservices.health.v4.FoodMeasurementUnit; /** - * Encodes the specified StepsRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.StepsRollupValue.verify|verify} messages. - * @param message StepsRollupValue message or plain object to encode + * Encodes the specified FoodMeasurementUnit message. Does not implicitly {@link google.devicesandservices.health.v4.FoodMeasurementUnit.verify|verify} messages. + * @param message FoodMeasurementUnit message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IStepsRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IFoodMeasurementUnit, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified StepsRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.StepsRollupValue.verify|verify} messages. - * @param message StepsRollupValue message or plain object to encode + * Encodes the specified FoodMeasurementUnit message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.FoodMeasurementUnit.verify|verify} messages. + * @param message FoodMeasurementUnit message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IStepsRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IFoodMeasurementUnit, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a StepsRollupValue message from the specified reader or buffer. + * Decodes a FoodMeasurementUnit message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns StepsRollupValue + * @returns FoodMeasurementUnit * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.StepsRollupValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.FoodMeasurementUnit; /** - * Decodes a StepsRollupValue message from the specified reader or buffer, length delimited. + * Decodes a FoodMeasurementUnit message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns StepsRollupValue + * @returns FoodMeasurementUnit * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.StepsRollupValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.FoodMeasurementUnit; /** - * Verifies a StepsRollupValue message. + * Verifies a FoodMeasurementUnit message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a StepsRollupValue message from a plain object. Also converts values to their respective internal types. + * Creates a FoodMeasurementUnit message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns StepsRollupValue + * @returns FoodMeasurementUnit */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.StepsRollupValue; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.FoodMeasurementUnit; /** - * Creates a plain object from a StepsRollupValue message. Also converts values to other types if specified. - * @param message StepsRollupValue + * Creates a plain object from a FoodMeasurementUnit message. Also converts values to other types if specified. + * @param message FoodMeasurementUnit * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.StepsRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.FoodMeasurementUnit, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this StepsRollupValue to JSON. + * Converts this FoodMeasurementUnit to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for StepsRollupValue + * Gets the default type url for FoodMeasurementUnit * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SwimLengthsData. */ - interface ISwimLengthsData { + /** Properties of a RespiratoryRateSleepSummary. */ + interface IRespiratoryRateSleepSummary { - /** SwimLengthsData interval */ - interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + /** RespiratoryRateSleepSummary sampleTime */ + sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); - /** SwimLengthsData swimStrokeType */ - swimStrokeType?: (google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType|keyof typeof google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType|null); + /** RespiratoryRateSleepSummary deepSleepStats */ + deepSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); - /** SwimLengthsData strokeCount */ - strokeCount?: (number|Long|string|null); + /** RespiratoryRateSleepSummary lightSleepStats */ + lightSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); + + /** RespiratoryRateSleepSummary remSleepStats */ + remSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); + + /** RespiratoryRateSleepSummary fullSleepStats */ + fullSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); } - /** Represents a SwimLengthsData. */ - class SwimLengthsData implements ISwimLengthsData { + /** Represents a RespiratoryRateSleepSummary. */ + class RespiratoryRateSleepSummary implements IRespiratoryRateSleepSummary { /** - * Constructs a new SwimLengthsData. + * Constructs a new RespiratoryRateSleepSummary. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.ISwimLengthsData); + constructor(properties?: google.devicesandservices.health.v4.IRespiratoryRateSleepSummary); - /** SwimLengthsData interval. */ - public interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + /** RespiratoryRateSleepSummary sampleTime. */ + public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); - /** SwimLengthsData swimStrokeType. */ - public swimStrokeType: (google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType|keyof typeof google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType); + /** RespiratoryRateSleepSummary deepSleepStats. */ + public deepSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); - /** SwimLengthsData strokeCount. */ - public strokeCount: (number|Long|string); + /** RespiratoryRateSleepSummary lightSleepStats. */ + public lightSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); + + /** RespiratoryRateSleepSummary remSleepStats. */ + public remSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); + + /** RespiratoryRateSleepSummary fullSleepStats. */ + public fullSleepStats?: (google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null); /** - * Creates a new SwimLengthsData instance using the specified properties. + * Creates a new RespiratoryRateSleepSummary instance using the specified properties. * @param [properties] Properties to set - * @returns SwimLengthsData instance + * @returns RespiratoryRateSleepSummary instance */ - public static create(properties?: google.devicesandservices.health.v4.ISwimLengthsData): google.devicesandservices.health.v4.SwimLengthsData; + public static create(properties?: google.devicesandservices.health.v4.IRespiratoryRateSleepSummary): google.devicesandservices.health.v4.RespiratoryRateSleepSummary; /** - * Encodes the specified SwimLengthsData message. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsData.verify|verify} messages. - * @param message SwimLengthsData message or plain object to encode + * Encodes the specified RespiratoryRateSleepSummary message. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.verify|verify} messages. + * @param message RespiratoryRateSleepSummary message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.ISwimLengthsData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IRespiratoryRateSleepSummary, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SwimLengthsData message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsData.verify|verify} messages. - * @param message SwimLengthsData message or plain object to encode + * Encodes the specified RespiratoryRateSleepSummary message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.verify|verify} messages. + * @param message RespiratoryRateSleepSummary message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.ISwimLengthsData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IRespiratoryRateSleepSummary, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SwimLengthsData message from the specified reader or buffer. + * Decodes a RespiratoryRateSleepSummary message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SwimLengthsData + * @returns RespiratoryRateSleepSummary * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.SwimLengthsData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.RespiratoryRateSleepSummary; /** - * Decodes a SwimLengthsData message from the specified reader or buffer, length delimited. + * Decodes a RespiratoryRateSleepSummary message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SwimLengthsData + * @returns RespiratoryRateSleepSummary * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.SwimLengthsData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.RespiratoryRateSleepSummary; /** - * Verifies a SwimLengthsData message. + * Verifies a RespiratoryRateSleepSummary message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SwimLengthsData message from a plain object. Also converts values to their respective internal types. + * Creates a RespiratoryRateSleepSummary message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SwimLengthsData + * @returns RespiratoryRateSleepSummary */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.SwimLengthsData; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.RespiratoryRateSleepSummary; /** - * Creates a plain object from a SwimLengthsData message. Also converts values to other types if specified. - * @param message SwimLengthsData + * Creates a plain object from a RespiratoryRateSleepSummary message. Also converts values to other types if specified. + * @param message RespiratoryRateSleepSummary * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.SwimLengthsData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.RespiratoryRateSleepSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SwimLengthsData to JSON. + * Converts this RespiratoryRateSleepSummary to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SwimLengthsData + * Gets the default type url for RespiratoryRateSleepSummary * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace SwimLengthsData { + namespace RespiratoryRateSleepSummary { - /** SwimStrokeType enum. */ - enum SwimStrokeType { - SWIM_STROKE_TYPE_UNSPECIFIED = 0, - FREESTYLE = 1, - BACKSTROKE = 2, - BREASTSTROKE = 3, - BUTTERFLY = 4 + /** Properties of a RespiratoryRateSleepSummaryStatistics. */ + interface IRespiratoryRateSleepSummaryStatistics { + + /** RespiratoryRateSleepSummaryStatistics breathsPerMinute */ + breathsPerMinute?: (number|null); + + /** RespiratoryRateSleepSummaryStatistics standardDeviation */ + standardDeviation?: (number|null); + + /** RespiratoryRateSleepSummaryStatistics signalToNoise */ + signalToNoise?: (number|null); + } + + /** Represents a RespiratoryRateSleepSummaryStatistics. */ + class RespiratoryRateSleepSummaryStatistics implements IRespiratoryRateSleepSummaryStatistics { + + /** + * Constructs a new RespiratoryRateSleepSummaryStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics); + + /** RespiratoryRateSleepSummaryStatistics breathsPerMinute. */ + public breathsPerMinute?: (number|null); + + /** RespiratoryRateSleepSummaryStatistics standardDeviation. */ + public standardDeviation?: (number|null); + + /** RespiratoryRateSleepSummaryStatistics signalToNoise. */ + public signalToNoise?: (number|null); + + /** + * Creates a new RespiratoryRateSleepSummaryStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns RespiratoryRateSleepSummaryStatistics instance + */ + public static create(properties?: google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics): google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics; + + /** + * Encodes the specified RespiratoryRateSleepSummaryStatistics message. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify|verify} messages. + * @param message RespiratoryRateSleepSummaryStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RespiratoryRateSleepSummaryStatistics message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify|verify} messages. + * @param message RespiratoryRateSleepSummaryStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RespiratoryRateSleepSummaryStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RespiratoryRateSleepSummaryStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics; + + /** + * Decodes a RespiratoryRateSleepSummaryStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RespiratoryRateSleepSummaryStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics; + + /** + * Verifies a RespiratoryRateSleepSummaryStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RespiratoryRateSleepSummaryStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RespiratoryRateSleepSummaryStatistics + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics; + + /** + * Creates a plain object from a RespiratoryRateSleepSummaryStatistics message. Also converts values to other types if specified. + * @param message RespiratoryRateSleepSummaryStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RespiratoryRateSleepSummaryStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RespiratoryRateSleepSummaryStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } - /** Properties of a SwimLengthsDataRollupValue. */ - interface ISwimLengthsDataRollupValue { + /** Properties of a Sleep. */ + interface ISleep { - /** SwimLengthsDataRollupValue strokeCountSum */ - strokeCountSum?: (number|Long|string|null); + /** Sleep interval */ + interval?: (google.devicesandservices.health.v4.ISessionTimeInterval|null); + + /** Sleep type */ + type?: (google.devicesandservices.health.v4.Sleep.SleepType|keyof typeof google.devicesandservices.health.v4.Sleep.SleepType|null); + + /** Sleep stages */ + stages?: (google.devicesandservices.health.v4.Sleep.ISleepStage[]|null); + + /** Sleep outOfBedSegments */ + outOfBedSegments?: (google.devicesandservices.health.v4.Sleep.IOutOfBedSegment[]|null); + + /** Sleep metadata */ + metadata?: (google.devicesandservices.health.v4.Sleep.ISleepMetadata|null); + + /** Sleep summary */ + summary?: (google.devicesandservices.health.v4.Sleep.ISleepSummary|null); + + /** Sleep createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Sleep updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); } - /** Represents a SwimLengthsDataRollupValue. */ - class SwimLengthsDataRollupValue implements ISwimLengthsDataRollupValue { + /** Represents a Sleep. */ + class Sleep implements ISleep { /** - * Constructs a new SwimLengthsDataRollupValue. + * Constructs a new Sleep. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.ISwimLengthsDataRollupValue); + constructor(properties?: google.devicesandservices.health.v4.ISleep); - /** SwimLengthsDataRollupValue strokeCountSum. */ - public strokeCountSum: (number|Long|string); + /** Sleep interval. */ + public interval?: (google.devicesandservices.health.v4.ISessionTimeInterval|null); + + /** Sleep type. */ + public type: (google.devicesandservices.health.v4.Sleep.SleepType|keyof typeof google.devicesandservices.health.v4.Sleep.SleepType); + + /** Sleep stages. */ + public stages: google.devicesandservices.health.v4.Sleep.ISleepStage[]; + + /** Sleep outOfBedSegments. */ + public outOfBedSegments: google.devicesandservices.health.v4.Sleep.IOutOfBedSegment[]; + + /** Sleep metadata. */ + public metadata?: (google.devicesandservices.health.v4.Sleep.ISleepMetadata|null); + + /** Sleep summary. */ + public summary?: (google.devicesandservices.health.v4.Sleep.ISleepSummary|null); + + /** Sleep createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Sleep updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new SwimLengthsDataRollupValue instance using the specified properties. + * Creates a new Sleep instance using the specified properties. * @param [properties] Properties to set - * @returns SwimLengthsDataRollupValue instance + * @returns Sleep instance */ - public static create(properties?: google.devicesandservices.health.v4.ISwimLengthsDataRollupValue): google.devicesandservices.health.v4.SwimLengthsDataRollupValue; + public static create(properties?: google.devicesandservices.health.v4.ISleep): google.devicesandservices.health.v4.Sleep; /** - * Encodes the specified SwimLengthsDataRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsDataRollupValue.verify|verify} messages. - * @param message SwimLengthsDataRollupValue message or plain object to encode + * Encodes the specified Sleep message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.verify|verify} messages. + * @param message Sleep message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.ISwimLengthsDataRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.ISleep, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SwimLengthsDataRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsDataRollupValue.verify|verify} messages. - * @param message SwimLengthsDataRollupValue message or plain object to encode + * Encodes the specified Sleep message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.verify|verify} messages. + * @param message Sleep message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.ISwimLengthsDataRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.ISleep, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SwimLengthsDataRollupValue message from the specified reader or buffer. + * Decodes a Sleep message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SwimLengthsDataRollupValue + * @returns Sleep * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.SwimLengthsDataRollupValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Sleep; /** - * Decodes a SwimLengthsDataRollupValue message from the specified reader or buffer, length delimited. + * Decodes a Sleep message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SwimLengthsDataRollupValue + * @returns Sleep * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.SwimLengthsDataRollupValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Sleep; /** - * Verifies a SwimLengthsDataRollupValue message. + * Verifies a Sleep message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SwimLengthsDataRollupValue message from a plain object. Also converts values to their respective internal types. + * Creates a Sleep message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SwimLengthsDataRollupValue + * @returns Sleep */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.SwimLengthsDataRollupValue; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Sleep; /** - * Creates a plain object from a SwimLengthsDataRollupValue message. Also converts values to other types if specified. - * @param message SwimLengthsDataRollupValue + * Creates a plain object from a Sleep message. Also converts values to other types if specified. + * @param message Sleep * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.SwimLengthsDataRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.Sleep, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SwimLengthsDataRollupValue to JSON. + * Converts this Sleep to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SwimLengthsDataRollupValue + * Gets the default type url for Sleep * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TimeInHeartRateZone. */ - interface ITimeInHeartRateZone { + namespace Sleep { - /** TimeInHeartRateZone interval */ - interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + /** Properties of a SleepStage. */ + interface ISleepStage { - /** TimeInHeartRateZone heartRateZoneType */ - heartRateZoneType?: (google.devicesandservices.health.v4.HeartRateZoneType|keyof typeof google.devicesandservices.health.v4.HeartRateZoneType|null); - } + /** SleepStage startTime */ + startTime?: (google.protobuf.ITimestamp|null); - /** Represents a TimeInHeartRateZone. */ - class TimeInHeartRateZone implements ITimeInHeartRateZone { + /** SleepStage startUtcOffset */ + startUtcOffset?: (google.protobuf.IDuration|null); - /** - * Constructs a new TimeInHeartRateZone. - * @param [properties] Properties to set - */ - constructor(properties?: google.devicesandservices.health.v4.ITimeInHeartRateZone); + /** SleepStage endTime */ + endTime?: (google.protobuf.ITimestamp|null); - /** TimeInHeartRateZone interval. */ - public interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + /** SleepStage endUtcOffset */ + endUtcOffset?: (google.protobuf.IDuration|null); - /** TimeInHeartRateZone heartRateZoneType. */ - public heartRateZoneType: (google.devicesandservices.health.v4.HeartRateZoneType|keyof typeof google.devicesandservices.health.v4.HeartRateZoneType); + /** SleepStage type */ + type?: (google.devicesandservices.health.v4.Sleep.SleepStageType|keyof typeof google.devicesandservices.health.v4.Sleep.SleepStageType|null); - /** - * Creates a new TimeInHeartRateZone instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeInHeartRateZone instance - */ - public static create(properties?: google.devicesandservices.health.v4.ITimeInHeartRateZone): google.devicesandservices.health.v4.TimeInHeartRateZone; - - /** - * Encodes the specified TimeInHeartRateZone message. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZone.verify|verify} messages. - * @param message TimeInHeartRateZone message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.devicesandservices.health.v4.ITimeInHeartRateZone, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimeInHeartRateZone message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZone.verify|verify} messages. - * @param message TimeInHeartRateZone message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.devicesandservices.health.v4.ITimeInHeartRateZone, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimeInHeartRateZone message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimeInHeartRateZone - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.TimeInHeartRateZone; - - /** - * Decodes a TimeInHeartRateZone message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimeInHeartRateZone - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.TimeInHeartRateZone; - - /** - * Verifies a TimeInHeartRateZone message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TimeInHeartRateZone message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeInHeartRateZone - */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.TimeInHeartRateZone; - - /** - * Creates a plain object from a TimeInHeartRateZone message. Also converts values to other types if specified. - * @param message TimeInHeartRateZone - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.devicesandservices.health.v4.TimeInHeartRateZone, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimeInHeartRateZone to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimeInHeartRateZone - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TimeInHeartRateZoneRollupValue. */ - interface ITimeInHeartRateZoneRollupValue { - - /** TimeInHeartRateZoneRollupValue timeInHeartRateZones */ - timeInHeartRateZones?: (google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue[]|null); - } - - /** Represents a TimeInHeartRateZoneRollupValue. */ - class TimeInHeartRateZoneRollupValue implements ITimeInHeartRateZoneRollupValue { - - /** - * Constructs a new TimeInHeartRateZoneRollupValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue); - - /** TimeInHeartRateZoneRollupValue timeInHeartRateZones. */ - public timeInHeartRateZones: google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue[]; - - /** - * Creates a new TimeInHeartRateZoneRollupValue instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeInHeartRateZoneRollupValue instance - */ - public static create(properties?: google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue; - - /** - * Encodes the specified TimeInHeartRateZoneRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.verify|verify} messages. - * @param message TimeInHeartRateZoneRollupValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimeInHeartRateZoneRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.verify|verify} messages. - * @param message TimeInHeartRateZoneRollupValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimeInHeartRateZoneRollupValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimeInHeartRateZoneRollupValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue; - - /** - * Decodes a TimeInHeartRateZoneRollupValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimeInHeartRateZoneRollupValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue; - - /** - * Verifies a TimeInHeartRateZoneRollupValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TimeInHeartRateZoneRollupValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeInHeartRateZoneRollupValue - */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue; - - /** - * Creates a plain object from a TimeInHeartRateZoneRollupValue message. Also converts values to other types if specified. - * @param message TimeInHeartRateZoneRollupValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** SleepStage createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** - * Converts this TimeInHeartRateZoneRollupValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** SleepStage updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } - /** - * Gets the default type url for TimeInHeartRateZoneRollupValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Represents a SleepStage. */ + class SleepStage implements ISleepStage { - namespace TimeInHeartRateZoneRollupValue { + /** + * Constructs a new SleepStage. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.Sleep.ISleepStage); - /** Properties of a TimeInHeartRateZoneValue. */ - interface ITimeInHeartRateZoneValue { + /** SleepStage startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** TimeInHeartRateZoneValue heartRateZone */ - heartRateZone?: (google.devicesandservices.health.v4.HeartRateZoneType|keyof typeof google.devicesandservices.health.v4.HeartRateZoneType|null); + /** SleepStage startUtcOffset. */ + public startUtcOffset?: (google.protobuf.IDuration|null); - /** TimeInHeartRateZoneValue duration */ - duration?: (google.protobuf.IDuration|null); - } + /** SleepStage endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); - /** Represents a TimeInHeartRateZoneValue. */ - class TimeInHeartRateZoneValue implements ITimeInHeartRateZoneValue { + /** SleepStage endUtcOffset. */ + public endUtcOffset?: (google.protobuf.IDuration|null); - /** - * Constructs a new TimeInHeartRateZoneValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue); + /** SleepStage type. */ + public type: (google.devicesandservices.health.v4.Sleep.SleepStageType|keyof typeof google.devicesandservices.health.v4.Sleep.SleepStageType); - /** TimeInHeartRateZoneValue heartRateZone. */ - public heartRateZone: (google.devicesandservices.health.v4.HeartRateZoneType|keyof typeof google.devicesandservices.health.v4.HeartRateZoneType); + /** SleepStage createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** TimeInHeartRateZoneValue duration. */ - public duration?: (google.protobuf.IDuration|null); + /** SleepStage updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new TimeInHeartRateZoneValue instance using the specified properties. + * Creates a new SleepStage instance using the specified properties. * @param [properties] Properties to set - * @returns TimeInHeartRateZoneValue instance + * @returns SleepStage instance */ - public static create(properties?: google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue; + public static create(properties?: google.devicesandservices.health.v4.Sleep.ISleepStage): google.devicesandservices.health.v4.Sleep.SleepStage; /** - * Encodes the specified TimeInHeartRateZoneValue message. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.verify|verify} messages. - * @param message TimeInHeartRateZoneValue message or plain object to encode + * Encodes the specified SleepStage message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepStage.verify|verify} messages. + * @param message SleepStage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.Sleep.ISleepStage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeInHeartRateZoneValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.verify|verify} messages. - * @param message TimeInHeartRateZoneValue message or plain object to encode + * Encodes the specified SleepStage message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepStage.verify|verify} messages. + * @param message SleepStage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.Sleep.ISleepStage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeInHeartRateZoneValue message from the specified reader or buffer. + * Decodes a SleepStage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeInHeartRateZoneValue + * @returns SleepStage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Sleep.SleepStage; /** - * Decodes a TimeInHeartRateZoneValue message from the specified reader or buffer, length delimited. + * Decodes a SleepStage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeInHeartRateZoneValue + * @returns SleepStage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Sleep.SleepStage; /** - * Verifies a TimeInHeartRateZoneValue message. + * Verifies a SleepStage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TimeInHeartRateZoneValue message from a plain object. Also converts values to their respective internal types. + * Creates a SleepStage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeInHeartRateZoneValue + * @returns SleepStage */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Sleep.SleepStage; /** - * Creates a plain object from a TimeInHeartRateZoneValue message. Also converts values to other types if specified. - * @param message TimeInHeartRateZoneValue - * @param [options] Conversion options + * Creates a plain object from a SleepStage message. Also converts values to other types if specified. + * @param message SleepStage + * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.Sleep.SleepStage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeInHeartRateZoneValue to JSON. + * Converts this SleepStage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TimeInHeartRateZoneValue + * Gets the default type url for SleepStage * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - } - /** Properties of a TotalCaloriesRollupValue. */ - interface ITotalCaloriesRollupValue { + /** Properties of an OutOfBedSegment. */ + interface IOutOfBedSegment { - /** TotalCaloriesRollupValue kcalSum */ - kcalSum?: (number|null); - } + /** OutOfBedSegment startTime */ + startTime?: (google.protobuf.ITimestamp|null); - /** Represents a TotalCaloriesRollupValue. */ - class TotalCaloriesRollupValue implements ITotalCaloriesRollupValue { + /** OutOfBedSegment startUtcOffset */ + startUtcOffset?: (google.protobuf.IDuration|null); - /** - * Constructs a new TotalCaloriesRollupValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.devicesandservices.health.v4.ITotalCaloriesRollupValue); + /** OutOfBedSegment endTime */ + endTime?: (google.protobuf.ITimestamp|null); - /** TotalCaloriesRollupValue kcalSum. */ - public kcalSum: number; + /** OutOfBedSegment endUtcOffset */ + endUtcOffset?: (google.protobuf.IDuration|null); + } - /** - * Creates a new TotalCaloriesRollupValue instance using the specified properties. - * @param [properties] Properties to set - * @returns TotalCaloriesRollupValue instance - */ - public static create(properties?: google.devicesandservices.health.v4.ITotalCaloriesRollupValue): google.devicesandservices.health.v4.TotalCaloriesRollupValue; + /** Represents an OutOfBedSegment. */ + class OutOfBedSegment implements IOutOfBedSegment { - /** - * Encodes the specified TotalCaloriesRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.TotalCaloriesRollupValue.verify|verify} messages. - * @param message TotalCaloriesRollupValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.devicesandservices.health.v4.ITotalCaloriesRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new OutOfBedSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.Sleep.IOutOfBedSegment); - /** - * Encodes the specified TotalCaloriesRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TotalCaloriesRollupValue.verify|verify} messages. - * @param message TotalCaloriesRollupValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.devicesandservices.health.v4.ITotalCaloriesRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** OutOfBedSegment startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes a TotalCaloriesRollupValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TotalCaloriesRollupValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.TotalCaloriesRollupValue; + /** OutOfBedSegment startUtcOffset. */ + public startUtcOffset?: (google.protobuf.IDuration|null); - /** - * Decodes a TotalCaloriesRollupValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TotalCaloriesRollupValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.TotalCaloriesRollupValue; + /** OutOfBedSegment endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); - /** - * Verifies a TotalCaloriesRollupValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** OutOfBedSegment endUtcOffset. */ + public endUtcOffset?: (google.protobuf.IDuration|null); - /** - * Creates a TotalCaloriesRollupValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TotalCaloriesRollupValue - */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.TotalCaloriesRollupValue; + /** + * Creates a new OutOfBedSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns OutOfBedSegment instance + */ + public static create(properties?: google.devicesandservices.health.v4.Sleep.IOutOfBedSegment): google.devicesandservices.health.v4.Sleep.OutOfBedSegment; - /** - * Creates a plain object from a TotalCaloriesRollupValue message. Also converts values to other types if specified. - * @param message TotalCaloriesRollupValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.devicesandservices.health.v4.TotalCaloriesRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified OutOfBedSegment message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.OutOfBedSegment.verify|verify} messages. + * @param message OutOfBedSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.Sleep.IOutOfBedSegment, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this TotalCaloriesRollupValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Encodes the specified OutOfBedSegment message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.OutOfBedSegment.verify|verify} messages. + * @param message OutOfBedSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.Sleep.IOutOfBedSegment, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Gets the default type url for TotalCaloriesRollupValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Decodes an OutOfBedSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutOfBedSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Sleep.OutOfBedSegment; - /** Properties of a VO2Max. */ - interface IVO2Max { + /** + * Decodes an OutOfBedSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutOfBedSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Sleep.OutOfBedSegment; - /** VO2Max sampleTime */ - sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + /** + * Verifies an OutOfBedSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** VO2Max vo2Max */ - vo2Max?: (number|null); + /** + * Creates an OutOfBedSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutOfBedSegment + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Sleep.OutOfBedSegment; - /** VO2Max measurementMethod */ - measurementMethod?: (google.devicesandservices.health.v4.VO2Max.MeasurementMethod|keyof typeof google.devicesandservices.health.v4.VO2Max.MeasurementMethod|null); - } + /** + * Creates a plain object from an OutOfBedSegment message. Also converts values to other types if specified. + * @param message OutOfBedSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.Sleep.OutOfBedSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a VO2Max. */ - class VO2Max implements IVO2Max { + /** + * Converts this OutOfBedSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Constructs a new VO2Max. - * @param [properties] Properties to set - */ - constructor(properties?: google.devicesandservices.health.v4.IVO2Max); + /** + * Gets the default type url for OutOfBedSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** VO2Max sampleTime. */ - public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + /** Properties of a SleepMetadata. */ + interface ISleepMetadata { - /** VO2Max vo2Max. */ - public vo2Max: number; + /** SleepMetadata stagesStatus */ + stagesStatus?: (google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState|keyof typeof google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState|null); - /** VO2Max measurementMethod. */ - public measurementMethod: (google.devicesandservices.health.v4.VO2Max.MeasurementMethod|keyof typeof google.devicesandservices.health.v4.VO2Max.MeasurementMethod); + /** SleepMetadata processed */ + processed?: (boolean|null); - /** - * Creates a new VO2Max instance using the specified properties. - * @param [properties] Properties to set - * @returns VO2Max instance - */ - public static create(properties?: google.devicesandservices.health.v4.IVO2Max): google.devicesandservices.health.v4.VO2Max; + /** SleepMetadata nap */ + nap?: (boolean|null); - /** - * Encodes the specified VO2Max message. Does not implicitly {@link google.devicesandservices.health.v4.VO2Max.verify|verify} messages. - * @param message VO2Max message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.devicesandservices.health.v4.IVO2Max, writer?: $protobuf.Writer): $protobuf.Writer; + /** SleepMetadata manuallyEdited */ + manuallyEdited?: (boolean|null); - /** - * Encodes the specified VO2Max message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.VO2Max.verify|verify} messages. - * @param message VO2Max message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IVO2Max, writer?: $protobuf.Writer): $protobuf.Writer; + /** SleepMetadata externalId */ + externalId?: (string|null); + } - /** - * Decodes a VO2Max message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VO2Max - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.VO2Max; + /** Represents a SleepMetadata. */ + class SleepMetadata implements ISleepMetadata { - /** - * Decodes a VO2Max message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VO2Max - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + /** + * Constructs a new SleepMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.Sleep.ISleepMetadata); + + /** SleepMetadata stagesStatus. */ + public stagesStatus: (google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState|keyof typeof google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState); + + /** SleepMetadata processed. */ + public processed: boolean; + + /** SleepMetadata nap. */ + public nap: boolean; + + /** SleepMetadata manuallyEdited. */ + public manuallyEdited: boolean; + + /** SleepMetadata externalId. */ + public externalId: string; + + /** + * Creates a new SleepMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns SleepMetadata instance + */ + public static create(properties?: google.devicesandservices.health.v4.Sleep.ISleepMetadata): google.devicesandservices.health.v4.Sleep.SleepMetadata; + + /** + * Encodes the specified SleepMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepMetadata.verify|verify} messages. + * @param message SleepMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.Sleep.ISleepMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SleepMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepMetadata.verify|verify} messages. + * @param message SleepMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.Sleep.ISleepMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SleepMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SleepMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Sleep.SleepMetadata; + + /** + * Decodes a SleepMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SleepMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Sleep.SleepMetadata; + + /** + * Verifies a SleepMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SleepMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SleepMetadata + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Sleep.SleepMetadata; + + /** + * Creates a plain object from a SleepMetadata message. Also converts values to other types if specified. + * @param message SleepMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.Sleep.SleepMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SleepMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SleepMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SleepMetadata { + + /** StagesState enum. */ + enum StagesState { + STAGES_STATE_UNSPECIFIED = 0, + REJECTED_COVERAGE = 1, + REJECTED_MAX_GAP = 2, + REJECTED_START_GAP = 3, + REJECTED_END_GAP = 4, + REJECTED_NAP = 5, + REJECTED_SERVER = 6, + TIMEOUT = 7, + SUCCEEDED = 8, + PROCESSING_INTERNAL_ERROR = 9 + } + } + + /** Properties of a SleepSummary. */ + interface ISleepSummary { + + /** SleepSummary minutesInSleepPeriod */ + minutesInSleepPeriod?: (number|Long|string|null); + + /** SleepSummary minutesAfterWakeUp */ + minutesAfterWakeUp?: (number|Long|string|null); + + /** SleepSummary minutesToFallAsleep */ + minutesToFallAsleep?: (number|Long|string|null); + + /** SleepSummary minutesAsleep */ + minutesAsleep?: (number|Long|string|null); + + /** SleepSummary minutesAwake */ + minutesAwake?: (number|Long|string|null); + + /** SleepSummary stagesSummary */ + stagesSummary?: (google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary[]|null); + } + + /** Represents a SleepSummary. */ + class SleepSummary implements ISleepSummary { + + /** + * Constructs a new SleepSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.Sleep.ISleepSummary); + + /** SleepSummary minutesInSleepPeriod. */ + public minutesInSleepPeriod?: (number|Long|string|null); + + /** SleepSummary minutesAfterWakeUp. */ + public minutesAfterWakeUp?: (number|Long|string|null); + + /** SleepSummary minutesToFallAsleep. */ + public minutesToFallAsleep?: (number|Long|string|null); + + /** SleepSummary minutesAsleep. */ + public minutesAsleep?: (number|Long|string|null); + + /** SleepSummary minutesAwake. */ + public minutesAwake?: (number|Long|string|null); + + /** SleepSummary stagesSummary. */ + public stagesSummary: google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary[]; + + /** + * Creates a new SleepSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns SleepSummary instance + */ + public static create(properties?: google.devicesandservices.health.v4.Sleep.ISleepSummary): google.devicesandservices.health.v4.Sleep.SleepSummary; + + /** + * Encodes the specified SleepSummary message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.verify|verify} messages. + * @param message SleepSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.Sleep.ISleepSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SleepSummary message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.verify|verify} messages. + * @param message SleepSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.Sleep.ISleepSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SleepSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SleepSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Sleep.SleepSummary; + + /** + * Decodes a SleepSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SleepSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Sleep.SleepSummary; + + /** + * Verifies a SleepSummary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SleepSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SleepSummary + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Sleep.SleepSummary; + + /** + * Creates a plain object from a SleepSummary message. Also converts values to other types if specified. + * @param message SleepSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.Sleep.SleepSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SleepSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SleepSummary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SleepSummary { + + /** Properties of a StageSummary. */ + interface IStageSummary { + + /** StageSummary type */ + type?: (google.devicesandservices.health.v4.Sleep.SleepStageType|keyof typeof google.devicesandservices.health.v4.Sleep.SleepStageType|null); + + /** StageSummary minutes */ + minutes?: (number|Long|string|null); + + /** StageSummary count */ + count?: (number|Long|string|null); + } + + /** Represents a StageSummary. */ + class StageSummary implements IStageSummary { + + /** + * Constructs a new StageSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary); + + /** StageSummary type. */ + public type: (google.devicesandservices.health.v4.Sleep.SleepStageType|keyof typeof google.devicesandservices.health.v4.Sleep.SleepStageType); + + /** StageSummary minutes. */ + public minutes?: (number|Long|string|null); + + /** StageSummary count. */ + public count?: (number|Long|string|null); + + /** + * Creates a new StageSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns StageSummary instance + */ + public static create(properties?: google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary): google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary; + + /** + * Encodes the specified StageSummary message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.verify|verify} messages. + * @param message StageSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StageSummary message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.verify|verify} messages. + * @param message StageSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StageSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StageSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary; + + /** + * Decodes a StageSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StageSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary; + + /** + * Verifies a StageSummary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StageSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StageSummary + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary; + + /** + * Creates a plain object from a StageSummary message. Also converts values to other types if specified. + * @param message StageSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StageSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StageSummary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** SleepType enum. */ + enum SleepType { + SLEEP_TYPE_UNSPECIFIED = 0, + CLASSIC = 1, + STAGES = 2 + } + + /** SleepStageType enum. */ + enum SleepStageType { + SLEEP_STAGE_TYPE_UNSPECIFIED = 0, + AWAKE = 1, + LIGHT = 2, + DEEP = 3, + REM = 4, + ASLEEP = 5, + RESTLESS = 6 + } + } + + /** Properties of a Steps. */ + interface ISteps { + + /** Steps interval */ + interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + + /** Steps count */ + count?: (number|Long|string|null); + } + + /** Represents a Steps. */ + class Steps implements ISteps { + + /** + * Constructs a new Steps. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.ISteps); + + /** Steps interval. */ + public interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + + /** Steps count. */ + public count?: (number|Long|string|null); + + /** + * Creates a new Steps instance using the specified properties. + * @param [properties] Properties to set + * @returns Steps instance + */ + public static create(properties?: google.devicesandservices.health.v4.ISteps): google.devicesandservices.health.v4.Steps; + + /** + * Encodes the specified Steps message. Does not implicitly {@link google.devicesandservices.health.v4.Steps.verify|verify} messages. + * @param message Steps message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.ISteps, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Steps message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Steps.verify|verify} messages. + * @param message Steps message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.ISteps, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Steps message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Steps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Steps; + + /** + * Decodes a Steps message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Steps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Steps; + + /** + * Verifies a Steps message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Steps message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Steps + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Steps; + + /** + * Creates a plain object from a Steps message. Also converts values to other types if specified. + * @param message Steps + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.Steps, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Steps to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Steps + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StepsRollupValue. */ + interface IStepsRollupValue { + + /** StepsRollupValue countSum */ + countSum?: (number|Long|string|null); + } + + /** Represents a StepsRollupValue. */ + class StepsRollupValue implements IStepsRollupValue { + + /** + * Constructs a new StepsRollupValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IStepsRollupValue); + + /** StepsRollupValue countSum. */ + public countSum?: (number|Long|string|null); + + /** + * Creates a new StepsRollupValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StepsRollupValue instance + */ + public static create(properties?: google.devicesandservices.health.v4.IStepsRollupValue): google.devicesandservices.health.v4.StepsRollupValue; + + /** + * Encodes the specified StepsRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.StepsRollupValue.verify|verify} messages. + * @param message StepsRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IStepsRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StepsRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.StepsRollupValue.verify|verify} messages. + * @param message StepsRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IStepsRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StepsRollupValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StepsRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.StepsRollupValue; + + /** + * Decodes a StepsRollupValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StepsRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.StepsRollupValue; + + /** + * Verifies a StepsRollupValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StepsRollupValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StepsRollupValue + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.StepsRollupValue; + + /** + * Creates a plain object from a StepsRollupValue message. Also converts values to other types if specified. + * @param message StepsRollupValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.StepsRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StepsRollupValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StepsRollupValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SwimLengthsData. */ + interface ISwimLengthsData { + + /** SwimLengthsData interval */ + interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + + /** SwimLengthsData swimStrokeType */ + swimStrokeType?: (google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType|keyof typeof google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType|null); + + /** SwimLengthsData strokeCount */ + strokeCount?: (number|Long|string|null); + } + + /** Represents a SwimLengthsData. */ + class SwimLengthsData implements ISwimLengthsData { + + /** + * Constructs a new SwimLengthsData. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.ISwimLengthsData); + + /** SwimLengthsData interval. */ + public interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + + /** SwimLengthsData swimStrokeType. */ + public swimStrokeType: (google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType|keyof typeof google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType); + + /** SwimLengthsData strokeCount. */ + public strokeCount?: (number|Long|string|null); + + /** + * Creates a new SwimLengthsData instance using the specified properties. + * @param [properties] Properties to set + * @returns SwimLengthsData instance + */ + public static create(properties?: google.devicesandservices.health.v4.ISwimLengthsData): google.devicesandservices.health.v4.SwimLengthsData; + + /** + * Encodes the specified SwimLengthsData message. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsData.verify|verify} messages. + * @param message SwimLengthsData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.ISwimLengthsData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SwimLengthsData message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsData.verify|verify} messages. + * @param message SwimLengthsData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.ISwimLengthsData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SwimLengthsData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SwimLengthsData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.SwimLengthsData; + + /** + * Decodes a SwimLengthsData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SwimLengthsData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.SwimLengthsData; + + /** + * Verifies a SwimLengthsData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SwimLengthsData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SwimLengthsData + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.SwimLengthsData; + + /** + * Creates a plain object from a SwimLengthsData message. Also converts values to other types if specified. + * @param message SwimLengthsData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.SwimLengthsData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SwimLengthsData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SwimLengthsData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SwimLengthsData { + + /** SwimStrokeType enum. */ + enum SwimStrokeType { + SWIM_STROKE_TYPE_UNSPECIFIED = 0, + FREESTYLE = 1, + BACKSTROKE = 2, + BREASTSTROKE = 3, + BUTTERFLY = 4 + } + } + + /** Properties of a SwimLengthsDataRollupValue. */ + interface ISwimLengthsDataRollupValue { + + /** SwimLengthsDataRollupValue strokeCountSum */ + strokeCountSum?: (number|Long|string|null); + } + + /** Represents a SwimLengthsDataRollupValue. */ + class SwimLengthsDataRollupValue implements ISwimLengthsDataRollupValue { + + /** + * Constructs a new SwimLengthsDataRollupValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.ISwimLengthsDataRollupValue); + + /** SwimLengthsDataRollupValue strokeCountSum. */ + public strokeCountSum?: (number|Long|string|null); + + /** + * Creates a new SwimLengthsDataRollupValue instance using the specified properties. + * @param [properties] Properties to set + * @returns SwimLengthsDataRollupValue instance + */ + public static create(properties?: google.devicesandservices.health.v4.ISwimLengthsDataRollupValue): google.devicesandservices.health.v4.SwimLengthsDataRollupValue; + + /** + * Encodes the specified SwimLengthsDataRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsDataRollupValue.verify|verify} messages. + * @param message SwimLengthsDataRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.ISwimLengthsDataRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SwimLengthsDataRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsDataRollupValue.verify|verify} messages. + * @param message SwimLengthsDataRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.ISwimLengthsDataRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SwimLengthsDataRollupValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SwimLengthsDataRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.SwimLengthsDataRollupValue; + + /** + * Decodes a SwimLengthsDataRollupValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SwimLengthsDataRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.SwimLengthsDataRollupValue; + + /** + * Verifies a SwimLengthsDataRollupValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SwimLengthsDataRollupValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SwimLengthsDataRollupValue + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.SwimLengthsDataRollupValue; + + /** + * Creates a plain object from a SwimLengthsDataRollupValue message. Also converts values to other types if specified. + * @param message SwimLengthsDataRollupValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.SwimLengthsDataRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SwimLengthsDataRollupValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SwimLengthsDataRollupValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeInHeartRateZone. */ + interface ITimeInHeartRateZone { + + /** TimeInHeartRateZone interval */ + interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + + /** TimeInHeartRateZone heartRateZoneType */ + heartRateZoneType?: (google.devicesandservices.health.v4.HeartRateZoneType|keyof typeof google.devicesandservices.health.v4.HeartRateZoneType|null); + } + + /** Represents a TimeInHeartRateZone. */ + class TimeInHeartRateZone implements ITimeInHeartRateZone { + + /** + * Constructs a new TimeInHeartRateZone. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.ITimeInHeartRateZone); + + /** TimeInHeartRateZone interval. */ + public interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + + /** TimeInHeartRateZone heartRateZoneType. */ + public heartRateZoneType: (google.devicesandservices.health.v4.HeartRateZoneType|keyof typeof google.devicesandservices.health.v4.HeartRateZoneType); + + /** + * Creates a new TimeInHeartRateZone instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeInHeartRateZone instance + */ + public static create(properties?: google.devicesandservices.health.v4.ITimeInHeartRateZone): google.devicesandservices.health.v4.TimeInHeartRateZone; + + /** + * Encodes the specified TimeInHeartRateZone message. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZone.verify|verify} messages. + * @param message TimeInHeartRateZone message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.ITimeInHeartRateZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeInHeartRateZone message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZone.verify|verify} messages. + * @param message TimeInHeartRateZone message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.ITimeInHeartRateZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeInHeartRateZone message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeInHeartRateZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.TimeInHeartRateZone; + + /** + * Decodes a TimeInHeartRateZone message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeInHeartRateZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.TimeInHeartRateZone; + + /** + * Verifies a TimeInHeartRateZone message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeInHeartRateZone message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeInHeartRateZone + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.TimeInHeartRateZone; + + /** + * Creates a plain object from a TimeInHeartRateZone message. Also converts values to other types if specified. + * @param message TimeInHeartRateZone + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.TimeInHeartRateZone, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeInHeartRateZone to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeInHeartRateZone + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeInHeartRateZoneRollupValue. */ + interface ITimeInHeartRateZoneRollupValue { + + /** TimeInHeartRateZoneRollupValue timeInHeartRateZones */ + timeInHeartRateZones?: (google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue[]|null); + } + + /** Represents a TimeInHeartRateZoneRollupValue. */ + class TimeInHeartRateZoneRollupValue implements ITimeInHeartRateZoneRollupValue { + + /** + * Constructs a new TimeInHeartRateZoneRollupValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue); + + /** TimeInHeartRateZoneRollupValue timeInHeartRateZones. */ + public timeInHeartRateZones: google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue[]; + + /** + * Creates a new TimeInHeartRateZoneRollupValue instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeInHeartRateZoneRollupValue instance + */ + public static create(properties?: google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue; + + /** + * Encodes the specified TimeInHeartRateZoneRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.verify|verify} messages. + * @param message TimeInHeartRateZoneRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeInHeartRateZoneRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.verify|verify} messages. + * @param message TimeInHeartRateZoneRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeInHeartRateZoneRollupValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeInHeartRateZoneRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue; + + /** + * Decodes a TimeInHeartRateZoneRollupValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeInHeartRateZoneRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue; + + /** + * Verifies a TimeInHeartRateZoneRollupValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeInHeartRateZoneRollupValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeInHeartRateZoneRollupValue + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue; + + /** + * Creates a plain object from a TimeInHeartRateZoneRollupValue message. Also converts values to other types if specified. + * @param message TimeInHeartRateZoneRollupValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeInHeartRateZoneRollupValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeInHeartRateZoneRollupValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TimeInHeartRateZoneRollupValue { + + /** Properties of a TimeInHeartRateZoneValue. */ + interface ITimeInHeartRateZoneValue { + + /** TimeInHeartRateZoneValue heartRateZone */ + heartRateZone?: (google.devicesandservices.health.v4.HeartRateZoneType|keyof typeof google.devicesandservices.health.v4.HeartRateZoneType|null); + + /** TimeInHeartRateZoneValue duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a TimeInHeartRateZoneValue. */ + class TimeInHeartRateZoneValue implements ITimeInHeartRateZoneValue { + + /** + * Constructs a new TimeInHeartRateZoneValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue); + + /** TimeInHeartRateZoneValue heartRateZone. */ + public heartRateZone: (google.devicesandservices.health.v4.HeartRateZoneType|keyof typeof google.devicesandservices.health.v4.HeartRateZoneType); + + /** TimeInHeartRateZoneValue duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new TimeInHeartRateZoneValue instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeInHeartRateZoneValue instance + */ + public static create(properties?: google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue; + + /** + * Encodes the specified TimeInHeartRateZoneValue message. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.verify|verify} messages. + * @param message TimeInHeartRateZoneValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeInHeartRateZoneValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.verify|verify} messages. + * @param message TimeInHeartRateZoneValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeInHeartRateZoneValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeInHeartRateZoneValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue; + + /** + * Decodes a TimeInHeartRateZoneValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeInHeartRateZoneValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue; + + /** + * Verifies a TimeInHeartRateZoneValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeInHeartRateZoneValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeInHeartRateZoneValue + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue; + + /** + * Creates a plain object from a TimeInHeartRateZoneValue message. Also converts values to other types if specified. + * @param message TimeInHeartRateZoneValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeInHeartRateZoneValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeInHeartRateZoneValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TotalCaloriesRollupValue. */ + interface ITotalCaloriesRollupValue { + + /** TotalCaloriesRollupValue kcalSum */ + kcalSum?: (number|null); + } + + /** Represents a TotalCaloriesRollupValue. */ + class TotalCaloriesRollupValue implements ITotalCaloriesRollupValue { + + /** + * Constructs a new TotalCaloriesRollupValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.ITotalCaloriesRollupValue); + + /** TotalCaloriesRollupValue kcalSum. */ + public kcalSum?: (number|null); + + /** + * Creates a new TotalCaloriesRollupValue instance using the specified properties. + * @param [properties] Properties to set + * @returns TotalCaloriesRollupValue instance + */ + public static create(properties?: google.devicesandservices.health.v4.ITotalCaloriesRollupValue): google.devicesandservices.health.v4.TotalCaloriesRollupValue; + + /** + * Encodes the specified TotalCaloriesRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.TotalCaloriesRollupValue.verify|verify} messages. + * @param message TotalCaloriesRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.ITotalCaloriesRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TotalCaloriesRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TotalCaloriesRollupValue.verify|verify} messages. + * @param message TotalCaloriesRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.ITotalCaloriesRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TotalCaloriesRollupValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TotalCaloriesRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.TotalCaloriesRollupValue; + + /** + * Decodes a TotalCaloriesRollupValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TotalCaloriesRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.TotalCaloriesRollupValue; + + /** + * Verifies a TotalCaloriesRollupValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TotalCaloriesRollupValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TotalCaloriesRollupValue + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.TotalCaloriesRollupValue; + + /** + * Creates a plain object from a TotalCaloriesRollupValue message. Also converts values to other types if specified. + * @param message TotalCaloriesRollupValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.TotalCaloriesRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TotalCaloriesRollupValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TotalCaloriesRollupValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VO2Max. */ + interface IVO2Max { + + /** VO2Max sampleTime */ + sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + + /** VO2Max vo2Max */ + vo2Max?: (number|null); + + /** VO2Max measurementMethod */ + measurementMethod?: (google.devicesandservices.health.v4.VO2Max.MeasurementMethod|keyof typeof google.devicesandservices.health.v4.VO2Max.MeasurementMethod|null); + } + + /** Represents a VO2Max. */ + class VO2Max implements IVO2Max { + + /** + * Constructs a new VO2Max. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IVO2Max); + + /** VO2Max sampleTime. */ + public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + + /** VO2Max vo2Max. */ + public vo2Max?: (number|null); + + /** VO2Max measurementMethod. */ + public measurementMethod: (google.devicesandservices.health.v4.VO2Max.MeasurementMethod|keyof typeof google.devicesandservices.health.v4.VO2Max.MeasurementMethod); + + /** + * Creates a new VO2Max instance using the specified properties. + * @param [properties] Properties to set + * @returns VO2Max instance + */ + public static create(properties?: google.devicesandservices.health.v4.IVO2Max): google.devicesandservices.health.v4.VO2Max; + + /** + * Encodes the specified VO2Max message. Does not implicitly {@link google.devicesandservices.health.v4.VO2Max.verify|verify} messages. + * @param message VO2Max message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IVO2Max, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VO2Max message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.VO2Max.verify|verify} messages. + * @param message VO2Max message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IVO2Max, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VO2Max message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VO2Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.VO2Max; + + /** + * Decodes a VO2Max message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VO2Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.VO2Max; + + /** + * Verifies a VO2Max message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VO2Max message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VO2Max + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.VO2Max; + + /** + * Creates a plain object from a VO2Max message. Also converts values to other types if specified. + * @param message VO2Max + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.VO2Max, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VO2Max to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VO2Max + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VO2Max { + + /** MeasurementMethod enum. */ + enum MeasurementMethod { + MEASUREMENT_METHOD_UNSPECIFIED = 0, + FITBIT_RUN = 1, + GOOGLE_DEMOGRAPHIC = 2, + COOPER_TEST = 3, + HEART_RATE_RATIO = 4, + METABOLIC_CART = 5, + MULTISTAGE_FITNESS_TEST = 6, + ROCKPORT_FITNESS_TEST = 7, + MAX_EXERCISE = 8, + PREDICTION_SUB_MAX_EXERCISE = 9, + PREDICTION_NON_EXERCISE = 10, + OTHER = 11 + } + } + + /** Properties of a Weight. */ + interface IWeight { + + /** Weight sampleTime */ + sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + + /** Weight weightGrams */ + weightGrams?: (number|null); + + /** Weight notes */ + notes?: (string|null); + } + + /** Represents a Weight. */ + class Weight implements IWeight { + + /** + * Constructs a new Weight. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IWeight); + + /** Weight sampleTime. */ + public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + + /** Weight weightGrams. */ + public weightGrams?: (number|null); + + /** Weight notes. */ + public notes: string; + + /** + * Creates a new Weight instance using the specified properties. + * @param [properties] Properties to set + * @returns Weight instance + */ + public static create(properties?: google.devicesandservices.health.v4.IWeight): google.devicesandservices.health.v4.Weight; + + /** + * Encodes the specified Weight message. Does not implicitly {@link google.devicesandservices.health.v4.Weight.verify|verify} messages. + * @param message Weight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IWeight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Weight message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Weight.verify|verify} messages. + * @param message Weight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IWeight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Weight message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Weight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Weight; + + /** + * Decodes a Weight message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Weight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Weight; + + /** + * Verifies a Weight message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Weight message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Weight + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Weight; + + /** + * Creates a plain object from a Weight message. Also converts values to other types if specified. + * @param message Weight + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.Weight, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Weight to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Weight + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WeightRollupValue. */ + interface IWeightRollupValue { + + /** WeightRollupValue weightGramsAvg */ + weightGramsAvg?: (number|null); + } + + /** Represents a WeightRollupValue. */ + class WeightRollupValue implements IWeightRollupValue { + + /** + * Constructs a new WeightRollupValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IWeightRollupValue); + + /** WeightRollupValue weightGramsAvg. */ + public weightGramsAvg?: (number|null); + + /** + * Creates a new WeightRollupValue instance using the specified properties. + * @param [properties] Properties to set + * @returns WeightRollupValue instance + */ + public static create(properties?: google.devicesandservices.health.v4.IWeightRollupValue): google.devicesandservices.health.v4.WeightRollupValue; + + /** + * Encodes the specified WeightRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.WeightRollupValue.verify|verify} messages. + * @param message WeightRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IWeightRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeightRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.WeightRollupValue.verify|verify} messages. + * @param message WeightRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IWeightRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WeightRollupValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WeightRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.WeightRollupValue; + + /** + * Decodes a WeightRollupValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WeightRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.WeightRollupValue; + + /** + * Verifies a WeightRollupValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WeightRollupValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WeightRollupValue + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.WeightRollupValue; + + /** + * Creates a plain object from a WeightRollupValue message. Also converts values to other types if specified. + * @param message WeightRollupValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.WeightRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WeightRollupValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WeightRollupValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BloodGlucose. */ + interface IBloodGlucose { + + /** BloodGlucose sampleTime */ + sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + + /** BloodGlucose bloodGlucoseMilligramsPerDeciliter */ + bloodGlucoseMilligramsPerDeciliter?: (number|null); + + /** BloodGlucose measurementSource */ + measurementSource?: (google.devicesandservices.health.v4.BloodGlucose.MeasurementSource|keyof typeof google.devicesandservices.health.v4.BloodGlucose.MeasurementSource|null); + + /** BloodGlucose mealType */ + mealType?: (google.devicesandservices.health.v4.BloodGlucose.MealType|keyof typeof google.devicesandservices.health.v4.BloodGlucose.MealType|null); + + /** BloodGlucose measurementTiming */ + measurementTiming?: (google.devicesandservices.health.v4.BloodGlucose.MeasurementTiming|keyof typeof google.devicesandservices.health.v4.BloodGlucose.MeasurementTiming|null); + + /** BloodGlucose specimen */ + specimen?: (google.devicesandservices.health.v4.BloodGlucose.Specimen|keyof typeof google.devicesandservices.health.v4.BloodGlucose.Specimen|null); + + /** BloodGlucose notes */ + notes?: (string|null); + } + + /** Represents a BloodGlucose. */ + class BloodGlucose implements IBloodGlucose { + + /** + * Constructs a new BloodGlucose. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IBloodGlucose); + + /** BloodGlucose sampleTime. */ + public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + + /** BloodGlucose bloodGlucoseMilligramsPerDeciliter. */ + public bloodGlucoseMilligramsPerDeciliter?: (number|null); + + /** BloodGlucose measurementSource. */ + public measurementSource: (google.devicesandservices.health.v4.BloodGlucose.MeasurementSource|keyof typeof google.devicesandservices.health.v4.BloodGlucose.MeasurementSource); + + /** BloodGlucose mealType. */ + public mealType: (google.devicesandservices.health.v4.BloodGlucose.MealType|keyof typeof google.devicesandservices.health.v4.BloodGlucose.MealType); + + /** BloodGlucose measurementTiming. */ + public measurementTiming: (google.devicesandservices.health.v4.BloodGlucose.MeasurementTiming|keyof typeof google.devicesandservices.health.v4.BloodGlucose.MeasurementTiming); + + /** BloodGlucose specimen. */ + public specimen: (google.devicesandservices.health.v4.BloodGlucose.Specimen|keyof typeof google.devicesandservices.health.v4.BloodGlucose.Specimen); + + /** BloodGlucose notes. */ + public notes: string; + + /** + * Creates a new BloodGlucose instance using the specified properties. + * @param [properties] Properties to set + * @returns BloodGlucose instance + */ + public static create(properties?: google.devicesandservices.health.v4.IBloodGlucose): google.devicesandservices.health.v4.BloodGlucose; + + /** + * Encodes the specified BloodGlucose message. Does not implicitly {@link google.devicesandservices.health.v4.BloodGlucose.verify|verify} messages. + * @param message BloodGlucose message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IBloodGlucose, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BloodGlucose message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BloodGlucose.verify|verify} messages. + * @param message BloodGlucose message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IBloodGlucose, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BloodGlucose message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BloodGlucose + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.BloodGlucose; + + /** + * Decodes a BloodGlucose message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BloodGlucose + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.BloodGlucose; + + /** + * Verifies a BloodGlucose message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BloodGlucose message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BloodGlucose + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.BloodGlucose; + + /** + * Creates a plain object from a BloodGlucose message. Also converts values to other types if specified. + * @param message BloodGlucose + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.BloodGlucose, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BloodGlucose to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BloodGlucose + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BloodGlucose { + + /** MeasurementSource enum. */ + enum MeasurementSource { + MEASUREMENT_SOURCE_UNSPECIFIED = 0, + SELF_MONITORING_BLOOD_GLUCOSE = 1, + CONTINUOUS_GLUCOSE_MONITORING = 2, + LAB_TEST = 3 + } + + /** MealType enum. */ + enum MealType { + MEAL_TYPE_UNSPECIFIED = 0, + BREAKFAST = 1, + LUNCH = 2, + DINNER = 3, + SNACK = 4 + } + + /** MeasurementTiming enum. */ + enum MeasurementTiming { + MEASUREMENT_TIMING_UNSPECIFIED = 0, + AFTER_MEAL = 1, + BEFORE_MEAL = 2, + FASTING = 3, + GENERAL = 4, + BEFORE_BED = 5, + OVER_NIGHT = 6 + } + + /** Specimen enum. */ + enum Specimen { + SPECIMEN_UNSPECIFIED = 0, + CAPILLARY_BLOOD = 1, + INTERSTITIAL_FLUID = 2, + PLASMA = 3, + SERUM = 4, + TEARS = 5, + WHOLE_BLOOD = 6 + } + } + + /** Properties of a BloodGlucoseRollupValue. */ + interface IBloodGlucoseRollupValue { + + /** BloodGlucoseRollupValue bloodGlucoseMilligramsPerDeciliterAvg */ + bloodGlucoseMilligramsPerDeciliterAvg?: (number|null); + } + + /** Represents a BloodGlucoseRollupValue. */ + class BloodGlucoseRollupValue implements IBloodGlucoseRollupValue { + + /** + * Constructs a new BloodGlucoseRollupValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IBloodGlucoseRollupValue); + + /** BloodGlucoseRollupValue bloodGlucoseMilligramsPerDeciliterAvg. */ + public bloodGlucoseMilligramsPerDeciliterAvg?: (number|null); + + /** + * Creates a new BloodGlucoseRollupValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BloodGlucoseRollupValue instance + */ + public static create(properties?: google.devicesandservices.health.v4.IBloodGlucoseRollupValue): google.devicesandservices.health.v4.BloodGlucoseRollupValue; + + /** + * Encodes the specified BloodGlucoseRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.BloodGlucoseRollupValue.verify|verify} messages. + * @param message BloodGlucoseRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IBloodGlucoseRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BloodGlucoseRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BloodGlucoseRollupValue.verify|verify} messages. + * @param message BloodGlucoseRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IBloodGlucoseRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BloodGlucoseRollupValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BloodGlucoseRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.BloodGlucoseRollupValue; + + /** + * Decodes a BloodGlucoseRollupValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BloodGlucoseRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.BloodGlucoseRollupValue; + + /** + * Verifies a BloodGlucoseRollupValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BloodGlucoseRollupValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BloodGlucoseRollupValue + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.BloodGlucoseRollupValue; + + /** + * Creates a plain object from a BloodGlucoseRollupValue message. Also converts values to other types if specified. + * @param message BloodGlucoseRollupValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.BloodGlucoseRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BloodGlucoseRollupValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BloodGlucoseRollupValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SedentaryPeriod. */ + interface ISedentaryPeriod { + + /** SedentaryPeriod interval */ + interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + } + + /** Represents a SedentaryPeriod. */ + class SedentaryPeriod implements ISedentaryPeriod { + + /** + * Constructs a new SedentaryPeriod. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.ISedentaryPeriod); + + /** SedentaryPeriod interval. */ + public interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + + /** + * Creates a new SedentaryPeriod instance using the specified properties. + * @param [properties] Properties to set + * @returns SedentaryPeriod instance + */ + public static create(properties?: google.devicesandservices.health.v4.ISedentaryPeriod): google.devicesandservices.health.v4.SedentaryPeriod; + + /** + * Encodes the specified SedentaryPeriod message. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriod.verify|verify} messages. + * @param message SedentaryPeriod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.ISedentaryPeriod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SedentaryPeriod message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriod.verify|verify} messages. + * @param message SedentaryPeriod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.ISedentaryPeriod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SedentaryPeriod message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SedentaryPeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.SedentaryPeriod; + + /** + * Decodes a SedentaryPeriod message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SedentaryPeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.SedentaryPeriod; + + /** + * Verifies a SedentaryPeriod message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SedentaryPeriod message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SedentaryPeriod + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.SedentaryPeriod; + + /** + * Creates a plain object from a SedentaryPeriod message. Also converts values to other types if specified. + * @param message SedentaryPeriod + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.SedentaryPeriod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SedentaryPeriod to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SedentaryPeriod + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SedentaryPeriodRollupValue. */ + interface ISedentaryPeriodRollupValue { + + /** SedentaryPeriodRollupValue durationSum */ + durationSum?: (google.protobuf.IDuration|null); + } + + /** Represents a SedentaryPeriodRollupValue. */ + class SedentaryPeriodRollupValue implements ISedentaryPeriodRollupValue { + + /** + * Constructs a new SedentaryPeriodRollupValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.ISedentaryPeriodRollupValue); + + /** SedentaryPeriodRollupValue durationSum. */ + public durationSum?: (google.protobuf.IDuration|null); + + /** + * Creates a new SedentaryPeriodRollupValue instance using the specified properties. + * @param [properties] Properties to set + * @returns SedentaryPeriodRollupValue instance + */ + public static create(properties?: google.devicesandservices.health.v4.ISedentaryPeriodRollupValue): google.devicesandservices.health.v4.SedentaryPeriodRollupValue; + + /** + * Encodes the specified SedentaryPeriodRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriodRollupValue.verify|verify} messages. + * @param message SedentaryPeriodRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.ISedentaryPeriodRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SedentaryPeriodRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriodRollupValue.verify|verify} messages. + * @param message SedentaryPeriodRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.ISedentaryPeriodRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SedentaryPeriodRollupValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SedentaryPeriodRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.SedentaryPeriodRollupValue; + + /** + * Decodes a SedentaryPeriodRollupValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SedentaryPeriodRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.SedentaryPeriodRollupValue; + + /** + * Verifies a SedentaryPeriodRollupValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SedentaryPeriodRollupValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SedentaryPeriodRollupValue + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.SedentaryPeriodRollupValue; + + /** + * Creates a plain object from a SedentaryPeriodRollupValue message. Also converts values to other types if specified. + * @param message SedentaryPeriodRollupValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.SedentaryPeriodRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SedentaryPeriodRollupValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SedentaryPeriodRollupValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ActiveEnergyBurned. */ + interface IActiveEnergyBurned { + + /** ActiveEnergyBurned interval */ + interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + + /** ActiveEnergyBurned kcal */ + kcal?: (number|null); + } + + /** Represents an ActiveEnergyBurned. */ + class ActiveEnergyBurned implements IActiveEnergyBurned { + + /** + * Constructs a new ActiveEnergyBurned. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IActiveEnergyBurned); + + /** ActiveEnergyBurned interval. */ + public interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + + /** ActiveEnergyBurned kcal. */ + public kcal?: (number|null); + + /** + * Creates a new ActiveEnergyBurned instance using the specified properties. + * @param [properties] Properties to set + * @returns ActiveEnergyBurned instance + */ + public static create(properties?: google.devicesandservices.health.v4.IActiveEnergyBurned): google.devicesandservices.health.v4.ActiveEnergyBurned; + + /** + * Encodes the specified ActiveEnergyBurned message. Does not implicitly {@link google.devicesandservices.health.v4.ActiveEnergyBurned.verify|verify} messages. + * @param message ActiveEnergyBurned message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IActiveEnergyBurned, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActiveEnergyBurned message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ActiveEnergyBurned.verify|verify} messages. + * @param message ActiveEnergyBurned message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IActiveEnergyBurned, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActiveEnergyBurned message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActiveEnergyBurned + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ActiveEnergyBurned; + + /** + * Decodes an ActiveEnergyBurned message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActiveEnergyBurned + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ActiveEnergyBurned; + + /** + * Verifies an ActiveEnergyBurned message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ActiveEnergyBurned message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActiveEnergyBurned + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ActiveEnergyBurned; + + /** + * Creates a plain object from an ActiveEnergyBurned message. Also converts values to other types if specified. + * @param message ActiveEnergyBurned + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.ActiveEnergyBurned, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActiveEnergyBurned to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActiveEnergyBurned + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ActiveEnergyBurnedRollupValue. */ + interface IActiveEnergyBurnedRollupValue { + + /** ActiveEnergyBurnedRollupValue kcalSum */ + kcalSum?: (number|null); + } + + /** Represents an ActiveEnergyBurnedRollupValue. */ + class ActiveEnergyBurnedRollupValue implements IActiveEnergyBurnedRollupValue { + + /** + * Constructs a new ActiveEnergyBurnedRollupValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue); + + /** ActiveEnergyBurnedRollupValue kcalSum. */ + public kcalSum?: (number|null); + + /** + * Creates a new ActiveEnergyBurnedRollupValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ActiveEnergyBurnedRollupValue instance + */ + public static create(properties?: google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue): google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue; + + /** + * Encodes the specified ActiveEnergyBurnedRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue.verify|verify} messages. + * @param message ActiveEnergyBurnedRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActiveEnergyBurnedRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue.verify|verify} messages. + * @param message ActiveEnergyBurnedRollupValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActiveEnergyBurnedRollupValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActiveEnergyBurnedRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue; + + /** + * Decodes an ActiveEnergyBurnedRollupValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActiveEnergyBurnedRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue; + + /** + * Verifies an ActiveEnergyBurnedRollupValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ActiveEnergyBurnedRollupValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActiveEnergyBurnedRollupValue + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue; + + /** + * Creates a plain object from an ActiveEnergyBurnedRollupValue message. Also converts values to other types if specified. + * @param message ActiveEnergyBurnedRollupValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActiveEnergyBurnedRollupValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActiveEnergyBurnedRollupValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MedicalDeviceInfo. */ + interface IMedicalDeviceInfo { + + /** MedicalDeviceInfo algorithmVersion */ + algorithmVersion?: (string|null); + + /** MedicalDeviceInfo serviceVersion */ + serviceVersion?: (string|null); + + /** MedicalDeviceInfo firmwareVersion */ + firmwareVersion?: (string|null); + + /** MedicalDeviceInfo featureVersion */ + featureVersion?: (string|null); + + /** MedicalDeviceInfo deviceModel */ + deviceModel?: (string|null); + } + + /** Represents a MedicalDeviceInfo. */ + class MedicalDeviceInfo implements IMedicalDeviceInfo { + + /** + * Constructs a new MedicalDeviceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IMedicalDeviceInfo); + + /** MedicalDeviceInfo algorithmVersion. */ + public algorithmVersion: string; + + /** MedicalDeviceInfo serviceVersion. */ + public serviceVersion: string; + + /** MedicalDeviceInfo firmwareVersion. */ + public firmwareVersion: string; + + /** MedicalDeviceInfo featureVersion. */ + public featureVersion: string; + + /** MedicalDeviceInfo deviceModel. */ + public deviceModel: string; + + /** + * Creates a new MedicalDeviceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns MedicalDeviceInfo instance + */ + public static create(properties?: google.devicesandservices.health.v4.IMedicalDeviceInfo): google.devicesandservices.health.v4.MedicalDeviceInfo; + + /** + * Encodes the specified MedicalDeviceInfo message. Does not implicitly {@link google.devicesandservices.health.v4.MedicalDeviceInfo.verify|verify} messages. + * @param message MedicalDeviceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IMedicalDeviceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MedicalDeviceInfo message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.MedicalDeviceInfo.verify|verify} messages. + * @param message MedicalDeviceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IMedicalDeviceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MedicalDeviceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MedicalDeviceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.MedicalDeviceInfo; + + /** + * Decodes a MedicalDeviceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MedicalDeviceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.MedicalDeviceInfo; + + /** + * Verifies a MedicalDeviceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MedicalDeviceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MedicalDeviceInfo + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.MedicalDeviceInfo; + + /** + * Creates a plain object from a MedicalDeviceInfo message. Also converts values to other types if specified. + * @param message MedicalDeviceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.MedicalDeviceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MedicalDeviceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MedicalDeviceInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a DataPointsService */ + class DataPointsService extends $protobuf.rpc.Service { + + /** + * Constructs a new DataPointsService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new DataPointsService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): DataPointsService; + + /** + * Calls GetDataPoint. + * @param request GetDataPointRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataPoint + */ + public getDataPoint(request: google.devicesandservices.health.v4.IGetDataPointRequest, callback: google.devicesandservices.health.v4.DataPointsService.GetDataPointCallback): void; + + /** + * Calls GetDataPoint. + * @param request GetDataPointRequest message or plain object + * @returns Promise + */ + public getDataPoint(request: google.devicesandservices.health.v4.IGetDataPointRequest): Promise; + + /** + * Calls ListDataPoints. + * @param request ListDataPointsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDataPointsResponse + */ + public listDataPoints(request: google.devicesandservices.health.v4.IListDataPointsRequest, callback: google.devicesandservices.health.v4.DataPointsService.ListDataPointsCallback): void; + + /** + * Calls ListDataPoints. + * @param request ListDataPointsRequest message or plain object + * @returns Promise + */ + public listDataPoints(request: google.devicesandservices.health.v4.IListDataPointsRequest): Promise; + + /** + * Calls CreateDataPoint. + * @param request CreateDataPointRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createDataPoint(request: google.devicesandservices.health.v4.ICreateDataPointRequest, callback: google.devicesandservices.health.v4.DataPointsService.CreateDataPointCallback): void; + + /** + * Calls CreateDataPoint. + * @param request CreateDataPointRequest message or plain object + * @returns Promise + */ + public createDataPoint(request: google.devicesandservices.health.v4.ICreateDataPointRequest): Promise; + + /** + * Calls UpdateDataPoint. + * @param request UpdateDataPointRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDataPoint(request: google.devicesandservices.health.v4.IUpdateDataPointRequest, callback: google.devicesandservices.health.v4.DataPointsService.UpdateDataPointCallback): void; + + /** + * Calls UpdateDataPoint. + * @param request UpdateDataPointRequest message or plain object + * @returns Promise + */ + public updateDataPoint(request: google.devicesandservices.health.v4.IUpdateDataPointRequest): Promise; + + /** + * Calls BatchDeleteDataPoints. + * @param request BatchDeleteDataPointsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchDeleteDataPoints(request: google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest, callback: google.devicesandservices.health.v4.DataPointsService.BatchDeleteDataPointsCallback): void; + + /** + * Calls BatchDeleteDataPoints. + * @param request BatchDeleteDataPointsRequest message or plain object + * @returns Promise + */ + public batchDeleteDataPoints(request: google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest): Promise; + + /** + * Calls ReconcileDataPoints. + * @param request ReconcileDataPointsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReconcileDataPointsResponse + */ + public reconcileDataPoints(request: google.devicesandservices.health.v4.IReconcileDataPointsRequest, callback: google.devicesandservices.health.v4.DataPointsService.ReconcileDataPointsCallback): void; + + /** + * Calls ReconcileDataPoints. + * @param request ReconcileDataPointsRequest message or plain object + * @returns Promise + */ + public reconcileDataPoints(request: google.devicesandservices.health.v4.IReconcileDataPointsRequest): Promise; + + /** + * Calls RollUpDataPoints. + * @param request RollUpDataPointsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RollUpDataPointsResponse + */ + public rollUpDataPoints(request: google.devicesandservices.health.v4.IRollUpDataPointsRequest, callback: google.devicesandservices.health.v4.DataPointsService.RollUpDataPointsCallback): void; + + /** + * Calls RollUpDataPoints. + * @param request RollUpDataPointsRequest message or plain object + * @returns Promise + */ + public rollUpDataPoints(request: google.devicesandservices.health.v4.IRollUpDataPointsRequest): Promise; + + /** + * Calls DailyRollUpDataPoints. + * @param request DailyRollUpDataPointsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DailyRollUpDataPointsResponse + */ + public dailyRollUpDataPoints(request: google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest, callback: google.devicesandservices.health.v4.DataPointsService.DailyRollUpDataPointsCallback): void; + + /** + * Calls DailyRollUpDataPoints. + * @param request DailyRollUpDataPointsRequest message or plain object + * @returns Promise + */ + public dailyRollUpDataPoints(request: google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest): Promise; + + /** + * Calls ExportExerciseTcx. + * @param request ExportExerciseTcxRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExportExerciseTcxResponse + */ + public exportExerciseTcx(request: google.devicesandservices.health.v4.IExportExerciseTcxRequest, callback: google.devicesandservices.health.v4.DataPointsService.ExportExerciseTcxCallback): void; + + /** + * Calls ExportExerciseTcx. + * @param request ExportExerciseTcxRequest message or plain object + * @returns Promise + */ + public exportExerciseTcx(request: google.devicesandservices.health.v4.IExportExerciseTcxRequest): Promise; + } + + namespace DataPointsService { + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|getDataPoint}. + * @param error Error, if any + * @param [response] DataPoint + */ + type GetDataPointCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.DataPoint) => void; + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|listDataPoints}. + * @param error Error, if any + * @param [response] ListDataPointsResponse + */ + type ListDataPointsCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.ListDataPointsResponse) => void; + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|createDataPoint}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateDataPointCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|updateDataPoint}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDataPointCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|batchDeleteDataPoints}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchDeleteDataPointsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|reconcileDataPoints}. + * @param error Error, if any + * @param [response] ReconcileDataPointsResponse + */ + type ReconcileDataPointsCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.ReconcileDataPointsResponse) => void; + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|rollUpDataPoints}. + * @param error Error, if any + * @param [response] RollUpDataPointsResponse + */ + type RollUpDataPointsCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.RollUpDataPointsResponse) => void; + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|dailyRollUpDataPoints}. + * @param error Error, if any + * @param [response] DailyRollUpDataPointsResponse + */ + type DailyRollUpDataPointsCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.DailyRollUpDataPointsResponse) => void; + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|exportExerciseTcx}. + * @param error Error, if any + * @param [response] ExportExerciseTcxResponse + */ + type ExportExerciseTcxCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.ExportExerciseTcxResponse) => void; + } + + /** Properties of a DataPoint. */ + interface IDataPoint { + + /** DataPoint steps */ + steps?: (google.devicesandservices.health.v4.ISteps|null); + + /** DataPoint floors */ + floors?: (google.devicesandservices.health.v4.IFloors|null); + + /** DataPoint heartRate */ + heartRate?: (google.devicesandservices.health.v4.IHeartRate|null); + + /** DataPoint sleep */ + sleep?: (google.devicesandservices.health.v4.ISleep|null); + + /** DataPoint dailyRestingHeartRate */ + dailyRestingHeartRate?: (google.devicesandservices.health.v4.IDailyRestingHeartRate|null); + + /** DataPoint dailyHeartRateVariability */ + dailyHeartRateVariability?: (google.devicesandservices.health.v4.IDailyHeartRateVariability|null); + + /** DataPoint exercise */ + exercise?: (google.devicesandservices.health.v4.IExercise|null); + + /** DataPoint weight */ + weight?: (google.devicesandservices.health.v4.IWeight|null); + + /** DataPoint altitude */ + altitude?: (google.devicesandservices.health.v4.IAltitude|null); + + /** DataPoint distance */ + distance?: (google.devicesandservices.health.v4.IDistance|null); + + /** DataPoint bodyFat */ + bodyFat?: (google.devicesandservices.health.v4.IBodyFat|null); + + /** DataPoint activeZoneMinutes */ + activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutes|null); + + /** DataPoint heartRateVariability */ + heartRateVariability?: (google.devicesandservices.health.v4.IHeartRateVariability|null); + + /** DataPoint dailySleepTemperatureDerivations */ + dailySleepTemperatureDerivations?: (google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null); + + /** DataPoint sedentaryPeriod */ + sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriod|null); + + /** DataPoint runVo2Max */ + runVo2Max?: (google.devicesandservices.health.v4.IRunVO2Max|null); + + /** DataPoint oxygenSaturation */ + oxygenSaturation?: (google.devicesandservices.health.v4.IOxygenSaturation|null); + + /** DataPoint dailyOxygenSaturation */ + dailyOxygenSaturation?: (google.devicesandservices.health.v4.IDailyOxygenSaturation|null); + + /** DataPoint activityLevel */ + activityLevel?: (google.devicesandservices.health.v4.IActivityLevel|null); + + /** DataPoint vo2Max */ + vo2Max?: (google.devicesandservices.health.v4.IVO2Max|null); + + /** DataPoint dailyVo2Max */ + dailyVo2Max?: (google.devicesandservices.health.v4.IDailyVO2Max|null); + + /** DataPoint nutritionLog */ + nutritionLog?: (google.devicesandservices.health.v4.INutritionLog|null); + + /** DataPoint irregularRhythmNotification */ + irregularRhythmNotification?: (google.devicesandservices.health.v4.IIrregularRhythmNotification|null); + + /** DataPoint electrocardiogram */ + electrocardiogram?: (google.devicesandservices.health.v4.IElectrocardiogram|null); + + /** DataPoint dailyHeartRateZones */ + dailyHeartRateZones?: (google.devicesandservices.health.v4.IDailyHeartRateZones|null); + + /** DataPoint hydrationLog */ + hydrationLog?: (google.devicesandservices.health.v4.IHydrationLog|null); + + /** DataPoint food */ + food?: (google.devicesandservices.health.v4.IFood|null); + + /** DataPoint timeInHeartRateZone */ + timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZone|null); + + /** DataPoint activeMinutes */ + activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutes|null); + + /** DataPoint respiratoryRateSleepSummary */ + respiratoryRateSleepSummary?: (google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null); + + /** DataPoint dailyRespiratoryRate */ + dailyRespiratoryRate?: (google.devicesandservices.health.v4.IDailyRespiratoryRate|null); + + /** DataPoint swimLengthsData */ + swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsData|null); + + /** DataPoint height */ + height?: (google.devicesandservices.health.v4.IHeight|null); + + /** DataPoint basalEnergyBurned */ + basalEnergyBurned?: (google.devicesandservices.health.v4.IBasalEnergyBurned|null); + + /** DataPoint coreBodyTemperature */ + coreBodyTemperature?: (google.devicesandservices.health.v4.ICoreBodyTemperature|null); + + /** DataPoint activeEnergyBurned */ + activeEnergyBurned?: (google.devicesandservices.health.v4.IActiveEnergyBurned|null); + + /** DataPoint foodMeasurementUnit */ + foodMeasurementUnit?: (google.devicesandservices.health.v4.IFoodMeasurementUnit|null); + + /** DataPoint bloodGlucose */ + bloodGlucose?: (google.devicesandservices.health.v4.IBloodGlucose|null); + + /** DataPoint name */ + name?: (string|null); + + /** DataPoint dataSource */ + dataSource?: (google.devicesandservices.health.v4.IDataSource|null); + } + + /** Represents a DataPoint. */ + class DataPoint implements IDataPoint { + + /** + * Constructs a new DataPoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IDataPoint); + + /** DataPoint steps. */ + public steps?: (google.devicesandservices.health.v4.ISteps|null); + + /** DataPoint floors. */ + public floors?: (google.devicesandservices.health.v4.IFloors|null); + + /** DataPoint heartRate. */ + public heartRate?: (google.devicesandservices.health.v4.IHeartRate|null); + + /** DataPoint sleep. */ + public sleep?: (google.devicesandservices.health.v4.ISleep|null); + + /** DataPoint dailyRestingHeartRate. */ + public dailyRestingHeartRate?: (google.devicesandservices.health.v4.IDailyRestingHeartRate|null); + + /** DataPoint dailyHeartRateVariability. */ + public dailyHeartRateVariability?: (google.devicesandservices.health.v4.IDailyHeartRateVariability|null); + + /** DataPoint exercise. */ + public exercise?: (google.devicesandservices.health.v4.IExercise|null); + + /** DataPoint weight. */ + public weight?: (google.devicesandservices.health.v4.IWeight|null); + + /** DataPoint altitude. */ + public altitude?: (google.devicesandservices.health.v4.IAltitude|null); + + /** DataPoint distance. */ + public distance?: (google.devicesandservices.health.v4.IDistance|null); + + /** DataPoint bodyFat. */ + public bodyFat?: (google.devicesandservices.health.v4.IBodyFat|null); + + /** DataPoint activeZoneMinutes. */ + public activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutes|null); + + /** DataPoint heartRateVariability. */ + public heartRateVariability?: (google.devicesandservices.health.v4.IHeartRateVariability|null); + + /** DataPoint dailySleepTemperatureDerivations. */ + public dailySleepTemperatureDerivations?: (google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null); + + /** DataPoint sedentaryPeriod. */ + public sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriod|null); + + /** DataPoint runVo2Max. */ + public runVo2Max?: (google.devicesandservices.health.v4.IRunVO2Max|null); + + /** DataPoint oxygenSaturation. */ + public oxygenSaturation?: (google.devicesandservices.health.v4.IOxygenSaturation|null); + + /** DataPoint dailyOxygenSaturation. */ + public dailyOxygenSaturation?: (google.devicesandservices.health.v4.IDailyOxygenSaturation|null); + + /** DataPoint activityLevel. */ + public activityLevel?: (google.devicesandservices.health.v4.IActivityLevel|null); + + /** DataPoint vo2Max. */ + public vo2Max?: (google.devicesandservices.health.v4.IVO2Max|null); + + /** DataPoint dailyVo2Max. */ + public dailyVo2Max?: (google.devicesandservices.health.v4.IDailyVO2Max|null); + + /** DataPoint nutritionLog. */ + public nutritionLog?: (google.devicesandservices.health.v4.INutritionLog|null); + + /** DataPoint irregularRhythmNotification. */ + public irregularRhythmNotification?: (google.devicesandservices.health.v4.IIrregularRhythmNotification|null); + + /** DataPoint electrocardiogram. */ + public electrocardiogram?: (google.devicesandservices.health.v4.IElectrocardiogram|null); + + /** DataPoint dailyHeartRateZones. */ + public dailyHeartRateZones?: (google.devicesandservices.health.v4.IDailyHeartRateZones|null); + + /** DataPoint hydrationLog. */ + public hydrationLog?: (google.devicesandservices.health.v4.IHydrationLog|null); + + /** DataPoint food. */ + public food?: (google.devicesandservices.health.v4.IFood|null); + + /** DataPoint timeInHeartRateZone. */ + public timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZone|null); + + /** DataPoint activeMinutes. */ + public activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutes|null); + + /** DataPoint respiratoryRateSleepSummary. */ + public respiratoryRateSleepSummary?: (google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null); + + /** DataPoint dailyRespiratoryRate. */ + public dailyRespiratoryRate?: (google.devicesandservices.health.v4.IDailyRespiratoryRate|null); + + /** DataPoint swimLengthsData. */ + public swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsData|null); + + /** DataPoint height. */ + public height?: (google.devicesandservices.health.v4.IHeight|null); + + /** DataPoint basalEnergyBurned. */ + public basalEnergyBurned?: (google.devicesandservices.health.v4.IBasalEnergyBurned|null); + + /** DataPoint coreBodyTemperature. */ + public coreBodyTemperature?: (google.devicesandservices.health.v4.ICoreBodyTemperature|null); + + /** DataPoint activeEnergyBurned. */ + public activeEnergyBurned?: (google.devicesandservices.health.v4.IActiveEnergyBurned|null); + + /** DataPoint foodMeasurementUnit. */ + public foodMeasurementUnit?: (google.devicesandservices.health.v4.IFoodMeasurementUnit|null); + + /** DataPoint bloodGlucose. */ + public bloodGlucose?: (google.devicesandservices.health.v4.IBloodGlucose|null); + + /** DataPoint name. */ + public name: string; + + /** DataPoint dataSource. */ + public dataSource?: (google.devicesandservices.health.v4.IDataSource|null); + + /** DataPoint data. */ + public data?: ("steps"|"floors"|"heartRate"|"sleep"|"dailyRestingHeartRate"|"dailyHeartRateVariability"|"exercise"|"weight"|"altitude"|"distance"|"bodyFat"|"activeZoneMinutes"|"heartRateVariability"|"dailySleepTemperatureDerivations"|"sedentaryPeriod"|"runVo2Max"|"oxygenSaturation"|"dailyOxygenSaturation"|"activityLevel"|"vo2Max"|"dailyVo2Max"|"nutritionLog"|"irregularRhythmNotification"|"electrocardiogram"|"dailyHeartRateZones"|"hydrationLog"|"food"|"timeInHeartRateZone"|"activeMinutes"|"respiratoryRateSleepSummary"|"dailyRespiratoryRate"|"swimLengthsData"|"height"|"basalEnergyBurned"|"coreBodyTemperature"|"activeEnergyBurned"|"foodMeasurementUnit"|"bloodGlucose"); + + /** + * Creates a new DataPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns DataPoint instance + */ + public static create(properties?: google.devicesandservices.health.v4.IDataPoint): google.devicesandservices.health.v4.DataPoint; + + /** + * Encodes the specified DataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.DataPoint.verify|verify} messages. + * @param message DataPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataPoint.verify|verify} messages. + * @param message DataPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataPoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DataPoint; + + /** + * Decodes a DataPoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DataPoint; + + /** + * Verifies a DataPoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataPoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataPoint + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DataPoint; + + /** + * Creates a plain object from a DataPoint message. Also converts values to other types if specified. + * @param message DataPoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.DataPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataPoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReconciledDataPoint. */ + interface IReconciledDataPoint { + + /** ReconciledDataPoint steps */ + steps?: (google.devicesandservices.health.v4.ISteps|null); + + /** ReconciledDataPoint floors */ + floors?: (google.devicesandservices.health.v4.IFloors|null); + + /** ReconciledDataPoint heartRate */ + heartRate?: (google.devicesandservices.health.v4.IHeartRate|null); + + /** ReconciledDataPoint sleep */ + sleep?: (google.devicesandservices.health.v4.ISleep|null); + + /** ReconciledDataPoint dailyRestingHeartRate */ + dailyRestingHeartRate?: (google.devicesandservices.health.v4.IDailyRestingHeartRate|null); + + /** ReconciledDataPoint dailyHeartRateVariability */ + dailyHeartRateVariability?: (google.devicesandservices.health.v4.IDailyHeartRateVariability|null); + + /** ReconciledDataPoint exercise */ + exercise?: (google.devicesandservices.health.v4.IExercise|null); + + /** ReconciledDataPoint weight */ + weight?: (google.devicesandservices.health.v4.IWeight|null); + + /** ReconciledDataPoint altitude */ + altitude?: (google.devicesandservices.health.v4.IAltitude|null); + + /** ReconciledDataPoint distance */ + distance?: (google.devicesandservices.health.v4.IDistance|null); + + /** ReconciledDataPoint bodyFat */ + bodyFat?: (google.devicesandservices.health.v4.IBodyFat|null); + + /** ReconciledDataPoint activeZoneMinutes */ + activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutes|null); + + /** ReconciledDataPoint heartRateVariability */ + heartRateVariability?: (google.devicesandservices.health.v4.IHeartRateVariability|null); + + /** ReconciledDataPoint dailySleepTemperatureDerivations */ + dailySleepTemperatureDerivations?: (google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null); + + /** ReconciledDataPoint sedentaryPeriod */ + sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriod|null); + + /** ReconciledDataPoint runVo2Max */ + runVo2Max?: (google.devicesandservices.health.v4.IRunVO2Max|null); + + /** ReconciledDataPoint oxygenSaturation */ + oxygenSaturation?: (google.devicesandservices.health.v4.IOxygenSaturation|null); + + /** ReconciledDataPoint dailyOxygenSaturation */ + dailyOxygenSaturation?: (google.devicesandservices.health.v4.IDailyOxygenSaturation|null); + + /** ReconciledDataPoint activityLevel */ + activityLevel?: (google.devicesandservices.health.v4.IActivityLevel|null); + + /** ReconciledDataPoint vo2Max */ + vo2Max?: (google.devicesandservices.health.v4.IVO2Max|null); + + /** ReconciledDataPoint dailyVo2Max */ + dailyVo2Max?: (google.devicesandservices.health.v4.IDailyVO2Max|null); + + /** ReconciledDataPoint nutritionLog */ + nutritionLog?: (google.devicesandservices.health.v4.INutritionLog|null); + + /** ReconciledDataPoint dailyHeartRateZones */ + dailyHeartRateZones?: (google.devicesandservices.health.v4.IDailyHeartRateZones|null); + + /** ReconciledDataPoint hydrationLog */ + hydrationLog?: (google.devicesandservices.health.v4.IHydrationLog|null); + + /** ReconciledDataPoint timeInHeartRateZone */ + timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZone|null); + + /** ReconciledDataPoint activeMinutes */ + activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutes|null); + + /** ReconciledDataPoint respiratoryRateSleepSummary */ + respiratoryRateSleepSummary?: (google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null); + + /** ReconciledDataPoint dailyRespiratoryRate */ + dailyRespiratoryRate?: (google.devicesandservices.health.v4.IDailyRespiratoryRate|null); + + /** ReconciledDataPoint swimLengthsData */ + swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsData|null); + + /** ReconciledDataPoint height */ + height?: (google.devicesandservices.health.v4.IHeight|null); + + /** ReconciledDataPoint basalEnergyBurned */ + basalEnergyBurned?: (google.devicesandservices.health.v4.IBasalEnergyBurned|null); + + /** ReconciledDataPoint coreBodyTemperature */ + coreBodyTemperature?: (google.devicesandservices.health.v4.ICoreBodyTemperature|null); + + /** ReconciledDataPoint activeEnergyBurned */ + activeEnergyBurned?: (google.devicesandservices.health.v4.IActiveEnergyBurned|null); + + /** ReconciledDataPoint bloodGlucose */ + bloodGlucose?: (google.devicesandservices.health.v4.IBloodGlucose|null); + + /** ReconciledDataPoint dataPointName */ + dataPointName?: (string|null); + } + + /** Represents a ReconciledDataPoint. */ + class ReconciledDataPoint implements IReconciledDataPoint { + + /** + * Constructs a new ReconciledDataPoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IReconciledDataPoint); + + /** ReconciledDataPoint steps. */ + public steps?: (google.devicesandservices.health.v4.ISteps|null); + + /** ReconciledDataPoint floors. */ + public floors?: (google.devicesandservices.health.v4.IFloors|null); + + /** ReconciledDataPoint heartRate. */ + public heartRate?: (google.devicesandservices.health.v4.IHeartRate|null); + + /** ReconciledDataPoint sleep. */ + public sleep?: (google.devicesandservices.health.v4.ISleep|null); + + /** ReconciledDataPoint dailyRestingHeartRate. */ + public dailyRestingHeartRate?: (google.devicesandservices.health.v4.IDailyRestingHeartRate|null); + + /** ReconciledDataPoint dailyHeartRateVariability. */ + public dailyHeartRateVariability?: (google.devicesandservices.health.v4.IDailyHeartRateVariability|null); + + /** ReconciledDataPoint exercise. */ + public exercise?: (google.devicesandservices.health.v4.IExercise|null); + + /** ReconciledDataPoint weight. */ + public weight?: (google.devicesandservices.health.v4.IWeight|null); + + /** ReconciledDataPoint altitude. */ + public altitude?: (google.devicesandservices.health.v4.IAltitude|null); + + /** ReconciledDataPoint distance. */ + public distance?: (google.devicesandservices.health.v4.IDistance|null); + + /** ReconciledDataPoint bodyFat. */ + public bodyFat?: (google.devicesandservices.health.v4.IBodyFat|null); + + /** ReconciledDataPoint activeZoneMinutes. */ + public activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutes|null); + + /** ReconciledDataPoint heartRateVariability. */ + public heartRateVariability?: (google.devicesandservices.health.v4.IHeartRateVariability|null); + + /** ReconciledDataPoint dailySleepTemperatureDerivations. */ + public dailySleepTemperatureDerivations?: (google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null); + + /** ReconciledDataPoint sedentaryPeriod. */ + public sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriod|null); + + /** ReconciledDataPoint runVo2Max. */ + public runVo2Max?: (google.devicesandservices.health.v4.IRunVO2Max|null); + + /** ReconciledDataPoint oxygenSaturation. */ + public oxygenSaturation?: (google.devicesandservices.health.v4.IOxygenSaturation|null); + + /** ReconciledDataPoint dailyOxygenSaturation. */ + public dailyOxygenSaturation?: (google.devicesandservices.health.v4.IDailyOxygenSaturation|null); + + /** ReconciledDataPoint activityLevel. */ + public activityLevel?: (google.devicesandservices.health.v4.IActivityLevel|null); + + /** ReconciledDataPoint vo2Max. */ + public vo2Max?: (google.devicesandservices.health.v4.IVO2Max|null); + + /** ReconciledDataPoint dailyVo2Max. */ + public dailyVo2Max?: (google.devicesandservices.health.v4.IDailyVO2Max|null); + + /** ReconciledDataPoint nutritionLog. */ + public nutritionLog?: (google.devicesandservices.health.v4.INutritionLog|null); + + /** ReconciledDataPoint dailyHeartRateZones. */ + public dailyHeartRateZones?: (google.devicesandservices.health.v4.IDailyHeartRateZones|null); + + /** ReconciledDataPoint hydrationLog. */ + public hydrationLog?: (google.devicesandservices.health.v4.IHydrationLog|null); + + /** ReconciledDataPoint timeInHeartRateZone. */ + public timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZone|null); + + /** ReconciledDataPoint activeMinutes. */ + public activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutes|null); + + /** ReconciledDataPoint respiratoryRateSleepSummary. */ + public respiratoryRateSleepSummary?: (google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null); + + /** ReconciledDataPoint dailyRespiratoryRate. */ + public dailyRespiratoryRate?: (google.devicesandservices.health.v4.IDailyRespiratoryRate|null); + + /** ReconciledDataPoint swimLengthsData. */ + public swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsData|null); + + /** ReconciledDataPoint height. */ + public height?: (google.devicesandservices.health.v4.IHeight|null); + + /** ReconciledDataPoint basalEnergyBurned. */ + public basalEnergyBurned?: (google.devicesandservices.health.v4.IBasalEnergyBurned|null); + + /** ReconciledDataPoint coreBodyTemperature. */ + public coreBodyTemperature?: (google.devicesandservices.health.v4.ICoreBodyTemperature|null); + + /** ReconciledDataPoint activeEnergyBurned. */ + public activeEnergyBurned?: (google.devicesandservices.health.v4.IActiveEnergyBurned|null); + + /** ReconciledDataPoint bloodGlucose. */ + public bloodGlucose?: (google.devicesandservices.health.v4.IBloodGlucose|null); + + /** ReconciledDataPoint dataPointName. */ + public dataPointName: string; + + /** ReconciledDataPoint data. */ + public data?: ("steps"|"floors"|"heartRate"|"sleep"|"dailyRestingHeartRate"|"dailyHeartRateVariability"|"exercise"|"weight"|"altitude"|"distance"|"bodyFat"|"activeZoneMinutes"|"heartRateVariability"|"dailySleepTemperatureDerivations"|"sedentaryPeriod"|"runVo2Max"|"oxygenSaturation"|"dailyOxygenSaturation"|"activityLevel"|"vo2Max"|"dailyVo2Max"|"nutritionLog"|"dailyHeartRateZones"|"hydrationLog"|"timeInHeartRateZone"|"activeMinutes"|"respiratoryRateSleepSummary"|"dailyRespiratoryRate"|"swimLengthsData"|"height"|"basalEnergyBurned"|"coreBodyTemperature"|"activeEnergyBurned"|"bloodGlucose"); + + /** + * Creates a new ReconciledDataPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ReconciledDataPoint instance + */ + public static create(properties?: google.devicesandservices.health.v4.IReconciledDataPoint): google.devicesandservices.health.v4.ReconciledDataPoint; + + /** + * Encodes the specified ReconciledDataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.ReconciledDataPoint.verify|verify} messages. + * @param message ReconciledDataPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IReconciledDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReconciledDataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ReconciledDataPoint.verify|verify} messages. + * @param message ReconciledDataPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IReconciledDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReconciledDataPoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReconciledDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ReconciledDataPoint; + + /** + * Decodes a ReconciledDataPoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReconciledDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ReconciledDataPoint; + + /** + * Verifies a ReconciledDataPoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReconciledDataPoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReconciledDataPoint + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ReconciledDataPoint; + + /** + * Creates a plain object from a ReconciledDataPoint message. Also converts values to other types if specified. + * @param message ReconciledDataPoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.ReconciledDataPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReconciledDataPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReconciledDataPoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RollupDataPoint. */ + interface IRollupDataPoint { + + /** RollupDataPoint steps */ + steps?: (google.devicesandservices.health.v4.IStepsRollupValue|null); + + /** RollupDataPoint floors */ + floors?: (google.devicesandservices.health.v4.IFloorsRollupValue|null); + + /** RollupDataPoint heartRate */ + heartRate?: (google.devicesandservices.health.v4.IHeartRateRollupValue|null); + + /** RollupDataPoint weight */ + weight?: (google.devicesandservices.health.v4.IWeightRollupValue|null); + + /** RollupDataPoint altitude */ + altitude?: (google.devicesandservices.health.v4.IAltitudeRollupValue|null); + + /** RollupDataPoint distance */ + distance?: (google.devicesandservices.health.v4.IDistanceRollupValue|null); + + /** RollupDataPoint bodyFat */ + bodyFat?: (google.devicesandservices.health.v4.IBodyFatRollupValue|null); + + /** RollupDataPoint totalCalories */ + totalCalories?: (google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null); + + /** RollupDataPoint activeZoneMinutes */ + activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null); + + /** RollupDataPoint sedentaryPeriod */ + sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null); + + /** RollupDataPoint runVo2Max */ + runVo2Max?: (google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null); + + /** RollupDataPoint caloriesInHeartRateZone */ + caloriesInHeartRateZone?: (google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null); + + /** RollupDataPoint activityLevel */ + activityLevel?: (google.devicesandservices.health.v4.IActivityLevelRollupValue|null); + + /** RollupDataPoint nutritionLog */ + nutritionLog?: (google.devicesandservices.health.v4.INutritionLogRollupValue|null); + + /** RollupDataPoint hydrationLog */ + hydrationLog?: (google.devicesandservices.health.v4.IHydrationLogRollupValue|null); + + /** RollupDataPoint timeInHeartRateZone */ + timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null); + + /** RollupDataPoint activeMinutes */ + activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutesRollupValue|null); + + /** RollupDataPoint swimLengthsData */ + swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null); + + /** RollupDataPoint coreBodyTemperature */ + coreBodyTemperature?: (google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue|null); + + /** RollupDataPoint activeEnergyBurned */ + activeEnergyBurned?: (google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue|null); + + /** RollupDataPoint bloodGlucose */ + bloodGlucose?: (google.devicesandservices.health.v4.IBloodGlucoseRollupValue|null); + + /** RollupDataPoint startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** RollupDataPoint endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a RollupDataPoint. */ + class RollupDataPoint implements IRollupDataPoint { + + /** + * Constructs a new RollupDataPoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IRollupDataPoint); + + /** RollupDataPoint steps. */ + public steps?: (google.devicesandservices.health.v4.IStepsRollupValue|null); + + /** RollupDataPoint floors. */ + public floors?: (google.devicesandservices.health.v4.IFloorsRollupValue|null); + + /** RollupDataPoint heartRate. */ + public heartRate?: (google.devicesandservices.health.v4.IHeartRateRollupValue|null); + + /** RollupDataPoint weight. */ + public weight?: (google.devicesandservices.health.v4.IWeightRollupValue|null); + + /** RollupDataPoint altitude. */ + public altitude?: (google.devicesandservices.health.v4.IAltitudeRollupValue|null); + + /** RollupDataPoint distance. */ + public distance?: (google.devicesandservices.health.v4.IDistanceRollupValue|null); + + /** RollupDataPoint bodyFat. */ + public bodyFat?: (google.devicesandservices.health.v4.IBodyFatRollupValue|null); + + /** RollupDataPoint totalCalories. */ + public totalCalories?: (google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null); + + /** RollupDataPoint activeZoneMinutes. */ + public activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null); + + /** RollupDataPoint sedentaryPeriod. */ + public sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null); + + /** RollupDataPoint runVo2Max. */ + public runVo2Max?: (google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null); + + /** RollupDataPoint caloriesInHeartRateZone. */ + public caloriesInHeartRateZone?: (google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null); + + /** RollupDataPoint activityLevel. */ + public activityLevel?: (google.devicesandservices.health.v4.IActivityLevelRollupValue|null); + + /** RollupDataPoint nutritionLog. */ + public nutritionLog?: (google.devicesandservices.health.v4.INutritionLogRollupValue|null); + + /** RollupDataPoint hydrationLog. */ + public hydrationLog?: (google.devicesandservices.health.v4.IHydrationLogRollupValue|null); + + /** RollupDataPoint timeInHeartRateZone. */ + public timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null); + + /** RollupDataPoint activeMinutes. */ + public activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutesRollupValue|null); + + /** RollupDataPoint swimLengthsData. */ + public swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null); + + /** RollupDataPoint coreBodyTemperature. */ + public coreBodyTemperature?: (google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue|null); + + /** RollupDataPoint activeEnergyBurned. */ + public activeEnergyBurned?: (google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue|null); + + /** RollupDataPoint bloodGlucose. */ + public bloodGlucose?: (google.devicesandservices.health.v4.IBloodGlucoseRollupValue|null); + + /** RollupDataPoint startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** RollupDataPoint endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** RollupDataPoint value. */ + public value?: ("steps"|"floors"|"heartRate"|"weight"|"altitude"|"distance"|"bodyFat"|"totalCalories"|"activeZoneMinutes"|"sedentaryPeriod"|"runVo2Max"|"caloriesInHeartRateZone"|"activityLevel"|"nutritionLog"|"hydrationLog"|"timeInHeartRateZone"|"activeMinutes"|"swimLengthsData"|"coreBodyTemperature"|"activeEnergyBurned"|"bloodGlucose"); + + /** + * Creates a new RollupDataPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns RollupDataPoint instance + */ + public static create(properties?: google.devicesandservices.health.v4.IRollupDataPoint): google.devicesandservices.health.v4.RollupDataPoint; + + /** + * Encodes the specified RollupDataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.RollupDataPoint.verify|verify} messages. + * @param message RollupDataPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IRollupDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RollupDataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RollupDataPoint.verify|verify} messages. + * @param message RollupDataPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IRollupDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RollupDataPoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RollupDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.RollupDataPoint; + + /** + * Decodes a RollupDataPoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RollupDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.RollupDataPoint; + + /** + * Verifies a RollupDataPoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RollupDataPoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RollupDataPoint + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.RollupDataPoint; + + /** + * Creates a plain object from a RollupDataPoint message. Also converts values to other types if specified. + * @param message RollupDataPoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.RollupDataPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RollupDataPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RollupDataPoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DailyRollupDataPoint. */ + interface IDailyRollupDataPoint { + + /** DailyRollupDataPoint steps */ + steps?: (google.devicesandservices.health.v4.IStepsRollupValue|null); + + /** DailyRollupDataPoint floors */ + floors?: (google.devicesandservices.health.v4.IFloorsRollupValue|null); + + /** DailyRollupDataPoint heartRate */ + heartRate?: (google.devicesandservices.health.v4.IHeartRateRollupValue|null); + + /** DailyRollupDataPoint restingHeartRatePersonalRange */ + restingHeartRatePersonalRange?: (google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue|null); + + /** DailyRollupDataPoint heartRateVariabilityPersonalRange */ + heartRateVariabilityPersonalRange?: (google.devicesandservices.health.v4.IHeartRateVariabilityPersonalRangeRollupValue|null); + + /** DailyRollupDataPoint weight */ + weight?: (google.devicesandservices.health.v4.IWeightRollupValue|null); + + /** DailyRollupDataPoint altitude */ + altitude?: (google.devicesandservices.health.v4.IAltitudeRollupValue|null); + + /** DailyRollupDataPoint distance */ + distance?: (google.devicesandservices.health.v4.IDistanceRollupValue|null); + + /** DailyRollupDataPoint bodyFat */ + bodyFat?: (google.devicesandservices.health.v4.IBodyFatRollupValue|null); + + /** DailyRollupDataPoint totalCalories */ + totalCalories?: (google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null); + + /** DailyRollupDataPoint activeZoneMinutes */ + activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null); + + /** DailyRollupDataPoint sedentaryPeriod */ + sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null); + + /** DailyRollupDataPoint runVo2Max */ + runVo2Max?: (google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null); + + /** DailyRollupDataPoint caloriesInHeartRateZone */ + caloriesInHeartRateZone?: (google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null); + + /** DailyRollupDataPoint activityLevel */ + activityLevel?: (google.devicesandservices.health.v4.IActivityLevelRollupValue|null); + + /** DailyRollupDataPoint nutritionLog */ + nutritionLog?: (google.devicesandservices.health.v4.INutritionLogRollupValue|null); + + /** DailyRollupDataPoint hydrationLog */ + hydrationLog?: (google.devicesandservices.health.v4.IHydrationLogRollupValue|null); + + /** DailyRollupDataPoint timeInHeartRateZone */ + timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null); + + /** DailyRollupDataPoint activeMinutes */ + activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutesRollupValue|null); + + /** DailyRollupDataPoint swimLengthsData */ + swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null); + + /** DailyRollupDataPoint coreBodyTemperature */ + coreBodyTemperature?: (google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue|null); + + /** DailyRollupDataPoint activeEnergyBurned */ + activeEnergyBurned?: (google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue|null); + + /** DailyRollupDataPoint bloodGlucose */ + bloodGlucose?: (google.devicesandservices.health.v4.IBloodGlucoseRollupValue|null); + + /** DailyRollupDataPoint civilStartTime */ + civilStartTime?: (google.devicesandservices.health.v4.ICivilDateTime|null); + + /** DailyRollupDataPoint civilEndTime */ + civilEndTime?: (google.devicesandservices.health.v4.ICivilDateTime|null); + } + + /** Represents a DailyRollupDataPoint. */ + class DailyRollupDataPoint implements IDailyRollupDataPoint { + + /** + * Constructs a new DailyRollupDataPoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IDailyRollupDataPoint); + + /** DailyRollupDataPoint steps. */ + public steps?: (google.devicesandservices.health.v4.IStepsRollupValue|null); + + /** DailyRollupDataPoint floors. */ + public floors?: (google.devicesandservices.health.v4.IFloorsRollupValue|null); + + /** DailyRollupDataPoint heartRate. */ + public heartRate?: (google.devicesandservices.health.v4.IHeartRateRollupValue|null); + + /** DailyRollupDataPoint restingHeartRatePersonalRange. */ + public restingHeartRatePersonalRange?: (google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue|null); + + /** DailyRollupDataPoint heartRateVariabilityPersonalRange. */ + public heartRateVariabilityPersonalRange?: (google.devicesandservices.health.v4.IHeartRateVariabilityPersonalRangeRollupValue|null); + + /** DailyRollupDataPoint weight. */ + public weight?: (google.devicesandservices.health.v4.IWeightRollupValue|null); + + /** DailyRollupDataPoint altitude. */ + public altitude?: (google.devicesandservices.health.v4.IAltitudeRollupValue|null); + + /** DailyRollupDataPoint distance. */ + public distance?: (google.devicesandservices.health.v4.IDistanceRollupValue|null); + + /** DailyRollupDataPoint bodyFat. */ + public bodyFat?: (google.devicesandservices.health.v4.IBodyFatRollupValue|null); + + /** DailyRollupDataPoint totalCalories. */ + public totalCalories?: (google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null); + + /** DailyRollupDataPoint activeZoneMinutes. */ + public activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null); + + /** DailyRollupDataPoint sedentaryPeriod. */ + public sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null); + + /** DailyRollupDataPoint runVo2Max. */ + public runVo2Max?: (google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null); + + /** DailyRollupDataPoint caloriesInHeartRateZone. */ + public caloriesInHeartRateZone?: (google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null); + + /** DailyRollupDataPoint activityLevel. */ + public activityLevel?: (google.devicesandservices.health.v4.IActivityLevelRollupValue|null); + + /** DailyRollupDataPoint nutritionLog. */ + public nutritionLog?: (google.devicesandservices.health.v4.INutritionLogRollupValue|null); + + /** DailyRollupDataPoint hydrationLog. */ + public hydrationLog?: (google.devicesandservices.health.v4.IHydrationLogRollupValue|null); + + /** DailyRollupDataPoint timeInHeartRateZone. */ + public timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null); + + /** DailyRollupDataPoint activeMinutes. */ + public activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutesRollupValue|null); + + /** DailyRollupDataPoint swimLengthsData. */ + public swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null); + + /** DailyRollupDataPoint coreBodyTemperature. */ + public coreBodyTemperature?: (google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue|null); + + /** DailyRollupDataPoint activeEnergyBurned. */ + public activeEnergyBurned?: (google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue|null); + + /** DailyRollupDataPoint bloodGlucose. */ + public bloodGlucose?: (google.devicesandservices.health.v4.IBloodGlucoseRollupValue|null); + + /** DailyRollupDataPoint civilStartTime. */ + public civilStartTime?: (google.devicesandservices.health.v4.ICivilDateTime|null); + + /** DailyRollupDataPoint civilEndTime. */ + public civilEndTime?: (google.devicesandservices.health.v4.ICivilDateTime|null); + + /** DailyRollupDataPoint value. */ + public value?: ("steps"|"floors"|"heartRate"|"restingHeartRatePersonalRange"|"heartRateVariabilityPersonalRange"|"weight"|"altitude"|"distance"|"bodyFat"|"totalCalories"|"activeZoneMinutes"|"sedentaryPeriod"|"runVo2Max"|"caloriesInHeartRateZone"|"activityLevel"|"nutritionLog"|"hydrationLog"|"timeInHeartRateZone"|"activeMinutes"|"swimLengthsData"|"coreBodyTemperature"|"activeEnergyBurned"|"bloodGlucose"); + + /** + * Creates a new DailyRollupDataPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns DailyRollupDataPoint instance + */ + public static create(properties?: google.devicesandservices.health.v4.IDailyRollupDataPoint): google.devicesandservices.health.v4.DailyRollupDataPoint; + + /** + * Encodes the specified DailyRollupDataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollupDataPoint.verify|verify} messages. + * @param message DailyRollupDataPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IDailyRollupDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DailyRollupDataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollupDataPoint.verify|verify} messages. + * @param message DailyRollupDataPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IDailyRollupDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DailyRollupDataPoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DailyRollupDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DailyRollupDataPoint; + + /** + * Decodes a DailyRollupDataPoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DailyRollupDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DailyRollupDataPoint; + + /** + * Verifies a DailyRollupDataPoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DailyRollupDataPoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DailyRollupDataPoint + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DailyRollupDataPoint; + + /** + * Creates a plain object from a DailyRollupDataPoint message. Also converts values to other types if specified. + * @param message DailyRollupDataPoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.DailyRollupDataPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DailyRollupDataPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DailyRollupDataPoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDataPointRequest. */ + interface IGetDataPointRequest { + + /** GetDataPointRequest name */ + name?: (string|null); + } + + /** Represents a GetDataPointRequest. */ + class GetDataPointRequest implements IGetDataPointRequest { + + /** + * Constructs a new GetDataPointRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IGetDataPointRequest); + + /** GetDataPointRequest name. */ + public name: string; + + /** + * Creates a new GetDataPointRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDataPointRequest instance + */ + public static create(properties?: google.devicesandservices.health.v4.IGetDataPointRequest): google.devicesandservices.health.v4.GetDataPointRequest; + + /** + * Encodes the specified GetDataPointRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetDataPointRequest.verify|verify} messages. + * @param message GetDataPointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IGetDataPointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDataPointRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetDataPointRequest.verify|verify} messages. + * @param message GetDataPointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IGetDataPointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDataPointRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDataPointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.GetDataPointRequest; + + /** + * Decodes a GetDataPointRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDataPointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.GetDataPointRequest; + + /** + * Verifies a GetDataPointRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDataPointRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDataPointRequest + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.GetDataPointRequest; + + /** + * Creates a plain object from a GetDataPointRequest message. Also converts values to other types if specified. + * @param message GetDataPointRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.GetDataPointRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDataPointRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDataPointRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataPointsRequest. */ + interface IListDataPointsRequest { + + /** ListDataPointsRequest parent */ + parent?: (string|null); + + /** ListDataPointsRequest pageSize */ + pageSize?: (number|null); + + /** ListDataPointsRequest pageToken */ + pageToken?: (string|null); + + /** ListDataPointsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListDataPointsRequest. */ + class ListDataPointsRequest implements IListDataPointsRequest { + + /** + * Constructs a new ListDataPointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IListDataPointsRequest); + + /** ListDataPointsRequest parent. */ + public parent: string; + + /** ListDataPointsRequest pageSize. */ + public pageSize: number; + + /** ListDataPointsRequest pageToken. */ + public pageToken: string; + + /** ListDataPointsRequest filter. */ + public filter: string; + + /** + * Creates a new ListDataPointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataPointsRequest instance + */ + public static create(properties?: google.devicesandservices.health.v4.IListDataPointsRequest): google.devicesandservices.health.v4.ListDataPointsRequest; + + /** + * Encodes the specified ListDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsRequest.verify|verify} messages. + * @param message ListDataPointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IListDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsRequest.verify|verify} messages. + * @param message ListDataPointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IListDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataPointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ListDataPointsRequest; + + /** + * Decodes a ListDataPointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ListDataPointsRequest; + + /** + * Verifies a ListDataPointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataPointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ListDataPointsRequest; + + /** + * Creates a plain object from a ListDataPointsRequest message. Also converts values to other types if specified. + * @param message ListDataPointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.ListDataPointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataPointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataPointsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataPointsResponse. */ + interface IListDataPointsResponse { + + /** ListDataPointsResponse dataPoints */ + dataPoints?: (google.devicesandservices.health.v4.IDataPoint[]|null); + + /** ListDataPointsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDataPointsResponse. */ + class ListDataPointsResponse implements IListDataPointsResponse { + + /** + * Constructs a new ListDataPointsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IListDataPointsResponse); + + /** ListDataPointsResponse dataPoints. */ + public dataPoints: google.devicesandservices.health.v4.IDataPoint[]; + + /** ListDataPointsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDataPointsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataPointsResponse instance + */ + public static create(properties?: google.devicesandservices.health.v4.IListDataPointsResponse): google.devicesandservices.health.v4.ListDataPointsResponse; + + /** + * Encodes the specified ListDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsResponse.verify|verify} messages. + * @param message ListDataPointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IListDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsResponse.verify|verify} messages. + * @param message ListDataPointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IListDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataPointsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ListDataPointsResponse; + + /** + * Decodes a ListDataPointsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ListDataPointsResponse; + + /** + * Verifies a ListDataPointsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataPointsResponse + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ListDataPointsResponse; + + /** + * Creates a plain object from a ListDataPointsResponse message. Also converts values to other types if specified. + * @param message ListDataPointsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.ListDataPointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataPointsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataPointsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDataPointRequest. */ + interface ICreateDataPointRequest { + + /** CreateDataPointRequest parent */ + parent?: (string|null); + + /** CreateDataPointRequest dataPoint */ + dataPoint?: (google.devicesandservices.health.v4.IDataPoint|null); + } + + /** Represents a CreateDataPointRequest. */ + class CreateDataPointRequest implements ICreateDataPointRequest { + + /** + * Constructs a new CreateDataPointRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.ICreateDataPointRequest); + + /** CreateDataPointRequest parent. */ + public parent: string; + + /** CreateDataPointRequest dataPoint. */ + public dataPoint?: (google.devicesandservices.health.v4.IDataPoint|null); + + /** + * Creates a new CreateDataPointRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDataPointRequest instance + */ + public static create(properties?: google.devicesandservices.health.v4.ICreateDataPointRequest): google.devicesandservices.health.v4.CreateDataPointRequest; + + /** + * Encodes the specified CreateDataPointRequest message. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointRequest.verify|verify} messages. + * @param message CreateDataPointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.ICreateDataPointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDataPointRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointRequest.verify|verify} messages. + * @param message CreateDataPointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.ICreateDataPointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDataPointRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDataPointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.CreateDataPointRequest; + + /** + * Decodes a CreateDataPointRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDataPointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.CreateDataPointRequest; + + /** + * Verifies a CreateDataPointRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDataPointRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDataPointRequest + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.CreateDataPointRequest; + + /** + * Creates a plain object from a CreateDataPointRequest message. Also converts values to other types if specified. + * @param message CreateDataPointRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.CreateDataPointRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDataPointRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDataPointRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDataPointOperationMetadata. */ + interface ICreateDataPointOperationMetadata { + } + + /** Represents a CreateDataPointOperationMetadata. */ + class CreateDataPointOperationMetadata implements ICreateDataPointOperationMetadata { + + /** + * Constructs a new CreateDataPointOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.ICreateDataPointOperationMetadata); + + /** + * Creates a new CreateDataPointOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDataPointOperationMetadata instance + */ + public static create(properties?: google.devicesandservices.health.v4.ICreateDataPointOperationMetadata): google.devicesandservices.health.v4.CreateDataPointOperationMetadata; + + /** + * Encodes the specified CreateDataPointOperationMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointOperationMetadata.verify|verify} messages. + * @param message CreateDataPointOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.ICreateDataPointOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDataPointOperationMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointOperationMetadata.verify|verify} messages. + * @param message CreateDataPointOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.ICreateDataPointOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDataPointOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDataPointOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.CreateDataPointOperationMetadata; + + /** + * Decodes a CreateDataPointOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDataPointOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.CreateDataPointOperationMetadata; + + /** + * Verifies a CreateDataPointOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDataPointOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDataPointOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.CreateDataPointOperationMetadata; + + /** + * Creates a plain object from a CreateDataPointOperationMetadata message. Also converts values to other types if specified. + * @param message CreateDataPointOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.CreateDataPointOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDataPointOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDataPointOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDataPointRequest. */ + interface IUpdateDataPointRequest { + + /** UpdateDataPointRequest dataPoint */ + dataPoint?: (google.devicesandservices.health.v4.IDataPoint|null); + } + + /** Represents an UpdateDataPointRequest. */ + class UpdateDataPointRequest implements IUpdateDataPointRequest { + + /** + * Constructs a new UpdateDataPointRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IUpdateDataPointRequest); + + /** UpdateDataPointRequest dataPoint. */ + public dataPoint?: (google.devicesandservices.health.v4.IDataPoint|null); + + /** + * Creates a new UpdateDataPointRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDataPointRequest instance + */ + public static create(properties?: google.devicesandservices.health.v4.IUpdateDataPointRequest): google.devicesandservices.health.v4.UpdateDataPointRequest; + + /** + * Encodes the specified UpdateDataPointRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointRequest.verify|verify} messages. + * @param message UpdateDataPointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IUpdateDataPointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDataPointRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointRequest.verify|verify} messages. + * @param message UpdateDataPointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IUpdateDataPointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDataPointRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDataPointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.UpdateDataPointRequest; + + /** + * Decodes an UpdateDataPointRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDataPointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.UpdateDataPointRequest; + + /** + * Verifies an UpdateDataPointRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDataPointRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDataPointRequest + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.UpdateDataPointRequest; + + /** + * Creates a plain object from an UpdateDataPointRequest message. Also converts values to other types if specified. + * @param message UpdateDataPointRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.UpdateDataPointRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDataPointRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDataPointRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDataPointOperationMetadata. */ + interface IUpdateDataPointOperationMetadata { + } + + /** Represents an UpdateDataPointOperationMetadata. */ + class UpdateDataPointOperationMetadata implements IUpdateDataPointOperationMetadata { + + /** + * Constructs a new UpdateDataPointOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata); + + /** + * Creates a new UpdateDataPointOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDataPointOperationMetadata instance + */ + public static create(properties?: google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata): google.devicesandservices.health.v4.UpdateDataPointOperationMetadata; + + /** + * Encodes the specified UpdateDataPointOperationMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointOperationMetadata.verify|verify} messages. + * @param message UpdateDataPointOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDataPointOperationMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointOperationMetadata.verify|verify} messages. + * @param message UpdateDataPointOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDataPointOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDataPointOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.UpdateDataPointOperationMetadata; + + /** + * Decodes an UpdateDataPointOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDataPointOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.UpdateDataPointOperationMetadata; + + /** + * Verifies an UpdateDataPointOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDataPointOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDataPointOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.UpdateDataPointOperationMetadata; + + /** + * Creates a plain object from an UpdateDataPointOperationMetadata message. Also converts values to other types if specified. + * @param message UpdateDataPointOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.UpdateDataPointOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDataPointOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDataPointOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteDataPointsRequest. */ + interface IBatchDeleteDataPointsRequest { + + /** BatchDeleteDataPointsRequest parent */ + parent?: (string|null); + + /** BatchDeleteDataPointsRequest names */ + names?: (string[]|null); + } + + /** Represents a BatchDeleteDataPointsRequest. */ + class BatchDeleteDataPointsRequest implements IBatchDeleteDataPointsRequest { + + /** + * Constructs a new BatchDeleteDataPointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest); + + /** BatchDeleteDataPointsRequest parent. */ + public parent: string; + + /** BatchDeleteDataPointsRequest names. */ + public names: string[]; + + /** + * Creates a new BatchDeleteDataPointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteDataPointsRequest instance + */ + public static create(properties?: google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest): google.devicesandservices.health.v4.BatchDeleteDataPointsRequest; + + /** + * Encodes the specified BatchDeleteDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsRequest.verify|verify} messages. + * @param message BatchDeleteDataPointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsRequest.verify|verify} messages. + * @param message BatchDeleteDataPointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteDataPointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.BatchDeleteDataPointsRequest; + + /** + * Decodes a BatchDeleteDataPointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.BatchDeleteDataPointsRequest; + + /** + * Verifies a BatchDeleteDataPointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteDataPointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.BatchDeleteDataPointsRequest; + + /** + * Creates a plain object from a BatchDeleteDataPointsRequest message. Also converts values to other types if specified. + * @param message BatchDeleteDataPointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.BatchDeleteDataPointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteDataPointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteDataPointsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteDataPointsResponse. */ + interface IBatchDeleteDataPointsResponse { + + /** BatchDeleteDataPointsResponse dataPoints */ + dataPoints?: (google.devicesandservices.health.v4.IDataPoint[]|null); + } + + /** Represents a BatchDeleteDataPointsResponse. */ + class BatchDeleteDataPointsResponse implements IBatchDeleteDataPointsResponse { + + /** + * Constructs a new BatchDeleteDataPointsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse); + + /** BatchDeleteDataPointsResponse dataPoints. */ + public dataPoints: google.devicesandservices.health.v4.IDataPoint[]; + + /** + * Creates a new BatchDeleteDataPointsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteDataPointsResponse instance + */ + public static create(properties?: google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse): google.devicesandservices.health.v4.BatchDeleteDataPointsResponse; + + /** + * Encodes the specified BatchDeleteDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsResponse.verify|verify} messages. + * @param message BatchDeleteDataPointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsResponse.verify|verify} messages. + * @param message BatchDeleteDataPointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteDataPointsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.BatchDeleteDataPointsResponse; + + /** + * Decodes a BatchDeleteDataPointsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.BatchDeleteDataPointsResponse; + + /** + * Verifies a BatchDeleteDataPointsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteDataPointsResponse + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.BatchDeleteDataPointsResponse; + + /** + * Creates a plain object from a BatchDeleteDataPointsResponse message. Also converts values to other types if specified. + * @param message BatchDeleteDataPointsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.BatchDeleteDataPointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteDataPointsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteDataPointsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteDataPointsOperationMetadata. */ + interface IBatchDeleteDataPointsOperationMetadata { + + /** BatchDeleteDataPointsOperationMetadata failedRequests */ + failedRequests?: ({ [k: string]: google.rpc.IStatus }|null); + } + + /** Represents a BatchDeleteDataPointsOperationMetadata. */ + class BatchDeleteDataPointsOperationMetadata implements IBatchDeleteDataPointsOperationMetadata { + + /** + * Constructs a new BatchDeleteDataPointsOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata); + + /** BatchDeleteDataPointsOperationMetadata failedRequests. */ + public failedRequests: { [k: string]: google.rpc.IStatus }; + + /** + * Creates a new BatchDeleteDataPointsOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteDataPointsOperationMetadata instance + */ + public static create(properties?: google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata): google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata; + + /** + * Encodes the specified BatchDeleteDataPointsOperationMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata.verify|verify} messages. + * @param message BatchDeleteDataPointsOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteDataPointsOperationMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata.verify|verify} messages. + * @param message BatchDeleteDataPointsOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteDataPointsOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteDataPointsOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata; + + /** + * Decodes a BatchDeleteDataPointsOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteDataPointsOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata; + + /** + * Verifies a BatchDeleteDataPointsOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteDataPointsOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteDataPointsOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata; + + /** + * Creates a plain object from a BatchDeleteDataPointsOperationMetadata message. Also converts values to other types if specified. + * @param message BatchDeleteDataPointsOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteDataPointsOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteDataPointsOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReconcileDataPointsRequest. */ + interface IReconcileDataPointsRequest { + + /** ReconcileDataPointsRequest parent */ + parent?: (string|null); + + /** ReconcileDataPointsRequest pageSize */ + pageSize?: (number|null); + + /** ReconcileDataPointsRequest pageToken */ + pageToken?: (string|null); + + /** ReconcileDataPointsRequest filter */ + filter?: (string|null); + + /** ReconcileDataPointsRequest dataSourceFamily */ + dataSourceFamily?: (string|null); + } + + /** Represents a ReconcileDataPointsRequest. */ + class ReconcileDataPointsRequest implements IReconcileDataPointsRequest { + + /** + * Constructs a new ReconcileDataPointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IReconcileDataPointsRequest); + + /** ReconcileDataPointsRequest parent. */ + public parent: string; + + /** ReconcileDataPointsRequest pageSize. */ + public pageSize: number; + + /** ReconcileDataPointsRequest pageToken. */ + public pageToken: string; + + /** ReconcileDataPointsRequest filter. */ + public filter: string; + + /** ReconcileDataPointsRequest dataSourceFamily. */ + public dataSourceFamily: string; + + /** + * Creates a new ReconcileDataPointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReconcileDataPointsRequest instance + */ + public static create(properties?: google.devicesandservices.health.v4.IReconcileDataPointsRequest): google.devicesandservices.health.v4.ReconcileDataPointsRequest; + + /** + * Encodes the specified ReconcileDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsRequest.verify|verify} messages. + * @param message ReconcileDataPointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IReconcileDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReconcileDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsRequest.verify|verify} messages. + * @param message ReconcileDataPointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IReconcileDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReconcileDataPointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReconcileDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ReconcileDataPointsRequest; + + /** + * Decodes a ReconcileDataPointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReconcileDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ReconcileDataPointsRequest; + + /** + * Verifies a ReconcileDataPointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReconcileDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReconcileDataPointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ReconcileDataPointsRequest; + + /** + * Creates a plain object from a ReconcileDataPointsRequest message. Also converts values to other types if specified. + * @param message ReconcileDataPointsRequest + * @param [options] Conversion options + * @returns Plain object */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.VO2Max; + public static toObject(message: google.devicesandservices.health.v4.ReconcileDataPointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Verifies a VO2Max message. + * Converts this ReconcileDataPointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReconcileDataPointsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReconcileDataPointsResponse. */ + interface IReconcileDataPointsResponse { + + /** ReconcileDataPointsResponse dataPoints */ + dataPoints?: (google.devicesandservices.health.v4.IReconciledDataPoint[]|null); + + /** ReconcileDataPointsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ReconcileDataPointsResponse. */ + class ReconcileDataPointsResponse implements IReconcileDataPointsResponse { + + /** + * Constructs a new ReconcileDataPointsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IReconcileDataPointsResponse); + + /** ReconcileDataPointsResponse dataPoints. */ + public dataPoints: google.devicesandservices.health.v4.IReconciledDataPoint[]; + + /** ReconcileDataPointsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ReconcileDataPointsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReconcileDataPointsResponse instance + */ + public static create(properties?: google.devicesandservices.health.v4.IReconcileDataPointsResponse): google.devicesandservices.health.v4.ReconcileDataPointsResponse; + + /** + * Encodes the specified ReconcileDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsResponse.verify|verify} messages. + * @param message ReconcileDataPointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IReconcileDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReconcileDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsResponse.verify|verify} messages. + * @param message ReconcileDataPointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IReconcileDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReconcileDataPointsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReconcileDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ReconcileDataPointsResponse; + + /** + * Decodes a ReconcileDataPointsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReconcileDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ReconcileDataPointsResponse; + + /** + * Verifies a ReconcileDataPointsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a VO2Max message from a plain object. Also converts values to their respective internal types. + * Creates a ReconcileDataPointsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VO2Max + * @returns ReconcileDataPointsResponse */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.VO2Max; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ReconcileDataPointsResponse; /** - * Creates a plain object from a VO2Max message. Also converts values to other types if specified. - * @param message VO2Max + * Creates a plain object from a ReconcileDataPointsResponse message. Also converts values to other types if specified. + * @param message ReconcileDataPointsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.VO2Max, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.ReconcileDataPointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VO2Max to JSON. + * Converts this ReconcileDataPointsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for VO2Max + * Gets the default type url for ReconcileDataPointsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace VO2Max { + /** Properties of a RollUpDataPointsRequest. */ + interface IRollUpDataPointsRequest { - /** MeasurementMethod enum. */ - enum MeasurementMethod { - MEASUREMENT_METHOD_UNSPECIFIED = 0, - FITBIT_RUN = 1, - GOOGLE_DEMOGRAPHIC = 2, - COOPER_TEST = 3, - HEART_RATE_RATIO = 4, - METABOLIC_CART = 5, - MULTISTAGE_FITNESS_TEST = 6, - ROCKPORT_FITNESS_TEST = 7, - MAX_EXERCISE = 8, - PREDICTION_SUB_MAX_EXERCISE = 9, - PREDICTION_NON_EXERCISE = 10, - OTHER = 11 - } + /** RollUpDataPointsRequest parent */ + parent?: (string|null); + + /** RollUpDataPointsRequest range */ + range?: (google.type.IInterval|null); + + /** RollUpDataPointsRequest windowSize */ + windowSize?: (google.protobuf.IDuration|null); + + /** RollUpDataPointsRequest pageSize */ + pageSize?: (number|null); + + /** RollUpDataPointsRequest pageToken */ + pageToken?: (string|null); + + /** RollUpDataPointsRequest dataSourceFamily */ + dataSourceFamily?: (string|null); } - /** Properties of a Weight. */ - interface IWeight { + /** Represents a RollUpDataPointsRequest. */ + class RollUpDataPointsRequest implements IRollUpDataPointsRequest { - /** Weight sampleTime */ - sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + /** + * Constructs a new RollUpDataPointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IRollUpDataPointsRequest); - /** Weight weightGrams */ - weightGrams?: (number|null); + /** RollUpDataPointsRequest parent. */ + public parent: string; + + /** RollUpDataPointsRequest range. */ + public range?: (google.type.IInterval|null); + + /** RollUpDataPointsRequest windowSize. */ + public windowSize?: (google.protobuf.IDuration|null); + + /** RollUpDataPointsRequest pageSize. */ + public pageSize: number; + + /** RollUpDataPointsRequest pageToken. */ + public pageToken: string; + + /** RollUpDataPointsRequest dataSourceFamily. */ + public dataSourceFamily: string; + + /** + * Creates a new RollUpDataPointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RollUpDataPointsRequest instance + */ + public static create(properties?: google.devicesandservices.health.v4.IRollUpDataPointsRequest): google.devicesandservices.health.v4.RollUpDataPointsRequest; + + /** + * Encodes the specified RollUpDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsRequest.verify|verify} messages. + * @param message RollUpDataPointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IRollUpDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RollUpDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsRequest.verify|verify} messages. + * @param message RollUpDataPointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IRollUpDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RollUpDataPointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RollUpDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.RollUpDataPointsRequest; + + /** + * Decodes a RollUpDataPointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RollUpDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.RollUpDataPointsRequest; + + /** + * Verifies a RollUpDataPointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RollUpDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RollUpDataPointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.RollUpDataPointsRequest; + + /** + * Creates a plain object from a RollUpDataPointsRequest message. Also converts values to other types if specified. + * @param message RollUpDataPointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.RollUpDataPointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RollUpDataPointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RollUpDataPointsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RollUpDataPointsResponse. */ + interface IRollUpDataPointsResponse { + + /** RollUpDataPointsResponse rollupDataPoints */ + rollupDataPoints?: (google.devicesandservices.health.v4.IRollupDataPoint[]|null); - /** Weight notes */ - notes?: (string|null); + /** RollUpDataPointsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a Weight. */ - class Weight implements IWeight { + /** Represents a RollUpDataPointsResponse. */ + class RollUpDataPointsResponse implements IRollUpDataPointsResponse { /** - * Constructs a new Weight. + * Constructs a new RollUpDataPointsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IWeight); - - /** Weight sampleTime. */ - public sampleTime?: (google.devicesandservices.health.v4.IObservationSampleTime|null); + constructor(properties?: google.devicesandservices.health.v4.IRollUpDataPointsResponse); - /** Weight weightGrams. */ - public weightGrams: number; + /** RollUpDataPointsResponse rollupDataPoints. */ + public rollupDataPoints: google.devicesandservices.health.v4.IRollupDataPoint[]; - /** Weight notes. */ - public notes: string; + /** RollUpDataPointsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new Weight instance using the specified properties. + * Creates a new RollUpDataPointsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Weight instance + * @returns RollUpDataPointsResponse instance */ - public static create(properties?: google.devicesandservices.health.v4.IWeight): google.devicesandservices.health.v4.Weight; + public static create(properties?: google.devicesandservices.health.v4.IRollUpDataPointsResponse): google.devicesandservices.health.v4.RollUpDataPointsResponse; /** - * Encodes the specified Weight message. Does not implicitly {@link google.devicesandservices.health.v4.Weight.verify|verify} messages. - * @param message Weight message or plain object to encode + * Encodes the specified RollUpDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsResponse.verify|verify} messages. + * @param message RollUpDataPointsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IWeight, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IRollUpDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Weight message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Weight.verify|verify} messages. - * @param message Weight message or plain object to encode + * Encodes the specified RollUpDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsResponse.verify|verify} messages. + * @param message RollUpDataPointsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IWeight, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IRollUpDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Weight message from the specified reader or buffer. + * Decodes a RollUpDataPointsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Weight + * @returns RollUpDataPointsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Weight; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.RollUpDataPointsResponse; /** - * Decodes a Weight message from the specified reader or buffer, length delimited. + * Decodes a RollUpDataPointsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Weight + * @returns RollUpDataPointsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Weight; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.RollUpDataPointsResponse; /** - * Verifies a Weight message. + * Verifies a RollUpDataPointsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Weight message from a plain object. Also converts values to their respective internal types. + * Creates a RollUpDataPointsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Weight + * @returns RollUpDataPointsResponse */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Weight; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.RollUpDataPointsResponse; /** - * Creates a plain object from a Weight message. Also converts values to other types if specified. - * @param message Weight + * Creates a plain object from a RollUpDataPointsResponse message. Also converts values to other types if specified. + * @param message RollUpDataPointsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.Weight, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.RollUpDataPointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Weight to JSON. + * Converts this RollUpDataPointsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Weight + * Gets the default type url for RollUpDataPointsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WeightRollupValue. */ - interface IWeightRollupValue { + /** Properties of a DailyRollUpDataPointsRequest. */ + interface IDailyRollUpDataPointsRequest { - /** WeightRollupValue weightGramsAvg */ - weightGramsAvg?: (number|null); + /** DailyRollUpDataPointsRequest parent */ + parent?: (string|null); + + /** DailyRollUpDataPointsRequest range */ + range?: (google.devicesandservices.health.v4.ICivilTimeInterval|null); + + /** DailyRollUpDataPointsRequest windowSizeDays */ + windowSizeDays?: (number|null); + + /** DailyRollUpDataPointsRequest pageSize */ + pageSize?: (number|null); + + /** DailyRollUpDataPointsRequest pageToken */ + pageToken?: (string|null); + + /** DailyRollUpDataPointsRequest dataSourceFamily */ + dataSourceFamily?: (string|null); } - /** Represents a WeightRollupValue. */ - class WeightRollupValue implements IWeightRollupValue { + /** Represents a DailyRollUpDataPointsRequest. */ + class DailyRollUpDataPointsRequest implements IDailyRollUpDataPointsRequest { /** - * Constructs a new WeightRollupValue. + * Constructs a new DailyRollUpDataPointsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IWeightRollupValue); + constructor(properties?: google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest); - /** WeightRollupValue weightGramsAvg. */ - public weightGramsAvg: number; + /** DailyRollUpDataPointsRequest parent. */ + public parent: string; + + /** DailyRollUpDataPointsRequest range. */ + public range?: (google.devicesandservices.health.v4.ICivilTimeInterval|null); + + /** DailyRollUpDataPointsRequest windowSizeDays. */ + public windowSizeDays: number; + + /** DailyRollUpDataPointsRequest pageSize. */ + public pageSize: number; + + /** DailyRollUpDataPointsRequest pageToken. */ + public pageToken: string; + + /** DailyRollUpDataPointsRequest dataSourceFamily. */ + public dataSourceFamily: string; /** - * Creates a new WeightRollupValue instance using the specified properties. + * Creates a new DailyRollUpDataPointsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns WeightRollupValue instance + * @returns DailyRollUpDataPointsRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.IWeightRollupValue): google.devicesandservices.health.v4.WeightRollupValue; + public static create(properties?: google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest): google.devicesandservices.health.v4.DailyRollUpDataPointsRequest; /** - * Encodes the specified WeightRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.WeightRollupValue.verify|verify} messages. - * @param message WeightRollupValue message or plain object to encode + * Encodes the specified DailyRollUpDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsRequest.verify|verify} messages. + * @param message DailyRollUpDataPointsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IWeightRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WeightRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.WeightRollupValue.verify|verify} messages. - * @param message WeightRollupValue message or plain object to encode + * Encodes the specified DailyRollUpDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsRequest.verify|verify} messages. + * @param message DailyRollUpDataPointsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IWeightRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WeightRollupValue message from the specified reader or buffer. + * Decodes a DailyRollUpDataPointsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WeightRollupValue + * @returns DailyRollUpDataPointsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.WeightRollupValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DailyRollUpDataPointsRequest; /** - * Decodes a WeightRollupValue message from the specified reader or buffer, length delimited. + * Decodes a DailyRollUpDataPointsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WeightRollupValue + * @returns DailyRollUpDataPointsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.WeightRollupValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DailyRollUpDataPointsRequest; /** - * Verifies a WeightRollupValue message. + * Verifies a DailyRollUpDataPointsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WeightRollupValue message from a plain object. Also converts values to their respective internal types. + * Creates a DailyRollUpDataPointsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WeightRollupValue + * @returns DailyRollUpDataPointsRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.WeightRollupValue; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DailyRollUpDataPointsRequest; /** - * Creates a plain object from a WeightRollupValue message. Also converts values to other types if specified. - * @param message WeightRollupValue + * Creates a plain object from a DailyRollUpDataPointsRequest message. Also converts values to other types if specified. + * @param message DailyRollUpDataPointsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.WeightRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.DailyRollUpDataPointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WeightRollupValue to JSON. + * Converts this DailyRollUpDataPointsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WeightRollupValue + * Gets the default type url for DailyRollUpDataPointsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SedentaryPeriod. */ - interface ISedentaryPeriod { + /** Properties of a DailyRollUpDataPointsResponse. */ + interface IDailyRollUpDataPointsResponse { - /** SedentaryPeriod interval */ - interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + /** DailyRollUpDataPointsResponse rollupDataPoints */ + rollupDataPoints?: (google.devicesandservices.health.v4.IDailyRollupDataPoint[]|null); } - /** Represents a SedentaryPeriod. */ - class SedentaryPeriod implements ISedentaryPeriod { + /** Represents a DailyRollUpDataPointsResponse. */ + class DailyRollUpDataPointsResponse implements IDailyRollUpDataPointsResponse { /** - * Constructs a new SedentaryPeriod. + * Constructs a new DailyRollUpDataPointsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.ISedentaryPeriod); + constructor(properties?: google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse); - /** SedentaryPeriod interval. */ - public interval?: (google.devicesandservices.health.v4.IObservationTimeInterval|null); + /** DailyRollUpDataPointsResponse rollupDataPoints. */ + public rollupDataPoints: google.devicesandservices.health.v4.IDailyRollupDataPoint[]; /** - * Creates a new SedentaryPeriod instance using the specified properties. + * Creates a new DailyRollUpDataPointsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns SedentaryPeriod instance + * @returns DailyRollUpDataPointsResponse instance */ - public static create(properties?: google.devicesandservices.health.v4.ISedentaryPeriod): google.devicesandservices.health.v4.SedentaryPeriod; + public static create(properties?: google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse): google.devicesandservices.health.v4.DailyRollUpDataPointsResponse; /** - * Encodes the specified SedentaryPeriod message. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriod.verify|verify} messages. - * @param message SedentaryPeriod message or plain object to encode + * Encodes the specified DailyRollUpDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsResponse.verify|verify} messages. + * @param message DailyRollUpDataPointsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.ISedentaryPeriod, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SedentaryPeriod message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriod.verify|verify} messages. - * @param message SedentaryPeriod message or plain object to encode + * Encodes the specified DailyRollUpDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsResponse.verify|verify} messages. + * @param message DailyRollUpDataPointsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.ISedentaryPeriod, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SedentaryPeriod message from the specified reader or buffer. + * Decodes a DailyRollUpDataPointsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SedentaryPeriod + * @returns DailyRollUpDataPointsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.SedentaryPeriod; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DailyRollUpDataPointsResponse; /** - * Decodes a SedentaryPeriod message from the specified reader or buffer, length delimited. + * Decodes a DailyRollUpDataPointsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SedentaryPeriod + * @returns DailyRollUpDataPointsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.SedentaryPeriod; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DailyRollUpDataPointsResponse; /** - * Verifies a SedentaryPeriod message. + * Verifies a DailyRollUpDataPointsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SedentaryPeriod message from a plain object. Also converts values to their respective internal types. + * Creates a DailyRollUpDataPointsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SedentaryPeriod + * @returns DailyRollUpDataPointsResponse */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.SedentaryPeriod; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DailyRollUpDataPointsResponse; /** - * Creates a plain object from a SedentaryPeriod message. Also converts values to other types if specified. - * @param message SedentaryPeriod + * Creates a plain object from a DailyRollUpDataPointsResponse message. Also converts values to other types if specified. + * @param message DailyRollUpDataPointsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.SedentaryPeriod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.DailyRollUpDataPointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SedentaryPeriod to JSON. + * Converts this DailyRollUpDataPointsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SedentaryPeriod + * Gets the default type url for DailyRollUpDataPointsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SedentaryPeriodRollupValue. */ - interface ISedentaryPeriodRollupValue { + /** Properties of a DataType. */ + interface IDataType { - /** SedentaryPeriodRollupValue durationSum */ - durationSum?: (google.protobuf.IDuration|null); + /** DataType name */ + name?: (string|null); } - /** Represents a SedentaryPeriodRollupValue. */ - class SedentaryPeriodRollupValue implements ISedentaryPeriodRollupValue { + /** Represents a DataType. */ + class DataType implements IDataType { /** - * Constructs a new SedentaryPeriodRollupValue. + * Constructs a new DataType. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.ISedentaryPeriodRollupValue); + constructor(properties?: google.devicesandservices.health.v4.IDataType); - /** SedentaryPeriodRollupValue durationSum. */ - public durationSum?: (google.protobuf.IDuration|null); + /** DataType name. */ + public name: string; /** - * Creates a new SedentaryPeriodRollupValue instance using the specified properties. + * Creates a new DataType instance using the specified properties. * @param [properties] Properties to set - * @returns SedentaryPeriodRollupValue instance + * @returns DataType instance */ - public static create(properties?: google.devicesandservices.health.v4.ISedentaryPeriodRollupValue): google.devicesandservices.health.v4.SedentaryPeriodRollupValue; + public static create(properties?: google.devicesandservices.health.v4.IDataType): google.devicesandservices.health.v4.DataType; /** - * Encodes the specified SedentaryPeriodRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriodRollupValue.verify|verify} messages. - * @param message SedentaryPeriodRollupValue message or plain object to encode + * Encodes the specified DataType message. Does not implicitly {@link google.devicesandservices.health.v4.DataType.verify|verify} messages. + * @param message DataType message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.ISedentaryPeriodRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IDataType, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SedentaryPeriodRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriodRollupValue.verify|verify} messages. - * @param message SedentaryPeriodRollupValue message or plain object to encode + * Encodes the specified DataType message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataType.verify|verify} messages. + * @param message DataType message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.ISedentaryPeriodRollupValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IDataType, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SedentaryPeriodRollupValue message from the specified reader or buffer. + * Decodes a DataType message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SedentaryPeriodRollupValue + * @returns DataType * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.SedentaryPeriodRollupValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DataType; /** - * Decodes a SedentaryPeriodRollupValue message from the specified reader or buffer, length delimited. + * Decodes a DataType message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SedentaryPeriodRollupValue + * @returns DataType * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.SedentaryPeriodRollupValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DataType; /** - * Verifies a SedentaryPeriodRollupValue message. + * Verifies a DataType message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SedentaryPeriodRollupValue message from a plain object. Also converts values to their respective internal types. + * Creates a DataType message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SedentaryPeriodRollupValue + * @returns DataType */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.SedentaryPeriodRollupValue; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DataType; /** - * Creates a plain object from a SedentaryPeriodRollupValue message. Also converts values to other types if specified. - * @param message SedentaryPeriodRollupValue + * Creates a plain object from a DataType message. Also converts values to other types if specified. + * @param message DataType * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.SedentaryPeriodRollupValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.DataType, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SedentaryPeriodRollupValue to JSON. + * Converts this DataType to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SedentaryPeriodRollupValue + * Gets the default type url for DataType * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Represents a DataPointsService */ - class DataPointsService extends $protobuf.rpc.Service { + /** Properties of an ExportExerciseTcxRequest. */ + interface IExportExerciseTcxRequest { - /** - * Constructs a new DataPointsService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** ExportExerciseTcxRequest name */ + name?: (string|null); - /** - * Creates new DataPointsService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): DataPointsService; + /** ExportExerciseTcxRequest partialData */ + partialData?: (boolean|null); + } - /** - * Calls GetDataPoint. - * @param request GetDataPointRequest message or plain object - * @param callback Node-style callback called with the error, if any, and DataPoint - */ - public getDataPoint(request: google.devicesandservices.health.v4.IGetDataPointRequest, callback: google.devicesandservices.health.v4.DataPointsService.GetDataPointCallback): void; + /** Represents an ExportExerciseTcxRequest. */ + class ExportExerciseTcxRequest implements IExportExerciseTcxRequest { /** - * Calls GetDataPoint. - * @param request GetDataPointRequest message or plain object - * @returns Promise + * Constructs a new ExportExerciseTcxRequest. + * @param [properties] Properties to set */ - public getDataPoint(request: google.devicesandservices.health.v4.IGetDataPointRequest): Promise; + constructor(properties?: google.devicesandservices.health.v4.IExportExerciseTcxRequest); - /** - * Calls ListDataPoints. - * @param request ListDataPointsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDataPointsResponse - */ - public listDataPoints(request: google.devicesandservices.health.v4.IListDataPointsRequest, callback: google.devicesandservices.health.v4.DataPointsService.ListDataPointsCallback): void; + /** ExportExerciseTcxRequest name. */ + public name: string; - /** - * Calls ListDataPoints. - * @param request ListDataPointsRequest message or plain object - * @returns Promise - */ - public listDataPoints(request: google.devicesandservices.health.v4.IListDataPointsRequest): Promise; + /** ExportExerciseTcxRequest partialData. */ + public partialData: boolean; /** - * Calls CreateDataPoint. - * @param request CreateDataPointRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a new ExportExerciseTcxRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportExerciseTcxRequest instance */ - public createDataPoint(request: google.devicesandservices.health.v4.ICreateDataPointRequest, callback: google.devicesandservices.health.v4.DataPointsService.CreateDataPointCallback): void; + public static create(properties?: google.devicesandservices.health.v4.IExportExerciseTcxRequest): google.devicesandservices.health.v4.ExportExerciseTcxRequest; /** - * Calls CreateDataPoint. - * @param request CreateDataPointRequest message or plain object - * @returns Promise + * Encodes the specified ExportExerciseTcxRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxRequest.verify|verify} messages. + * @param message ExportExerciseTcxRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createDataPoint(request: google.devicesandservices.health.v4.ICreateDataPointRequest): Promise; + public static encode(message: google.devicesandservices.health.v4.IExportExerciseTcxRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateDataPoint. - * @param request UpdateDataPointRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified ExportExerciseTcxRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxRequest.verify|verify} messages. + * @param message ExportExerciseTcxRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateDataPoint(request: google.devicesandservices.health.v4.IUpdateDataPointRequest, callback: google.devicesandservices.health.v4.DataPointsService.UpdateDataPointCallback): void; + public static encodeDelimited(message: google.devicesandservices.health.v4.IExportExerciseTcxRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateDataPoint. - * @param request UpdateDataPointRequest message or plain object - * @returns Promise + * Decodes an ExportExerciseTcxRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportExerciseTcxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateDataPoint(request: google.devicesandservices.health.v4.IUpdateDataPointRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ExportExerciseTcxRequest; /** - * Calls BatchDeleteDataPoints. - * @param request BatchDeleteDataPointsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes an ExportExerciseTcxRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportExerciseTcxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public batchDeleteDataPoints(request: google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest, callback: google.devicesandservices.health.v4.DataPointsService.BatchDeleteDataPointsCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ExportExerciseTcxRequest; /** - * Calls BatchDeleteDataPoints. - * @param request BatchDeleteDataPointsRequest message or plain object - * @returns Promise + * Verifies an ExportExerciseTcxRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public batchDeleteDataPoints(request: google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ReconcileDataPoints. - * @param request ReconcileDataPointsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ReconcileDataPointsResponse + * Creates an ExportExerciseTcxRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportExerciseTcxRequest */ - public reconcileDataPoints(request: google.devicesandservices.health.v4.IReconcileDataPointsRequest, callback: google.devicesandservices.health.v4.DataPointsService.ReconcileDataPointsCallback): void; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ExportExerciseTcxRequest; /** - * Calls ReconcileDataPoints. - * @param request ReconcileDataPointsRequest message or plain object - * @returns Promise + * Creates a plain object from an ExportExerciseTcxRequest message. Also converts values to other types if specified. + * @param message ExportExerciseTcxRequest + * @param [options] Conversion options + * @returns Plain object */ - public reconcileDataPoints(request: google.devicesandservices.health.v4.IReconcileDataPointsRequest): Promise; + public static toObject(message: google.devicesandservices.health.v4.ExportExerciseTcxRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls RollUpDataPoints. - * @param request RollUpDataPointsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RollUpDataPointsResponse + * Converts this ExportExerciseTcxRequest to JSON. + * @returns JSON object */ - public rollUpDataPoints(request: google.devicesandservices.health.v4.IRollUpDataPointsRequest, callback: google.devicesandservices.health.v4.DataPointsService.RollUpDataPointsCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls RollUpDataPoints. - * @param request RollUpDataPointsRequest message or plain object - * @returns Promise + * Gets the default type url for ExportExerciseTcxRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public rollUpDataPoints(request: google.devicesandservices.health.v4.IRollUpDataPointsRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Calls DailyRollUpDataPoints. - * @param request DailyRollUpDataPointsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and DailyRollUpDataPointsResponse - */ - public dailyRollUpDataPoints(request: google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest, callback: google.devicesandservices.health.v4.DataPointsService.DailyRollUpDataPointsCallback): void; + /** Properties of an ExportExerciseTcxResponse. */ + interface IExportExerciseTcxResponse { - /** - * Calls DailyRollUpDataPoints. - * @param request DailyRollUpDataPointsRequest message or plain object - * @returns Promise - */ - public dailyRollUpDataPoints(request: google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest): Promise; + /** ExportExerciseTcxResponse tcxData */ + tcxData?: (string|null); + } + + /** Represents an ExportExerciseTcxResponse. */ + class ExportExerciseTcxResponse implements IExportExerciseTcxResponse { /** - * Calls ExportExerciseTcx. - * @param request ExportExerciseTcxRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ExportExerciseTcxResponse + * Constructs a new ExportExerciseTcxResponse. + * @param [properties] Properties to set */ - public exportExerciseTcx(request: google.devicesandservices.health.v4.IExportExerciseTcxRequest, callback: google.devicesandservices.health.v4.DataPointsService.ExportExerciseTcxCallback): void; + constructor(properties?: google.devicesandservices.health.v4.IExportExerciseTcxResponse); + + /** ExportExerciseTcxResponse tcxData. */ + public tcxData: string; /** - * Calls ExportExerciseTcx. - * @param request ExportExerciseTcxRequest message or plain object - * @returns Promise + * Creates a new ExportExerciseTcxResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportExerciseTcxResponse instance */ - public exportExerciseTcx(request: google.devicesandservices.health.v4.IExportExerciseTcxRequest): Promise; - } - - namespace DataPointsService { + public static create(properties?: google.devicesandservices.health.v4.IExportExerciseTcxResponse): google.devicesandservices.health.v4.ExportExerciseTcxResponse; /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|getDataPoint}. - * @param error Error, if any - * @param [response] DataPoint + * Encodes the specified ExportExerciseTcxResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxResponse.verify|verify} messages. + * @param message ExportExerciseTcxResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetDataPointCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.DataPoint) => void; + public static encode(message: google.devicesandservices.health.v4.IExportExerciseTcxResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|listDataPoints}. - * @param error Error, if any - * @param [response] ListDataPointsResponse + * Encodes the specified ExportExerciseTcxResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxResponse.verify|verify} messages. + * @param message ExportExerciseTcxResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ListDataPointsCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.ListDataPointsResponse) => void; + public static encodeDelimited(message: google.devicesandservices.health.v4.IExportExerciseTcxResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|createDataPoint}. - * @param error Error, if any - * @param [response] Operation + * Decodes an ExportExerciseTcxResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportExerciseTcxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type CreateDataPointCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ExportExerciseTcxResponse; /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|updateDataPoint}. - * @param error Error, if any - * @param [response] Operation + * Decodes an ExportExerciseTcxResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportExerciseTcxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type UpdateDataPointCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ExportExerciseTcxResponse; /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|batchDeleteDataPoints}. - * @param error Error, if any - * @param [response] Operation + * Verifies an ExportExerciseTcxResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type BatchDeleteDataPointsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|reconcileDataPoints}. - * @param error Error, if any - * @param [response] ReconcileDataPointsResponse + * Creates an ExportExerciseTcxResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportExerciseTcxResponse */ - type ReconcileDataPointsCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.ReconcileDataPointsResponse) => void; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ExportExerciseTcxResponse; /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|rollUpDataPoints}. - * @param error Error, if any - * @param [response] RollUpDataPointsResponse + * Creates a plain object from an ExportExerciseTcxResponse message. Also converts values to other types if specified. + * @param message ExportExerciseTcxResponse + * @param [options] Conversion options + * @returns Plain object */ - type RollUpDataPointsCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.RollUpDataPointsResponse) => void; + public static toObject(message: google.devicesandservices.health.v4.ExportExerciseTcxResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|dailyRollUpDataPoints}. - * @param error Error, if any - * @param [response] DailyRollUpDataPointsResponse + * Converts this ExportExerciseTcxResponse to JSON. + * @returns JSON object */ - type DailyRollUpDataPointsCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.DailyRollUpDataPointsResponse) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|exportExerciseTcx}. - * @param error Error, if any - * @param [response] ExportExerciseTcxResponse + * Gets the default type url for ExportExerciseTcxResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type ExportExerciseTcxCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.ExportExerciseTcxResponse) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DataPoint. */ - interface IDataPoint { - - /** DataPoint steps */ - steps?: (google.devicesandservices.health.v4.ISteps|null); - - /** DataPoint floors */ - floors?: (google.devicesandservices.health.v4.IFloors|null); + /** Properties of a DataSource. */ + interface IDataSource { - /** DataPoint heartRate */ - heartRate?: (google.devicesandservices.health.v4.IHeartRate|null); + /** DataSource recordingMethod */ + recordingMethod?: (google.devicesandservices.health.v4.DataSource.RecordingMethod|keyof typeof google.devicesandservices.health.v4.DataSource.RecordingMethod|null); - /** DataPoint sleep */ - sleep?: (google.devicesandservices.health.v4.ISleep|null); + /** DataSource device */ + device?: (google.devicesandservices.health.v4.DataSource.IDevice|null); - /** DataPoint dailyRestingHeartRate */ - dailyRestingHeartRate?: (google.devicesandservices.health.v4.IDailyRestingHeartRate|null); + /** DataSource application */ + application?: (google.devicesandservices.health.v4.DataSource.IApplication|null); - /** DataPoint dailyHeartRateVariability */ - dailyHeartRateVariability?: (google.devicesandservices.health.v4.IDailyHeartRateVariability|null); + /** DataSource platform */ + platform?: (google.devicesandservices.health.v4.DataSource.Platform|keyof typeof google.devicesandservices.health.v4.DataSource.Platform|null); + } - /** DataPoint exercise */ - exercise?: (google.devicesandservices.health.v4.IExercise|null); + /** Represents a DataSource. */ + class DataSource implements IDataSource { - /** DataPoint weight */ - weight?: (google.devicesandservices.health.v4.IWeight|null); + /** + * Constructs a new DataSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IDataSource); - /** DataPoint altitude */ - altitude?: (google.devicesandservices.health.v4.IAltitude|null); + /** DataSource recordingMethod. */ + public recordingMethod: (google.devicesandservices.health.v4.DataSource.RecordingMethod|keyof typeof google.devicesandservices.health.v4.DataSource.RecordingMethod); - /** DataPoint distance */ - distance?: (google.devicesandservices.health.v4.IDistance|null); + /** DataSource device. */ + public device?: (google.devicesandservices.health.v4.DataSource.IDevice|null); - /** DataPoint bodyFat */ - bodyFat?: (google.devicesandservices.health.v4.IBodyFat|null); + /** DataSource application. */ + public application?: (google.devicesandservices.health.v4.DataSource.IApplication|null); - /** DataPoint activeZoneMinutes */ - activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutes|null); + /** DataSource platform. */ + public platform: (google.devicesandservices.health.v4.DataSource.Platform|keyof typeof google.devicesandservices.health.v4.DataSource.Platform); - /** DataPoint heartRateVariability */ - heartRateVariability?: (google.devicesandservices.health.v4.IHeartRateVariability|null); + /** + * Creates a new DataSource instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSource instance + */ + public static create(properties?: google.devicesandservices.health.v4.IDataSource): google.devicesandservices.health.v4.DataSource; - /** DataPoint dailySleepTemperatureDerivations */ - dailySleepTemperatureDerivations?: (google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null); + /** + * Encodes the specified DataSource message. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.verify|verify} messages. + * @param message DataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** DataPoint sedentaryPeriod */ - sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriod|null); + /** + * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.verify|verify} messages. + * @param message DataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** DataPoint runVo2Max */ - runVo2Max?: (google.devicesandservices.health.v4.IRunVO2Max|null); + /** + * Decodes a DataSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DataSource; - /** DataPoint oxygenSaturation */ - oxygenSaturation?: (google.devicesandservices.health.v4.IOxygenSaturation|null); + /** + * Decodes a DataSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DataSource; - /** DataPoint dailyOxygenSaturation */ - dailyOxygenSaturation?: (google.devicesandservices.health.v4.IDailyOxygenSaturation|null); + /** + * Verifies a DataSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** DataPoint activityLevel */ - activityLevel?: (google.devicesandservices.health.v4.IActivityLevel|null); + /** + * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSource + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DataSource; - /** DataPoint vo2Max */ - vo2Max?: (google.devicesandservices.health.v4.IVO2Max|null); + /** + * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * @param message DataSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.DataSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** DataPoint dailyVo2Max */ - dailyVo2Max?: (google.devicesandservices.health.v4.IDailyVO2Max|null); + /** + * Converts this DataSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** DataPoint dailyHeartRateZones */ - dailyHeartRateZones?: (google.devicesandservices.health.v4.IDailyHeartRateZones|null); + /** + * Gets the default type url for DataSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** DataPoint hydrationLog */ - hydrationLog?: (google.devicesandservices.health.v4.IHydrationLog|null); + namespace DataSource { - /** DataPoint timeInHeartRateZone */ - timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZone|null); + /** Properties of a Device. */ + interface IDevice { - /** DataPoint activeMinutes */ - activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutes|null); + /** Device formFactor */ + formFactor?: (google.devicesandservices.health.v4.DataSource.Device.FormFactor|keyof typeof google.devicesandservices.health.v4.DataSource.Device.FormFactor|null); - /** DataPoint respiratoryRateSleepSummary */ - respiratoryRateSleepSummary?: (google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null); + /** Device manufacturer */ + manufacturer?: (string|null); - /** DataPoint dailyRespiratoryRate */ - dailyRespiratoryRate?: (google.devicesandservices.health.v4.IDailyRespiratoryRate|null); + /** Device displayName */ + displayName?: (string|null); + } - /** DataPoint swimLengthsData */ - swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsData|null); + /** Represents a Device. */ + class Device implements IDevice { - /** DataPoint height */ - height?: (google.devicesandservices.health.v4.IHeight|null); + /** + * Constructs a new Device. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.DataSource.IDevice); - /** DataPoint basalEnergyBurned */ - basalEnergyBurned?: (google.devicesandservices.health.v4.IBasalEnergyBurned|null); + /** Device formFactor. */ + public formFactor: (google.devicesandservices.health.v4.DataSource.Device.FormFactor|keyof typeof google.devicesandservices.health.v4.DataSource.Device.FormFactor); - /** DataPoint name */ - name?: (string|null); + /** Device manufacturer. */ + public manufacturer: string; - /** DataPoint dataSource */ - dataSource?: (google.devicesandservices.health.v4.IDataSource|null); - } + /** Device displayName. */ + public displayName: string; - /** Represents a DataPoint. */ - class DataPoint implements IDataPoint { + /** + * Creates a new Device instance using the specified properties. + * @param [properties] Properties to set + * @returns Device instance + */ + public static create(properties?: google.devicesandservices.health.v4.DataSource.IDevice): google.devicesandservices.health.v4.DataSource.Device; - /** - * Constructs a new DataPoint. - * @param [properties] Properties to set - */ - constructor(properties?: google.devicesandservices.health.v4.IDataPoint); + /** + * Encodes the specified Device message. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Device.verify|verify} messages. + * @param message Device message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.DataSource.IDevice, writer?: $protobuf.Writer): $protobuf.Writer; - /** DataPoint steps. */ - public steps?: (google.devicesandservices.health.v4.ISteps|null); + /** + * Encodes the specified Device message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Device.verify|verify} messages. + * @param message Device message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.DataSource.IDevice, writer?: $protobuf.Writer): $protobuf.Writer; - /** DataPoint floors. */ - public floors?: (google.devicesandservices.health.v4.IFloors|null); + /** + * Decodes a Device message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Device + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DataSource.Device; - /** DataPoint heartRate. */ - public heartRate?: (google.devicesandservices.health.v4.IHeartRate|null); + /** + * Decodes a Device message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Device + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DataSource.Device; - /** DataPoint sleep. */ - public sleep?: (google.devicesandservices.health.v4.ISleep|null); + /** + * Verifies a Device message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** DataPoint dailyRestingHeartRate. */ - public dailyRestingHeartRate?: (google.devicesandservices.health.v4.IDailyRestingHeartRate|null); + /** + * Creates a Device message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Device + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DataSource.Device; - /** DataPoint dailyHeartRateVariability. */ - public dailyHeartRateVariability?: (google.devicesandservices.health.v4.IDailyHeartRateVariability|null); + /** + * Creates a plain object from a Device message. Also converts values to other types if specified. + * @param message Device + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.DataSource.Device, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** DataPoint exercise. */ - public exercise?: (google.devicesandservices.health.v4.IExercise|null); + /** + * Converts this Device to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** DataPoint weight. */ - public weight?: (google.devicesandservices.health.v4.IWeight|null); + /** + * Gets the default type url for Device + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** DataPoint altitude. */ - public altitude?: (google.devicesandservices.health.v4.IAltitude|null); + namespace Device { - /** DataPoint distance. */ - public distance?: (google.devicesandservices.health.v4.IDistance|null); + /** FormFactor enum. */ + enum FormFactor { + FORM_FACTOR_UNSPECIFIED = 0, + FITNESS_BAND = 1, + WATCH = 2, + PHONE = 3, + RING = 4, + CHEST_STRAP = 5, + SCALE = 6, + TABLET = 7, + HEAD_MOUNTED = 8, + SMART_DISPLAY = 9 + } + } - /** DataPoint bodyFat. */ - public bodyFat?: (google.devicesandservices.health.v4.IBodyFat|null); + /** Properties of an Application. */ + interface IApplication { - /** DataPoint activeZoneMinutes. */ - public activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutes|null); + /** Application packageName */ + packageName?: (string|null); - /** DataPoint heartRateVariability. */ - public heartRateVariability?: (google.devicesandservices.health.v4.IHeartRateVariability|null); + /** Application webClientId */ + webClientId?: (string|null); - /** DataPoint dailySleepTemperatureDerivations. */ - public dailySleepTemperatureDerivations?: (google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null); + /** Application googleWebClientId */ + googleWebClientId?: (string|null); + } - /** DataPoint sedentaryPeriod. */ - public sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriod|null); + /** Represents an Application. */ + class Application implements IApplication { - /** DataPoint runVo2Max. */ - public runVo2Max?: (google.devicesandservices.health.v4.IRunVO2Max|null); + /** + * Constructs a new Application. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.DataSource.IApplication); - /** DataPoint oxygenSaturation. */ - public oxygenSaturation?: (google.devicesandservices.health.v4.IOxygenSaturation|null); + /** Application packageName. */ + public packageName: string; - /** DataPoint dailyOxygenSaturation. */ - public dailyOxygenSaturation?: (google.devicesandservices.health.v4.IDailyOxygenSaturation|null); + /** Application webClientId. */ + public webClientId: string; - /** DataPoint activityLevel. */ - public activityLevel?: (google.devicesandservices.health.v4.IActivityLevel|null); + /** Application googleWebClientId. */ + public googleWebClientId: string; - /** DataPoint vo2Max. */ - public vo2Max?: (google.devicesandservices.health.v4.IVO2Max|null); + /** + * Creates a new Application instance using the specified properties. + * @param [properties] Properties to set + * @returns Application instance + */ + public static create(properties?: google.devicesandservices.health.v4.DataSource.IApplication): google.devicesandservices.health.v4.DataSource.Application; - /** DataPoint dailyVo2Max. */ - public dailyVo2Max?: (google.devicesandservices.health.v4.IDailyVO2Max|null); + /** + * Encodes the specified Application message. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Application.verify|verify} messages. + * @param message Application message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.DataSource.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; - /** DataPoint dailyHeartRateZones. */ - public dailyHeartRateZones?: (google.devicesandservices.health.v4.IDailyHeartRateZones|null); + /** + * Encodes the specified Application message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Application.verify|verify} messages. + * @param message Application message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.DataSource.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; - /** DataPoint hydrationLog. */ - public hydrationLog?: (google.devicesandservices.health.v4.IHydrationLog|null); + /** + * Decodes an Application message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DataSource.Application; - /** DataPoint timeInHeartRateZone. */ - public timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZone|null); + /** + * Decodes an Application message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DataSource.Application; - /** DataPoint activeMinutes. */ - public activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutes|null); + /** + * Verifies an Application message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** DataPoint respiratoryRateSleepSummary. */ - public respiratoryRateSleepSummary?: (google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null); + /** + * Creates an Application message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Application + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DataSource.Application; - /** DataPoint dailyRespiratoryRate. */ - public dailyRespiratoryRate?: (google.devicesandservices.health.v4.IDailyRespiratoryRate|null); + /** + * Creates a plain object from an Application message. Also converts values to other types if specified. + * @param message Application + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.DataSource.Application, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** DataPoint swimLengthsData. */ - public swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsData|null); + /** + * Converts this Application to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** DataPoint height. */ - public height?: (google.devicesandservices.health.v4.IHeight|null); + /** + * Gets the default type url for Application + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** DataPoint basalEnergyBurned. */ - public basalEnergyBurned?: (google.devicesandservices.health.v4.IBasalEnergyBurned|null); + /** RecordingMethod enum. */ + enum RecordingMethod { + RECORDING_METHOD_UNSPECIFIED = 0, + MANUAL = 1, + PASSIVELY_MEASURED = 2, + DERIVED = 3, + ACTIVELY_MEASURED = 4, + UNKNOWN = 5 + } - /** DataPoint name. */ - public name: string; + /** Platform enum. */ + enum Platform { + PLATFORM_UNSPECIFIED = 0, + FITBIT = 1, + HEALTH_CONNECT = 2, + HEALTH_KIT = 3, + FIT = 4, + FITBIT_WEB_API = 5, + NEST = 6, + GOOGLE_WEB_API = 7, + GOOGLE_PARTNER_INTEGRATION = 8 + } + } - /** DataPoint dataSource. */ - public dataSource?: (google.devicesandservices.health.v4.IDataSource|null); + /** Represents a DataSubscriptionService */ + class DataSubscriptionService extends $protobuf.rpc.Service { - /** DataPoint data. */ - public data?: ("steps"|"floors"|"heartRate"|"sleep"|"dailyRestingHeartRate"|"dailyHeartRateVariability"|"exercise"|"weight"|"altitude"|"distance"|"bodyFat"|"activeZoneMinutes"|"heartRateVariability"|"dailySleepTemperatureDerivations"|"sedentaryPeriod"|"runVo2Max"|"oxygenSaturation"|"dailyOxygenSaturation"|"activityLevel"|"vo2Max"|"dailyVo2Max"|"dailyHeartRateZones"|"hydrationLog"|"timeInHeartRateZone"|"activeMinutes"|"respiratoryRateSleepSummary"|"dailyRespiratoryRate"|"swimLengthsData"|"height"|"basalEnergyBurned"); + /** + * Constructs a new DataSubscriptionService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates a new DataPoint instance using the specified properties. - * @param [properties] Properties to set - * @returns DataPoint instance + * Creates new DataSubscriptionService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. */ - public static create(properties?: google.devicesandservices.health.v4.IDataPoint): google.devicesandservices.health.v4.DataPoint; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): DataSubscriptionService; /** - * Encodes the specified DataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.DataPoint.verify|verify} messages. - * @param message DataPoint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls CreateSubscriber. + * @param request CreateSubscriberRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static encode(message: google.devicesandservices.health.v4.IDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + public createSubscriber(request: google.devicesandservices.health.v4.ICreateSubscriberRequest, callback: google.devicesandservices.health.v4.DataSubscriptionService.CreateSubscriberCallback): void; /** - * Encodes the specified DataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataPoint.verify|verify} messages. - * @param message DataPoint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls CreateSubscriber. + * @param request CreateSubscriberRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + public createSubscriber(request: google.devicesandservices.health.v4.ICreateSubscriberRequest): Promise; /** - * Decodes a DataPoint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListSubscribers. + * @param request ListSubscribersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSubscribersResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DataPoint; + public listSubscribers(request: google.devicesandservices.health.v4.IListSubscribersRequest, callback: google.devicesandservices.health.v4.DataSubscriptionService.ListSubscribersCallback): void; /** - * Decodes a DataPoint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListSubscribers. + * @param request ListSubscribersRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DataPoint; + public listSubscribers(request: google.devicesandservices.health.v4.IListSubscribersRequest): Promise; /** - * Verifies a DataPoint message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls UpdateSubscriber. + * @param request UpdateSubscriberRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static verify(message: { [k: string]: any }): (string|null); + public updateSubscriber(request: google.devicesandservices.health.v4.IUpdateSubscriberRequest, callback: google.devicesandservices.health.v4.DataSubscriptionService.UpdateSubscriberCallback): void; /** - * Creates a DataPoint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataPoint + * Calls UpdateSubscriber. + * @param request UpdateSubscriberRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DataPoint; + public updateSubscriber(request: google.devicesandservices.health.v4.IUpdateSubscriberRequest): Promise; /** - * Creates a plain object from a DataPoint message. Also converts values to other types if specified. - * @param message DataPoint - * @param [options] Conversion options - * @returns Plain object + * Calls DeleteSubscriber. + * @param request DeleteSubscriberRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static toObject(message: google.devicesandservices.health.v4.DataPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public deleteSubscriber(request: google.devicesandservices.health.v4.IDeleteSubscriberRequest, callback: google.devicesandservices.health.v4.DataSubscriptionService.DeleteSubscriberCallback): void; /** - * Converts this DataPoint to JSON. - * @returns JSON object + * Calls DeleteSubscriber. + * @param request DeleteSubscriberRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; + public deleteSubscriber(request: google.devicesandservices.health.v4.IDeleteSubscriberRequest): Promise; /** - * Gets the default type url for DataPoint - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Calls CreateSubscription. + * @param request CreateSubscriptionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Subscription */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReconciledDataPoint. */ - interface IReconciledDataPoint { - - /** ReconciledDataPoint steps */ - steps?: (google.devicesandservices.health.v4.ISteps|null); - - /** ReconciledDataPoint floors */ - floors?: (google.devicesandservices.health.v4.IFloors|null); - - /** ReconciledDataPoint heartRate */ - heartRate?: (google.devicesandservices.health.v4.IHeartRate|null); - - /** ReconciledDataPoint sleep */ - sleep?: (google.devicesandservices.health.v4.ISleep|null); - - /** ReconciledDataPoint dailyRestingHeartRate */ - dailyRestingHeartRate?: (google.devicesandservices.health.v4.IDailyRestingHeartRate|null); - - /** ReconciledDataPoint dailyHeartRateVariability */ - dailyHeartRateVariability?: (google.devicesandservices.health.v4.IDailyHeartRateVariability|null); - - /** ReconciledDataPoint exercise */ - exercise?: (google.devicesandservices.health.v4.IExercise|null); - - /** ReconciledDataPoint weight */ - weight?: (google.devicesandservices.health.v4.IWeight|null); - - /** ReconciledDataPoint altitude */ - altitude?: (google.devicesandservices.health.v4.IAltitude|null); - - /** ReconciledDataPoint distance */ - distance?: (google.devicesandservices.health.v4.IDistance|null); - - /** ReconciledDataPoint bodyFat */ - bodyFat?: (google.devicesandservices.health.v4.IBodyFat|null); - - /** ReconciledDataPoint activeZoneMinutes */ - activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutes|null); - - /** ReconciledDataPoint heartRateVariability */ - heartRateVariability?: (google.devicesandservices.health.v4.IHeartRateVariability|null); - - /** ReconciledDataPoint dailySleepTemperatureDerivations */ - dailySleepTemperatureDerivations?: (google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null); - - /** ReconciledDataPoint sedentaryPeriod */ - sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriod|null); - - /** ReconciledDataPoint runVo2Max */ - runVo2Max?: (google.devicesandservices.health.v4.IRunVO2Max|null); - - /** ReconciledDataPoint oxygenSaturation */ - oxygenSaturation?: (google.devicesandservices.health.v4.IOxygenSaturation|null); - - /** ReconciledDataPoint dailyOxygenSaturation */ - dailyOxygenSaturation?: (google.devicesandservices.health.v4.IDailyOxygenSaturation|null); - - /** ReconciledDataPoint activityLevel */ - activityLevel?: (google.devicesandservices.health.v4.IActivityLevel|null); - - /** ReconciledDataPoint vo2Max */ - vo2Max?: (google.devicesandservices.health.v4.IVO2Max|null); - - /** ReconciledDataPoint dailyVo2Max */ - dailyVo2Max?: (google.devicesandservices.health.v4.IDailyVO2Max|null); - - /** ReconciledDataPoint dailyHeartRateZones */ - dailyHeartRateZones?: (google.devicesandservices.health.v4.IDailyHeartRateZones|null); - - /** ReconciledDataPoint hydrationLog */ - hydrationLog?: (google.devicesandservices.health.v4.IHydrationLog|null); + public createSubscription(request: google.devicesandservices.health.v4.ICreateSubscriptionRequest, callback: google.devicesandservices.health.v4.DataSubscriptionService.CreateSubscriptionCallback): void; - /** ReconciledDataPoint timeInHeartRateZone */ - timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZone|null); - - /** ReconciledDataPoint activeMinutes */ - activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutes|null); + /** + * Calls CreateSubscription. + * @param request CreateSubscriptionRequest message or plain object + * @returns Promise + */ + public createSubscription(request: google.devicesandservices.health.v4.ICreateSubscriptionRequest): Promise; - /** ReconciledDataPoint respiratoryRateSleepSummary */ - respiratoryRateSleepSummary?: (google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null); + /** + * Calls ListSubscriptions. + * @param request ListSubscriptionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSubscriptionsResponse + */ + public listSubscriptions(request: google.devicesandservices.health.v4.IListSubscriptionsRequest, callback: google.devicesandservices.health.v4.DataSubscriptionService.ListSubscriptionsCallback): void; - /** ReconciledDataPoint dailyRespiratoryRate */ - dailyRespiratoryRate?: (google.devicesandservices.health.v4.IDailyRespiratoryRate|null); + /** + * Calls ListSubscriptions. + * @param request ListSubscriptionsRequest message or plain object + * @returns Promise + */ + public listSubscriptions(request: google.devicesandservices.health.v4.IListSubscriptionsRequest): Promise; - /** ReconciledDataPoint swimLengthsData */ - swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsData|null); + /** + * Calls UpdateSubscription. + * @param request UpdateSubscriptionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Subscription + */ + public updateSubscription(request: google.devicesandservices.health.v4.IUpdateSubscriptionRequest, callback: google.devicesandservices.health.v4.DataSubscriptionService.UpdateSubscriptionCallback): void; - /** ReconciledDataPoint height */ - height?: (google.devicesandservices.health.v4.IHeight|null); + /** + * Calls UpdateSubscription. + * @param request UpdateSubscriptionRequest message or plain object + * @returns Promise + */ + public updateSubscription(request: google.devicesandservices.health.v4.IUpdateSubscriptionRequest): Promise; - /** ReconciledDataPoint basalEnergyBurned */ - basalEnergyBurned?: (google.devicesandservices.health.v4.IBasalEnergyBurned|null); + /** + * Calls DeleteSubscription. + * @param request DeleteSubscriptionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSubscription(request: google.devicesandservices.health.v4.IDeleteSubscriptionRequest, callback: google.devicesandservices.health.v4.DataSubscriptionService.DeleteSubscriptionCallback): void; - /** ReconciledDataPoint dataPointName */ - dataPointName?: (string|null); + /** + * Calls DeleteSubscription. + * @param request DeleteSubscriptionRequest message or plain object + * @returns Promise + */ + public deleteSubscription(request: google.devicesandservices.health.v4.IDeleteSubscriptionRequest): Promise; } - /** Represents a ReconciledDataPoint. */ - class ReconciledDataPoint implements IReconciledDataPoint { + namespace DataSubscriptionService { /** - * Constructs a new ReconciledDataPoint. - * @param [properties] Properties to set + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|createSubscriber}. + * @param error Error, if any + * @param [response] Operation */ - constructor(properties?: google.devicesandservices.health.v4.IReconciledDataPoint); - - /** ReconciledDataPoint steps. */ - public steps?: (google.devicesandservices.health.v4.ISteps|null); - - /** ReconciledDataPoint floors. */ - public floors?: (google.devicesandservices.health.v4.IFloors|null); - - /** ReconciledDataPoint heartRate. */ - public heartRate?: (google.devicesandservices.health.v4.IHeartRate|null); - - /** ReconciledDataPoint sleep. */ - public sleep?: (google.devicesandservices.health.v4.ISleep|null); - - /** ReconciledDataPoint dailyRestingHeartRate. */ - public dailyRestingHeartRate?: (google.devicesandservices.health.v4.IDailyRestingHeartRate|null); - - /** ReconciledDataPoint dailyHeartRateVariability. */ - public dailyHeartRateVariability?: (google.devicesandservices.health.v4.IDailyHeartRateVariability|null); + type CreateSubscriberCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** ReconciledDataPoint exercise. */ - public exercise?: (google.devicesandservices.health.v4.IExercise|null); - - /** ReconciledDataPoint weight. */ - public weight?: (google.devicesandservices.health.v4.IWeight|null); - - /** ReconciledDataPoint altitude. */ - public altitude?: (google.devicesandservices.health.v4.IAltitude|null); - - /** ReconciledDataPoint distance. */ - public distance?: (google.devicesandservices.health.v4.IDistance|null); - - /** ReconciledDataPoint bodyFat. */ - public bodyFat?: (google.devicesandservices.health.v4.IBodyFat|null); - - /** ReconciledDataPoint activeZoneMinutes. */ - public activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutes|null); - - /** ReconciledDataPoint heartRateVariability. */ - public heartRateVariability?: (google.devicesandservices.health.v4.IHeartRateVariability|null); - - /** ReconciledDataPoint dailySleepTemperatureDerivations. */ - public dailySleepTemperatureDerivations?: (google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null); - - /** ReconciledDataPoint sedentaryPeriod. */ - public sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriod|null); - - /** ReconciledDataPoint runVo2Max. */ - public runVo2Max?: (google.devicesandservices.health.v4.IRunVO2Max|null); - - /** ReconciledDataPoint oxygenSaturation. */ - public oxygenSaturation?: (google.devicesandservices.health.v4.IOxygenSaturation|null); + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|listSubscribers}. + * @param error Error, if any + * @param [response] ListSubscribersResponse + */ + type ListSubscribersCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.ListSubscribersResponse) => void; - /** ReconciledDataPoint dailyOxygenSaturation. */ - public dailyOxygenSaturation?: (google.devicesandservices.health.v4.IDailyOxygenSaturation|null); + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|updateSubscriber}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateSubscriberCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** ReconciledDataPoint activityLevel. */ - public activityLevel?: (google.devicesandservices.health.v4.IActivityLevel|null); + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|deleteSubscriber}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteSubscriberCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** ReconciledDataPoint vo2Max. */ - public vo2Max?: (google.devicesandservices.health.v4.IVO2Max|null); + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|createSubscription}. + * @param error Error, if any + * @param [response] Subscription + */ + type CreateSubscriptionCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.Subscription) => void; - /** ReconciledDataPoint dailyVo2Max. */ - public dailyVo2Max?: (google.devicesandservices.health.v4.IDailyVO2Max|null); + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|listSubscriptions}. + * @param error Error, if any + * @param [response] ListSubscriptionsResponse + */ + type ListSubscriptionsCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.ListSubscriptionsResponse) => void; - /** ReconciledDataPoint dailyHeartRateZones. */ - public dailyHeartRateZones?: (google.devicesandservices.health.v4.IDailyHeartRateZones|null); + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|updateSubscription}. + * @param error Error, if any + * @param [response] Subscription + */ + type UpdateSubscriptionCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.Subscription) => void; - /** ReconciledDataPoint hydrationLog. */ - public hydrationLog?: (google.devicesandservices.health.v4.IHydrationLog|null); + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|deleteSubscription}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSubscriptionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } - /** ReconciledDataPoint timeInHeartRateZone. */ - public timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZone|null); + /** Properties of a CreateSubscriberRequest. */ + interface ICreateSubscriberRequest { - /** ReconciledDataPoint activeMinutes. */ - public activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutes|null); + /** CreateSubscriberRequest parent */ + parent?: (string|null); - /** ReconciledDataPoint respiratoryRateSleepSummary. */ - public respiratoryRateSleepSummary?: (google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null); + /** CreateSubscriberRequest subscriber */ + subscriber?: (google.devicesandservices.health.v4.ICreateSubscriberPayload|null); - /** ReconciledDataPoint dailyRespiratoryRate. */ - public dailyRespiratoryRate?: (google.devicesandservices.health.v4.IDailyRespiratoryRate|null); + /** CreateSubscriberRequest subscriberId */ + subscriberId?: (string|null); + } - /** ReconciledDataPoint swimLengthsData. */ - public swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsData|null); + /** Represents a CreateSubscriberRequest. */ + class CreateSubscriberRequest implements ICreateSubscriberRequest { - /** ReconciledDataPoint height. */ - public height?: (google.devicesandservices.health.v4.IHeight|null); + /** + * Constructs a new CreateSubscriberRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.ICreateSubscriberRequest); - /** ReconciledDataPoint basalEnergyBurned. */ - public basalEnergyBurned?: (google.devicesandservices.health.v4.IBasalEnergyBurned|null); + /** CreateSubscriberRequest parent. */ + public parent: string; - /** ReconciledDataPoint dataPointName. */ - public dataPointName: string; + /** CreateSubscriberRequest subscriber. */ + public subscriber?: (google.devicesandservices.health.v4.ICreateSubscriberPayload|null); - /** ReconciledDataPoint data. */ - public data?: ("steps"|"floors"|"heartRate"|"sleep"|"dailyRestingHeartRate"|"dailyHeartRateVariability"|"exercise"|"weight"|"altitude"|"distance"|"bodyFat"|"activeZoneMinutes"|"heartRateVariability"|"dailySleepTemperatureDerivations"|"sedentaryPeriod"|"runVo2Max"|"oxygenSaturation"|"dailyOxygenSaturation"|"activityLevel"|"vo2Max"|"dailyVo2Max"|"dailyHeartRateZones"|"hydrationLog"|"timeInHeartRateZone"|"activeMinutes"|"respiratoryRateSleepSummary"|"dailyRespiratoryRate"|"swimLengthsData"|"height"|"basalEnergyBurned"); + /** CreateSubscriberRequest subscriberId. */ + public subscriberId: string; /** - * Creates a new ReconciledDataPoint instance using the specified properties. + * Creates a new CreateSubscriberRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ReconciledDataPoint instance + * @returns CreateSubscriberRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.IReconciledDataPoint): google.devicesandservices.health.v4.ReconciledDataPoint; + public static create(properties?: google.devicesandservices.health.v4.ICreateSubscriberRequest): google.devicesandservices.health.v4.CreateSubscriberRequest; /** - * Encodes the specified ReconciledDataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.ReconciledDataPoint.verify|verify} messages. - * @param message ReconciledDataPoint message or plain object to encode + * Encodes the specified CreateSubscriberRequest message. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriberRequest.verify|verify} messages. + * @param message CreateSubscriberRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IReconciledDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.ICreateSubscriberRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReconciledDataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ReconciledDataPoint.verify|verify} messages. - * @param message ReconciledDataPoint message or plain object to encode + * Encodes the specified CreateSubscriberRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriberRequest.verify|verify} messages. + * @param message CreateSubscriberRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IReconciledDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.ICreateSubscriberRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReconciledDataPoint message from the specified reader or buffer. + * Decodes a CreateSubscriberRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReconciledDataPoint + * @returns CreateSubscriberRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ReconciledDataPoint; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.CreateSubscriberRequest; /** - * Decodes a ReconciledDataPoint message from the specified reader or buffer, length delimited. + * Decodes a CreateSubscriberRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReconciledDataPoint + * @returns CreateSubscriberRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ReconciledDataPoint; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.CreateSubscriberRequest; /** - * Verifies a ReconciledDataPoint message. + * Verifies a CreateSubscriberRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReconciledDataPoint message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSubscriberRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReconciledDataPoint + * @returns CreateSubscriberRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ReconciledDataPoint; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.CreateSubscriberRequest; /** - * Creates a plain object from a ReconciledDataPoint message. Also converts values to other types if specified. - * @param message ReconciledDataPoint + * Creates a plain object from a CreateSubscriberRequest message. Also converts values to other types if specified. + * @param message CreateSubscriberRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.ReconciledDataPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.CreateSubscriberRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReconciledDataPoint to JSON. + * Converts this CreateSubscriberRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ReconciledDataPoint + * Gets the default type url for CreateSubscriberRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RollupDataPoint. */ - interface IRollupDataPoint { - - /** RollupDataPoint steps */ - steps?: (google.devicesandservices.health.v4.IStepsRollupValue|null); - - /** RollupDataPoint floors */ - floors?: (google.devicesandservices.health.v4.IFloorsRollupValue|null); - - /** RollupDataPoint heartRate */ - heartRate?: (google.devicesandservices.health.v4.IHeartRateRollupValue|null); - - /** RollupDataPoint weight */ - weight?: (google.devicesandservices.health.v4.IWeightRollupValue|null); - - /** RollupDataPoint altitude */ - altitude?: (google.devicesandservices.health.v4.IAltitudeRollupValue|null); - - /** RollupDataPoint distance */ - distance?: (google.devicesandservices.health.v4.IDistanceRollupValue|null); - - /** RollupDataPoint bodyFat */ - bodyFat?: (google.devicesandservices.health.v4.IBodyFatRollupValue|null); - - /** RollupDataPoint totalCalories */ - totalCalories?: (google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null); - - /** RollupDataPoint activeZoneMinutes */ - activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null); - - /** RollupDataPoint sedentaryPeriod */ - sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null); - - /** RollupDataPoint runVo2Max */ - runVo2Max?: (google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null); - - /** RollupDataPoint caloriesInHeartRateZone */ - caloriesInHeartRateZone?: (google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null); - - /** RollupDataPoint activityLevel */ - activityLevel?: (google.devicesandservices.health.v4.IActivityLevelRollupValue|null); - - /** RollupDataPoint hydrationLog */ - hydrationLog?: (google.devicesandservices.health.v4.IHydrationLogRollupValue|null); - - /** RollupDataPoint timeInHeartRateZone */ - timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null); - - /** RollupDataPoint activeMinutes */ - activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutesRollupValue|null); + /** Properties of a ListSubscribersRequest. */ + interface IListSubscribersRequest { - /** RollupDataPoint swimLengthsData */ - swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null); + /** ListSubscribersRequest parent */ + parent?: (string|null); - /** RollupDataPoint startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** ListSubscribersRequest pageSize */ + pageSize?: (number|null); - /** RollupDataPoint endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** ListSubscribersRequest pageToken */ + pageToken?: (string|null); } - /** Represents a RollupDataPoint. */ - class RollupDataPoint implements IRollupDataPoint { + /** Represents a ListSubscribersRequest. */ + class ListSubscribersRequest implements IListSubscribersRequest { /** - * Constructs a new RollupDataPoint. + * Constructs a new ListSubscribersRequest. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IRollupDataPoint); - - /** RollupDataPoint steps. */ - public steps?: (google.devicesandservices.health.v4.IStepsRollupValue|null); - - /** RollupDataPoint floors. */ - public floors?: (google.devicesandservices.health.v4.IFloorsRollupValue|null); - - /** RollupDataPoint heartRate. */ - public heartRate?: (google.devicesandservices.health.v4.IHeartRateRollupValue|null); - - /** RollupDataPoint weight. */ - public weight?: (google.devicesandservices.health.v4.IWeightRollupValue|null); - - /** RollupDataPoint altitude. */ - public altitude?: (google.devicesandservices.health.v4.IAltitudeRollupValue|null); - - /** RollupDataPoint distance. */ - public distance?: (google.devicesandservices.health.v4.IDistanceRollupValue|null); - - /** RollupDataPoint bodyFat. */ - public bodyFat?: (google.devicesandservices.health.v4.IBodyFatRollupValue|null); - - /** RollupDataPoint totalCalories. */ - public totalCalories?: (google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null); - - /** RollupDataPoint activeZoneMinutes. */ - public activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null); - - /** RollupDataPoint sedentaryPeriod. */ - public sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null); - - /** RollupDataPoint runVo2Max. */ - public runVo2Max?: (google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null); - - /** RollupDataPoint caloriesInHeartRateZone. */ - public caloriesInHeartRateZone?: (google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null); - - /** RollupDataPoint activityLevel. */ - public activityLevel?: (google.devicesandservices.health.v4.IActivityLevelRollupValue|null); - - /** RollupDataPoint hydrationLog. */ - public hydrationLog?: (google.devicesandservices.health.v4.IHydrationLogRollupValue|null); - - /** RollupDataPoint timeInHeartRateZone. */ - public timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null); - - /** RollupDataPoint activeMinutes. */ - public activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutesRollupValue|null); - - /** RollupDataPoint swimLengthsData. */ - public swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null); + constructor(properties?: google.devicesandservices.health.v4.IListSubscribersRequest); - /** RollupDataPoint startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** ListSubscribersRequest parent. */ + public parent: string; - /** RollupDataPoint endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** ListSubscribersRequest pageSize. */ + public pageSize: number; - /** RollupDataPoint value. */ - public value?: ("steps"|"floors"|"heartRate"|"weight"|"altitude"|"distance"|"bodyFat"|"totalCalories"|"activeZoneMinutes"|"sedentaryPeriod"|"runVo2Max"|"caloriesInHeartRateZone"|"activityLevel"|"hydrationLog"|"timeInHeartRateZone"|"activeMinutes"|"swimLengthsData"); + /** ListSubscribersRequest pageToken. */ + public pageToken: string; /** - * Creates a new RollupDataPoint instance using the specified properties. + * Creates a new ListSubscribersRequest instance using the specified properties. * @param [properties] Properties to set - * @returns RollupDataPoint instance + * @returns ListSubscribersRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.IRollupDataPoint): google.devicesandservices.health.v4.RollupDataPoint; + public static create(properties?: google.devicesandservices.health.v4.IListSubscribersRequest): google.devicesandservices.health.v4.ListSubscribersRequest; /** - * Encodes the specified RollupDataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.RollupDataPoint.verify|verify} messages. - * @param message RollupDataPoint message or plain object to encode + * Encodes the specified ListSubscribersRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscribersRequest.verify|verify} messages. + * @param message ListSubscribersRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IRollupDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IListSubscribersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RollupDataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RollupDataPoint.verify|verify} messages. - * @param message RollupDataPoint message or plain object to encode + * Encodes the specified ListSubscribersRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscribersRequest.verify|verify} messages. + * @param message ListSubscribersRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IRollupDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IListSubscribersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RollupDataPoint message from the specified reader or buffer. + * Decodes a ListSubscribersRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RollupDataPoint + * @returns ListSubscribersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.RollupDataPoint; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ListSubscribersRequest; /** - * Decodes a RollupDataPoint message from the specified reader or buffer, length delimited. + * Decodes a ListSubscribersRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RollupDataPoint + * @returns ListSubscribersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.RollupDataPoint; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ListSubscribersRequest; /** - * Verifies a RollupDataPoint message. + * Verifies a ListSubscribersRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RollupDataPoint message from a plain object. Also converts values to their respective internal types. + * Creates a ListSubscribersRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RollupDataPoint + * @returns ListSubscribersRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.RollupDataPoint; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ListSubscribersRequest; /** - * Creates a plain object from a RollupDataPoint message. Also converts values to other types if specified. - * @param message RollupDataPoint + * Creates a plain object from a ListSubscribersRequest message. Also converts values to other types if specified. + * @param message ListSubscribersRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.RollupDataPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.ListSubscribersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RollupDataPoint to JSON. + * Converts this ListSubscribersRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RollupDataPoint + * Gets the default type url for ListSubscribersRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DailyRollupDataPoint. */ - interface IDailyRollupDataPoint { - - /** DailyRollupDataPoint steps */ - steps?: (google.devicesandservices.health.v4.IStepsRollupValue|null); + /** Properties of a ListSubscribersResponse. */ + interface IListSubscribersResponse { - /** DailyRollupDataPoint floors */ - floors?: (google.devicesandservices.health.v4.IFloorsRollupValue|null); + /** ListSubscribersResponse subscribers */ + subscribers?: (google.devicesandservices.health.v4.ISubscriber[]|null); - /** DailyRollupDataPoint heartRate */ - heartRate?: (google.devicesandservices.health.v4.IHeartRateRollupValue|null); + /** ListSubscribersResponse nextPageToken */ + nextPageToken?: (string|null); - /** DailyRollupDataPoint restingHeartRatePersonalRange */ - restingHeartRatePersonalRange?: (google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue|null); + /** ListSubscribersResponse totalSize */ + totalSize?: (number|null); + } - /** DailyRollupDataPoint heartRateVariabilityPersonalRange */ - heartRateVariabilityPersonalRange?: (google.devicesandservices.health.v4.IHeartRateVariabilityPersonalRangeRollupValue|null); + /** Represents a ListSubscribersResponse. */ + class ListSubscribersResponse implements IListSubscribersResponse { - /** DailyRollupDataPoint weight */ - weight?: (google.devicesandservices.health.v4.IWeightRollupValue|null); + /** + * Constructs a new ListSubscribersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IListSubscribersResponse); - /** DailyRollupDataPoint altitude */ - altitude?: (google.devicesandservices.health.v4.IAltitudeRollupValue|null); + /** ListSubscribersResponse subscribers. */ + public subscribers: google.devicesandservices.health.v4.ISubscriber[]; - /** DailyRollupDataPoint distance */ - distance?: (google.devicesandservices.health.v4.IDistanceRollupValue|null); + /** ListSubscribersResponse nextPageToken. */ + public nextPageToken: string; - /** DailyRollupDataPoint bodyFat */ - bodyFat?: (google.devicesandservices.health.v4.IBodyFatRollupValue|null); + /** ListSubscribersResponse totalSize. */ + public totalSize: number; - /** DailyRollupDataPoint totalCalories */ - totalCalories?: (google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null); + /** + * Creates a new ListSubscribersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSubscribersResponse instance + */ + public static create(properties?: google.devicesandservices.health.v4.IListSubscribersResponse): google.devicesandservices.health.v4.ListSubscribersResponse; - /** DailyRollupDataPoint activeZoneMinutes */ - activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null); + /** + * Encodes the specified ListSubscribersResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscribersResponse.verify|verify} messages. + * @param message ListSubscribersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IListSubscribersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** DailyRollupDataPoint sedentaryPeriod */ - sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null); + /** + * Encodes the specified ListSubscribersResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscribersResponse.verify|verify} messages. + * @param message ListSubscribersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IListSubscribersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** DailyRollupDataPoint runVo2Max */ - runVo2Max?: (google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null); + /** + * Decodes a ListSubscribersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSubscribersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ListSubscribersResponse; - /** DailyRollupDataPoint caloriesInHeartRateZone */ - caloriesInHeartRateZone?: (google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null); + /** + * Decodes a ListSubscribersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSubscribersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ListSubscribersResponse; - /** DailyRollupDataPoint activityLevel */ - activityLevel?: (google.devicesandservices.health.v4.IActivityLevelRollupValue|null); + /** + * Verifies a ListSubscribersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** DailyRollupDataPoint hydrationLog */ - hydrationLog?: (google.devicesandservices.health.v4.IHydrationLogRollupValue|null); + /** + * Creates a ListSubscribersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSubscribersResponse + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ListSubscribersResponse; - /** DailyRollupDataPoint timeInHeartRateZone */ - timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null); + /** + * Creates a plain object from a ListSubscribersResponse message. Also converts values to other types if specified. + * @param message ListSubscribersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.ListSubscribersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** DailyRollupDataPoint activeMinutes */ - activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutesRollupValue|null); + /** + * Converts this ListSubscribersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** DailyRollupDataPoint swimLengthsData */ - swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null); + /** + * Gets the default type url for ListSubscribersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** DailyRollupDataPoint civilStartTime */ - civilStartTime?: (google.devicesandservices.health.v4.ICivilDateTime|null); + /** Properties of an UpdateSubscriberRequest. */ + interface IUpdateSubscriberRequest { - /** DailyRollupDataPoint civilEndTime */ - civilEndTime?: (google.devicesandservices.health.v4.ICivilDateTime|null); + /** UpdateSubscriberRequest subscriber */ + subscriber?: (google.devicesandservices.health.v4.ISubscriber|null); + + /** UpdateSubscriberRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a DailyRollupDataPoint. */ - class DailyRollupDataPoint implements IDailyRollupDataPoint { + /** Represents an UpdateSubscriberRequest. */ + class UpdateSubscriberRequest implements IUpdateSubscriberRequest { /** - * Constructs a new DailyRollupDataPoint. + * Constructs a new UpdateSubscriberRequest. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IDailyRollupDataPoint); - - /** DailyRollupDataPoint steps. */ - public steps?: (google.devicesandservices.health.v4.IStepsRollupValue|null); - - /** DailyRollupDataPoint floors. */ - public floors?: (google.devicesandservices.health.v4.IFloorsRollupValue|null); + constructor(properties?: google.devicesandservices.health.v4.IUpdateSubscriberRequest); - /** DailyRollupDataPoint heartRate. */ - public heartRate?: (google.devicesandservices.health.v4.IHeartRateRollupValue|null); - - /** DailyRollupDataPoint restingHeartRatePersonalRange. */ - public restingHeartRatePersonalRange?: (google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue|null); + /** UpdateSubscriberRequest subscriber. */ + public subscriber?: (google.devicesandservices.health.v4.ISubscriber|null); - /** DailyRollupDataPoint heartRateVariabilityPersonalRange. */ - public heartRateVariabilityPersonalRange?: (google.devicesandservices.health.v4.IHeartRateVariabilityPersonalRangeRollupValue|null); + /** UpdateSubscriberRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** DailyRollupDataPoint weight. */ - public weight?: (google.devicesandservices.health.v4.IWeightRollupValue|null); + /** + * Creates a new UpdateSubscriberRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSubscriberRequest instance + */ + public static create(properties?: google.devicesandservices.health.v4.IUpdateSubscriberRequest): google.devicesandservices.health.v4.UpdateSubscriberRequest; - /** DailyRollupDataPoint altitude. */ - public altitude?: (google.devicesandservices.health.v4.IAltitudeRollupValue|null); + /** + * Encodes the specified UpdateSubscriberRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSubscriberRequest.verify|verify} messages. + * @param message UpdateSubscriberRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IUpdateSubscriberRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** DailyRollupDataPoint distance. */ - public distance?: (google.devicesandservices.health.v4.IDistanceRollupValue|null); + /** + * Encodes the specified UpdateSubscriberRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSubscriberRequest.verify|verify} messages. + * @param message UpdateSubscriberRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IUpdateSubscriberRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** DailyRollupDataPoint bodyFat. */ - public bodyFat?: (google.devicesandservices.health.v4.IBodyFatRollupValue|null); + /** + * Decodes an UpdateSubscriberRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSubscriberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.UpdateSubscriberRequest; - /** DailyRollupDataPoint totalCalories. */ - public totalCalories?: (google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null); + /** + * Decodes an UpdateSubscriberRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSubscriberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.UpdateSubscriberRequest; - /** DailyRollupDataPoint activeZoneMinutes. */ - public activeZoneMinutes?: (google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null); + /** + * Verifies an UpdateSubscriberRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** DailyRollupDataPoint sedentaryPeriod. */ - public sedentaryPeriod?: (google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null); + /** + * Creates an UpdateSubscriberRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSubscriberRequest + */ + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.UpdateSubscriberRequest; - /** DailyRollupDataPoint runVo2Max. */ - public runVo2Max?: (google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null); + /** + * Creates a plain object from an UpdateSubscriberRequest message. Also converts values to other types if specified. + * @param message UpdateSubscriberRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devicesandservices.health.v4.UpdateSubscriberRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** DailyRollupDataPoint caloriesInHeartRateZone. */ - public caloriesInHeartRateZone?: (google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null); + /** + * Converts this UpdateSubscriberRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** DailyRollupDataPoint activityLevel. */ - public activityLevel?: (google.devicesandservices.health.v4.IActivityLevelRollupValue|null); + /** + * Gets the default type url for UpdateSubscriberRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** DailyRollupDataPoint hydrationLog. */ - public hydrationLog?: (google.devicesandservices.health.v4.IHydrationLogRollupValue|null); + /** Properties of a DeleteSubscriberRequest. */ + interface IDeleteSubscriberRequest { - /** DailyRollupDataPoint timeInHeartRateZone. */ - public timeInHeartRateZone?: (google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null); + /** DeleteSubscriberRequest name */ + name?: (string|null); - /** DailyRollupDataPoint activeMinutes. */ - public activeMinutes?: (google.devicesandservices.health.v4.IActiveMinutesRollupValue|null); + /** DeleteSubscriberRequest force */ + force?: (boolean|null); + } - /** DailyRollupDataPoint swimLengthsData. */ - public swimLengthsData?: (google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null); + /** Represents a DeleteSubscriberRequest. */ + class DeleteSubscriberRequest implements IDeleteSubscriberRequest { - /** DailyRollupDataPoint civilStartTime. */ - public civilStartTime?: (google.devicesandservices.health.v4.ICivilDateTime|null); + /** + * Constructs a new DeleteSubscriberRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IDeleteSubscriberRequest); - /** DailyRollupDataPoint civilEndTime. */ - public civilEndTime?: (google.devicesandservices.health.v4.ICivilDateTime|null); + /** DeleteSubscriberRequest name. */ + public name: string; - /** DailyRollupDataPoint value. */ - public value?: ("steps"|"floors"|"heartRate"|"restingHeartRatePersonalRange"|"heartRateVariabilityPersonalRange"|"weight"|"altitude"|"distance"|"bodyFat"|"totalCalories"|"activeZoneMinutes"|"sedentaryPeriod"|"runVo2Max"|"caloriesInHeartRateZone"|"activityLevel"|"hydrationLog"|"timeInHeartRateZone"|"activeMinutes"|"swimLengthsData"); + /** DeleteSubscriberRequest force. */ + public force: boolean; /** - * Creates a new DailyRollupDataPoint instance using the specified properties. + * Creates a new DeleteSubscriberRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DailyRollupDataPoint instance + * @returns DeleteSubscriberRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.IDailyRollupDataPoint): google.devicesandservices.health.v4.DailyRollupDataPoint; + public static create(properties?: google.devicesandservices.health.v4.IDeleteSubscriberRequest): google.devicesandservices.health.v4.DeleteSubscriberRequest; /** - * Encodes the specified DailyRollupDataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollupDataPoint.verify|verify} messages. - * @param message DailyRollupDataPoint message or plain object to encode + * Encodes the specified DeleteSubscriberRequest message. Does not implicitly {@link google.devicesandservices.health.v4.DeleteSubscriberRequest.verify|verify} messages. + * @param message DeleteSubscriberRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IDailyRollupDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IDeleteSubscriberRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DailyRollupDataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollupDataPoint.verify|verify} messages. - * @param message DailyRollupDataPoint message or plain object to encode + * Encodes the specified DeleteSubscriberRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DeleteSubscriberRequest.verify|verify} messages. + * @param message DeleteSubscriberRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IDailyRollupDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IDeleteSubscriberRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DailyRollupDataPoint message from the specified reader or buffer. + * Decodes a DeleteSubscriberRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DailyRollupDataPoint + * @returns DeleteSubscriberRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DailyRollupDataPoint; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DeleteSubscriberRequest; /** - * Decodes a DailyRollupDataPoint message from the specified reader or buffer, length delimited. + * Decodes a DeleteSubscriberRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DailyRollupDataPoint + * @returns DeleteSubscriberRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DailyRollupDataPoint; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DeleteSubscriberRequest; /** - * Verifies a DailyRollupDataPoint message. + * Verifies a DeleteSubscriberRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DailyRollupDataPoint message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSubscriberRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DailyRollupDataPoint + * @returns DeleteSubscriberRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DailyRollupDataPoint; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DeleteSubscriberRequest; /** - * Creates a plain object from a DailyRollupDataPoint message. Also converts values to other types if specified. - * @param message DailyRollupDataPoint + * Creates a plain object from a DeleteSubscriberRequest message. Also converts values to other types if specified. + * @param message DeleteSubscriberRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.DailyRollupDataPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.DeleteSubscriberRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DailyRollupDataPoint to JSON. + * Converts this DeleteSubscriberRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DailyRollupDataPoint + * Gets the default type url for DeleteSubscriberRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetDataPointRequest. */ - interface IGetDataPointRequest { + /** Properties of a CreateSubscriptionRequest. */ + interface ICreateSubscriptionRequest { - /** GetDataPointRequest name */ - name?: (string|null); + /** CreateSubscriptionRequest parent */ + parent?: (string|null); + + /** CreateSubscriptionRequest subscriptionId */ + subscriptionId?: (string|null); + + /** CreateSubscriptionRequest subscription */ + subscription?: (google.devicesandservices.health.v4.ICreateSubscriptionPayload|null); } - /** Represents a GetDataPointRequest. */ - class GetDataPointRequest implements IGetDataPointRequest { + /** Represents a CreateSubscriptionRequest. */ + class CreateSubscriptionRequest implements ICreateSubscriptionRequest { /** - * Constructs a new GetDataPointRequest. + * Constructs a new CreateSubscriptionRequest. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IGetDataPointRequest); + constructor(properties?: google.devicesandservices.health.v4.ICreateSubscriptionRequest); - /** GetDataPointRequest name. */ - public name: string; + /** CreateSubscriptionRequest parent. */ + public parent: string; + + /** CreateSubscriptionRequest subscriptionId. */ + public subscriptionId: string; + + /** CreateSubscriptionRequest subscription. */ + public subscription?: (google.devicesandservices.health.v4.ICreateSubscriptionPayload|null); /** - * Creates a new GetDataPointRequest instance using the specified properties. + * Creates a new CreateSubscriptionRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetDataPointRequest instance + * @returns CreateSubscriptionRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.IGetDataPointRequest): google.devicesandservices.health.v4.GetDataPointRequest; + public static create(properties?: google.devicesandservices.health.v4.ICreateSubscriptionRequest): google.devicesandservices.health.v4.CreateSubscriptionRequest; /** - * Encodes the specified GetDataPointRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetDataPointRequest.verify|verify} messages. - * @param message GetDataPointRequest message or plain object to encode + * Encodes the specified CreateSubscriptionRequest message. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriptionRequest.verify|verify} messages. + * @param message CreateSubscriptionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IGetDataPointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.ICreateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetDataPointRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetDataPointRequest.verify|verify} messages. - * @param message GetDataPointRequest message or plain object to encode + * Encodes the specified CreateSubscriptionRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriptionRequest.verify|verify} messages. + * @param message CreateSubscriptionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IGetDataPointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.ICreateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetDataPointRequest message from the specified reader or buffer. + * Decodes a CreateSubscriptionRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetDataPointRequest + * @returns CreateSubscriptionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.GetDataPointRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.CreateSubscriptionRequest; /** - * Decodes a GetDataPointRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSubscriptionRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetDataPointRequest + * @returns CreateSubscriptionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.GetDataPointRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.CreateSubscriptionRequest; /** - * Verifies a GetDataPointRequest message. + * Verifies a CreateSubscriptionRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetDataPointRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetDataPointRequest + * @returns CreateSubscriptionRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.GetDataPointRequest; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.CreateSubscriptionRequest; /** - * Creates a plain object from a GetDataPointRequest message. Also converts values to other types if specified. - * @param message GetDataPointRequest + * Creates a plain object from a CreateSubscriptionRequest message. Also converts values to other types if specified. + * @param message CreateSubscriptionRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.GetDataPointRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.CreateSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetDataPointRequest to JSON. + * Converts this CreateSubscriptionRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetDataPointRequest + * Gets the default type url for CreateSubscriptionRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListDataPointsRequest. */ - interface IListDataPointsRequest { + /** Properties of a ListSubscriptionsRequest. */ + interface IListSubscriptionsRequest { - /** ListDataPointsRequest parent */ + /** ListSubscriptionsRequest parent */ parent?: (string|null); - /** ListDataPointsRequest pageSize */ + /** ListSubscriptionsRequest filter */ + filter?: (string|null); + + /** ListSubscriptionsRequest pageSize */ pageSize?: (number|null); - /** ListDataPointsRequest pageToken */ + /** ListSubscriptionsRequest pageToken */ pageToken?: (string|null); - - /** ListDataPointsRequest filter */ - filter?: (string|null); } - /** Represents a ListDataPointsRequest. */ - class ListDataPointsRequest implements IListDataPointsRequest { + /** Represents a ListSubscriptionsRequest. */ + class ListSubscriptionsRequest implements IListSubscriptionsRequest { /** - * Constructs a new ListDataPointsRequest. + * Constructs a new ListSubscriptionsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IListDataPointsRequest); + constructor(properties?: google.devicesandservices.health.v4.IListSubscriptionsRequest); - /** ListDataPointsRequest parent. */ + /** ListSubscriptionsRequest parent. */ public parent: string; - /** ListDataPointsRequest pageSize. */ + /** ListSubscriptionsRequest filter. */ + public filter: string; + + /** ListSubscriptionsRequest pageSize. */ public pageSize: number; - /** ListDataPointsRequest pageToken. */ + /** ListSubscriptionsRequest pageToken. */ public pageToken: string; - /** ListDataPointsRequest filter. */ - public filter: string; - /** - * Creates a new ListDataPointsRequest instance using the specified properties. + * Creates a new ListSubscriptionsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListDataPointsRequest instance + * @returns ListSubscriptionsRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.IListDataPointsRequest): google.devicesandservices.health.v4.ListDataPointsRequest; + public static create(properties?: google.devicesandservices.health.v4.IListSubscriptionsRequest): google.devicesandservices.health.v4.ListSubscriptionsRequest; /** - * Encodes the specified ListDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsRequest.verify|verify} messages. - * @param message ListDataPointsRequest message or plain object to encode + * Encodes the specified ListSubscriptionsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscriptionsRequest.verify|verify} messages. + * @param message ListSubscriptionsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IListDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IListSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsRequest.verify|verify} messages. - * @param message ListDataPointsRequest message or plain object to encode + * Encodes the specified ListSubscriptionsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscriptionsRequest.verify|verify} messages. + * @param message ListSubscriptionsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IListDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IListSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListDataPointsRequest message from the specified reader or buffer. + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListDataPointsRequest + * @returns ListSubscriptionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ListDataPointsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ListSubscriptionsRequest; /** - * Decodes a ListDataPointsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListDataPointsRequest + * @returns ListSubscriptionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ListDataPointsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ListSubscriptionsRequest; /** - * Verifies a ListDataPointsRequest message. + * Verifies a ListSubscriptionsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListDataPointsRequest + * @returns ListSubscriptionsRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ListDataPointsRequest; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ListSubscriptionsRequest; /** - * Creates a plain object from a ListDataPointsRequest message. Also converts values to other types if specified. - * @param message ListDataPointsRequest + * Creates a plain object from a ListSubscriptionsRequest message. Also converts values to other types if specified. + * @param message ListSubscriptionsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.ListDataPointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.ListSubscriptionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListDataPointsRequest to JSON. + * Converts this ListSubscriptionsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListDataPointsRequest + * Gets the default type url for ListSubscriptionsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListDataPointsResponse. */ - interface IListDataPointsResponse { + /** Properties of a ListSubscriptionsResponse. */ + interface IListSubscriptionsResponse { - /** ListDataPointsResponse dataPoints */ - dataPoints?: (google.devicesandservices.health.v4.IDataPoint[]|null); + /** ListSubscriptionsResponse subscriptions */ + subscriptions?: (google.devicesandservices.health.v4.ISubscription[]|null); - /** ListDataPointsResponse nextPageToken */ + /** ListSubscriptionsResponse nextPageToken */ nextPageToken?: (string|null); } - /** Represents a ListDataPointsResponse. */ - class ListDataPointsResponse implements IListDataPointsResponse { + /** Represents a ListSubscriptionsResponse. */ + class ListSubscriptionsResponse implements IListSubscriptionsResponse { /** - * Constructs a new ListDataPointsResponse. + * Constructs a new ListSubscriptionsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IListDataPointsResponse); + constructor(properties?: google.devicesandservices.health.v4.IListSubscriptionsResponse); - /** ListDataPointsResponse dataPoints. */ - public dataPoints: google.devicesandservices.health.v4.IDataPoint[]; + /** ListSubscriptionsResponse subscriptions. */ + public subscriptions: google.devicesandservices.health.v4.ISubscription[]; - /** ListDataPointsResponse nextPageToken. */ + /** ListSubscriptionsResponse nextPageToken. */ public nextPageToken: string; /** - * Creates a new ListDataPointsResponse instance using the specified properties. + * Creates a new ListSubscriptionsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListDataPointsResponse instance + * @returns ListSubscriptionsResponse instance */ - public static create(properties?: google.devicesandservices.health.v4.IListDataPointsResponse): google.devicesandservices.health.v4.ListDataPointsResponse; + public static create(properties?: google.devicesandservices.health.v4.IListSubscriptionsResponse): google.devicesandservices.health.v4.ListSubscriptionsResponse; /** - * Encodes the specified ListDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsResponse.verify|verify} messages. - * @param message ListDataPointsResponse message or plain object to encode + * Encodes the specified ListSubscriptionsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscriptionsResponse.verify|verify} messages. + * @param message ListSubscriptionsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IListDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IListSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsResponse.verify|verify} messages. - * @param message ListDataPointsResponse message or plain object to encode + * Encodes the specified ListSubscriptionsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscriptionsResponse.verify|verify} messages. + * @param message ListSubscriptionsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IListDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IListSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListDataPointsResponse message from the specified reader or buffer. + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListDataPointsResponse + * @returns ListSubscriptionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ListDataPointsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ListSubscriptionsResponse; /** - * Decodes a ListDataPointsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListDataPointsResponse + * @returns ListSubscriptionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ListDataPointsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ListSubscriptionsResponse; /** - * Verifies a ListDataPointsResponse message. + * Verifies a ListSubscriptionsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListDataPointsResponse + * @returns ListSubscriptionsResponse */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ListDataPointsResponse; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ListSubscriptionsResponse; /** - * Creates a plain object from a ListDataPointsResponse message. Also converts values to other types if specified. - * @param message ListDataPointsResponse + * Creates a plain object from a ListSubscriptionsResponse message. Also converts values to other types if specified. + * @param message ListSubscriptionsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.ListDataPointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.ListSubscriptionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListDataPointsResponse to JSON. + * Converts this ListSubscriptionsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListDataPointsResponse + * Gets the default type url for ListSubscriptionsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateDataPointRequest. */ - interface ICreateDataPointRequest { + /** Properties of an UpdateSubscriptionRequest. */ + interface IUpdateSubscriptionRequest { - /** CreateDataPointRequest parent */ - parent?: (string|null); + /** UpdateSubscriptionRequest subscription */ + subscription?: (google.devicesandservices.health.v4.ISubscription|null); - /** CreateDataPointRequest dataPoint */ - dataPoint?: (google.devicesandservices.health.v4.IDataPoint|null); + /** UpdateSubscriptionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a CreateDataPointRequest. */ - class CreateDataPointRequest implements ICreateDataPointRequest { + /** Represents an UpdateSubscriptionRequest. */ + class UpdateSubscriptionRequest implements IUpdateSubscriptionRequest { /** - * Constructs a new CreateDataPointRequest. + * Constructs a new UpdateSubscriptionRequest. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.ICreateDataPointRequest); + constructor(properties?: google.devicesandservices.health.v4.IUpdateSubscriptionRequest); - /** CreateDataPointRequest parent. */ - public parent: string; + /** UpdateSubscriptionRequest subscription. */ + public subscription?: (google.devicesandservices.health.v4.ISubscription|null); - /** CreateDataPointRequest dataPoint. */ - public dataPoint?: (google.devicesandservices.health.v4.IDataPoint|null); + /** UpdateSubscriptionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new CreateDataPointRequest instance using the specified properties. + * Creates a new UpdateSubscriptionRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateDataPointRequest instance + * @returns UpdateSubscriptionRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.ICreateDataPointRequest): google.devicesandservices.health.v4.CreateDataPointRequest; + public static create(properties?: google.devicesandservices.health.v4.IUpdateSubscriptionRequest): google.devicesandservices.health.v4.UpdateSubscriptionRequest; /** - * Encodes the specified CreateDataPointRequest message. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointRequest.verify|verify} messages. - * @param message CreateDataPointRequest message or plain object to encode + * Encodes the specified UpdateSubscriptionRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSubscriptionRequest.verify|verify} messages. + * @param message UpdateSubscriptionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.ICreateDataPointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IUpdateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateDataPointRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointRequest.verify|verify} messages. - * @param message CreateDataPointRequest message or plain object to encode + * Encodes the specified UpdateSubscriptionRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSubscriptionRequest.verify|verify} messages. + * @param message UpdateSubscriptionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.ICreateDataPointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IUpdateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateDataPointRequest message from the specified reader or buffer. + * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateDataPointRequest + * @returns UpdateSubscriptionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.CreateDataPointRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.UpdateSubscriptionRequest; /** - * Decodes a CreateDataPointRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateDataPointRequest + * @returns UpdateSubscriptionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.CreateDataPointRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.UpdateSubscriptionRequest; /** - * Verifies a CreateDataPointRequest message. + * Verifies an UpdateSubscriptionRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateDataPointRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateDataPointRequest + * @returns UpdateSubscriptionRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.CreateDataPointRequest; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.UpdateSubscriptionRequest; /** - * Creates a plain object from a CreateDataPointRequest message. Also converts values to other types if specified. - * @param message CreateDataPointRequest + * Creates a plain object from an UpdateSubscriptionRequest message. Also converts values to other types if specified. + * @param message UpdateSubscriptionRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.CreateDataPointRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.UpdateSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateDataPointRequest to JSON. + * Converts this UpdateSubscriptionRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateDataPointRequest + * Gets the default type url for UpdateSubscriptionRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateDataPointOperationMetadata. */ - interface ICreateDataPointOperationMetadata { + /** Properties of a DeleteSubscriptionRequest. */ + interface IDeleteSubscriptionRequest { + + /** DeleteSubscriptionRequest name */ + name?: (string|null); } - /** Represents a CreateDataPointOperationMetadata. */ - class CreateDataPointOperationMetadata implements ICreateDataPointOperationMetadata { + /** Represents a DeleteSubscriptionRequest. */ + class DeleteSubscriptionRequest implements IDeleteSubscriptionRequest { /** - * Constructs a new CreateDataPointOperationMetadata. + * Constructs a new DeleteSubscriptionRequest. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.ICreateDataPointOperationMetadata); + constructor(properties?: google.devicesandservices.health.v4.IDeleteSubscriptionRequest); + + /** DeleteSubscriptionRequest name. */ + public name: string; /** - * Creates a new CreateDataPointOperationMetadata instance using the specified properties. + * Creates a new DeleteSubscriptionRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateDataPointOperationMetadata instance + * @returns DeleteSubscriptionRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.ICreateDataPointOperationMetadata): google.devicesandservices.health.v4.CreateDataPointOperationMetadata; + public static create(properties?: google.devicesandservices.health.v4.IDeleteSubscriptionRequest): google.devicesandservices.health.v4.DeleteSubscriptionRequest; /** - * Encodes the specified CreateDataPointOperationMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointOperationMetadata.verify|verify} messages. - * @param message CreateDataPointOperationMetadata message or plain object to encode + * Encodes the specified DeleteSubscriptionRequest message. Does not implicitly {@link google.devicesandservices.health.v4.DeleteSubscriptionRequest.verify|verify} messages. + * @param message DeleteSubscriptionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.ICreateDataPointOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IDeleteSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateDataPointOperationMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointOperationMetadata.verify|verify} messages. - * @param message CreateDataPointOperationMetadata message or plain object to encode + * Encodes the specified DeleteSubscriptionRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DeleteSubscriptionRequest.verify|verify} messages. + * @param message DeleteSubscriptionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.ICreateDataPointOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IDeleteSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateDataPointOperationMetadata message from the specified reader or buffer. + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateDataPointOperationMetadata + * @returns DeleteSubscriptionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.CreateDataPointOperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DeleteSubscriptionRequest; /** - * Decodes a CreateDataPointOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateDataPointOperationMetadata + * @returns DeleteSubscriptionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.CreateDataPointOperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DeleteSubscriptionRequest; /** - * Verifies a CreateDataPointOperationMetadata message. + * Verifies a DeleteSubscriptionRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateDataPointOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSubscriptionRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateDataPointOperationMetadata + * @returns DeleteSubscriptionRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.CreateDataPointOperationMetadata; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DeleteSubscriptionRequest; /** - * Creates a plain object from a CreateDataPointOperationMetadata message. Also converts values to other types if specified. - * @param message CreateDataPointOperationMetadata + * Creates a plain object from a DeleteSubscriptionRequest message. Also converts values to other types if specified. + * @param message DeleteSubscriptionRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.CreateDataPointOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.DeleteSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateDataPointOperationMetadata to JSON. + * Converts this DeleteSubscriptionRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateDataPointOperationMetadata + * Gets the default type url for DeleteSubscriptionRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateDataPointRequest. */ - interface IUpdateDataPointRequest { + /** Properties of a Subscriber. */ + interface ISubscriber { - /** UpdateDataPointRequest dataPoint */ - dataPoint?: (google.devicesandservices.health.v4.IDataPoint|null); + /** Subscriber name */ + name?: (string|null); + + /** Subscriber endpointUri */ + endpointUri?: (string|null); + + /** Subscriber createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Subscriber updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Subscriber subscriberConfigs */ + subscriberConfigs?: (google.devicesandservices.health.v4.ISubscriberConfig[]|null); + + /** Subscriber endpointAuthorization */ + endpointAuthorization?: (google.devicesandservices.health.v4.IEndpointAuthorization|null); + + /** Subscriber state */ + state?: (google.devicesandservices.health.v4.Subscriber.State|keyof typeof google.devicesandservices.health.v4.Subscriber.State|null); } - /** Represents an UpdateDataPointRequest. */ - class UpdateDataPointRequest implements IUpdateDataPointRequest { + /** Represents a Subscriber. */ + class Subscriber implements ISubscriber { /** - * Constructs a new UpdateDataPointRequest. + * Constructs a new Subscriber. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IUpdateDataPointRequest); + constructor(properties?: google.devicesandservices.health.v4.ISubscriber); - /** UpdateDataPointRequest dataPoint. */ - public dataPoint?: (google.devicesandservices.health.v4.IDataPoint|null); + /** Subscriber name. */ + public name: string; + + /** Subscriber endpointUri. */ + public endpointUri: string; + + /** Subscriber createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Subscriber updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Subscriber subscriberConfigs. */ + public subscriberConfigs: google.devicesandservices.health.v4.ISubscriberConfig[]; + + /** Subscriber endpointAuthorization. */ + public endpointAuthorization?: (google.devicesandservices.health.v4.IEndpointAuthorization|null); + + /** Subscriber state. */ + public state: (google.devicesandservices.health.v4.Subscriber.State|keyof typeof google.devicesandservices.health.v4.Subscriber.State); /** - * Creates a new UpdateDataPointRequest instance using the specified properties. + * Creates a new Subscriber instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateDataPointRequest instance + * @returns Subscriber instance */ - public static create(properties?: google.devicesandservices.health.v4.IUpdateDataPointRequest): google.devicesandservices.health.v4.UpdateDataPointRequest; + public static create(properties?: google.devicesandservices.health.v4.ISubscriber): google.devicesandservices.health.v4.Subscriber; /** - * Encodes the specified UpdateDataPointRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointRequest.verify|verify} messages. - * @param message UpdateDataPointRequest message or plain object to encode + * Encodes the specified Subscriber message. Does not implicitly {@link google.devicesandservices.health.v4.Subscriber.verify|verify} messages. + * @param message Subscriber message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IUpdateDataPointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.ISubscriber, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateDataPointRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointRequest.verify|verify} messages. - * @param message UpdateDataPointRequest message or plain object to encode + * Encodes the specified Subscriber message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Subscriber.verify|verify} messages. + * @param message Subscriber message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IUpdateDataPointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.ISubscriber, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateDataPointRequest message from the specified reader or buffer. + * Decodes a Subscriber message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateDataPointRequest + * @returns Subscriber * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.UpdateDataPointRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Subscriber; /** - * Decodes an UpdateDataPointRequest message from the specified reader or buffer, length delimited. + * Decodes a Subscriber message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateDataPointRequest + * @returns Subscriber * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.UpdateDataPointRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Subscriber; /** - * Verifies an UpdateDataPointRequest message. + * Verifies a Subscriber message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateDataPointRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Subscriber message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateDataPointRequest + * @returns Subscriber */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.UpdateDataPointRequest; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Subscriber; /** - * Creates a plain object from an UpdateDataPointRequest message. Also converts values to other types if specified. - * @param message UpdateDataPointRequest + * Creates a plain object from a Subscriber message. Also converts values to other types if specified. + * @param message Subscriber * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.UpdateDataPointRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.Subscriber, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateDataPointRequest to JSON. + * Converts this Subscriber to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateDataPointRequest + * Gets the default type url for Subscriber * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateDataPointOperationMetadata. */ - interface IUpdateDataPointOperationMetadata { + namespace Subscriber { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + UNVERIFIED = 1, + ACTIVE = 2, + INACTIVE = 3 + } } - /** Represents an UpdateDataPointOperationMetadata. */ - class UpdateDataPointOperationMetadata implements IUpdateDataPointOperationMetadata { + /** Properties of a Subscription. */ + interface ISubscription { + + /** Subscription name */ + name?: (string|null); + + /** Subscription dataTypes */ + dataTypes?: (string[]|null); + + /** Subscription user */ + user?: (string|null); + } + + /** Represents a Subscription. */ + class Subscription implements ISubscription { /** - * Constructs a new UpdateDataPointOperationMetadata. + * Constructs a new Subscription. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata); + constructor(properties?: google.devicesandservices.health.v4.ISubscription); + + /** Subscription name. */ + public name: string; + + /** Subscription dataTypes. */ + public dataTypes: string[]; + + /** Subscription user. */ + public user: string; /** - * Creates a new UpdateDataPointOperationMetadata instance using the specified properties. + * Creates a new Subscription instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateDataPointOperationMetadata instance + * @returns Subscription instance */ - public static create(properties?: google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata): google.devicesandservices.health.v4.UpdateDataPointOperationMetadata; + public static create(properties?: google.devicesandservices.health.v4.ISubscription): google.devicesandservices.health.v4.Subscription; /** - * Encodes the specified UpdateDataPointOperationMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointOperationMetadata.verify|verify} messages. - * @param message UpdateDataPointOperationMetadata message or plain object to encode + * Encodes the specified Subscription message. Does not implicitly {@link google.devicesandservices.health.v4.Subscription.verify|verify} messages. + * @param message Subscription message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateDataPointOperationMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointOperationMetadata.verify|verify} messages. - * @param message UpdateDataPointOperationMetadata message or plain object to encode + * Encodes the specified Subscription message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Subscription.verify|verify} messages. + * @param message Subscription message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateDataPointOperationMetadata message from the specified reader or buffer. + * Decodes a Subscription message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateDataPointOperationMetadata + * @returns Subscription * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.UpdateDataPointOperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Subscription; /** - * Decodes an UpdateDataPointOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a Subscription message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateDataPointOperationMetadata + * @returns Subscription * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.UpdateDataPointOperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Subscription; /** - * Verifies an UpdateDataPointOperationMetadata message. + * Verifies a Subscription message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateDataPointOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a Subscription message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateDataPointOperationMetadata + * @returns Subscription */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.UpdateDataPointOperationMetadata; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Subscription; /** - * Creates a plain object from an UpdateDataPointOperationMetadata message. Also converts values to other types if specified. - * @param message UpdateDataPointOperationMetadata + * Creates a plain object from a Subscription message. Also converts values to other types if specified. + * @param message Subscription * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.UpdateDataPointOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.Subscription, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateDataPointOperationMetadata to JSON. + * Converts this Subscription to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateDataPointOperationMetadata + * Gets the default type url for Subscription * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchDeleteDataPointsRequest. */ - interface IBatchDeleteDataPointsRequest { + /** Properties of a SubscriberConfig. */ + interface ISubscriberConfig { - /** BatchDeleteDataPointsRequest parent */ - parent?: (string|null); + /** SubscriberConfig dataTypes */ + dataTypes?: (string[]|null); - /** BatchDeleteDataPointsRequest names */ - names?: (string[]|null); + /** SubscriberConfig subscriptionCreatePolicy */ + subscriptionCreatePolicy?: (google.devicesandservices.health.v4.SubscriberConfig.SubscriptionCreatePolicy|keyof typeof google.devicesandservices.health.v4.SubscriberConfig.SubscriptionCreatePolicy|null); } - /** Represents a BatchDeleteDataPointsRequest. */ - class BatchDeleteDataPointsRequest implements IBatchDeleteDataPointsRequest { + /** Represents a SubscriberConfig. */ + class SubscriberConfig implements ISubscriberConfig { /** - * Constructs a new BatchDeleteDataPointsRequest. + * Constructs a new SubscriberConfig. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest); + constructor(properties?: google.devicesandservices.health.v4.ISubscriberConfig); - /** BatchDeleteDataPointsRequest parent. */ - public parent: string; + /** SubscriberConfig dataTypes. */ + public dataTypes: string[]; - /** BatchDeleteDataPointsRequest names. */ - public names: string[]; + /** SubscriberConfig subscriptionCreatePolicy. */ + public subscriptionCreatePolicy: (google.devicesandservices.health.v4.SubscriberConfig.SubscriptionCreatePolicy|keyof typeof google.devicesandservices.health.v4.SubscriberConfig.SubscriptionCreatePolicy); /** - * Creates a new BatchDeleteDataPointsRequest instance using the specified properties. + * Creates a new SubscriberConfig instance using the specified properties. * @param [properties] Properties to set - * @returns BatchDeleteDataPointsRequest instance + * @returns SubscriberConfig instance */ - public static create(properties?: google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest): google.devicesandservices.health.v4.BatchDeleteDataPointsRequest; + public static create(properties?: google.devicesandservices.health.v4.ISubscriberConfig): google.devicesandservices.health.v4.SubscriberConfig; /** - * Encodes the specified BatchDeleteDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsRequest.verify|verify} messages. - * @param message BatchDeleteDataPointsRequest message or plain object to encode + * Encodes the specified SubscriberConfig message. Does not implicitly {@link google.devicesandservices.health.v4.SubscriberConfig.verify|verify} messages. + * @param message SubscriberConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.ISubscriberConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchDeleteDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsRequest.verify|verify} messages. - * @param message BatchDeleteDataPointsRequest message or plain object to encode + * Encodes the specified SubscriberConfig message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SubscriberConfig.verify|verify} messages. + * @param message SubscriberConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.ISubscriberConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchDeleteDataPointsRequest message from the specified reader or buffer. + * Decodes a SubscriberConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchDeleteDataPointsRequest + * @returns SubscriberConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.BatchDeleteDataPointsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.SubscriberConfig; /** - * Decodes a BatchDeleteDataPointsRequest message from the specified reader or buffer, length delimited. + * Decodes a SubscriberConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchDeleteDataPointsRequest + * @returns SubscriberConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.BatchDeleteDataPointsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.SubscriberConfig; /** - * Verifies a BatchDeleteDataPointsRequest message. + * Verifies a SubscriberConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchDeleteDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SubscriberConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchDeleteDataPointsRequest + * @returns SubscriberConfig */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.BatchDeleteDataPointsRequest; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.SubscriberConfig; /** - * Creates a plain object from a BatchDeleteDataPointsRequest message. Also converts values to other types if specified. - * @param message BatchDeleteDataPointsRequest + * Creates a plain object from a SubscriberConfig message. Also converts values to other types if specified. + * @param message SubscriberConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.BatchDeleteDataPointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.SubscriberConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchDeleteDataPointsRequest to JSON. + * Converts this SubscriberConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchDeleteDataPointsRequest + * Gets the default type url for SubscriberConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchDeleteDataPointsResponse. */ - interface IBatchDeleteDataPointsResponse { + namespace SubscriberConfig { - /** BatchDeleteDataPointsResponse dataPoints */ - dataPoints?: (google.devicesandservices.health.v4.IDataPoint[]|null); + /** SubscriptionCreatePolicy enum. */ + enum SubscriptionCreatePolicy { + SUBSCRIPTION_CREATE_POLICY_UNSPECIFIED = 0, + AUTOMATIC = 1, + MANUAL = 2 + } } - /** Represents a BatchDeleteDataPointsResponse. */ - class BatchDeleteDataPointsResponse implements IBatchDeleteDataPointsResponse { + /** Properties of an EndpointAuthorization. */ + interface IEndpointAuthorization { + + /** EndpointAuthorization secret */ + secret?: (string|null); + + /** EndpointAuthorization secretSet */ + secretSet?: (boolean|null); + } + + /** Represents an EndpointAuthorization. */ + class EndpointAuthorization implements IEndpointAuthorization { /** - * Constructs a new BatchDeleteDataPointsResponse. + * Constructs a new EndpointAuthorization. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse); + constructor(properties?: google.devicesandservices.health.v4.IEndpointAuthorization); - /** BatchDeleteDataPointsResponse dataPoints. */ - public dataPoints: google.devicesandservices.health.v4.IDataPoint[]; + /** EndpointAuthorization secret. */ + public secret: string; + + /** EndpointAuthorization secretSet. */ + public secretSet: boolean; /** - * Creates a new BatchDeleteDataPointsResponse instance using the specified properties. + * Creates a new EndpointAuthorization instance using the specified properties. * @param [properties] Properties to set - * @returns BatchDeleteDataPointsResponse instance + * @returns EndpointAuthorization instance */ - public static create(properties?: google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse): google.devicesandservices.health.v4.BatchDeleteDataPointsResponse; + public static create(properties?: google.devicesandservices.health.v4.IEndpointAuthorization): google.devicesandservices.health.v4.EndpointAuthorization; /** - * Encodes the specified BatchDeleteDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsResponse.verify|verify} messages. - * @param message BatchDeleteDataPointsResponse message or plain object to encode + * Encodes the specified EndpointAuthorization message. Does not implicitly {@link google.devicesandservices.health.v4.EndpointAuthorization.verify|verify} messages. + * @param message EndpointAuthorization message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IEndpointAuthorization, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchDeleteDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsResponse.verify|verify} messages. - * @param message BatchDeleteDataPointsResponse message or plain object to encode + * Encodes the specified EndpointAuthorization message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.EndpointAuthorization.verify|verify} messages. + * @param message EndpointAuthorization message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IEndpointAuthorization, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchDeleteDataPointsResponse message from the specified reader or buffer. + * Decodes an EndpointAuthorization message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchDeleteDataPointsResponse + * @returns EndpointAuthorization * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.BatchDeleteDataPointsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.EndpointAuthorization; /** - * Decodes a BatchDeleteDataPointsResponse message from the specified reader or buffer, length delimited. + * Decodes an EndpointAuthorization message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchDeleteDataPointsResponse + * @returns EndpointAuthorization * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.BatchDeleteDataPointsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.EndpointAuthorization; /** - * Verifies a BatchDeleteDataPointsResponse message. + * Verifies an EndpointAuthorization message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchDeleteDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an EndpointAuthorization message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchDeleteDataPointsResponse + * @returns EndpointAuthorization */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.BatchDeleteDataPointsResponse; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.EndpointAuthorization; /** - * Creates a plain object from a BatchDeleteDataPointsResponse message. Also converts values to other types if specified. - * @param message BatchDeleteDataPointsResponse + * Creates a plain object from an EndpointAuthorization message. Also converts values to other types if specified. + * @param message EndpointAuthorization * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.BatchDeleteDataPointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.EndpointAuthorization, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchDeleteDataPointsResponse to JSON. + * Converts this EndpointAuthorization to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchDeleteDataPointsResponse + * Gets the default type url for EndpointAuthorization * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchDeleteDataPointsOperationMetadata. */ - interface IBatchDeleteDataPointsOperationMetadata { + /** Properties of a CreateSubscriberPayload. */ + interface ICreateSubscriberPayload { - /** BatchDeleteDataPointsOperationMetadata failedRequests */ - failedRequests?: ({ [k: string]: google.rpc.IStatus }|null); + /** CreateSubscriberPayload endpointUri */ + endpointUri?: (string|null); + + /** CreateSubscriberPayload subscriberConfigs */ + subscriberConfigs?: (google.devicesandservices.health.v4.ISubscriberConfig[]|null); + + /** CreateSubscriberPayload endpointAuthorization */ + endpointAuthorization?: (google.devicesandservices.health.v4.IEndpointAuthorization|null); } - /** Represents a BatchDeleteDataPointsOperationMetadata. */ - class BatchDeleteDataPointsOperationMetadata implements IBatchDeleteDataPointsOperationMetadata { + /** Represents a CreateSubscriberPayload. */ + class CreateSubscriberPayload implements ICreateSubscriberPayload { /** - * Constructs a new BatchDeleteDataPointsOperationMetadata. + * Constructs a new CreateSubscriberPayload. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata); + constructor(properties?: google.devicesandservices.health.v4.ICreateSubscriberPayload); - /** BatchDeleteDataPointsOperationMetadata failedRequests. */ - public failedRequests: { [k: string]: google.rpc.IStatus }; + /** CreateSubscriberPayload endpointUri. */ + public endpointUri: string; + + /** CreateSubscriberPayload subscriberConfigs. */ + public subscriberConfigs: google.devicesandservices.health.v4.ISubscriberConfig[]; + + /** CreateSubscriberPayload endpointAuthorization. */ + public endpointAuthorization?: (google.devicesandservices.health.v4.IEndpointAuthorization|null); /** - * Creates a new BatchDeleteDataPointsOperationMetadata instance using the specified properties. + * Creates a new CreateSubscriberPayload instance using the specified properties. * @param [properties] Properties to set - * @returns BatchDeleteDataPointsOperationMetadata instance + * @returns CreateSubscriberPayload instance */ - public static create(properties?: google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata): google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata; + public static create(properties?: google.devicesandservices.health.v4.ICreateSubscriberPayload): google.devicesandservices.health.v4.CreateSubscriberPayload; /** - * Encodes the specified BatchDeleteDataPointsOperationMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata.verify|verify} messages. - * @param message BatchDeleteDataPointsOperationMetadata message or plain object to encode + * Encodes the specified CreateSubscriberPayload message. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriberPayload.verify|verify} messages. + * @param message CreateSubscriberPayload message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.ICreateSubscriberPayload, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchDeleteDataPointsOperationMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata.verify|verify} messages. - * @param message BatchDeleteDataPointsOperationMetadata message or plain object to encode + * Encodes the specified CreateSubscriberPayload message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriberPayload.verify|verify} messages. + * @param message CreateSubscriberPayload message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.ICreateSubscriberPayload, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchDeleteDataPointsOperationMetadata message from the specified reader or buffer. + * Decodes a CreateSubscriberPayload message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchDeleteDataPointsOperationMetadata + * @returns CreateSubscriberPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.CreateSubscriberPayload; /** - * Decodes a BatchDeleteDataPointsOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a CreateSubscriberPayload message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchDeleteDataPointsOperationMetadata + * @returns CreateSubscriberPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.CreateSubscriberPayload; /** - * Verifies a BatchDeleteDataPointsOperationMetadata message. + * Verifies a CreateSubscriberPayload message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchDeleteDataPointsOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSubscriberPayload message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchDeleteDataPointsOperationMetadata + * @returns CreateSubscriberPayload */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.CreateSubscriberPayload; /** - * Creates a plain object from a BatchDeleteDataPointsOperationMetadata message. Also converts values to other types if specified. - * @param message BatchDeleteDataPointsOperationMetadata + * Creates a plain object from a CreateSubscriberPayload message. Also converts values to other types if specified. + * @param message CreateSubscriberPayload * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.CreateSubscriberPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchDeleteDataPointsOperationMetadata to JSON. + * Converts this CreateSubscriberPayload to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchDeleteDataPointsOperationMetadata + * Gets the default type url for CreateSubscriberPayload * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ReconcileDataPointsRequest. */ - interface IReconcileDataPointsRequest { - - /** ReconcileDataPointsRequest parent */ - parent?: (string|null); - - /** ReconcileDataPointsRequest pageSize */ - pageSize?: (number|null); - - /** ReconcileDataPointsRequest pageToken */ - pageToken?: (string|null); + /** Properties of a CreateSubscriptionPayload. */ + interface ICreateSubscriptionPayload { - /** ReconcileDataPointsRequest filter */ - filter?: (string|null); + /** CreateSubscriptionPayload dataTypes */ + dataTypes?: (string[]|null); - /** ReconcileDataPointsRequest dataSourceFamily */ - dataSourceFamily?: (string|null); + /** CreateSubscriptionPayload user */ + user?: (string|null); } - /** Represents a ReconcileDataPointsRequest. */ - class ReconcileDataPointsRequest implements IReconcileDataPointsRequest { + /** Represents a CreateSubscriptionPayload. */ + class CreateSubscriptionPayload implements ICreateSubscriptionPayload { /** - * Constructs a new ReconcileDataPointsRequest. + * Constructs a new CreateSubscriptionPayload. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IReconcileDataPointsRequest); - - /** ReconcileDataPointsRequest parent. */ - public parent: string; - - /** ReconcileDataPointsRequest pageSize. */ - public pageSize: number; - - /** ReconcileDataPointsRequest pageToken. */ - public pageToken: string; + constructor(properties?: google.devicesandservices.health.v4.ICreateSubscriptionPayload); - /** ReconcileDataPointsRequest filter. */ - public filter: string; + /** CreateSubscriptionPayload dataTypes. */ + public dataTypes: string[]; - /** ReconcileDataPointsRequest dataSourceFamily. */ - public dataSourceFamily: string; + /** CreateSubscriptionPayload user. */ + public user: string; /** - * Creates a new ReconcileDataPointsRequest instance using the specified properties. + * Creates a new CreateSubscriptionPayload instance using the specified properties. * @param [properties] Properties to set - * @returns ReconcileDataPointsRequest instance + * @returns CreateSubscriptionPayload instance */ - public static create(properties?: google.devicesandservices.health.v4.IReconcileDataPointsRequest): google.devicesandservices.health.v4.ReconcileDataPointsRequest; + public static create(properties?: google.devicesandservices.health.v4.ICreateSubscriptionPayload): google.devicesandservices.health.v4.CreateSubscriptionPayload; /** - * Encodes the specified ReconcileDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsRequest.verify|verify} messages. - * @param message ReconcileDataPointsRequest message or plain object to encode + * Encodes the specified CreateSubscriptionPayload message. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriptionPayload.verify|verify} messages. + * @param message CreateSubscriptionPayload message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IReconcileDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.ICreateSubscriptionPayload, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReconcileDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsRequest.verify|verify} messages. - * @param message ReconcileDataPointsRequest message or plain object to encode + * Encodes the specified CreateSubscriptionPayload message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriptionPayload.verify|verify} messages. + * @param message CreateSubscriptionPayload message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IReconcileDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.ICreateSubscriptionPayload, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReconcileDataPointsRequest message from the specified reader or buffer. + * Decodes a CreateSubscriptionPayload message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReconcileDataPointsRequest + * @returns CreateSubscriptionPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ReconcileDataPointsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.CreateSubscriptionPayload; /** - * Decodes a ReconcileDataPointsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSubscriptionPayload message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReconcileDataPointsRequest + * @returns CreateSubscriptionPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ReconcileDataPointsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.CreateSubscriptionPayload; /** - * Verifies a ReconcileDataPointsRequest message. + * Verifies a CreateSubscriptionPayload message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReconcileDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSubscriptionPayload message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReconcileDataPointsRequest + * @returns CreateSubscriptionPayload */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ReconcileDataPointsRequest; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.CreateSubscriptionPayload; /** - * Creates a plain object from a ReconcileDataPointsRequest message. Also converts values to other types if specified. - * @param message ReconcileDataPointsRequest + * Creates a plain object from a CreateSubscriptionPayload message. Also converts values to other types if specified. + * @param message CreateSubscriptionPayload * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.ReconcileDataPointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.CreateSubscriptionPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReconcileDataPointsRequest to JSON. + * Converts this CreateSubscriptionPayload to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ReconcileDataPointsRequest + * Gets the default type url for CreateSubscriptionPayload * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ReconcileDataPointsResponse. */ - interface IReconcileDataPointsResponse { - - /** ReconcileDataPointsResponse dataPoints */ - dataPoints?: (google.devicesandservices.health.v4.IReconciledDataPoint[]|null); - - /** ReconcileDataPointsResponse nextPageToken */ - nextPageToken?: (string|null); + /** Properties of a CreateSubscriberMetadata. */ + interface ICreateSubscriberMetadata { } - /** Represents a ReconcileDataPointsResponse. */ - class ReconcileDataPointsResponse implements IReconcileDataPointsResponse { + /** Represents a CreateSubscriberMetadata. */ + class CreateSubscriberMetadata implements ICreateSubscriberMetadata { /** - * Constructs a new ReconcileDataPointsResponse. + * Constructs a new CreateSubscriberMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IReconcileDataPointsResponse); - - /** ReconcileDataPointsResponse dataPoints. */ - public dataPoints: google.devicesandservices.health.v4.IReconciledDataPoint[]; - - /** ReconcileDataPointsResponse nextPageToken. */ - public nextPageToken: string; + constructor(properties?: google.devicesandservices.health.v4.ICreateSubscriberMetadata); /** - * Creates a new ReconcileDataPointsResponse instance using the specified properties. + * Creates a new CreateSubscriberMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ReconcileDataPointsResponse instance + * @returns CreateSubscriberMetadata instance */ - public static create(properties?: google.devicesandservices.health.v4.IReconcileDataPointsResponse): google.devicesandservices.health.v4.ReconcileDataPointsResponse; + public static create(properties?: google.devicesandservices.health.v4.ICreateSubscriberMetadata): google.devicesandservices.health.v4.CreateSubscriberMetadata; /** - * Encodes the specified ReconcileDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsResponse.verify|verify} messages. - * @param message ReconcileDataPointsResponse message or plain object to encode + * Encodes the specified CreateSubscriberMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriberMetadata.verify|verify} messages. + * @param message CreateSubscriberMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IReconcileDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.ICreateSubscriberMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReconcileDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsResponse.verify|verify} messages. - * @param message ReconcileDataPointsResponse message or plain object to encode + * Encodes the specified CreateSubscriberMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriberMetadata.verify|verify} messages. + * @param message CreateSubscriberMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IReconcileDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.ICreateSubscriberMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReconcileDataPointsResponse message from the specified reader or buffer. + * Decodes a CreateSubscriberMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReconcileDataPointsResponse + * @returns CreateSubscriberMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ReconcileDataPointsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.CreateSubscriberMetadata; /** - * Decodes a ReconcileDataPointsResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateSubscriberMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReconcileDataPointsResponse + * @returns CreateSubscriberMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ReconcileDataPointsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.CreateSubscriberMetadata; /** - * Verifies a ReconcileDataPointsResponse message. + * Verifies a CreateSubscriberMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReconcileDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSubscriberMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReconcileDataPointsResponse + * @returns CreateSubscriberMetadata */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ReconcileDataPointsResponse; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.CreateSubscriberMetadata; /** - * Creates a plain object from a ReconcileDataPointsResponse message. Also converts values to other types if specified. - * @param message ReconcileDataPointsResponse + * Creates a plain object from a CreateSubscriberMetadata message. Also converts values to other types if specified. + * @param message CreateSubscriberMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.ReconcileDataPointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.CreateSubscriberMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReconcileDataPointsResponse to JSON. + * Converts this CreateSubscriberMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ReconcileDataPointsResponse + * Gets the default type url for CreateSubscriberMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RollUpDataPointsRequest. */ - interface IRollUpDataPointsRequest { - - /** RollUpDataPointsRequest parent */ - parent?: (string|null); - - /** RollUpDataPointsRequest range */ - range?: (google.type.IInterval|null); - - /** RollUpDataPointsRequest windowSize */ - windowSize?: (google.protobuf.IDuration|null); - - /** RollUpDataPointsRequest pageSize */ - pageSize?: (number|null); - - /** RollUpDataPointsRequest pageToken */ - pageToken?: (string|null); - - /** RollUpDataPointsRequest dataSourceFamily */ - dataSourceFamily?: (string|null); + /** Properties of an UpdateSubscriberMetadata. */ + interface IUpdateSubscriberMetadata { } - /** Represents a RollUpDataPointsRequest. */ - class RollUpDataPointsRequest implements IRollUpDataPointsRequest { + /** Represents an UpdateSubscriberMetadata. */ + class UpdateSubscriberMetadata implements IUpdateSubscriberMetadata { /** - * Constructs a new RollUpDataPointsRequest. + * Constructs a new UpdateSubscriberMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IRollUpDataPointsRequest); - - /** RollUpDataPointsRequest parent. */ - public parent: string; - - /** RollUpDataPointsRequest range. */ - public range?: (google.type.IInterval|null); - - /** RollUpDataPointsRequest windowSize. */ - public windowSize?: (google.protobuf.IDuration|null); - - /** RollUpDataPointsRequest pageSize. */ - public pageSize: number; - - /** RollUpDataPointsRequest pageToken. */ - public pageToken: string; - - /** RollUpDataPointsRequest dataSourceFamily. */ - public dataSourceFamily: string; + constructor(properties?: google.devicesandservices.health.v4.IUpdateSubscriberMetadata); /** - * Creates a new RollUpDataPointsRequest instance using the specified properties. + * Creates a new UpdateSubscriberMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns RollUpDataPointsRequest instance + * @returns UpdateSubscriberMetadata instance */ - public static create(properties?: google.devicesandservices.health.v4.IRollUpDataPointsRequest): google.devicesandservices.health.v4.RollUpDataPointsRequest; + public static create(properties?: google.devicesandservices.health.v4.IUpdateSubscriberMetadata): google.devicesandservices.health.v4.UpdateSubscriberMetadata; /** - * Encodes the specified RollUpDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsRequest.verify|verify} messages. - * @param message RollUpDataPointsRequest message or plain object to encode + * Encodes the specified UpdateSubscriberMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSubscriberMetadata.verify|verify} messages. + * @param message UpdateSubscriberMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IRollUpDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IUpdateSubscriberMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RollUpDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsRequest.verify|verify} messages. - * @param message RollUpDataPointsRequest message or plain object to encode + * Encodes the specified UpdateSubscriberMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSubscriberMetadata.verify|verify} messages. + * @param message UpdateSubscriberMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IRollUpDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IUpdateSubscriberMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RollUpDataPointsRequest message from the specified reader or buffer. + * Decodes an UpdateSubscriberMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RollUpDataPointsRequest + * @returns UpdateSubscriberMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.RollUpDataPointsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.UpdateSubscriberMetadata; /** - * Decodes a RollUpDataPointsRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateSubscriberMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RollUpDataPointsRequest + * @returns UpdateSubscriberMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.RollUpDataPointsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.UpdateSubscriberMetadata; /** - * Verifies a RollUpDataPointsRequest message. + * Verifies an UpdateSubscriberMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RollUpDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSubscriberMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RollUpDataPointsRequest + * @returns UpdateSubscriberMetadata */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.RollUpDataPointsRequest; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.UpdateSubscriberMetadata; /** - * Creates a plain object from a RollUpDataPointsRequest message. Also converts values to other types if specified. - * @param message RollUpDataPointsRequest + * Creates a plain object from an UpdateSubscriberMetadata message. Also converts values to other types if specified. + * @param message UpdateSubscriberMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.RollUpDataPointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.UpdateSubscriberMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RollUpDataPointsRequest to JSON. + * Converts this UpdateSubscriberMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RollUpDataPointsRequest + * Gets the default type url for UpdateSubscriberMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RollUpDataPointsResponse. */ - interface IRollUpDataPointsResponse { - - /** RollUpDataPointsResponse rollupDataPoints */ - rollupDataPoints?: (google.devicesandservices.health.v4.IRollupDataPoint[]|null); - - /** RollUpDataPointsResponse nextPageToken */ - nextPageToken?: (string|null); + /** Properties of a DeleteSubscriberMetadata. */ + interface IDeleteSubscriberMetadata { } - /** Represents a RollUpDataPointsResponse. */ - class RollUpDataPointsResponse implements IRollUpDataPointsResponse { + /** Represents a DeleteSubscriberMetadata. */ + class DeleteSubscriberMetadata implements IDeleteSubscriberMetadata { /** - * Constructs a new RollUpDataPointsResponse. + * Constructs a new DeleteSubscriberMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IRollUpDataPointsResponse); - - /** RollUpDataPointsResponse rollupDataPoints. */ - public rollupDataPoints: google.devicesandservices.health.v4.IRollupDataPoint[]; - - /** RollUpDataPointsResponse nextPageToken. */ - public nextPageToken: string; + constructor(properties?: google.devicesandservices.health.v4.IDeleteSubscriberMetadata); /** - * Creates a new RollUpDataPointsResponse instance using the specified properties. + * Creates a new DeleteSubscriberMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns RollUpDataPointsResponse instance + * @returns DeleteSubscriberMetadata instance */ - public static create(properties?: google.devicesandservices.health.v4.IRollUpDataPointsResponse): google.devicesandservices.health.v4.RollUpDataPointsResponse; + public static create(properties?: google.devicesandservices.health.v4.IDeleteSubscriberMetadata): google.devicesandservices.health.v4.DeleteSubscriberMetadata; /** - * Encodes the specified RollUpDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsResponse.verify|verify} messages. - * @param message RollUpDataPointsResponse message or plain object to encode + * Encodes the specified DeleteSubscriberMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.DeleteSubscriberMetadata.verify|verify} messages. + * @param message DeleteSubscriberMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IRollUpDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IDeleteSubscriberMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RollUpDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsResponse.verify|verify} messages. - * @param message RollUpDataPointsResponse message or plain object to encode + * Encodes the specified DeleteSubscriberMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DeleteSubscriberMetadata.verify|verify} messages. + * @param message DeleteSubscriberMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IRollUpDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IDeleteSubscriberMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RollUpDataPointsResponse message from the specified reader or buffer. + * Decodes a DeleteSubscriberMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RollUpDataPointsResponse + * @returns DeleteSubscriberMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.RollUpDataPointsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DeleteSubscriberMetadata; /** - * Decodes a RollUpDataPointsResponse message from the specified reader or buffer, length delimited. + * Decodes a DeleteSubscriberMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RollUpDataPointsResponse + * @returns DeleteSubscriberMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.RollUpDataPointsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DeleteSubscriberMetadata; /** - * Verifies a RollUpDataPointsResponse message. + * Verifies a DeleteSubscriberMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RollUpDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSubscriberMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RollUpDataPointsResponse + * @returns DeleteSubscriberMetadata */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.RollUpDataPointsResponse; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DeleteSubscriberMetadata; /** - * Creates a plain object from a RollUpDataPointsResponse message. Also converts values to other types if specified. - * @param message RollUpDataPointsResponse + * Creates a plain object from a DeleteSubscriberMetadata message. Also converts values to other types if specified. + * @param message DeleteSubscriberMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.RollUpDataPointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.DeleteSubscriberMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RollUpDataPointsResponse to JSON. + * Converts this DeleteSubscriberMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RollUpDataPointsResponse + * Gets the default type url for DeleteSubscriberMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DailyRollUpDataPointsRequest. */ - interface IDailyRollUpDataPointsRequest { + /** Represents a HealthProfileService */ + class HealthProfileService extends $protobuf.rpc.Service { - /** DailyRollUpDataPointsRequest parent */ - parent?: (string|null); + /** + * Constructs a new HealthProfileService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** DailyRollUpDataPointsRequest range */ - range?: (google.devicesandservices.health.v4.ICivilTimeInterval|null); + /** + * Creates new HealthProfileService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): HealthProfileService; - /** DailyRollUpDataPointsRequest windowSizeDays */ - windowSizeDays?: (number|null); + /** + * Calls GetProfile. + * @param request GetProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Profile + */ + public getProfile(request: google.devicesandservices.health.v4.IGetProfileRequest, callback: google.devicesandservices.health.v4.HealthProfileService.GetProfileCallback): void; - /** DailyRollUpDataPointsRequest pageSize */ - pageSize?: (number|null); + /** + * Calls GetProfile. + * @param request GetProfileRequest message or plain object + * @returns Promise + */ + public getProfile(request: google.devicesandservices.health.v4.IGetProfileRequest): Promise; - /** DailyRollUpDataPointsRequest pageToken */ - pageToken?: (string|null); + /** + * Calls UpdateProfile. + * @param request UpdateProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Profile + */ + public updateProfile(request: google.devicesandservices.health.v4.IUpdateProfileRequest, callback: google.devicesandservices.health.v4.HealthProfileService.UpdateProfileCallback): void; - /** DailyRollUpDataPointsRequest dataSourceFamily */ - dataSourceFamily?: (string|null); - } + /** + * Calls UpdateProfile. + * @param request UpdateProfileRequest message or plain object + * @returns Promise + */ + public updateProfile(request: google.devicesandservices.health.v4.IUpdateProfileRequest): Promise; - /** Represents a DailyRollUpDataPointsRequest. */ - class DailyRollUpDataPointsRequest implements IDailyRollUpDataPointsRequest { + /** + * Calls GetSettings. + * @param request GetSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Settings + */ + public getSettings(request: google.devicesandservices.health.v4.IGetSettingsRequest, callback: google.devicesandservices.health.v4.HealthProfileService.GetSettingsCallback): void; /** - * Constructs a new DailyRollUpDataPointsRequest. - * @param [properties] Properties to set + * Calls GetSettings. + * @param request GetSettingsRequest message or plain object + * @returns Promise */ - constructor(properties?: google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest); + public getSettings(request: google.devicesandservices.health.v4.IGetSettingsRequest): Promise; - /** DailyRollUpDataPointsRequest parent. */ - public parent: string; + /** + * Calls UpdateSettings. + * @param request UpdateSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Settings + */ + public updateSettings(request: google.devicesandservices.health.v4.IUpdateSettingsRequest, callback: google.devicesandservices.health.v4.HealthProfileService.UpdateSettingsCallback): void; - /** DailyRollUpDataPointsRequest range. */ - public range?: (google.devicesandservices.health.v4.ICivilTimeInterval|null); + /** + * Calls UpdateSettings. + * @param request UpdateSettingsRequest message or plain object + * @returns Promise + */ + public updateSettings(request: google.devicesandservices.health.v4.IUpdateSettingsRequest): Promise; - /** DailyRollUpDataPointsRequest windowSizeDays. */ - public windowSizeDays: number; + /** + * Calls GetIdentity. + * @param request GetIdentityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Identity + */ + public getIdentity(request: google.devicesandservices.health.v4.IGetIdentityRequest, callback: google.devicesandservices.health.v4.HealthProfileService.GetIdentityCallback): void; - /** DailyRollUpDataPointsRequest pageSize. */ - public pageSize: number; + /** + * Calls GetIdentity. + * @param request GetIdentityRequest message or plain object + * @returns Promise + */ + public getIdentity(request: google.devicesandservices.health.v4.IGetIdentityRequest): Promise; - /** DailyRollUpDataPointsRequest pageToken. */ - public pageToken: string; + /** + * Calls GetIrnProfile. + * @param request GetIrnProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and IrnProfile + */ + public getIrnProfile(request: google.devicesandservices.health.v4.IGetIrnProfileRequest, callback: google.devicesandservices.health.v4.HealthProfileService.GetIrnProfileCallback): void; - /** DailyRollUpDataPointsRequest dataSourceFamily. */ - public dataSourceFamily: string; + /** + * Calls GetIrnProfile. + * @param request GetIrnProfileRequest message or plain object + * @returns Promise + */ + public getIrnProfile(request: google.devicesandservices.health.v4.IGetIrnProfileRequest): Promise; /** - * Creates a new DailyRollUpDataPointsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DailyRollUpDataPointsRequest instance + * Calls GetPairedDevice. + * @param request GetPairedDeviceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PairedDevice */ - public static create(properties?: google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest): google.devicesandservices.health.v4.DailyRollUpDataPointsRequest; + public getPairedDevice(request: google.devicesandservices.health.v4.IGetPairedDeviceRequest, callback: google.devicesandservices.health.v4.HealthProfileService.GetPairedDeviceCallback): void; /** - * Encodes the specified DailyRollUpDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsRequest.verify|verify} messages. - * @param message DailyRollUpDataPointsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetPairedDevice. + * @param request GetPairedDeviceRequest message or plain object + * @returns Promise */ - public static encode(message: google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public getPairedDevice(request: google.devicesandservices.health.v4.IGetPairedDeviceRequest): Promise; /** - * Encodes the specified DailyRollUpDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsRequest.verify|verify} messages. - * @param message DailyRollUpDataPointsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListPairedDevices. + * @param request ListPairedDevicesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPairedDevicesResponse */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public listPairedDevices(request: google.devicesandservices.health.v4.IListPairedDevicesRequest, callback: google.devicesandservices.health.v4.HealthProfileService.ListPairedDevicesCallback): void; /** - * Decodes a DailyRollUpDataPointsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DailyRollUpDataPointsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListPairedDevices. + * @param request ListPairedDevicesRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DailyRollUpDataPointsRequest; + public listPairedDevices(request: google.devicesandservices.health.v4.IListPairedDevicesRequest): Promise; + } + + namespace HealthProfileService { /** - * Decodes a DailyRollUpDataPointsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DailyRollUpDataPointsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getProfile}. + * @param error Error, if any + * @param [response] Profile */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DailyRollUpDataPointsRequest; + type GetProfileCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.Profile) => void; /** - * Verifies a DailyRollUpDataPointsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|updateProfile}. + * @param error Error, if any + * @param [response] Profile */ - public static verify(message: { [k: string]: any }): (string|null); + type UpdateProfileCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.Profile) => void; /** - * Creates a DailyRollUpDataPointsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DailyRollUpDataPointsRequest + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getSettings}. + * @param error Error, if any + * @param [response] Settings */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DailyRollUpDataPointsRequest; + type GetSettingsCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.Settings) => void; /** - * Creates a plain object from a DailyRollUpDataPointsRequest message. Also converts values to other types if specified. - * @param message DailyRollUpDataPointsRequest - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|updateSettings}. + * @param error Error, if any + * @param [response] Settings */ - public static toObject(message: google.devicesandservices.health.v4.DailyRollUpDataPointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type UpdateSettingsCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.Settings) => void; /** - * Converts this DailyRollUpDataPointsRequest to JSON. - * @returns JSON object + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getIdentity}. + * @param error Error, if any + * @param [response] Identity */ - public toJSON(): { [k: string]: any }; + type GetIdentityCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.Identity) => void; /** - * Gets the default type url for DailyRollUpDataPointsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getIrnProfile}. + * @param error Error, if any + * @param [response] IrnProfile */ - public static getTypeUrl(typeUrlPrefix?: string): string; + type GetIrnProfileCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.IrnProfile) => void; + + /** + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getPairedDevice}. + * @param error Error, if any + * @param [response] PairedDevice + */ + type GetPairedDeviceCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.PairedDevice) => void; + + /** + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|listPairedDevices}. + * @param error Error, if any + * @param [response] ListPairedDevicesResponse + */ + type ListPairedDevicesCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.ListPairedDevicesResponse) => void; } - /** Properties of a DailyRollUpDataPointsResponse. */ - interface IDailyRollUpDataPointsResponse { + /** Properties of a User. */ + interface IUser { - /** DailyRollUpDataPointsResponse rollupDataPoints */ - rollupDataPoints?: (google.devicesandservices.health.v4.IDailyRollupDataPoint[]|null); + /** User name */ + name?: (string|null); } - /** Represents a DailyRollUpDataPointsResponse. */ - class DailyRollUpDataPointsResponse implements IDailyRollUpDataPointsResponse { + /** Represents a User. */ + class User implements IUser { /** - * Constructs a new DailyRollUpDataPointsResponse. + * Constructs a new User. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse); + constructor(properties?: google.devicesandservices.health.v4.IUser); - /** DailyRollUpDataPointsResponse rollupDataPoints. */ - public rollupDataPoints: google.devicesandservices.health.v4.IDailyRollupDataPoint[]; + /** User name. */ + public name: string; /** - * Creates a new DailyRollUpDataPointsResponse instance using the specified properties. + * Creates a new User instance using the specified properties. * @param [properties] Properties to set - * @returns DailyRollUpDataPointsResponse instance + * @returns User instance */ - public static create(properties?: google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse): google.devicesandservices.health.v4.DailyRollUpDataPointsResponse; + public static create(properties?: google.devicesandservices.health.v4.IUser): google.devicesandservices.health.v4.User; /** - * Encodes the specified DailyRollUpDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsResponse.verify|verify} messages. - * @param message DailyRollUpDataPointsResponse message or plain object to encode + * Encodes the specified User message. Does not implicitly {@link google.devicesandservices.health.v4.User.verify|verify} messages. + * @param message User message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IUser, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DailyRollUpDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsResponse.verify|verify} messages. - * @param message DailyRollUpDataPointsResponse message or plain object to encode + * Encodes the specified User message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.User.verify|verify} messages. + * @param message User message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IUser, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DailyRollUpDataPointsResponse message from the specified reader or buffer. + * Decodes a User message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DailyRollUpDataPointsResponse + * @returns User * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DailyRollUpDataPointsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.User; /** - * Decodes a DailyRollUpDataPointsResponse message from the specified reader or buffer, length delimited. + * Decodes a User message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DailyRollUpDataPointsResponse + * @returns User * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DailyRollUpDataPointsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.User; /** - * Verifies a DailyRollUpDataPointsResponse message. + * Verifies a User message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DailyRollUpDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a User message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DailyRollUpDataPointsResponse + * @returns User */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DailyRollUpDataPointsResponse; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.User; /** - * Creates a plain object from a DailyRollUpDataPointsResponse message. Also converts values to other types if specified. - * @param message DailyRollUpDataPointsResponse + * Creates a plain object from a User message. Also converts values to other types if specified. + * @param message User * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.DailyRollUpDataPointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DailyRollUpDataPointsResponse to JSON. + * Converts this User to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DailyRollUpDataPointsResponse + * Gets the default type url for User * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DataType. */ - interface IDataType { + /** Properties of a Profile. */ + interface IProfile { + + /** Profile name */ + name?: (string|null); + + /** Profile age */ + age?: (number|null); + + /** Profile membershipStartDate */ + membershipStartDate?: (google.type.IDate|null); + + /** Profile userConfiguredWalkingStrideLengthMm */ + userConfiguredWalkingStrideLengthMm?: (number|null); + + /** Profile userConfiguredRunningStrideLengthMm */ + userConfiguredRunningStrideLengthMm?: (number|null); + + /** Profile autoWalkingStrideLengthMm */ + autoWalkingStrideLengthMm?: (number|null); - /** DataType name */ - name?: (string|null); + /** Profile autoRunningStrideLengthMm */ + autoRunningStrideLengthMm?: (number|null); } - /** Represents a DataType. */ - class DataType implements IDataType { + /** Represents a Profile. */ + class Profile implements IProfile { /** - * Constructs a new DataType. + * Constructs a new Profile. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IDataType); + constructor(properties?: google.devicesandservices.health.v4.IProfile); - /** DataType name. */ + /** Profile name. */ public name: string; + /** Profile age. */ + public age: number; + + /** Profile membershipStartDate. */ + public membershipStartDate?: (google.type.IDate|null); + + /** Profile userConfiguredWalkingStrideLengthMm. */ + public userConfiguredWalkingStrideLengthMm?: (number|null); + + /** Profile userConfiguredRunningStrideLengthMm. */ + public userConfiguredRunningStrideLengthMm?: (number|null); + + /** Profile autoWalkingStrideLengthMm. */ + public autoWalkingStrideLengthMm?: (number|null); + + /** Profile autoRunningStrideLengthMm. */ + public autoRunningStrideLengthMm?: (number|null); + /** - * Creates a new DataType instance using the specified properties. + * Creates a new Profile instance using the specified properties. * @param [properties] Properties to set - * @returns DataType instance + * @returns Profile instance */ - public static create(properties?: google.devicesandservices.health.v4.IDataType): google.devicesandservices.health.v4.DataType; + public static create(properties?: google.devicesandservices.health.v4.IProfile): google.devicesandservices.health.v4.Profile; /** - * Encodes the specified DataType message. Does not implicitly {@link google.devicesandservices.health.v4.DataType.verify|verify} messages. - * @param message DataType message or plain object to encode + * Encodes the specified Profile message. Does not implicitly {@link google.devicesandservices.health.v4.Profile.verify|verify} messages. + * @param message Profile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IDataType, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DataType message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataType.verify|verify} messages. - * @param message DataType message or plain object to encode + * Encodes the specified Profile message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Profile.verify|verify} messages. + * @param message Profile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IDataType, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DataType message from the specified reader or buffer. + * Decodes a Profile message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DataType + * @returns Profile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DataType; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Profile; /** - * Decodes a DataType message from the specified reader or buffer, length delimited. + * Decodes a Profile message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DataType + * @returns Profile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DataType; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Profile; /** - * Verifies a DataType message. + * Verifies a Profile message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DataType message from a plain object. Also converts values to their respective internal types. + * Creates a Profile message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DataType + * @returns Profile */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DataType; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Profile; /** - * Creates a plain object from a DataType message. Also converts values to other types if specified. - * @param message DataType + * Creates a plain object from a Profile message. Also converts values to other types if specified. + * @param message Profile * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.DataType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.Profile, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DataType to JSON. + * Converts this Profile to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DataType + * Gets the default type url for Profile * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ExportExerciseTcxRequest. */ - interface IExportExerciseTcxRequest { + /** Properties of a PairedDevice. */ + interface IPairedDevice { - /** ExportExerciseTcxRequest name */ + /** PairedDevice name */ name?: (string|null); - /** ExportExerciseTcxRequest partialData */ - partialData?: (boolean|null); + /** PairedDevice deviceType */ + deviceType?: (google.devicesandservices.health.v4.PairedDevice.DeviceType|keyof typeof google.devicesandservices.health.v4.PairedDevice.DeviceType|null); + + /** PairedDevice batteryStatus */ + batteryStatus?: (string|null); + + /** PairedDevice batteryLevel */ + batteryLevel?: (number|null); + + /** PairedDevice lastSyncTime */ + lastSyncTime?: (google.protobuf.ITimestamp|null); + + /** PairedDevice deviceVersion */ + deviceVersion?: (string|null); + + /** PairedDevice macAddress */ + macAddress?: (string|null); + + /** PairedDevice features */ + features?: (string[]|null); } - /** Represents an ExportExerciseTcxRequest. */ - class ExportExerciseTcxRequest implements IExportExerciseTcxRequest { + /** Represents a PairedDevice. */ + class PairedDevice implements IPairedDevice { /** - * Constructs a new ExportExerciseTcxRequest. + * Constructs a new PairedDevice. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IExportExerciseTcxRequest); + constructor(properties?: google.devicesandservices.health.v4.IPairedDevice); - /** ExportExerciseTcxRequest name. */ + /** PairedDevice name. */ public name: string; - /** ExportExerciseTcxRequest partialData. */ - public partialData: boolean; + /** PairedDevice deviceType. */ + public deviceType: (google.devicesandservices.health.v4.PairedDevice.DeviceType|keyof typeof google.devicesandservices.health.v4.PairedDevice.DeviceType); + + /** PairedDevice batteryStatus. */ + public batteryStatus: string; + + /** PairedDevice batteryLevel. */ + public batteryLevel: number; + + /** PairedDevice lastSyncTime. */ + public lastSyncTime?: (google.protobuf.ITimestamp|null); + + /** PairedDevice deviceVersion. */ + public deviceVersion: string; + + /** PairedDevice macAddress. */ + public macAddress: string; + + /** PairedDevice features. */ + public features: string[]; /** - * Creates a new ExportExerciseTcxRequest instance using the specified properties. + * Creates a new PairedDevice instance using the specified properties. * @param [properties] Properties to set - * @returns ExportExerciseTcxRequest instance + * @returns PairedDevice instance */ - public static create(properties?: google.devicesandservices.health.v4.IExportExerciseTcxRequest): google.devicesandservices.health.v4.ExportExerciseTcxRequest; + public static create(properties?: google.devicesandservices.health.v4.IPairedDevice): google.devicesandservices.health.v4.PairedDevice; /** - * Encodes the specified ExportExerciseTcxRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxRequest.verify|verify} messages. - * @param message ExportExerciseTcxRequest message or plain object to encode + * Encodes the specified PairedDevice message. Does not implicitly {@link google.devicesandservices.health.v4.PairedDevice.verify|verify} messages. + * @param message PairedDevice message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IExportExerciseTcxRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IPairedDevice, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportExerciseTcxRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxRequest.verify|verify} messages. - * @param message ExportExerciseTcxRequest message or plain object to encode + * Encodes the specified PairedDevice message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.PairedDevice.verify|verify} messages. + * @param message PairedDevice message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IExportExerciseTcxRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IPairedDevice, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportExerciseTcxRequest message from the specified reader or buffer. + * Decodes a PairedDevice message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportExerciseTcxRequest + * @returns PairedDevice * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ExportExerciseTcxRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.PairedDevice; /** - * Decodes an ExportExerciseTcxRequest message from the specified reader or buffer, length delimited. + * Decodes a PairedDevice message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportExerciseTcxRequest + * @returns PairedDevice * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ExportExerciseTcxRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.PairedDevice; /** - * Verifies an ExportExerciseTcxRequest message. + * Verifies a PairedDevice message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ExportExerciseTcxRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PairedDevice message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportExerciseTcxRequest + * @returns PairedDevice */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ExportExerciseTcxRequest; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.PairedDevice; /** - * Creates a plain object from an ExportExerciseTcxRequest message. Also converts values to other types if specified. - * @param message ExportExerciseTcxRequest + * Creates a plain object from a PairedDevice message. Also converts values to other types if specified. + * @param message PairedDevice * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.ExportExerciseTcxRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.PairedDevice, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportExerciseTcxRequest to JSON. + * Converts this PairedDevice to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ExportExerciseTcxRequest + * Gets the default type url for PairedDevice * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ExportExerciseTcxResponse. */ - interface IExportExerciseTcxResponse { + namespace PairedDevice { - /** ExportExerciseTcxResponse tcxData */ - tcxData?: (string|null); + /** DeviceType enum. */ + enum DeviceType { + DEVICE_TYPE_UNSPECIFIED = 0, + TRACKER = 1, + SCALE = 2 + } } - /** Represents an ExportExerciseTcxResponse. */ - class ExportExerciseTcxResponse implements IExportExerciseTcxResponse { + /** Properties of an IrnProfile. */ + interface IIrnProfile { + + /** IrnProfile name */ + name?: (string|null); + + /** IrnProfile onboardingStatus */ + onboardingStatus?: (boolean|null); + + /** IrnProfile enrollmentStatus */ + enrollmentStatus?: (boolean|null); + + /** IrnProfile updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an IrnProfile. */ + class IrnProfile implements IIrnProfile { /** - * Constructs a new ExportExerciseTcxResponse. + * Constructs a new IrnProfile. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IExportExerciseTcxResponse); + constructor(properties?: google.devicesandservices.health.v4.IIrnProfile); - /** ExportExerciseTcxResponse tcxData. */ - public tcxData: string; + /** IrnProfile name. */ + public name: string; + + /** IrnProfile onboardingStatus. */ + public onboardingStatus: boolean; + + /** IrnProfile enrollmentStatus. */ + public enrollmentStatus: boolean; + + /** IrnProfile updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new ExportExerciseTcxResponse instance using the specified properties. + * Creates a new IrnProfile instance using the specified properties. * @param [properties] Properties to set - * @returns ExportExerciseTcxResponse instance + * @returns IrnProfile instance */ - public static create(properties?: google.devicesandservices.health.v4.IExportExerciseTcxResponse): google.devicesandservices.health.v4.ExportExerciseTcxResponse; + public static create(properties?: google.devicesandservices.health.v4.IIrnProfile): google.devicesandservices.health.v4.IrnProfile; /** - * Encodes the specified ExportExerciseTcxResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxResponse.verify|verify} messages. - * @param message ExportExerciseTcxResponse message or plain object to encode + * Encodes the specified IrnProfile message. Does not implicitly {@link google.devicesandservices.health.v4.IrnProfile.verify|verify} messages. + * @param message IrnProfile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IExportExerciseTcxResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IIrnProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportExerciseTcxResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxResponse.verify|verify} messages. - * @param message ExportExerciseTcxResponse message or plain object to encode + * Encodes the specified IrnProfile message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.IrnProfile.verify|verify} messages. + * @param message IrnProfile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IExportExerciseTcxResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IIrnProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportExerciseTcxResponse message from the specified reader or buffer. + * Decodes an IrnProfile message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportExerciseTcxResponse + * @returns IrnProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ExportExerciseTcxResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.IrnProfile; /** - * Decodes an ExportExerciseTcxResponse message from the specified reader or buffer, length delimited. + * Decodes an IrnProfile message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportExerciseTcxResponse + * @returns IrnProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ExportExerciseTcxResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.IrnProfile; /** - * Verifies an ExportExerciseTcxResponse message. + * Verifies an IrnProfile message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ExportExerciseTcxResponse message from a plain object. Also converts values to their respective internal types. + * Creates an IrnProfile message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportExerciseTcxResponse + * @returns IrnProfile */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ExportExerciseTcxResponse; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.IrnProfile; /** - * Creates a plain object from an ExportExerciseTcxResponse message. Also converts values to other types if specified. - * @param message ExportExerciseTcxResponse + * Creates a plain object from an IrnProfile message. Also converts values to other types if specified. + * @param message IrnProfile * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.ExportExerciseTcxResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.IrnProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportExerciseTcxResponse to JSON. + * Converts this IrnProfile to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ExportExerciseTcxResponse + * Gets the default type url for IrnProfile * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DataSource. */ - interface IDataSource { + /** Properties of a Settings. */ + interface ISettings { - /** DataSource recordingMethod */ - recordingMethod?: (google.devicesandservices.health.v4.DataSource.RecordingMethod|keyof typeof google.devicesandservices.health.v4.DataSource.RecordingMethod|null); + /** Settings name */ + name?: (string|null); - /** DataSource device */ - device?: (google.devicesandservices.health.v4.DataSource.IDevice|null); + /** Settings autoStrideEnabled */ + autoStrideEnabled?: (boolean|null); + + /** Settings distanceUnit */ + distanceUnit?: (google.devicesandservices.health.v4.Settings.DistanceUnit|keyof typeof google.devicesandservices.health.v4.Settings.DistanceUnit|null); + + /** Settings glucoseUnit */ + glucoseUnit?: (google.devicesandservices.health.v4.Settings.GlucoseUnit|keyof typeof google.devicesandservices.health.v4.Settings.GlucoseUnit|null); + + /** Settings heightUnit */ + heightUnit?: (google.devicesandservices.health.v4.Settings.HeightUnit|keyof typeof google.devicesandservices.health.v4.Settings.HeightUnit|null); + + /** Settings languageLocale */ + languageLocale?: (string|null); + + /** Settings utcOffset */ + utcOffset?: (google.protobuf.IDuration|null); + + /** Settings strideLengthWalkingType */ + strideLengthWalkingType?: (google.devicesandservices.health.v4.Settings.StrideLengthType|keyof typeof google.devicesandservices.health.v4.Settings.StrideLengthType|null); + + /** Settings strideLengthRunningType */ + strideLengthRunningType?: (google.devicesandservices.health.v4.Settings.StrideLengthType|keyof typeof google.devicesandservices.health.v4.Settings.StrideLengthType|null); + + /** Settings swimUnit */ + swimUnit?: (google.devicesandservices.health.v4.Settings.SwimUnit|keyof typeof google.devicesandservices.health.v4.Settings.SwimUnit|null); + + /** Settings temperatureUnit */ + temperatureUnit?: (google.devicesandservices.health.v4.Settings.TemperatureUnit|keyof typeof google.devicesandservices.health.v4.Settings.TemperatureUnit|null); + + /** Settings timeZone */ + timeZone?: (string|null); + + /** Settings weightUnit */ + weightUnit?: (google.devicesandservices.health.v4.Settings.WeightUnit|keyof typeof google.devicesandservices.health.v4.Settings.WeightUnit|null); + + /** Settings waterUnit */ + waterUnit?: (google.devicesandservices.health.v4.Settings.WaterUnit|keyof typeof google.devicesandservices.health.v4.Settings.WaterUnit|null); + + /** Settings foodLanguageCode */ + foodLanguageCode?: (string|null); + } + + /** Represents a Settings. */ + class Settings implements ISettings { + + /** + * Constructs a new Settings. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.ISettings); + + /** Settings name. */ + public name: string; + + /** Settings autoStrideEnabled. */ + public autoStrideEnabled: boolean; + + /** Settings distanceUnit. */ + public distanceUnit: (google.devicesandservices.health.v4.Settings.DistanceUnit|keyof typeof google.devicesandservices.health.v4.Settings.DistanceUnit); + + /** Settings glucoseUnit. */ + public glucoseUnit: (google.devicesandservices.health.v4.Settings.GlucoseUnit|keyof typeof google.devicesandservices.health.v4.Settings.GlucoseUnit); + + /** Settings heightUnit. */ + public heightUnit: (google.devicesandservices.health.v4.Settings.HeightUnit|keyof typeof google.devicesandservices.health.v4.Settings.HeightUnit); + + /** Settings languageLocale. */ + public languageLocale: string; + + /** Settings utcOffset. */ + public utcOffset?: (google.protobuf.IDuration|null); - /** DataSource application */ - application?: (google.devicesandservices.health.v4.DataSource.IApplication|null); + /** Settings strideLengthWalkingType. */ + public strideLengthWalkingType: (google.devicesandservices.health.v4.Settings.StrideLengthType|keyof typeof google.devicesandservices.health.v4.Settings.StrideLengthType); - /** DataSource platform */ - platform?: (google.devicesandservices.health.v4.DataSource.Platform|keyof typeof google.devicesandservices.health.v4.DataSource.Platform|null); - } + /** Settings strideLengthRunningType. */ + public strideLengthRunningType: (google.devicesandservices.health.v4.Settings.StrideLengthType|keyof typeof google.devicesandservices.health.v4.Settings.StrideLengthType); - /** Represents a DataSource. */ - class DataSource implements IDataSource { + /** Settings swimUnit. */ + public swimUnit: (google.devicesandservices.health.v4.Settings.SwimUnit|keyof typeof google.devicesandservices.health.v4.Settings.SwimUnit); - /** - * Constructs a new DataSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.devicesandservices.health.v4.IDataSource); + /** Settings temperatureUnit. */ + public temperatureUnit: (google.devicesandservices.health.v4.Settings.TemperatureUnit|keyof typeof google.devicesandservices.health.v4.Settings.TemperatureUnit); - /** DataSource recordingMethod. */ - public recordingMethod: (google.devicesandservices.health.v4.DataSource.RecordingMethod|keyof typeof google.devicesandservices.health.v4.DataSource.RecordingMethod); + /** Settings timeZone. */ + public timeZone: string; - /** DataSource device. */ - public device?: (google.devicesandservices.health.v4.DataSource.IDevice|null); + /** Settings weightUnit. */ + public weightUnit: (google.devicesandservices.health.v4.Settings.WeightUnit|keyof typeof google.devicesandservices.health.v4.Settings.WeightUnit); - /** DataSource application. */ - public application?: (google.devicesandservices.health.v4.DataSource.IApplication|null); + /** Settings waterUnit. */ + public waterUnit: (google.devicesandservices.health.v4.Settings.WaterUnit|keyof typeof google.devicesandservices.health.v4.Settings.WaterUnit); - /** DataSource platform. */ - public platform: (google.devicesandservices.health.v4.DataSource.Platform|keyof typeof google.devicesandservices.health.v4.DataSource.Platform); + /** Settings foodLanguageCode. */ + public foodLanguageCode: string; /** - * Creates a new DataSource instance using the specified properties. + * Creates a new Settings instance using the specified properties. * @param [properties] Properties to set - * @returns DataSource instance + * @returns Settings instance */ - public static create(properties?: google.devicesandservices.health.v4.IDataSource): google.devicesandservices.health.v4.DataSource; + public static create(properties?: google.devicesandservices.health.v4.ISettings): google.devicesandservices.health.v4.Settings; /** - * Encodes the specified DataSource message. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.verify|verify} messages. - * @param message DataSource message or plain object to encode + * Encodes the specified Settings message. Does not implicitly {@link google.devicesandservices.health.v4.Settings.verify|verify} messages. + * @param message Settings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.ISettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.verify|verify} messages. - * @param message DataSource message or plain object to encode + * Encodes the specified Settings message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Settings.verify|verify} messages. + * @param message Settings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.ISettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DataSource message from the specified reader or buffer. + * Decodes a Settings message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DataSource + * @returns Settings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DataSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Settings; /** - * Decodes a DataSource message from the specified reader or buffer, length delimited. + * Decodes a Settings message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DataSource + * @returns Settings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DataSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Settings; /** - * Verifies a DataSource message. + * Verifies a Settings message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * Creates a Settings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DataSource + * @returns Settings */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DataSource; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Settings; /** - * Creates a plain object from a DataSource message. Also converts values to other types if specified. - * @param message DataSource + * Creates a plain object from a Settings message. Also converts values to other types if specified. + * @param message Settings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.DataSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.Settings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DataSource to JSON. + * Converts this Settings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DataSource + * Gets the default type url for Settings * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace DataSource { - - /** Properties of a Device. */ - interface IDevice { - - /** Device formFactor */ - formFactor?: (google.devicesandservices.health.v4.DataSource.Device.FormFactor|keyof typeof google.devicesandservices.health.v4.DataSource.Device.FormFactor|null); - - /** Device manufacturer */ - manufacturer?: (string|null); + namespace Settings { - /** Device displayName */ - displayName?: (string|null); + /** DistanceUnit enum. */ + enum DistanceUnit { + DISTANCE_UNIT_UNSPECIFIED = 0, + DISTANCE_UNIT_MILES = 1, + DISTANCE_UNIT_KILOMETERS = 2 } - /** Represents a Device. */ - class Device implements IDevice { - - /** - * Constructs a new Device. - * @param [properties] Properties to set - */ - constructor(properties?: google.devicesandservices.health.v4.DataSource.IDevice); - - /** Device formFactor. */ - public formFactor: (google.devicesandservices.health.v4.DataSource.Device.FormFactor|keyof typeof google.devicesandservices.health.v4.DataSource.Device.FormFactor); - - /** Device manufacturer. */ - public manufacturer: string; - - /** Device displayName. */ - public displayName: string; - - /** - * Creates a new Device instance using the specified properties. - * @param [properties] Properties to set - * @returns Device instance - */ - public static create(properties?: google.devicesandservices.health.v4.DataSource.IDevice): google.devicesandservices.health.v4.DataSource.Device; - - /** - * Encodes the specified Device message. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Device.verify|verify} messages. - * @param message Device message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.devicesandservices.health.v4.DataSource.IDevice, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Device message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Device.verify|verify} messages. - * @param message Device message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.devicesandservices.health.v4.DataSource.IDevice, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Device message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Device - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DataSource.Device; - - /** - * Decodes a Device message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Device - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DataSource.Device; - - /** - * Verifies a Device message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Device message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Device - */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DataSource.Device; - - /** - * Creates a plain object from a Device message. Also converts values to other types if specified. - * @param message Device - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.devicesandservices.health.v4.DataSource.Device, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Device to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Device - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** GlucoseUnit enum. */ + enum GlucoseUnit { + GLUCOSE_UNIT_UNSPECIFIED = 0, + GLUCOSE_UNIT_MG_DL = 1, + GLUCOSE_UNIT_MMOL_L = 2 } - namespace Device { - - /** FormFactor enum. */ - enum FormFactor { - FORM_FACTOR_UNSPECIFIED = 0, - FITNESS_BAND = 1, - WATCH = 2, - PHONE = 3, - RING = 4, - CHEST_STRAP = 5, - SCALE = 6, - TABLET = 7, - HEAD_MOUNTED = 8, - SMART_DISPLAY = 9 - } + /** HeightUnit enum. */ + enum HeightUnit { + HEIGHT_UNIT_UNSPECIFIED = 0, + HEIGHT_UNIT_INCHES = 1, + HEIGHT_UNIT_CENTIMETERS = 2 } - /** Properties of an Application. */ - interface IApplication { - - /** Application packageName */ - packageName?: (string|null); - - /** Application webClientId */ - webClientId?: (string|null); - - /** Application googleWebClientId */ - googleWebClientId?: (string|null); + /** StrideLengthType enum. */ + enum StrideLengthType { + STRIDE_LENGTH_TYPE_UNSPECIFIED = 0, + STRIDE_LENGTH_TYPE_DEFAULT = 1, + STRIDE_LENGTH_TYPE_MANUAL = 2, + STRIDE_LENGTH_TYPE_AUTO = 3 } - /** Represents an Application. */ - class Application implements IApplication { - - /** - * Constructs a new Application. - * @param [properties] Properties to set - */ - constructor(properties?: google.devicesandservices.health.v4.DataSource.IApplication); + /** SwimUnit enum. */ + enum SwimUnit { + SWIM_UNIT_UNSPECIFIED = 0, + SWIM_UNIT_METERS = 1, + SWIM_UNIT_YARDS = 2 + } - /** Application packageName. */ - public packageName: string; + /** TemperatureUnit enum. */ + enum TemperatureUnit { + TEMPERATURE_UNIT_UNSPECIFIED = 0, + TEMPERATURE_UNIT_CELSIUS = 1, + TEMPERATURE_UNIT_FAHRENHEIT = 2 + } - /** Application webClientId. */ - public webClientId: string; + /** WeightUnit enum. */ + enum WeightUnit { + WEIGHT_UNIT_UNSPECIFIED = 0, + WEIGHT_UNIT_POUNDS = 1, + WEIGHT_UNIT_STONE = 2, + WEIGHT_UNIT_KILOGRAMS = 3 + } - /** Application googleWebClientId. */ - public googleWebClientId: string; + /** WaterUnit enum. */ + enum WaterUnit { + WATER_UNIT_UNSPECIFIED = 0, + WATER_UNIT_ML = 1, + WATER_UNIT_FL_OZ = 2, + WATER_UNIT_CUP = 3 + } + } - /** - * Creates a new Application instance using the specified properties. - * @param [properties] Properties to set - * @returns Application instance - */ - public static create(properties?: google.devicesandservices.health.v4.DataSource.IApplication): google.devicesandservices.health.v4.DataSource.Application; + /** Properties of an Identity. */ + interface IIdentity { - /** - * Encodes the specified Application message. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Application.verify|verify} messages. - * @param message Application message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.devicesandservices.health.v4.DataSource.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; + /** Identity name */ + name?: (string|null); - /** - * Encodes the specified Application message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Application.verify|verify} messages. - * @param message Application message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.devicesandservices.health.v4.DataSource.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; + /** Identity legacyUserId */ + legacyUserId?: (string|null); - /** - * Decodes an Application message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Application - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.DataSource.Application; + /** Identity healthUserId */ + healthUserId?: (string|null); + } - /** - * Decodes an Application message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Application - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.DataSource.Application; + /** Represents an Identity. */ + class Identity implements IIdentity { - /** - * Verifies an Application message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new Identity. + * @param [properties] Properties to set + */ + constructor(properties?: google.devicesandservices.health.v4.IIdentity); - /** - * Creates an Application message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Application - */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.DataSource.Application; + /** Identity name. */ + public name: string; - /** - * Creates a plain object from an Application message. Also converts values to other types if specified. - * @param message Application - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.devicesandservices.health.v4.DataSource.Application, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Identity legacyUserId. */ + public legacyUserId: string; - /** - * Converts this Application to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Identity healthUserId. */ + public healthUserId: string; - /** - * Gets the default type url for Application - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Creates a new Identity instance using the specified properties. + * @param [properties] Properties to set + * @returns Identity instance + */ + public static create(properties?: google.devicesandservices.health.v4.IIdentity): google.devicesandservices.health.v4.Identity; - /** RecordingMethod enum. */ - enum RecordingMethod { - RECORDING_METHOD_UNSPECIFIED = 0, - MANUAL = 1, - PASSIVELY_MEASURED = 2, - DERIVED = 3, - ACTIVELY_MEASURED = 4, - UNKNOWN = 5 - } + /** + * Encodes the specified Identity message. Does not implicitly {@link google.devicesandservices.health.v4.Identity.verify|verify} messages. + * @param message Identity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devicesandservices.health.v4.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; - /** Platform enum. */ - enum Platform { - PLATFORM_UNSPECIFIED = 0, - FITBIT = 1, - HEALTH_CONNECT = 2, - HEALTH_KIT = 3, - FIT = 4, - FITBIT_WEB_API = 5, - NEST = 6, - GOOGLE_WEB_API = 7, - GOOGLE_PARTNER_INTEGRATION = 8 - } - } + /** + * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Identity.verify|verify} messages. + * @param message Identity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devicesandservices.health.v4.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a HealthProfileService */ - class HealthProfileService extends $protobuf.rpc.Service { + /** + * Decodes an Identity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Identity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Identity; /** - * Constructs a new HealthProfileService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Decodes an Identity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Identity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Identity; /** - * Creates new HealthProfileService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. + * Verifies an Identity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): HealthProfileService; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GetProfile. - * @param request GetProfileRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Profile + * Creates an Identity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Identity */ - public getProfile(request: google.devicesandservices.health.v4.IGetProfileRequest, callback: google.devicesandservices.health.v4.HealthProfileService.GetProfileCallback): void; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Identity; /** - * Calls GetProfile. - * @param request GetProfileRequest message or plain object - * @returns Promise + * Creates a plain object from an Identity message. Also converts values to other types if specified. + * @param message Identity + * @param [options] Conversion options + * @returns Plain object */ - public getProfile(request: google.devicesandservices.health.v4.IGetProfileRequest): Promise; + public static toObject(message: google.devicesandservices.health.v4.Identity, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls UpdateProfile. - * @param request UpdateProfileRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Profile + * Converts this Identity to JSON. + * @returns JSON object */ - public updateProfile(request: google.devicesandservices.health.v4.IUpdateProfileRequest, callback: google.devicesandservices.health.v4.HealthProfileService.UpdateProfileCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls UpdateProfile. - * @param request UpdateProfileRequest message or plain object - * @returns Promise + * Gets the default type url for Identity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public updateProfile(request: google.devicesandservices.health.v4.IUpdateProfileRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetProfileRequest. */ + interface IGetProfileRequest { + + /** GetProfileRequest name */ + name?: (string|null); + } + + /** Represents a GetProfileRequest. */ + class GetProfileRequest implements IGetProfileRequest { /** - * Calls GetSettings. - * @param request GetSettingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Settings + * Constructs a new GetProfileRequest. + * @param [properties] Properties to set */ - public getSettings(request: google.devicesandservices.health.v4.IGetSettingsRequest, callback: google.devicesandservices.health.v4.HealthProfileService.GetSettingsCallback): void; + constructor(properties?: google.devicesandservices.health.v4.IGetProfileRequest); + + /** GetProfileRequest name. */ + public name: string; /** - * Calls GetSettings. - * @param request GetSettingsRequest message or plain object - * @returns Promise + * Creates a new GetProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProfileRequest instance */ - public getSettings(request: google.devicesandservices.health.v4.IGetSettingsRequest): Promise; + public static create(properties?: google.devicesandservices.health.v4.IGetProfileRequest): google.devicesandservices.health.v4.GetProfileRequest; /** - * Calls UpdateSettings. - * @param request UpdateSettingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Settings + * Encodes the specified GetProfileRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetProfileRequest.verify|verify} messages. + * @param message GetProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateSettings(request: google.devicesandservices.health.v4.IUpdateSettingsRequest, callback: google.devicesandservices.health.v4.HealthProfileService.UpdateSettingsCallback): void; + public static encode(message: google.devicesandservices.health.v4.IGetProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateSettings. - * @param request UpdateSettingsRequest message or plain object - * @returns Promise + * Encodes the specified GetProfileRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetProfileRequest.verify|verify} messages. + * @param message GetProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateSettings(request: google.devicesandservices.health.v4.IUpdateSettingsRequest): Promise; + public static encodeDelimited(message: google.devicesandservices.health.v4.IGetProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetIdentity. - * @param request GetIdentityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Identity + * Decodes a GetProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getIdentity(request: google.devicesandservices.health.v4.IGetIdentityRequest, callback: google.devicesandservices.health.v4.HealthProfileService.GetIdentityCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.GetProfileRequest; /** - * Calls GetIdentity. - * @param request GetIdentityRequest message or plain object - * @returns Promise + * Decodes a GetProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getIdentity(request: google.devicesandservices.health.v4.IGetIdentityRequest): Promise; - } - - namespace HealthProfileService { + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.GetProfileRequest; /** - * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getProfile}. - * @param error Error, if any - * @param [response] Profile + * Verifies a GetProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type GetProfileCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.Profile) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|updateProfile}. - * @param error Error, if any - * @param [response] Profile + * Creates a GetProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProfileRequest */ - type UpdateProfileCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.Profile) => void; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.GetProfileRequest; /** - * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getSettings}. - * @param error Error, if any - * @param [response] Settings + * Creates a plain object from a GetProfileRequest message. Also converts values to other types if specified. + * @param message GetProfileRequest + * @param [options] Conversion options + * @returns Plain object */ - type GetSettingsCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.Settings) => void; + public static toObject(message: google.devicesandservices.health.v4.GetProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|updateSettings}. - * @param error Error, if any - * @param [response] Settings + * Converts this GetProfileRequest to JSON. + * @returns JSON object */ - type UpdateSettingsCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.Settings) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getIdentity}. - * @param error Error, if any - * @param [response] Identity + * Gets the default type url for GetProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type GetIdentityCallback = (error: (Error|null), response?: google.devicesandservices.health.v4.Identity) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Profile. */ - interface IProfile { + /** Properties of a GetIrnProfileRequest. */ + interface IGetIrnProfileRequest { - /** Profile name */ + /** GetIrnProfileRequest name */ name?: (string|null); - - /** Profile age */ - age?: (number|null); - - /** Profile membershipStartDate */ - membershipStartDate?: (google.type.IDate|null); - - /** Profile userConfiguredWalkingStrideLengthMm */ - userConfiguredWalkingStrideLengthMm?: (number|null); - - /** Profile userConfiguredRunningStrideLengthMm */ - userConfiguredRunningStrideLengthMm?: (number|null); - - /** Profile autoWalkingStrideLengthMm */ - autoWalkingStrideLengthMm?: (number|null); - - /** Profile autoRunningStrideLengthMm */ - autoRunningStrideLengthMm?: (number|null); } - /** Represents a Profile. */ - class Profile implements IProfile { + /** Represents a GetIrnProfileRequest. */ + class GetIrnProfileRequest implements IGetIrnProfileRequest { /** - * Constructs a new Profile. + * Constructs a new GetIrnProfileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IProfile); + constructor(properties?: google.devicesandservices.health.v4.IGetIrnProfileRequest); - /** Profile name. */ + /** GetIrnProfileRequest name. */ public name: string; - /** Profile age. */ - public age: number; - - /** Profile membershipStartDate. */ - public membershipStartDate?: (google.type.IDate|null); - - /** Profile userConfiguredWalkingStrideLengthMm. */ - public userConfiguredWalkingStrideLengthMm?: (number|null); - - /** Profile userConfiguredRunningStrideLengthMm. */ - public userConfiguredRunningStrideLengthMm?: (number|null); - - /** Profile autoWalkingStrideLengthMm. */ - public autoWalkingStrideLengthMm?: (number|null); - - /** Profile autoRunningStrideLengthMm. */ - public autoRunningStrideLengthMm?: (number|null); - /** - * Creates a new Profile instance using the specified properties. + * Creates a new GetIrnProfileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Profile instance + * @returns GetIrnProfileRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.IProfile): google.devicesandservices.health.v4.Profile; + public static create(properties?: google.devicesandservices.health.v4.IGetIrnProfileRequest): google.devicesandservices.health.v4.GetIrnProfileRequest; /** - * Encodes the specified Profile message. Does not implicitly {@link google.devicesandservices.health.v4.Profile.verify|verify} messages. - * @param message Profile message or plain object to encode + * Encodes the specified GetIrnProfileRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetIrnProfileRequest.verify|verify} messages. + * @param message GetIrnProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IProfile, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IGetIrnProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Profile message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Profile.verify|verify} messages. - * @param message Profile message or plain object to encode + * Encodes the specified GetIrnProfileRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetIrnProfileRequest.verify|verify} messages. + * @param message GetIrnProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IProfile, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IGetIrnProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Profile message from the specified reader or buffer. + * Decodes a GetIrnProfileRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Profile + * @returns GetIrnProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Profile; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.GetIrnProfileRequest; /** - * Decodes a Profile message from the specified reader or buffer, length delimited. + * Decodes a GetIrnProfileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Profile + * @returns GetIrnProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Profile; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.GetIrnProfileRequest; /** - * Verifies a Profile message. + * Verifies a GetIrnProfileRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Profile message from a plain object. Also converts values to their respective internal types. + * Creates a GetIrnProfileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Profile + * @returns GetIrnProfileRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Profile; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.GetIrnProfileRequest; /** - * Creates a plain object from a Profile message. Also converts values to other types if specified. - * @param message Profile + * Creates a plain object from a GetIrnProfileRequest message. Also converts values to other types if specified. + * @param message GetIrnProfileRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.Profile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.GetIrnProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Profile to JSON. + * Converts this GetIrnProfileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Profile + * Gets the default type url for GetIrnProfileRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Settings. */ - interface ISettings { - - /** Settings name */ - name?: (string|null); - - /** Settings autoStrideEnabled */ - autoStrideEnabled?: (boolean|null); - - /** Settings distanceUnit */ - distanceUnit?: (google.devicesandservices.health.v4.Settings.DistanceUnit|keyof typeof google.devicesandservices.health.v4.Settings.DistanceUnit|null); - - /** Settings glucoseUnit */ - glucoseUnit?: (google.devicesandservices.health.v4.Settings.GlucoseUnit|keyof typeof google.devicesandservices.health.v4.Settings.GlucoseUnit|null); - - /** Settings heightUnit */ - heightUnit?: (google.devicesandservices.health.v4.Settings.HeightUnit|keyof typeof google.devicesandservices.health.v4.Settings.HeightUnit|null); - - /** Settings languageLocale */ - languageLocale?: (string|null); - - /** Settings utcOffset */ - utcOffset?: (google.protobuf.IDuration|null); - - /** Settings strideLengthWalkingType */ - strideLengthWalkingType?: (google.devicesandservices.health.v4.Settings.StrideLengthType|keyof typeof google.devicesandservices.health.v4.Settings.StrideLengthType|null); - - /** Settings strideLengthRunningType */ - strideLengthRunningType?: (google.devicesandservices.health.v4.Settings.StrideLengthType|keyof typeof google.devicesandservices.health.v4.Settings.StrideLengthType|null); - - /** Settings swimUnit */ - swimUnit?: (google.devicesandservices.health.v4.Settings.SwimUnit|keyof typeof google.devicesandservices.health.v4.Settings.SwimUnit|null); - - /** Settings temperatureUnit */ - temperatureUnit?: (google.devicesandservices.health.v4.Settings.TemperatureUnit|keyof typeof google.devicesandservices.health.v4.Settings.TemperatureUnit|null); - - /** Settings timeZone */ - timeZone?: (string|null); + /** Properties of an UpdateProfileRequest. */ + interface IUpdateProfileRequest { - /** Settings weightUnit */ - weightUnit?: (google.devicesandservices.health.v4.Settings.WeightUnit|keyof typeof google.devicesandservices.health.v4.Settings.WeightUnit|null); + /** UpdateProfileRequest profile */ + profile?: (google.devicesandservices.health.v4.IProfile|null); - /** Settings waterUnit */ - waterUnit?: (google.devicesandservices.health.v4.Settings.WaterUnit|keyof typeof google.devicesandservices.health.v4.Settings.WaterUnit|null); + /** UpdateProfileRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a Settings. */ - class Settings implements ISettings { + /** Represents an UpdateProfileRequest. */ + class UpdateProfileRequest implements IUpdateProfileRequest { /** - * Constructs a new Settings. + * Constructs a new UpdateProfileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.ISettings); - - /** Settings name. */ - public name: string; - - /** Settings autoStrideEnabled. */ - public autoStrideEnabled: boolean; - - /** Settings distanceUnit. */ - public distanceUnit: (google.devicesandservices.health.v4.Settings.DistanceUnit|keyof typeof google.devicesandservices.health.v4.Settings.DistanceUnit); - - /** Settings glucoseUnit. */ - public glucoseUnit: (google.devicesandservices.health.v4.Settings.GlucoseUnit|keyof typeof google.devicesandservices.health.v4.Settings.GlucoseUnit); - - /** Settings heightUnit. */ - public heightUnit: (google.devicesandservices.health.v4.Settings.HeightUnit|keyof typeof google.devicesandservices.health.v4.Settings.HeightUnit); - - /** Settings languageLocale. */ - public languageLocale: string; - - /** Settings utcOffset. */ - public utcOffset?: (google.protobuf.IDuration|null); - - /** Settings strideLengthWalkingType. */ - public strideLengthWalkingType: (google.devicesandservices.health.v4.Settings.StrideLengthType|keyof typeof google.devicesandservices.health.v4.Settings.StrideLengthType); - - /** Settings strideLengthRunningType. */ - public strideLengthRunningType: (google.devicesandservices.health.v4.Settings.StrideLengthType|keyof typeof google.devicesandservices.health.v4.Settings.StrideLengthType); - - /** Settings swimUnit. */ - public swimUnit: (google.devicesandservices.health.v4.Settings.SwimUnit|keyof typeof google.devicesandservices.health.v4.Settings.SwimUnit); - - /** Settings temperatureUnit. */ - public temperatureUnit: (google.devicesandservices.health.v4.Settings.TemperatureUnit|keyof typeof google.devicesandservices.health.v4.Settings.TemperatureUnit); - - /** Settings timeZone. */ - public timeZone: string; + constructor(properties?: google.devicesandservices.health.v4.IUpdateProfileRequest); - /** Settings weightUnit. */ - public weightUnit: (google.devicesandservices.health.v4.Settings.WeightUnit|keyof typeof google.devicesandservices.health.v4.Settings.WeightUnit); + /** UpdateProfileRequest profile. */ + public profile?: (google.devicesandservices.health.v4.IProfile|null); - /** Settings waterUnit. */ - public waterUnit: (google.devicesandservices.health.v4.Settings.WaterUnit|keyof typeof google.devicesandservices.health.v4.Settings.WaterUnit); + /** UpdateProfileRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new Settings instance using the specified properties. + * Creates a new UpdateProfileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Settings instance + * @returns UpdateProfileRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.ISettings): google.devicesandservices.health.v4.Settings; + public static create(properties?: google.devicesandservices.health.v4.IUpdateProfileRequest): google.devicesandservices.health.v4.UpdateProfileRequest; /** - * Encodes the specified Settings message. Does not implicitly {@link google.devicesandservices.health.v4.Settings.verify|verify} messages. - * @param message Settings message or plain object to encode + * Encodes the specified UpdateProfileRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateProfileRequest.verify|verify} messages. + * @param message UpdateProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.ISettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IUpdateProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Settings message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Settings.verify|verify} messages. - * @param message Settings message or plain object to encode + * Encodes the specified UpdateProfileRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateProfileRequest.verify|verify} messages. + * @param message UpdateProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.ISettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IUpdateProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Settings message from the specified reader or buffer. + * Decodes an UpdateProfileRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Settings + * @returns UpdateProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Settings; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.UpdateProfileRequest; /** - * Decodes a Settings message from the specified reader or buffer, length delimited. + * Decodes an UpdateProfileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Settings + * @returns UpdateProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Settings; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.UpdateProfileRequest; /** - * Verifies a Settings message. + * Verifies an UpdateProfileRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Settings message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateProfileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Settings + * @returns UpdateProfileRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Settings; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.UpdateProfileRequest; /** - * Creates a plain object from a Settings message. Also converts values to other types if specified. - * @param message Settings + * Creates a plain object from an UpdateProfileRequest message. Also converts values to other types if specified. + * @param message UpdateProfileRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.Settings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.UpdateProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Settings to JSON. + * Converts this UpdateProfileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Settings + * Gets the default type url for UpdateProfileRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace Settings { - - /** DistanceUnit enum. */ - enum DistanceUnit { - DISTANCE_UNIT_UNSPECIFIED = 0, - DISTANCE_UNIT_MILES = 1, - DISTANCE_UNIT_KILOMETERS = 2 - } - - /** GlucoseUnit enum. */ - enum GlucoseUnit { - GLUCOSE_UNIT_UNSPECIFIED = 0, - GLUCOSE_UNIT_MG_DL = 1, - GLUCOSE_UNIT_MMOL_L = 2 - } - - /** HeightUnit enum. */ - enum HeightUnit { - HEIGHT_UNIT_UNSPECIFIED = 0, - HEIGHT_UNIT_INCHES = 1, - HEIGHT_UNIT_CENTIMETERS = 2 - } - - /** StrideLengthType enum. */ - enum StrideLengthType { - STRIDE_LENGTH_TYPE_UNSPECIFIED = 0, - STRIDE_LENGTH_TYPE_DEFAULT = 1, - STRIDE_LENGTH_TYPE_MANUAL = 2, - STRIDE_LENGTH_TYPE_AUTO = 3 - } - - /** SwimUnit enum. */ - enum SwimUnit { - SWIM_UNIT_UNSPECIFIED = 0, - SWIM_UNIT_METERS = 1, - SWIM_UNIT_YARDS = 2 - } - - /** TemperatureUnit enum. */ - enum TemperatureUnit { - TEMPERATURE_UNIT_UNSPECIFIED = 0, - TEMPERATURE_UNIT_CELSIUS = 1, - TEMPERATURE_UNIT_FAHRENHEIT = 2 - } - - /** WeightUnit enum. */ - enum WeightUnit { - WEIGHT_UNIT_UNSPECIFIED = 0, - WEIGHT_UNIT_POUNDS = 1, - WEIGHT_UNIT_STONE = 2, - WEIGHT_UNIT_KILOGRAMS = 3 - } - - /** WaterUnit enum. */ - enum WaterUnit { - WATER_UNIT_UNSPECIFIED = 0, - WATER_UNIT_ML = 1, - WATER_UNIT_FL_OZ = 2, - WATER_UNIT_CUP = 3 - } - } - - /** Properties of an Identity. */ - interface IIdentity { + /** Properties of a GetSettingsRequest. */ + interface IGetSettingsRequest { - /** Identity name */ + /** GetSettingsRequest name */ name?: (string|null); - - /** Identity legacyUserId */ - legacyUserId?: (string|null); - - /** Identity healthUserId */ - healthUserId?: (string|null); } - /** Represents an Identity. */ - class Identity implements IIdentity { + /** Represents a GetSettingsRequest. */ + class GetSettingsRequest implements IGetSettingsRequest { /** - * Constructs a new Identity. + * Constructs a new GetSettingsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IIdentity); + constructor(properties?: google.devicesandservices.health.v4.IGetSettingsRequest); - /** Identity name. */ + /** GetSettingsRequest name. */ public name: string; - /** Identity legacyUserId. */ - public legacyUserId: string; - - /** Identity healthUserId. */ - public healthUserId: string; - /** - * Creates a new Identity instance using the specified properties. + * Creates a new GetSettingsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Identity instance + * @returns GetSettingsRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.IIdentity): google.devicesandservices.health.v4.Identity; + public static create(properties?: google.devicesandservices.health.v4.IGetSettingsRequest): google.devicesandservices.health.v4.GetSettingsRequest; /** - * Encodes the specified Identity message. Does not implicitly {@link google.devicesandservices.health.v4.Identity.verify|verify} messages. - * @param message Identity message or plain object to encode + * Encodes the specified GetSettingsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetSettingsRequest.verify|verify} messages. + * @param message GetSettingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IGetSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Identity.verify|verify} messages. - * @param message Identity message or plain object to encode + * Encodes the specified GetSettingsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetSettingsRequest.verify|verify} messages. + * @param message GetSettingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IGetSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Identity message from the specified reader or buffer. + * Decodes a GetSettingsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Identity + * @returns GetSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.Identity; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.GetSettingsRequest; /** - * Decodes an Identity message from the specified reader or buffer, length delimited. + * Decodes a GetSettingsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Identity + * @returns GetSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.Identity; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.GetSettingsRequest; /** - * Verifies an Identity message. + * Verifies a GetSettingsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an Identity message from a plain object. Also converts values to their respective internal types. + * Creates a GetSettingsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Identity + * @returns GetSettingsRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.Identity; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.GetSettingsRequest; /** - * Creates a plain object from an Identity message. Also converts values to other types if specified. - * @param message Identity + * Creates a plain object from a GetSettingsRequest message. Also converts values to other types if specified. + * @param message GetSettingsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.Identity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.GetSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Identity to JSON. + * Converts this GetSettingsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Identity + * Gets the default type url for GetSettingsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetProfileRequest. */ - interface IGetProfileRequest { + /** Properties of an UpdateSettingsRequest. */ + interface IUpdateSettingsRequest { - /** GetProfileRequest name */ - name?: (string|null); + /** UpdateSettingsRequest settings */ + settings?: (google.devicesandservices.health.v4.ISettings|null); + + /** UpdateSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a GetProfileRequest. */ - class GetProfileRequest implements IGetProfileRequest { + /** Represents an UpdateSettingsRequest. */ + class UpdateSettingsRequest implements IUpdateSettingsRequest { /** - * Constructs a new GetProfileRequest. + * Constructs a new UpdateSettingsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IGetProfileRequest); + constructor(properties?: google.devicesandservices.health.v4.IUpdateSettingsRequest); - /** GetProfileRequest name. */ - public name: string; + /** UpdateSettingsRequest settings. */ + public settings?: (google.devicesandservices.health.v4.ISettings|null); + + /** UpdateSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new GetProfileRequest instance using the specified properties. + * Creates a new UpdateSettingsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetProfileRequest instance + * @returns UpdateSettingsRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.IGetProfileRequest): google.devicesandservices.health.v4.GetProfileRequest; + public static create(properties?: google.devicesandservices.health.v4.IUpdateSettingsRequest): google.devicesandservices.health.v4.UpdateSettingsRequest; /** - * Encodes the specified GetProfileRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetProfileRequest.verify|verify} messages. - * @param message GetProfileRequest message or plain object to encode + * Encodes the specified UpdateSettingsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSettingsRequest.verify|verify} messages. + * @param message UpdateSettingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IGetProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IUpdateSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetProfileRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetProfileRequest.verify|verify} messages. - * @param message GetProfileRequest message or plain object to encode + * Encodes the specified UpdateSettingsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSettingsRequest.verify|verify} messages. + * @param message UpdateSettingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IGetProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IUpdateSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetProfileRequest message from the specified reader or buffer. + * Decodes an UpdateSettingsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetProfileRequest + * @returns UpdateSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.GetProfileRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.UpdateSettingsRequest; /** - * Decodes a GetProfileRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateSettingsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetProfileRequest + * @returns UpdateSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.GetProfileRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.UpdateSettingsRequest; /** - * Verifies a GetProfileRequest message. + * Verifies an UpdateSettingsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetProfileRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSettingsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetProfileRequest + * @returns UpdateSettingsRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.GetProfileRequest; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.UpdateSettingsRequest; /** - * Creates a plain object from a GetProfileRequest message. Also converts values to other types if specified. - * @param message GetProfileRequest + * Creates a plain object from an UpdateSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateSettingsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.GetProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.UpdateSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetProfileRequest to JSON. + * Converts this UpdateSettingsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetProfileRequest + * Gets the default type url for UpdateSettingsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateProfileRequest. */ - interface IUpdateProfileRequest { - - /** UpdateProfileRequest profile */ - profile?: (google.devicesandservices.health.v4.IProfile|null); + /** Properties of a GetIdentityRequest. */ + interface IGetIdentityRequest { - /** UpdateProfileRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** GetIdentityRequest name */ + name?: (string|null); } - /** Represents an UpdateProfileRequest. */ - class UpdateProfileRequest implements IUpdateProfileRequest { + /** Represents a GetIdentityRequest. */ + class GetIdentityRequest implements IGetIdentityRequest { /** - * Constructs a new UpdateProfileRequest. + * Constructs a new GetIdentityRequest. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IUpdateProfileRequest); - - /** UpdateProfileRequest profile. */ - public profile?: (google.devicesandservices.health.v4.IProfile|null); + constructor(properties?: google.devicesandservices.health.v4.IGetIdentityRequest); - /** UpdateProfileRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** GetIdentityRequest name. */ + public name: string; /** - * Creates a new UpdateProfileRequest instance using the specified properties. + * Creates a new GetIdentityRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateProfileRequest instance + * @returns GetIdentityRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.IUpdateProfileRequest): google.devicesandservices.health.v4.UpdateProfileRequest; + public static create(properties?: google.devicesandservices.health.v4.IGetIdentityRequest): google.devicesandservices.health.v4.GetIdentityRequest; /** - * Encodes the specified UpdateProfileRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateProfileRequest.verify|verify} messages. - * @param message UpdateProfileRequest message or plain object to encode + * Encodes the specified GetIdentityRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetIdentityRequest.verify|verify} messages. + * @param message GetIdentityRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IUpdateProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IGetIdentityRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateProfileRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateProfileRequest.verify|verify} messages. - * @param message UpdateProfileRequest message or plain object to encode + * Encodes the specified GetIdentityRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetIdentityRequest.verify|verify} messages. + * @param message GetIdentityRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IUpdateProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IGetIdentityRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateProfileRequest message from the specified reader or buffer. + * Decodes a GetIdentityRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateProfileRequest + * @returns GetIdentityRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.UpdateProfileRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.GetIdentityRequest; /** - * Decodes an UpdateProfileRequest message from the specified reader or buffer, length delimited. + * Decodes a GetIdentityRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateProfileRequest + * @returns GetIdentityRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.UpdateProfileRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.GetIdentityRequest; /** - * Verifies an UpdateProfileRequest message. + * Verifies a GetIdentityRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateProfileRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetIdentityRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateProfileRequest + * @returns GetIdentityRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.UpdateProfileRequest; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.GetIdentityRequest; /** - * Creates a plain object from an UpdateProfileRequest message. Also converts values to other types if specified. - * @param message UpdateProfileRequest + * Creates a plain object from a GetIdentityRequest message. Also converts values to other types if specified. + * @param message GetIdentityRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.UpdateProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.GetIdentityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateProfileRequest to JSON. + * Converts this GetIdentityRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateProfileRequest + * Gets the default type url for GetIdentityRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetSettingsRequest. */ - interface IGetSettingsRequest { + /** Properties of a GetPairedDeviceRequest. */ + interface IGetPairedDeviceRequest { - /** GetSettingsRequest name */ + /** GetPairedDeviceRequest name */ name?: (string|null); } - /** Represents a GetSettingsRequest. */ - class GetSettingsRequest implements IGetSettingsRequest { + /** Represents a GetPairedDeviceRequest. */ + class GetPairedDeviceRequest implements IGetPairedDeviceRequest { /** - * Constructs a new GetSettingsRequest. + * Constructs a new GetPairedDeviceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IGetSettingsRequest); + constructor(properties?: google.devicesandservices.health.v4.IGetPairedDeviceRequest); - /** GetSettingsRequest name. */ + /** GetPairedDeviceRequest name. */ public name: string; /** - * Creates a new GetSettingsRequest instance using the specified properties. + * Creates a new GetPairedDeviceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetSettingsRequest instance + * @returns GetPairedDeviceRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.IGetSettingsRequest): google.devicesandservices.health.v4.GetSettingsRequest; + public static create(properties?: google.devicesandservices.health.v4.IGetPairedDeviceRequest): google.devicesandservices.health.v4.GetPairedDeviceRequest; /** - * Encodes the specified GetSettingsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetSettingsRequest.verify|verify} messages. - * @param message GetSettingsRequest message or plain object to encode + * Encodes the specified GetPairedDeviceRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetPairedDeviceRequest.verify|verify} messages. + * @param message GetPairedDeviceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IGetSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IGetPairedDeviceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetSettingsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetSettingsRequest.verify|verify} messages. - * @param message GetSettingsRequest message or plain object to encode + * Encodes the specified GetPairedDeviceRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetPairedDeviceRequest.verify|verify} messages. + * @param message GetPairedDeviceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IGetSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IGetPairedDeviceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetSettingsRequest message from the specified reader or buffer. + * Decodes a GetPairedDeviceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetSettingsRequest + * @returns GetPairedDeviceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.GetSettingsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.GetPairedDeviceRequest; /** - * Decodes a GetSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetPairedDeviceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetSettingsRequest + * @returns GetPairedDeviceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.GetSettingsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.GetPairedDeviceRequest; /** - * Verifies a GetSettingsRequest message. + * Verifies a GetPairedDeviceRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetPairedDeviceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetSettingsRequest + * @returns GetPairedDeviceRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.GetSettingsRequest; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.GetPairedDeviceRequest; /** - * Creates a plain object from a GetSettingsRequest message. Also converts values to other types if specified. - * @param message GetSettingsRequest + * Creates a plain object from a GetPairedDeviceRequest message. Also converts values to other types if specified. + * @param message GetPairedDeviceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.GetSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.GetPairedDeviceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetSettingsRequest to JSON. + * Converts this GetPairedDeviceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetSettingsRequest + * Gets the default type url for GetPairedDeviceRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateSettingsRequest. */ - interface IUpdateSettingsRequest { + /** Properties of a ListPairedDevicesRequest. */ + interface IListPairedDevicesRequest { - /** UpdateSettingsRequest settings */ - settings?: (google.devicesandservices.health.v4.ISettings|null); + /** ListPairedDevicesRequest parent */ + parent?: (string|null); - /** UpdateSettingsRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** ListPairedDevicesRequest pageSize */ + pageSize?: (number|null); + + /** ListPairedDevicesRequest pageToken */ + pageToken?: (string|null); } - /** Represents an UpdateSettingsRequest. */ - class UpdateSettingsRequest implements IUpdateSettingsRequest { + /** Represents a ListPairedDevicesRequest. */ + class ListPairedDevicesRequest implements IListPairedDevicesRequest { /** - * Constructs a new UpdateSettingsRequest. + * Constructs a new ListPairedDevicesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IUpdateSettingsRequest); + constructor(properties?: google.devicesandservices.health.v4.IListPairedDevicesRequest); - /** UpdateSettingsRequest settings. */ - public settings?: (google.devicesandservices.health.v4.ISettings|null); + /** ListPairedDevicesRequest parent. */ + public parent: string; - /** UpdateSettingsRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ListPairedDevicesRequest pageSize. */ + public pageSize: number; + + /** ListPairedDevicesRequest pageToken. */ + public pageToken: string; /** - * Creates a new UpdateSettingsRequest instance using the specified properties. + * Creates a new ListPairedDevicesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateSettingsRequest instance + * @returns ListPairedDevicesRequest instance */ - public static create(properties?: google.devicesandservices.health.v4.IUpdateSettingsRequest): google.devicesandservices.health.v4.UpdateSettingsRequest; + public static create(properties?: google.devicesandservices.health.v4.IListPairedDevicesRequest): google.devicesandservices.health.v4.ListPairedDevicesRequest; /** - * Encodes the specified UpdateSettingsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSettingsRequest.verify|verify} messages. - * @param message UpdateSettingsRequest message or plain object to encode + * Encodes the specified ListPairedDevicesRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ListPairedDevicesRequest.verify|verify} messages. + * @param message ListPairedDevicesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IUpdateSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IListPairedDevicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateSettingsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSettingsRequest.verify|verify} messages. - * @param message UpdateSettingsRequest message or plain object to encode + * Encodes the specified ListPairedDevicesRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListPairedDevicesRequest.verify|verify} messages. + * @param message ListPairedDevicesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IUpdateSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IListPairedDevicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateSettingsRequest message from the specified reader or buffer. + * Decodes a ListPairedDevicesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateSettingsRequest + * @returns ListPairedDevicesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.UpdateSettingsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ListPairedDevicesRequest; /** - * Decodes an UpdateSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListPairedDevicesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateSettingsRequest + * @returns ListPairedDevicesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.UpdateSettingsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ListPairedDevicesRequest; /** - * Verifies an UpdateSettingsRequest message. + * Verifies a ListPairedDevicesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListPairedDevicesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateSettingsRequest + * @returns ListPairedDevicesRequest */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.UpdateSettingsRequest; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ListPairedDevicesRequest; /** - * Creates a plain object from an UpdateSettingsRequest message. Also converts values to other types if specified. - * @param message UpdateSettingsRequest + * Creates a plain object from a ListPairedDevicesRequest message. Also converts values to other types if specified. + * @param message ListPairedDevicesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.UpdateSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.ListPairedDevicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateSettingsRequest to JSON. + * Converts this ListPairedDevicesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateSettingsRequest + * Gets the default type url for ListPairedDevicesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetIdentityRequest. */ - interface IGetIdentityRequest { + /** Properties of a ListPairedDevicesResponse. */ + interface IListPairedDevicesResponse { - /** GetIdentityRequest name */ - name?: (string|null); + /** ListPairedDevicesResponse pairedDevices */ + pairedDevices?: (google.devicesandservices.health.v4.IPairedDevice[]|null); + + /** ListPairedDevicesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a GetIdentityRequest. */ - class GetIdentityRequest implements IGetIdentityRequest { + /** Represents a ListPairedDevicesResponse. */ + class ListPairedDevicesResponse implements IListPairedDevicesResponse { /** - * Constructs a new GetIdentityRequest. + * Constructs a new ListPairedDevicesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.devicesandservices.health.v4.IGetIdentityRequest); + constructor(properties?: google.devicesandservices.health.v4.IListPairedDevicesResponse); - /** GetIdentityRequest name. */ - public name: string; + /** ListPairedDevicesResponse pairedDevices. */ + public pairedDevices: google.devicesandservices.health.v4.IPairedDevice[]; + + /** ListPairedDevicesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new GetIdentityRequest instance using the specified properties. + * Creates a new ListPairedDevicesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetIdentityRequest instance + * @returns ListPairedDevicesResponse instance */ - public static create(properties?: google.devicesandservices.health.v4.IGetIdentityRequest): google.devicesandservices.health.v4.GetIdentityRequest; + public static create(properties?: google.devicesandservices.health.v4.IListPairedDevicesResponse): google.devicesandservices.health.v4.ListPairedDevicesResponse; /** - * Encodes the specified GetIdentityRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetIdentityRequest.verify|verify} messages. - * @param message GetIdentityRequest message or plain object to encode + * Encodes the specified ListPairedDevicesResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ListPairedDevicesResponse.verify|verify} messages. + * @param message ListPairedDevicesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devicesandservices.health.v4.IGetIdentityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devicesandservices.health.v4.IListPairedDevicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetIdentityRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetIdentityRequest.verify|verify} messages. - * @param message GetIdentityRequest message or plain object to encode + * Encodes the specified ListPairedDevicesResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListPairedDevicesResponse.verify|verify} messages. + * @param message ListPairedDevicesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devicesandservices.health.v4.IGetIdentityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devicesandservices.health.v4.IListPairedDevicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetIdentityRequest message from the specified reader or buffer. + * Decodes a ListPairedDevicesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetIdentityRequest + * @returns ListPairedDevicesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.GetIdentityRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devicesandservices.health.v4.ListPairedDevicesResponse; /** - * Decodes a GetIdentityRequest message from the specified reader or buffer, length delimited. + * Decodes a ListPairedDevicesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetIdentityRequest + * @returns ListPairedDevicesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.GetIdentityRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devicesandservices.health.v4.ListPairedDevicesResponse; /** - * Verifies a GetIdentityRequest message. + * Verifies a ListPairedDevicesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetIdentityRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListPairedDevicesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetIdentityRequest + * @returns ListPairedDevicesResponse */ - public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.GetIdentityRequest; + public static fromObject(object: { [k: string]: any }): google.devicesandservices.health.v4.ListPairedDevicesResponse; /** - * Creates a plain object from a GetIdentityRequest message. Also converts values to other types if specified. - * @param message GetIdentityRequest + * Creates a plain object from a ListPairedDevicesResponse message. Also converts values to other types if specified. + * @param message ListPairedDevicesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devicesandservices.health.v4.GetIdentityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devicesandservices.health.v4.ListPairedDevicesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetIdentityRequest to JSON. + * Converts this ListPairedDevicesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetIdentityRequest + * Gets the default type url for ListPairedDevicesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -13922,6 +19947,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -13939,6 +19967,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -14639,6 +20670,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -14653,6 +20687,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -14709,26 +20746,138 @@ export namespace google { */ public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a NodeSettings. */ @@ -15057,6 +21206,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -15071,6 +21223,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -15395,6 +21550,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** LaunchStage enum. */ enum LaunchStage { LAUNCH_STAGE_UNSPECIFIED = 0, @@ -15511,6 +21769,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -15541,6 +21800,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -15590,6 +21852,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -15724,6 +21989,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -15765,6 +22033,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -16612,6 +22883,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -16638,6 +22912,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -17572,6 +23849,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -17627,6 +23907,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -17847,6 +24130,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -18085,6 +24483,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -18107,6 +24508,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -18699,6 +25103,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -18728,6 +25138,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -18850,6 +25266,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -18969,8 +25495,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -18985,8 +25514,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -19519,6 +26051,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of a Duration. */ interface IDuration { diff --git a/packages/google-devicesandservices-health/protos/protos.js b/packages/google-devicesandservices-health/protos/protos.js index 7b505ff44279..3e8002fb5f98 100644 --- a/packages/google-devicesandservices-health/protos/protos.js +++ b/packages/google-devicesandservices-health/protos/protos.js @@ -1533,6 +1533,192 @@ return values; })(); + /** + * FoodAccessLevel enum. + * @name google.devicesandservices.health.v4.FoodAccessLevel + * @enum {number} + * @property {number} FOOD_ACCESS_LEVEL_UNSPECIFIED=0 FOOD_ACCESS_LEVEL_UNSPECIFIED value + * @property {number} FOOD_ACCESS_LEVEL_PUBLIC=1 FOOD_ACCESS_LEVEL_PUBLIC value + * @property {number} FOOD_ACCESS_LEVEL_PRIVATE=2 FOOD_ACCESS_LEVEL_PRIVATE value + */ + v4.FoodAccessLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FOOD_ACCESS_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "FOOD_ACCESS_LEVEL_PUBLIC"] = 1; + values[valuesById[2] = "FOOD_ACCESS_LEVEL_PRIVATE"] = 2; + return values; + })(); + + /** + * MealType enum. + * @name google.devicesandservices.health.v4.MealType + * @enum {number} + * @property {number} MEAL_TYPE_UNSPECIFIED=0 MEAL_TYPE_UNSPECIFIED value + * @property {number} BEFORE_BREAKFAST=1 BEFORE_BREAKFAST value + * @property {number} BREAKFAST=2 BREAKFAST value + * @property {number} BEFORE_LUNCH=3 BEFORE_LUNCH value + * @property {number} LUNCH=4 LUNCH value + * @property {number} BEFORE_DINNER=5 BEFORE_DINNER value + * @property {number} DINNER=6 DINNER value + * @property {number} AFTER_DINNER=7 AFTER_DINNER value + * @property {number} SNACK=8 SNACK value + * @property {number} ANYTIME=9 ANYTIME value + */ + v4.MealType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEAL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BEFORE_BREAKFAST"] = 1; + values[valuesById[2] = "BREAKFAST"] = 2; + values[valuesById[3] = "BEFORE_LUNCH"] = 3; + values[valuesById[4] = "LUNCH"] = 4; + values[valuesById[5] = "BEFORE_DINNER"] = 5; + values[valuesById[6] = "DINNER"] = 6; + values[valuesById[7] = "AFTER_DINNER"] = 7; + values[valuesById[8] = "SNACK"] = 8; + values[valuesById[9] = "ANYTIME"] = 9; + return values; + })(); + + /** + * EnergyUnit enum. + * @name google.devicesandservices.health.v4.EnergyUnit + * @enum {number} + * @property {number} ENERGY_UNIT_UNSPECIFIED=0 ENERGY_UNIT_UNSPECIFIED value + * @property {number} JOULE=1 JOULE value + * @property {number} KILOJOULE=2 KILOJOULE value + * @property {number} KILOCALORIE=3 KILOCALORIE value + * @property {number} SMALL_CALORIE=4 SMALL_CALORIE value + * @property {number} CALORIE=5 CALORIE value + */ + v4.EnergyUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENERGY_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOULE"] = 1; + values[valuesById[2] = "KILOJOULE"] = 2; + values[valuesById[3] = "KILOCALORIE"] = 3; + values[valuesById[4] = "SMALL_CALORIE"] = 4; + values[valuesById[5] = "CALORIE"] = 5; + return values; + })(); + + /** + * Nutrient enum. + * @name google.devicesandservices.health.v4.Nutrient + * @enum {number} + * @property {number} NUTRIENT_UNSPECIFIED=0 NUTRIENT_UNSPECIFIED value + * @property {number} BIOTIN=1 BIOTIN value + * @property {number} CAFFEINE=2 CAFFEINE value + * @property {number} CALCIUM=3 CALCIUM value + * @property {number} CHLORIDE=4 CHLORIDE value + * @property {number} CARBOHYDRATES=5 CARBOHYDRATES value + * @property {number} CHOLESTEROL=6 CHOLESTEROL value + * @property {number} CHROMIUM=7 CHROMIUM value + * @property {number} COPPER=8 COPPER value + * @property {number} DIETARY_FIBER=9 DIETARY_FIBER value + * @property {number} FOLIC_ACID=10 FOLIC_ACID value + * @property {number} IODINE=11 IODINE value + * @property {number} IRON=12 IRON value + * @property {number} MAGNESIUM=13 MAGNESIUM value + * @property {number} MANGANESE=14 MANGANESE value + * @property {number} MOLYBDENUM=15 MOLYBDENUM value + * @property {number} MONOUNSATURATED_FAT=16 MONOUNSATURATED_FAT value + * @property {number} NIACIN=17 NIACIN value + * @property {number} PANTOTHENIC_ACID=18 PANTOTHENIC_ACID value + * @property {number} PHOSPHORUS=19 PHOSPHORUS value + * @property {number} POLYUNSATURATED_FAT=20 POLYUNSATURATED_FAT value + * @property {number} POTASSIUM=21 POTASSIUM value + * @property {number} PROTEIN=22 PROTEIN value + * @property {number} RIBOFLAVIN=23 RIBOFLAVIN value + * @property {number} SATURATED_FAT=24 SATURATED_FAT value + * @property {number} SELENIUM=25 SELENIUM value + * @property {number} SODIUM=26 SODIUM value + * @property {number} SUGAR=27 SUGAR value + * @property {number} THIAMIN=28 THIAMIN value + * @property {number} TRANS_FAT=29 TRANS_FAT value + * @property {number} UNSATURATED_FAT=30 UNSATURATED_FAT value + * @property {number} VITAMIN_A=31 VITAMIN_A value + * @property {number} VITAMIN_B12=32 VITAMIN_B12 value + * @property {number} VITAMIN_B6=33 VITAMIN_B6 value + * @property {number} VITAMIN_C=34 VITAMIN_C value + * @property {number} VITAMIN_D=35 VITAMIN_D value + * @property {number} VITAMIN_E=36 VITAMIN_E value + * @property {number} VITAMIN_K=37 VITAMIN_K value + * @property {number} ZINC=38 ZINC value + * @property {number} FOLATE=39 FOLATE value + */ + v4.Nutrient = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NUTRIENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "BIOTIN"] = 1; + values[valuesById[2] = "CAFFEINE"] = 2; + values[valuesById[3] = "CALCIUM"] = 3; + values[valuesById[4] = "CHLORIDE"] = 4; + values[valuesById[5] = "CARBOHYDRATES"] = 5; + values[valuesById[6] = "CHOLESTEROL"] = 6; + values[valuesById[7] = "CHROMIUM"] = 7; + values[valuesById[8] = "COPPER"] = 8; + values[valuesById[9] = "DIETARY_FIBER"] = 9; + values[valuesById[10] = "FOLIC_ACID"] = 10; + values[valuesById[11] = "IODINE"] = 11; + values[valuesById[12] = "IRON"] = 12; + values[valuesById[13] = "MAGNESIUM"] = 13; + values[valuesById[14] = "MANGANESE"] = 14; + values[valuesById[15] = "MOLYBDENUM"] = 15; + values[valuesById[16] = "MONOUNSATURATED_FAT"] = 16; + values[valuesById[17] = "NIACIN"] = 17; + values[valuesById[18] = "PANTOTHENIC_ACID"] = 18; + values[valuesById[19] = "PHOSPHORUS"] = 19; + values[valuesById[20] = "POLYUNSATURATED_FAT"] = 20; + values[valuesById[21] = "POTASSIUM"] = 21; + values[valuesById[22] = "PROTEIN"] = 22; + values[valuesById[23] = "RIBOFLAVIN"] = 23; + values[valuesById[24] = "SATURATED_FAT"] = 24; + values[valuesById[25] = "SELENIUM"] = 25; + values[valuesById[26] = "SODIUM"] = 26; + values[valuesById[27] = "SUGAR"] = 27; + values[valuesById[28] = "THIAMIN"] = 28; + values[valuesById[29] = "TRANS_FAT"] = 29; + values[valuesById[30] = "UNSATURATED_FAT"] = 30; + values[valuesById[31] = "VITAMIN_A"] = 31; + values[valuesById[32] = "VITAMIN_B12"] = 32; + values[valuesById[33] = "VITAMIN_B6"] = 33; + values[valuesById[34] = "VITAMIN_C"] = 34; + values[valuesById[35] = "VITAMIN_D"] = 35; + values[valuesById[36] = "VITAMIN_E"] = 36; + values[valuesById[37] = "VITAMIN_K"] = 37; + values[valuesById[38] = "ZINC"] = 38; + values[valuesById[39] = "FOLATE"] = 39; + return values; + })(); + + /** + * WeightUnit enum. + * @name google.devicesandservices.health.v4.WeightUnit + * @enum {number} + * @property {number} WEIGHT_UNIT_UNSPECIFIED=0 WEIGHT_UNIT_UNSPECIFIED value + * @property {number} GRAM=1 GRAM value + * @property {number} KILOGRAM=2 KILOGRAM value + * @property {number} OUNCE=3 OUNCE value + * @property {number} POUND=4 POUND value + * @property {number} STONE=5 STONE value + * @property {number} MILLIGRAM=6 MILLIGRAM value + * @property {number} MICROGRAM=7 MICROGRAM value + * @property {number} NANOGRAM=8 NANOGRAM value + */ + v4.WeightUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WEIGHT_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "GRAM"] = 1; + values[valuesById[2] = "KILOGRAM"] = 2; + values[valuesById[3] = "OUNCE"] = 3; + values[valuesById[4] = "POUND"] = 4; + values[valuesById[5] = "STONE"] = 5; + values[valuesById[6] = "MILLIGRAM"] = 6; + values[valuesById[7] = "MICROGRAM"] = 7; + values[valuesById[8] = "NANOGRAM"] = 8; + return values; + })(); + /** * VolumeUnit enum. * @name google.devicesandservices.health.v4.VolumeUnit @@ -1605,11 +1791,20 @@ /** * ActiveZoneMinutes activeZoneMinutes. - * @member {number|Long} activeZoneMinutes + * @member {number|Long|null|undefined} activeZoneMinutes * @memberof google.devicesandservices.health.v4.ActiveZoneMinutes * @instance */ - ActiveZoneMinutes.prototype.activeZoneMinutes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ActiveZoneMinutes.prototype.activeZoneMinutes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ActiveZoneMinutes.prototype, "_activeZoneMinutes", { + get: $util.oneOfGetter($oneOfFields = ["activeZoneMinutes"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new ActiveZoneMinutes instance using the specified properties. @@ -1724,6 +1919,7 @@ ActiveZoneMinutes.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.interval != null && message.hasOwnProperty("interval")) { var error = $root.google.devicesandservices.health.v4.ObservationTimeInterval.verify(message.interval); if (error) @@ -1739,9 +1935,11 @@ case 3: break; } - if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) + if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { + properties._activeZoneMinutes = 1; if (!$util.isInteger(message.activeZoneMinutes) && !(message.activeZoneMinutes && $util.isInteger(message.activeZoneMinutes.low) && $util.isInteger(message.activeZoneMinutes.high))) return "activeZoneMinutes: integer|Long expected"; + } return null; }; @@ -1814,21 +2012,19 @@ if (options.defaults) { object.interval = null; object.heartRateZone = options.enums === String ? "HEART_RATE_ZONE_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.activeZoneMinutes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.activeZoneMinutes = options.longs === String ? "0" : 0; } if (message.interval != null && message.hasOwnProperty("interval")) object.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.toObject(message.interval, options); if (message.heartRateZone != null && message.hasOwnProperty("heartRateZone")) object.heartRateZone = options.enums === String ? $root.google.devicesandservices.health.v4.ActiveZoneMinutes.HeartRateZone[message.heartRateZone] === undefined ? message.heartRateZone : $root.google.devicesandservices.health.v4.ActiveZoneMinutes.HeartRateZone[message.heartRateZone] : message.heartRateZone; - if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) + if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { if (typeof message.activeZoneMinutes === "number") object.activeZoneMinutes = options.longs === String ? String(message.activeZoneMinutes) : message.activeZoneMinutes; else object.activeZoneMinutes = options.longs === String ? $util.Long.prototype.toString.call(message.activeZoneMinutes) : options.longs === Number ? new $util.LongBits(message.activeZoneMinutes.low >>> 0, message.activeZoneMinutes.high >>> 0).toNumber() : message.activeZoneMinutes; + if (options.oneofs) + object._activeZoneMinutes = "activeZoneMinutes"; + } return object; }; @@ -1907,27 +2103,48 @@ /** * ActiveZoneMinutesRollupValue sumInCardioHeartZone. - * @member {number|Long} sumInCardioHeartZone + * @member {number|Long|null|undefined} sumInCardioHeartZone * @memberof google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue * @instance */ - ActiveZoneMinutesRollupValue.prototype.sumInCardioHeartZone = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ActiveZoneMinutesRollupValue.prototype.sumInCardioHeartZone = null; /** * ActiveZoneMinutesRollupValue sumInPeakHeartZone. - * @member {number|Long} sumInPeakHeartZone + * @member {number|Long|null|undefined} sumInPeakHeartZone * @memberof google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue * @instance */ - ActiveZoneMinutesRollupValue.prototype.sumInPeakHeartZone = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ActiveZoneMinutesRollupValue.prototype.sumInPeakHeartZone = null; /** * ActiveZoneMinutesRollupValue sumInFatBurnHeartZone. - * @member {number|Long} sumInFatBurnHeartZone + * @member {number|Long|null|undefined} sumInFatBurnHeartZone * @memberof google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue * @instance */ - ActiveZoneMinutesRollupValue.prototype.sumInFatBurnHeartZone = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ActiveZoneMinutesRollupValue.prototype.sumInFatBurnHeartZone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ActiveZoneMinutesRollupValue.prototype, "_sumInCardioHeartZone", { + get: $util.oneOfGetter($oneOfFields = ["sumInCardioHeartZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ActiveZoneMinutesRollupValue.prototype, "_sumInPeakHeartZone", { + get: $util.oneOfGetter($oneOfFields = ["sumInPeakHeartZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ActiveZoneMinutesRollupValue.prototype, "_sumInFatBurnHeartZone", { + get: $util.oneOfGetter($oneOfFields = ["sumInFatBurnHeartZone"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new ActiveZoneMinutesRollupValue instance using the specified properties. @@ -2042,15 +2259,22 @@ ActiveZoneMinutesRollupValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sumInCardioHeartZone != null && message.hasOwnProperty("sumInCardioHeartZone")) + var properties = {}; + if (message.sumInCardioHeartZone != null && message.hasOwnProperty("sumInCardioHeartZone")) { + properties._sumInCardioHeartZone = 1; if (!$util.isInteger(message.sumInCardioHeartZone) && !(message.sumInCardioHeartZone && $util.isInteger(message.sumInCardioHeartZone.low) && $util.isInteger(message.sumInCardioHeartZone.high))) return "sumInCardioHeartZone: integer|Long expected"; - if (message.sumInPeakHeartZone != null && message.hasOwnProperty("sumInPeakHeartZone")) + } + if (message.sumInPeakHeartZone != null && message.hasOwnProperty("sumInPeakHeartZone")) { + properties._sumInPeakHeartZone = 1; if (!$util.isInteger(message.sumInPeakHeartZone) && !(message.sumInPeakHeartZone && $util.isInteger(message.sumInPeakHeartZone.low) && $util.isInteger(message.sumInPeakHeartZone.high))) return "sumInPeakHeartZone: integer|Long expected"; - if (message.sumInFatBurnHeartZone != null && message.hasOwnProperty("sumInFatBurnHeartZone")) + } + if (message.sumInFatBurnHeartZone != null && message.hasOwnProperty("sumInFatBurnHeartZone")) { + properties._sumInFatBurnHeartZone = 1; if (!$util.isInteger(message.sumInFatBurnHeartZone) && !(message.sumInFatBurnHeartZone && $util.isInteger(message.sumInFatBurnHeartZone.low) && $util.isInteger(message.sumInFatBurnHeartZone.high))) return "sumInFatBurnHeartZone: integer|Long expected"; + } return null; }; @@ -2109,38 +2333,30 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sumInCardioHeartZone = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sumInCardioHeartZone = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sumInPeakHeartZone = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sumInPeakHeartZone = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sumInFatBurnHeartZone = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sumInFatBurnHeartZone = options.longs === String ? "0" : 0; - } - if (message.sumInCardioHeartZone != null && message.hasOwnProperty("sumInCardioHeartZone")) + if (message.sumInCardioHeartZone != null && message.hasOwnProperty("sumInCardioHeartZone")) { if (typeof message.sumInCardioHeartZone === "number") object.sumInCardioHeartZone = options.longs === String ? String(message.sumInCardioHeartZone) : message.sumInCardioHeartZone; else object.sumInCardioHeartZone = options.longs === String ? $util.Long.prototype.toString.call(message.sumInCardioHeartZone) : options.longs === Number ? new $util.LongBits(message.sumInCardioHeartZone.low >>> 0, message.sumInCardioHeartZone.high >>> 0).toNumber() : message.sumInCardioHeartZone; - if (message.sumInPeakHeartZone != null && message.hasOwnProperty("sumInPeakHeartZone")) + if (options.oneofs) + object._sumInCardioHeartZone = "sumInCardioHeartZone"; + } + if (message.sumInPeakHeartZone != null && message.hasOwnProperty("sumInPeakHeartZone")) { if (typeof message.sumInPeakHeartZone === "number") object.sumInPeakHeartZone = options.longs === String ? String(message.sumInPeakHeartZone) : message.sumInPeakHeartZone; else object.sumInPeakHeartZone = options.longs === String ? $util.Long.prototype.toString.call(message.sumInPeakHeartZone) : options.longs === Number ? new $util.LongBits(message.sumInPeakHeartZone.low >>> 0, message.sumInPeakHeartZone.high >>> 0).toNumber() : message.sumInPeakHeartZone; - if (message.sumInFatBurnHeartZone != null && message.hasOwnProperty("sumInFatBurnHeartZone")) + if (options.oneofs) + object._sumInPeakHeartZone = "sumInPeakHeartZone"; + } + if (message.sumInFatBurnHeartZone != null && message.hasOwnProperty("sumInFatBurnHeartZone")) { if (typeof message.sumInFatBurnHeartZone === "number") object.sumInFatBurnHeartZone = options.longs === String ? String(message.sumInFatBurnHeartZone) : message.sumInFatBurnHeartZone; else object.sumInFatBurnHeartZone = options.longs === String ? $util.Long.prototype.toString.call(message.sumInFatBurnHeartZone) : options.longs === Number ? new $util.LongBits(message.sumInFatBurnHeartZone.low >>> 0, message.sumInFatBurnHeartZone.high >>> 0).toNumber() : message.sumInFatBurnHeartZone; + if (options.oneofs) + object._sumInFatBurnHeartZone = "sumInFatBurnHeartZone"; + } return object; }; @@ -2460,11 +2676,20 @@ /** * ActiveMinutesByActivityLevel activeMinutes. - * @member {number|Long} activeMinutes + * @member {number|Long|null|undefined} activeMinutes * @memberof google.devicesandservices.health.v4.ActiveMinutes.ActiveMinutesByActivityLevel * @instance */ - ActiveMinutesByActivityLevel.prototype.activeMinutes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ActiveMinutesByActivityLevel.prototype.activeMinutes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ActiveMinutesByActivityLevel.prototype, "_activeMinutes", { + get: $util.oneOfGetter($oneOfFields = ["activeMinutes"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new ActiveMinutesByActivityLevel instance using the specified properties. @@ -2573,6 +2798,7 @@ ActiveMinutesByActivityLevel.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) switch (message.activityLevel) { default: @@ -2583,9 +2809,11 @@ case 3: break; } - if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) + if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { + properties._activeMinutes = 1; if (!$util.isInteger(message.activeMinutes) && !(message.activeMinutes && $util.isInteger(message.activeMinutes.low) && $util.isInteger(message.activeMinutes.high))) return "activeMinutes: integer|Long expected"; + } return null; }; @@ -2650,21 +2878,18 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.activityLevel = options.enums === String ? "ACTIVITY_LEVEL_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.activeMinutes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.activeMinutes = options.longs === String ? "0" : 0; - } if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) object.activityLevel = options.enums === String ? $root.google.devicesandservices.health.v4.ActiveMinutes.ActivityLevel[message.activityLevel] === undefined ? message.activityLevel : $root.google.devicesandservices.health.v4.ActiveMinutes.ActivityLevel[message.activityLevel] : message.activityLevel; - if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) + if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { if (typeof message.activeMinutes === "number") object.activeMinutes = options.longs === String ? String(message.activeMinutes) : message.activeMinutes; else object.activeMinutes = options.longs === String ? $util.Long.prototype.toString.call(message.activeMinutes) : options.longs === Number ? new $util.LongBits(message.activeMinutes.low >>> 0, message.activeMinutes.high >>> 0).toNumber() : message.activeMinutes; + if (options.oneofs) + object._activeMinutes = "activeMinutes"; + } return object; }; @@ -2976,11 +3201,20 @@ /** * ActiveMinutesRollupByActivityLevel activeMinutesSum. - * @member {number|Long} activeMinutesSum + * @member {number|Long|null|undefined} activeMinutesSum * @memberof google.devicesandservices.health.v4.ActiveMinutesRollupValue.ActiveMinutesRollupByActivityLevel * @instance */ - ActiveMinutesRollupByActivityLevel.prototype.activeMinutesSum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ActiveMinutesRollupByActivityLevel.prototype.activeMinutesSum = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ActiveMinutesRollupByActivityLevel.prototype, "_activeMinutesSum", { + get: $util.oneOfGetter($oneOfFields = ["activeMinutesSum"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new ActiveMinutesRollupByActivityLevel instance using the specified properties. @@ -3089,6 +3323,7 @@ ActiveMinutesRollupByActivityLevel.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) switch (message.activityLevel) { default: @@ -3099,9 +3334,11 @@ case 3: break; } - if (message.activeMinutesSum != null && message.hasOwnProperty("activeMinutesSum")) + if (message.activeMinutesSum != null && message.hasOwnProperty("activeMinutesSum")) { + properties._activeMinutesSum = 1; if (!$util.isInteger(message.activeMinutesSum) && !(message.activeMinutesSum && $util.isInteger(message.activeMinutesSum.low) && $util.isInteger(message.activeMinutesSum.high))) return "activeMinutesSum: integer|Long expected"; + } return null; }; @@ -3166,21 +3403,18 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.activityLevel = options.enums === String ? "ACTIVITY_LEVEL_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.activeMinutesSum = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.activeMinutesSum = options.longs === String ? "0" : 0; - } if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) object.activityLevel = options.enums === String ? $root.google.devicesandservices.health.v4.ActiveMinutes.ActivityLevel[message.activityLevel] === undefined ? message.activityLevel : $root.google.devicesandservices.health.v4.ActiveMinutes.ActivityLevel[message.activityLevel] : message.activityLevel; - if (message.activeMinutesSum != null && message.hasOwnProperty("activeMinutesSum")) + if (message.activeMinutesSum != null && message.hasOwnProperty("activeMinutesSum")) { if (typeof message.activeMinutesSum === "number") object.activeMinutesSum = options.longs === String ? String(message.activeMinutesSum) : message.activeMinutesSum; else object.activeMinutesSum = options.longs === String ? $util.Long.prototype.toString.call(message.activeMinutesSum) : options.longs === Number ? new $util.LongBits(message.activeMinutesSum.low >>> 0, message.activeMinutesSum.high >>> 0).toNumber() : message.activeMinutesSum; + if (options.oneofs) + object._activeMinutesSum = "activeMinutesSum"; + } return object; }; @@ -4033,11 +4267,20 @@ /** * Altitude gainMillimeters. - * @member {number|Long} gainMillimeters + * @member {number|Long|null|undefined} gainMillimeters * @memberof google.devicesandservices.health.v4.Altitude * @instance */ - Altitude.prototype.gainMillimeters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Altitude.prototype.gainMillimeters = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Altitude.prototype, "_gainMillimeters", { + get: $util.oneOfGetter($oneOfFields = ["gainMillimeters"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new Altitude instance using the specified properties. @@ -4146,14 +4389,17 @@ Altitude.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.interval != null && message.hasOwnProperty("interval")) { var error = $root.google.devicesandservices.health.v4.ObservationTimeInterval.verify(message.interval); if (error) return "interval." + error; } - if (message.gainMillimeters != null && message.hasOwnProperty("gainMillimeters")) + if (message.gainMillimeters != null && message.hasOwnProperty("gainMillimeters")) { + properties._gainMillimeters = 1; if (!$util.isInteger(message.gainMillimeters) && !(message.gainMillimeters && $util.isInteger(message.gainMillimeters.low) && $util.isInteger(message.gainMillimeters.high))) return "gainMillimeters: integer|Long expected"; + } return null; }; @@ -4199,21 +4445,18 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.interval = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.gainMillimeters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.gainMillimeters = options.longs === String ? "0" : 0; - } if (message.interval != null && message.hasOwnProperty("interval")) object.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.toObject(message.interval, options); - if (message.gainMillimeters != null && message.hasOwnProperty("gainMillimeters")) + if (message.gainMillimeters != null && message.hasOwnProperty("gainMillimeters")) { if (typeof message.gainMillimeters === "number") object.gainMillimeters = options.longs === String ? String(message.gainMillimeters) : message.gainMillimeters; else object.gainMillimeters = options.longs === String ? $util.Long.prototype.toString.call(message.gainMillimeters) : options.longs === Number ? new $util.LongBits(message.gainMillimeters.low >>> 0, message.gainMillimeters.high >>> 0).toNumber() : message.gainMillimeters; + if (options.oneofs) + object._gainMillimeters = "gainMillimeters"; + } return object; }; @@ -4281,11 +4524,20 @@ /** * BasalEnergyBurned kcal. - * @member {number} kcal + * @member {number|null|undefined} kcal * @memberof google.devicesandservices.health.v4.BasalEnergyBurned * @instance */ - BasalEnergyBurned.prototype.kcal = 0; + BasalEnergyBurned.prototype.kcal = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BasalEnergyBurned.prototype, "_kcal", { + get: $util.oneOfGetter($oneOfFields = ["kcal"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new BasalEnergyBurned instance using the specified properties. @@ -4394,14 +4646,17 @@ BasalEnergyBurned.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.interval != null && message.hasOwnProperty("interval")) { var error = $root.google.devicesandservices.health.v4.ObservationTimeInterval.verify(message.interval); if (error) return "interval." + error; } - if (message.kcal != null && message.hasOwnProperty("kcal")) + if (message.kcal != null && message.hasOwnProperty("kcal")) { + properties._kcal = 1; if (typeof message.kcal !== "number") return "kcal: number expected"; + } return null; }; @@ -4440,14 +4695,15 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.interval = null; - object.kcal = 0; - } if (message.interval != null && message.hasOwnProperty("interval")) object.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.toObject(message.interval, options); - if (message.kcal != null && message.hasOwnProperty("kcal")) + if (message.kcal != null && message.hasOwnProperty("kcal")) { object.kcal = options.json && !isFinite(message.kcal) ? String(message.kcal) : message.kcal; + if (options.oneofs) + object._kcal = "kcal"; + } return object; }; @@ -4515,11 +4771,20 @@ /** * BodyFat percentage. - * @member {number} percentage + * @member {number|null|undefined} percentage * @memberof google.devicesandservices.health.v4.BodyFat * @instance */ - BodyFat.prototype.percentage = 0; + BodyFat.prototype.percentage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BodyFat.prototype, "_percentage", { + get: $util.oneOfGetter($oneOfFields = ["percentage"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new BodyFat instance using the specified properties. @@ -4628,14 +4893,17 @@ BodyFat.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); if (error) return "sampleTime." + error; } - if (message.percentage != null && message.hasOwnProperty("percentage")) + if (message.percentage != null && message.hasOwnProperty("percentage")) { + properties._percentage = 1; if (typeof message.percentage !== "number") return "percentage: number expected"; + } return null; }; @@ -4674,14 +4942,15 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.sampleTime = null; - object.percentage = 0; - } if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); - if (message.percentage != null && message.hasOwnProperty("percentage")) + if (message.percentage != null && message.hasOwnProperty("percentage")) { object.percentage = options.json && !isFinite(message.percentage) ? String(message.percentage) : message.percentage; + if (options.oneofs) + object._percentage = "percentage"; + } return object; }; @@ -4740,11 +5009,20 @@ /** * BodyFatRollupValue bodyFatPercentageAvg. - * @member {number} bodyFatPercentageAvg + * @member {number|null|undefined} bodyFatPercentageAvg * @memberof google.devicesandservices.health.v4.BodyFatRollupValue * @instance */ - BodyFatRollupValue.prototype.bodyFatPercentageAvg = 0; + BodyFatRollupValue.prototype.bodyFatPercentageAvg = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BodyFatRollupValue.prototype, "_bodyFatPercentageAvg", { + get: $util.oneOfGetter($oneOfFields = ["bodyFatPercentageAvg"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new BodyFatRollupValue instance using the specified properties. @@ -4847,9 +5125,12 @@ BodyFatRollupValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.bodyFatPercentageAvg != null && message.hasOwnProperty("bodyFatPercentageAvg")) + var properties = {}; + if (message.bodyFatPercentageAvg != null && message.hasOwnProperty("bodyFatPercentageAvg")) { + properties._bodyFatPercentageAvg = 1; if (typeof message.bodyFatPercentageAvg !== "number") return "bodyFatPercentageAvg: number expected"; + } return null; }; @@ -4883,10 +5164,11 @@ if (!options) options = {}; var object = {}; - if (options.defaults) - object.bodyFatPercentageAvg = 0; - if (message.bodyFatPercentageAvg != null && message.hasOwnProperty("bodyFatPercentageAvg")) + if (message.bodyFatPercentageAvg != null && message.hasOwnProperty("bodyFatPercentageAvg")) { object.bodyFatPercentageAvg = options.json && !isFinite(message.bodyFatPercentageAvg) ? String(message.bodyFatPercentageAvg) : message.bodyFatPercentageAvg; + if (options.oneofs) + object._bodyFatPercentageAvg = "bodyFatPercentageAvg"; + } return object; }; @@ -4919,25 +5201,27 @@ return BodyFatRollupValue; })(); - v4.CaloriesInHeartRateZoneRollupValue = (function() { + v4.CoreBodyTemperature = (function() { /** - * Properties of a CaloriesInHeartRateZoneRollupValue. + * Properties of a CoreBodyTemperature. * @memberof google.devicesandservices.health.v4 - * @interface ICaloriesInHeartRateZoneRollupValue - * @property {Array.|null} [caloriesInHeartRateZones] CaloriesInHeartRateZoneRollupValue caloriesInHeartRateZones + * @interface ICoreBodyTemperature + * @property {google.devicesandservices.health.v4.IObservationSampleTime|null} [sampleTime] CoreBodyTemperature sampleTime + * @property {number|null} [temperatureCelsius] CoreBodyTemperature temperatureCelsius + * @property {google.devicesandservices.health.v4.CoreBodyTemperature.MeasurementLocation|null} [measurementLocation] CoreBodyTemperature measurementLocation + * @property {string|null} [id] CoreBodyTemperature id */ /** - * Constructs a new CaloriesInHeartRateZoneRollupValue. + * Constructs a new CoreBodyTemperature. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a CaloriesInHeartRateZoneRollupValue. - * @implements ICaloriesInHeartRateZoneRollupValue + * @classdesc Represents a CoreBodyTemperature. + * @implements ICoreBodyTemperature * @constructor - * @param {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.ICoreBodyTemperature=} [properties] Properties to set */ - function CaloriesInHeartRateZoneRollupValue(properties) { - this.caloriesInHeartRateZones = []; + function CoreBodyTemperature(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4945,80 +5229,128 @@ } /** - * CaloriesInHeartRateZoneRollupValue caloriesInHeartRateZones. - * @member {Array.} caloriesInHeartRateZones - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue + * CoreBodyTemperature sampleTime. + * @member {google.devicesandservices.health.v4.IObservationSampleTime|null|undefined} sampleTime + * @memberof google.devicesandservices.health.v4.CoreBodyTemperature * @instance */ - CaloriesInHeartRateZoneRollupValue.prototype.caloriesInHeartRateZones = $util.emptyArray; + CoreBodyTemperature.prototype.sampleTime = null; /** - * Creates a new CaloriesInHeartRateZoneRollupValue instance using the specified properties. + * CoreBodyTemperature temperatureCelsius. + * @member {number|null|undefined} temperatureCelsius + * @memberof google.devicesandservices.health.v4.CoreBodyTemperature + * @instance + */ + CoreBodyTemperature.prototype.temperatureCelsius = null; + + /** + * CoreBodyTemperature measurementLocation. + * @member {google.devicesandservices.health.v4.CoreBodyTemperature.MeasurementLocation} measurementLocation + * @memberof google.devicesandservices.health.v4.CoreBodyTemperature + * @instance + */ + CoreBodyTemperature.prototype.measurementLocation = 0; + + /** + * CoreBodyTemperature id. + * @member {string} id + * @memberof google.devicesandservices.health.v4.CoreBodyTemperature + * @instance + */ + CoreBodyTemperature.prototype.id = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CoreBodyTemperature.prototype, "_temperatureCelsius", { + get: $util.oneOfGetter($oneOfFields = ["temperatureCelsius"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CoreBodyTemperature instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.CoreBodyTemperature * @static - * @param {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue} CaloriesInHeartRateZoneRollupValue instance + * @param {google.devicesandservices.health.v4.ICoreBodyTemperature=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.CoreBodyTemperature} CoreBodyTemperature instance */ - CaloriesInHeartRateZoneRollupValue.create = function create(properties) { - return new CaloriesInHeartRateZoneRollupValue(properties); + CoreBodyTemperature.create = function create(properties) { + return new CoreBodyTemperature(properties); }; /** - * Encodes the specified CaloriesInHeartRateZoneRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.verify|verify} messages. + * Encodes the specified CoreBodyTemperature message. Does not implicitly {@link google.devicesandservices.health.v4.CoreBodyTemperature.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.CoreBodyTemperature * @static - * @param {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue} message CaloriesInHeartRateZoneRollupValue message or plain object to encode + * @param {google.devicesandservices.health.v4.ICoreBodyTemperature} message CoreBodyTemperature message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CaloriesInHeartRateZoneRollupValue.encode = function encode(message, writer) { + CoreBodyTemperature.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.caloriesInHeartRateZones != null && message.caloriesInHeartRateZones.length) - for (var i = 0; i < message.caloriesInHeartRateZones.length; ++i) - $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue.encode(message.caloriesInHeartRateZones[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sampleTime != null && Object.hasOwnProperty.call(message, "sampleTime")) + $root.google.devicesandservices.health.v4.ObservationSampleTime.encode(message.sampleTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.temperatureCelsius != null && Object.hasOwnProperty.call(message, "temperatureCelsius")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.temperatureCelsius); + if (message.measurementLocation != null && Object.hasOwnProperty.call(message, "measurementLocation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.measurementLocation); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.id); return writer; }; /** - * Encodes the specified CaloriesInHeartRateZoneRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.verify|verify} messages. + * Encodes the specified CoreBodyTemperature message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CoreBodyTemperature.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.CoreBodyTemperature * @static - * @param {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue} message CaloriesInHeartRateZoneRollupValue message or plain object to encode + * @param {google.devicesandservices.health.v4.ICoreBodyTemperature} message CoreBodyTemperature message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CaloriesInHeartRateZoneRollupValue.encodeDelimited = function encodeDelimited(message, writer) { + CoreBodyTemperature.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CaloriesInHeartRateZoneRollupValue message from the specified reader or buffer. + * Decodes a CoreBodyTemperature message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.CoreBodyTemperature * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue} CaloriesInHeartRateZoneRollupValue + * @returns {google.devicesandservices.health.v4.CoreBodyTemperature} CoreBodyTemperature * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CaloriesInHeartRateZoneRollupValue.decode = function decode(reader, length, error) { + CoreBodyTemperature.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CoreBodyTemperature(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 1: { - if (!(message.caloriesInHeartRateZones && message.caloriesInHeartRateZones.length)) - message.caloriesInHeartRateZones = []; - message.caloriesInHeartRateZones.push($root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue.decode(reader, reader.uint32())); + case 2: { + message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.decode(reader, reader.uint32()); + break; + } + case 3: { + message.temperatureCelsius = reader.double(); + break; + } + case 4: { + message.measurementLocation = reader.int32(); + break; + } + case 5: { + message.id = reader.string(); break; } default: @@ -5030,404 +5362,587 @@ }; /** - * Decodes a CaloriesInHeartRateZoneRollupValue message from the specified reader or buffer, length delimited. + * Decodes a CoreBodyTemperature message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.CoreBodyTemperature * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue} CaloriesInHeartRateZoneRollupValue + * @returns {google.devicesandservices.health.v4.CoreBodyTemperature} CoreBodyTemperature * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CaloriesInHeartRateZoneRollupValue.decodeDelimited = function decodeDelimited(reader) { + CoreBodyTemperature.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CaloriesInHeartRateZoneRollupValue message. + * Verifies a CoreBodyTemperature message. * @function verify - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.CoreBodyTemperature * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CaloriesInHeartRateZoneRollupValue.verify = function verify(message) { + CoreBodyTemperature.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.caloriesInHeartRateZones != null && message.hasOwnProperty("caloriesInHeartRateZones")) { - if (!Array.isArray(message.caloriesInHeartRateZones)) - return "caloriesInHeartRateZones: array expected"; - for (var i = 0; i < message.caloriesInHeartRateZones.length; ++i) { - var error = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue.verify(message.caloriesInHeartRateZones[i]); - if (error) - return "caloriesInHeartRateZones." + error; - } + var properties = {}; + if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { + var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); + if (error) + return "sampleTime." + error; + } + if (message.temperatureCelsius != null && message.hasOwnProperty("temperatureCelsius")) { + properties._temperatureCelsius = 1; + if (typeof message.temperatureCelsius !== "number") + return "temperatureCelsius: number expected"; } + if (message.measurementLocation != null && message.hasOwnProperty("measurementLocation")) + switch (message.measurementLocation) { + default: + return "measurementLocation: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + break; + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; return null; }; /** - * Creates a CaloriesInHeartRateZoneRollupValue message from a plain object. Also converts values to their respective internal types. + * Creates a CoreBodyTemperature message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.CoreBodyTemperature * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue} CaloriesInHeartRateZoneRollupValue + * @returns {google.devicesandservices.health.v4.CoreBodyTemperature} CoreBodyTemperature */ - CaloriesInHeartRateZoneRollupValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue) + CoreBodyTemperature.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.CoreBodyTemperature) return object; - var message = new $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue(); - if (object.caloriesInHeartRateZones) { - if (!Array.isArray(object.caloriesInHeartRateZones)) - throw TypeError(".google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.caloriesInHeartRateZones: array expected"); - message.caloriesInHeartRateZones = []; - for (var i = 0; i < object.caloriesInHeartRateZones.length; ++i) { - if (typeof object.caloriesInHeartRateZones[i] !== "object") - throw TypeError(".google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.caloriesInHeartRateZones: object expected"); - message.caloriesInHeartRateZones[i] = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue.fromObject(object.caloriesInHeartRateZones[i]); + var message = new $root.google.devicesandservices.health.v4.CoreBodyTemperature(); + if (object.sampleTime != null) { + if (typeof object.sampleTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.CoreBodyTemperature.sampleTime: object expected"); + message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.fromObject(object.sampleTime); + } + if (object.temperatureCelsius != null) + message.temperatureCelsius = Number(object.temperatureCelsius); + switch (object.measurementLocation) { + default: + if (typeof object.measurementLocation === "number") { + message.measurementLocation = object.measurementLocation; + break; } + break; + case "MEASUREMENT_LOCATION_UNSPECIFIED": + case 0: + message.measurementLocation = 0; + break; + case "OTHER": + case 1: + message.measurementLocation = 1; + break; + case "ARMPIT": + case 2: + message.measurementLocation = 2; + break; + case "BODY": + case 3: + message.measurementLocation = 3; + break; + case "EAR": + case 4: + message.measurementLocation = 4; + break; + case "FINGER": + case 5: + message.measurementLocation = 5; + break; + case "GASTRO_INTESTINAL": + case 6: + message.measurementLocation = 6; + break; + case "MOUTH": + case 7: + message.measurementLocation = 7; + break; + case "RECTUM": + case 8: + message.measurementLocation = 8; + break; + case "TOE": + case 9: + message.measurementLocation = 9; + break; + case "EAR_DRUM": + case 10: + message.measurementLocation = 10; + break; + case "TEMPORAL_ARTERY": + case 11: + message.measurementLocation = 11; + break; + case "FOREHEAD": + case 12: + message.measurementLocation = 12; + break; + case "URINARY_BLADDER": + case 13: + message.measurementLocation = 13; + break; + case "NASAL": + case 14: + message.measurementLocation = 14; + break; + case "NASOPHARYNGEAL": + case 15: + message.measurementLocation = 15; + break; + case "WRIST": + case 16: + message.measurementLocation = 16; + break; + case "VAGINA": + case 17: + message.measurementLocation = 17; + break; } + if (object.id != null) + message.id = String(object.id); return message; }; /** - * Creates a plain object from a CaloriesInHeartRateZoneRollupValue message. Also converts values to other types if specified. + * Creates a plain object from a CoreBodyTemperature message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.CoreBodyTemperature * @static - * @param {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue} message CaloriesInHeartRateZoneRollupValue + * @param {google.devicesandservices.health.v4.CoreBodyTemperature} message CoreBodyTemperature * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CaloriesInHeartRateZoneRollupValue.toObject = function toObject(message, options) { + CoreBodyTemperature.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.caloriesInHeartRateZones = []; - if (message.caloriesInHeartRateZones && message.caloriesInHeartRateZones.length) { - object.caloriesInHeartRateZones = []; - for (var j = 0; j < message.caloriesInHeartRateZones.length; ++j) - object.caloriesInHeartRateZones[j] = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue.toObject(message.caloriesInHeartRateZones[j], options); + if (options.defaults) { + object.sampleTime = null; + object.measurementLocation = options.enums === String ? "MEASUREMENT_LOCATION_UNSPECIFIED" : 0; + object.id = ""; + } + if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) + object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); + if (message.temperatureCelsius != null && message.hasOwnProperty("temperatureCelsius")) { + object.temperatureCelsius = options.json && !isFinite(message.temperatureCelsius) ? String(message.temperatureCelsius) : message.temperatureCelsius; + if (options.oneofs) + object._temperatureCelsius = "temperatureCelsius"; } + if (message.measurementLocation != null && message.hasOwnProperty("measurementLocation")) + object.measurementLocation = options.enums === String ? $root.google.devicesandservices.health.v4.CoreBodyTemperature.MeasurementLocation[message.measurementLocation] === undefined ? message.measurementLocation : $root.google.devicesandservices.health.v4.CoreBodyTemperature.MeasurementLocation[message.measurementLocation] : message.measurementLocation; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; return object; }; /** - * Converts this CaloriesInHeartRateZoneRollupValue to JSON. + * Converts this CoreBodyTemperature to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.CoreBodyTemperature * @instance * @returns {Object.} JSON object */ - CaloriesInHeartRateZoneRollupValue.prototype.toJSON = function toJSON() { + CoreBodyTemperature.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CaloriesInHeartRateZoneRollupValue + * Gets the default type url for CoreBodyTemperature * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.CoreBodyTemperature * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CaloriesInHeartRateZoneRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CoreBodyTemperature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.CoreBodyTemperature"; }; - CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue = (function() { + /** + * MeasurementLocation enum. + * @name google.devicesandservices.health.v4.CoreBodyTemperature.MeasurementLocation + * @enum {number} + * @property {number} MEASUREMENT_LOCATION_UNSPECIFIED=0 MEASUREMENT_LOCATION_UNSPECIFIED value + * @property {number} OTHER=1 OTHER value + * @property {number} ARMPIT=2 ARMPIT value + * @property {number} BODY=3 BODY value + * @property {number} EAR=4 EAR value + * @property {number} FINGER=5 FINGER value + * @property {number} GASTRO_INTESTINAL=6 GASTRO_INTESTINAL value + * @property {number} MOUTH=7 MOUTH value + * @property {number} RECTUM=8 RECTUM value + * @property {number} TOE=9 TOE value + * @property {number} EAR_DRUM=10 EAR_DRUM value + * @property {number} TEMPORAL_ARTERY=11 TEMPORAL_ARTERY value + * @property {number} FOREHEAD=12 FOREHEAD value + * @property {number} URINARY_BLADDER=13 URINARY_BLADDER value + * @property {number} NASAL=14 NASAL value + * @property {number} NASOPHARYNGEAL=15 NASOPHARYNGEAL value + * @property {number} WRIST=16 WRIST value + * @property {number} VAGINA=17 VAGINA value + */ + CoreBodyTemperature.MeasurementLocation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEASUREMENT_LOCATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "OTHER"] = 1; + values[valuesById[2] = "ARMPIT"] = 2; + values[valuesById[3] = "BODY"] = 3; + values[valuesById[4] = "EAR"] = 4; + values[valuesById[5] = "FINGER"] = 5; + values[valuesById[6] = "GASTRO_INTESTINAL"] = 6; + values[valuesById[7] = "MOUTH"] = 7; + values[valuesById[8] = "RECTUM"] = 8; + values[valuesById[9] = "TOE"] = 9; + values[valuesById[10] = "EAR_DRUM"] = 10; + values[valuesById[11] = "TEMPORAL_ARTERY"] = 11; + values[valuesById[12] = "FOREHEAD"] = 12; + values[valuesById[13] = "URINARY_BLADDER"] = 13; + values[valuesById[14] = "NASAL"] = 14; + values[valuesById[15] = "NASOPHARYNGEAL"] = 15; + values[valuesById[16] = "WRIST"] = 16; + values[valuesById[17] = "VAGINA"] = 17; + return values; + })(); - /** - * Properties of a CaloriesInHeartRateZoneValue. - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue - * @interface ICaloriesInHeartRateZoneValue - * @property {google.devicesandservices.health.v4.HeartRateZoneType|null} [heartRateZone] CaloriesInHeartRateZoneValue heartRateZone - * @property {number|null} [kcal] CaloriesInHeartRateZoneValue kcal - */ + return CoreBodyTemperature; + })(); - /** - * Constructs a new CaloriesInHeartRateZoneValue. - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue - * @classdesc Represents a CaloriesInHeartRateZoneValue. - * @implements ICaloriesInHeartRateZoneValue - * @constructor - * @param {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.ICaloriesInHeartRateZoneValue=} [properties] Properties to set - */ - function CaloriesInHeartRateZoneValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v4.CoreBodyTemperatureRollupValue = (function() { - /** - * CaloriesInHeartRateZoneValue heartRateZone. - * @member {google.devicesandservices.health.v4.HeartRateZoneType} heartRateZone - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue - * @instance - */ - CaloriesInHeartRateZoneValue.prototype.heartRateZone = 0; + /** + * Properties of a CoreBodyTemperatureRollupValue. + * @memberof google.devicesandservices.health.v4 + * @interface ICoreBodyTemperatureRollupValue + * @property {number|null} [temperatureCelsiusAvg] CoreBodyTemperatureRollupValue temperatureCelsiusAvg + * @property {number|null} [temperatureCelsiusMax] CoreBodyTemperatureRollupValue temperatureCelsiusMax + * @property {number|null} [temperatureCelsiusMin] CoreBodyTemperatureRollupValue temperatureCelsiusMin + */ - /** - * CaloriesInHeartRateZoneValue kcal. - * @member {number} kcal - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue - * @instance - */ - CaloriesInHeartRateZoneValue.prototype.kcal = 0; + /** + * Constructs a new CoreBodyTemperatureRollupValue. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a CoreBodyTemperatureRollupValue. + * @implements ICoreBodyTemperatureRollupValue + * @constructor + * @param {google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue=} [properties] Properties to set + */ + function CoreBodyTemperatureRollupValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new CaloriesInHeartRateZoneValue instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue - * @static - * @param {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.ICaloriesInHeartRateZoneValue=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue} CaloriesInHeartRateZoneValue instance - */ - CaloriesInHeartRateZoneValue.create = function create(properties) { - return new CaloriesInHeartRateZoneValue(properties); - }; + /** + * CoreBodyTemperatureRollupValue temperatureCelsiusAvg. + * @member {number|null|undefined} temperatureCelsiusAvg + * @memberof google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue + * @instance + */ + CoreBodyTemperatureRollupValue.prototype.temperatureCelsiusAvg = null; - /** - * Encodes the specified CaloriesInHeartRateZoneValue message. Does not implicitly {@link google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue - * @static - * @param {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.ICaloriesInHeartRateZoneValue} message CaloriesInHeartRateZoneValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaloriesInHeartRateZoneValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.heartRateZone != null && Object.hasOwnProperty.call(message, "heartRateZone")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.heartRateZone); - if (message.kcal != null && Object.hasOwnProperty.call(message, "kcal")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.kcal); - return writer; - }; + /** + * CoreBodyTemperatureRollupValue temperatureCelsiusMax. + * @member {number|null|undefined} temperatureCelsiusMax + * @memberof google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue + * @instance + */ + CoreBodyTemperatureRollupValue.prototype.temperatureCelsiusMax = null; - /** - * Encodes the specified CaloriesInHeartRateZoneValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue - * @static - * @param {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.ICaloriesInHeartRateZoneValue} message CaloriesInHeartRateZoneValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaloriesInHeartRateZoneValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * CoreBodyTemperatureRollupValue temperatureCelsiusMin. + * @member {number|null|undefined} temperatureCelsiusMin + * @memberof google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue + * @instance + */ + CoreBodyTemperatureRollupValue.prototype.temperatureCelsiusMin = null; - /** - * Decodes a CaloriesInHeartRateZoneValue message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue} CaloriesInHeartRateZoneValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaloriesInHeartRateZoneValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.heartRateZone = reader.int32(); - break; - } - case 2: { - message.kcal = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Decodes a CaloriesInHeartRateZoneValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue} CaloriesInHeartRateZoneValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaloriesInHeartRateZoneValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + // Virtual OneOf for proto3 optional field + Object.defineProperty(CoreBodyTemperatureRollupValue.prototype, "_temperatureCelsiusAvg", { + get: $util.oneOfGetter($oneOfFields = ["temperatureCelsiusAvg"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Verifies a CaloriesInHeartRateZoneValue message. - * @function verify - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CaloriesInHeartRateZoneValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.heartRateZone != null && message.hasOwnProperty("heartRateZone")) - switch (message.heartRateZone) { - default: - return "heartRateZone: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: + // Virtual OneOf for proto3 optional field + Object.defineProperty(CoreBodyTemperatureRollupValue.prototype, "_temperatureCelsiusMax", { + get: $util.oneOfGetter($oneOfFields = ["temperatureCelsiusMax"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CoreBodyTemperatureRollupValue.prototype, "_temperatureCelsiusMin", { + get: $util.oneOfGetter($oneOfFields = ["temperatureCelsiusMin"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CoreBodyTemperatureRollupValue instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue + * @static + * @param {google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue} CoreBodyTemperatureRollupValue instance + */ + CoreBodyTemperatureRollupValue.create = function create(properties) { + return new CoreBodyTemperatureRollupValue(properties); + }; + + /** + * Encodes the specified CoreBodyTemperatureRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue + * @static + * @param {google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue} message CoreBodyTemperatureRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CoreBodyTemperatureRollupValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.temperatureCelsiusAvg != null && Object.hasOwnProperty.call(message, "temperatureCelsiusAvg")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.temperatureCelsiusAvg); + if (message.temperatureCelsiusMax != null && Object.hasOwnProperty.call(message, "temperatureCelsiusMax")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.temperatureCelsiusMax); + if (message.temperatureCelsiusMin != null && Object.hasOwnProperty.call(message, "temperatureCelsiusMin")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.temperatureCelsiusMin); + return writer; + }; + + /** + * Encodes the specified CoreBodyTemperatureRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue + * @static + * @param {google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue} message CoreBodyTemperatureRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CoreBodyTemperatureRollupValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CoreBodyTemperatureRollupValue message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue} CoreBodyTemperatureRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CoreBodyTemperatureRollupValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.temperatureCelsiusAvg = reader.double(); break; } - if (message.kcal != null && message.hasOwnProperty("kcal")) - if (typeof message.kcal !== "number") - return "kcal: number expected"; - return null; - }; - - /** - * Creates a CaloriesInHeartRateZoneValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue} CaloriesInHeartRateZoneValue - */ - CaloriesInHeartRateZoneValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue) - return object; - var message = new $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue(); - switch (object.heartRateZone) { - default: - if (typeof object.heartRateZone === "number") { - message.heartRateZone = object.heartRateZone; + case 2: { + message.temperatureCelsiusMax = reader.double(); break; } - break; - case "HEART_RATE_ZONE_TYPE_UNSPECIFIED": - case 0: - message.heartRateZone = 0; - break; - case "LIGHT": - case 1: - message.heartRateZone = 1; - break; - case "MODERATE": - case 2: - message.heartRateZone = 2; - break; - case "VIGOROUS": - case 3: - message.heartRateZone = 3; - break; - case "PEAK": - case 4: - message.heartRateZone = 4; + case 3: { + message.temperatureCelsiusMin = reader.double(); + break; + } + default: + reader.skipType(tag & 7); break; } - if (object.kcal != null) - message.kcal = Number(object.kcal); - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a CaloriesInHeartRateZoneValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue - * @static - * @param {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue} message CaloriesInHeartRateZoneValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CaloriesInHeartRateZoneValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.heartRateZone = options.enums === String ? "HEART_RATE_ZONE_TYPE_UNSPECIFIED" : 0; - object.kcal = 0; - } - if (message.heartRateZone != null && message.hasOwnProperty("heartRateZone")) - object.heartRateZone = options.enums === String ? $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZone] === undefined ? message.heartRateZone : $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZone] : message.heartRateZone; - if (message.kcal != null && message.hasOwnProperty("kcal")) - object.kcal = options.json && !isFinite(message.kcal) ? String(message.kcal) : message.kcal; + /** + * Decodes a CoreBodyTemperatureRollupValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue} CoreBodyTemperatureRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CoreBodyTemperatureRollupValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CoreBodyTemperatureRollupValue message. + * @function verify + * @memberof google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CoreBodyTemperatureRollupValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.temperatureCelsiusAvg != null && message.hasOwnProperty("temperatureCelsiusAvg")) { + properties._temperatureCelsiusAvg = 1; + if (typeof message.temperatureCelsiusAvg !== "number") + return "temperatureCelsiusAvg: number expected"; + } + if (message.temperatureCelsiusMax != null && message.hasOwnProperty("temperatureCelsiusMax")) { + properties._temperatureCelsiusMax = 1; + if (typeof message.temperatureCelsiusMax !== "number") + return "temperatureCelsiusMax: number expected"; + } + if (message.temperatureCelsiusMin != null && message.hasOwnProperty("temperatureCelsiusMin")) { + properties._temperatureCelsiusMin = 1; + if (typeof message.temperatureCelsiusMin !== "number") + return "temperatureCelsiusMin: number expected"; + } + return null; + }; + + /** + * Creates a CoreBodyTemperatureRollupValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue} CoreBodyTemperatureRollupValue + */ + CoreBodyTemperatureRollupValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue) return object; - }; + var message = new $root.google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue(); + if (object.temperatureCelsiusAvg != null) + message.temperatureCelsiusAvg = Number(object.temperatureCelsiusAvg); + if (object.temperatureCelsiusMax != null) + message.temperatureCelsiusMax = Number(object.temperatureCelsiusMax); + if (object.temperatureCelsiusMin != null) + message.temperatureCelsiusMin = Number(object.temperatureCelsiusMin); + return message; + }; - /** - * Converts this CaloriesInHeartRateZoneValue to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue - * @instance - * @returns {Object.} JSON object - */ - CaloriesInHeartRateZoneValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a CoreBodyTemperatureRollupValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue + * @static + * @param {google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue} message CoreBodyTemperatureRollupValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CoreBodyTemperatureRollupValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.temperatureCelsiusAvg != null && message.hasOwnProperty("temperatureCelsiusAvg")) { + object.temperatureCelsiusAvg = options.json && !isFinite(message.temperatureCelsiusAvg) ? String(message.temperatureCelsiusAvg) : message.temperatureCelsiusAvg; + if (options.oneofs) + object._temperatureCelsiusAvg = "temperatureCelsiusAvg"; + } + if (message.temperatureCelsiusMax != null && message.hasOwnProperty("temperatureCelsiusMax")) { + object.temperatureCelsiusMax = options.json && !isFinite(message.temperatureCelsiusMax) ? String(message.temperatureCelsiusMax) : message.temperatureCelsiusMax; + if (options.oneofs) + object._temperatureCelsiusMax = "temperatureCelsiusMax"; + } + if (message.temperatureCelsiusMin != null && message.hasOwnProperty("temperatureCelsiusMin")) { + object.temperatureCelsiusMin = options.json && !isFinite(message.temperatureCelsiusMin) ? String(message.temperatureCelsiusMin) : message.temperatureCelsiusMin; + if (options.oneofs) + object._temperatureCelsiusMin = "temperatureCelsiusMin"; + } + return object; + }; - /** - * Gets the default type url for CaloriesInHeartRateZoneValue - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CaloriesInHeartRateZoneValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue"; - }; + /** + * Converts this CoreBodyTemperatureRollupValue to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue + * @instance + * @returns {Object.} JSON object + */ + CoreBodyTemperatureRollupValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return CaloriesInHeartRateZoneValue; - })(); + /** + * Gets the default type url for CoreBodyTemperatureRollupValue + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CoreBodyTemperatureRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue"; + }; - return CaloriesInHeartRateZoneRollupValue; + return CoreBodyTemperatureRollupValue; })(); - v4.DailyHeartRateZones = (function() { + v4.CaloriesInHeartRateZoneRollupValue = (function() { /** - * Properties of a DailyHeartRateZones. + * Properties of a CaloriesInHeartRateZoneRollupValue. * @memberof google.devicesandservices.health.v4 - * @interface IDailyHeartRateZones - * @property {google.type.IDate|null} [date] DailyHeartRateZones date - * @property {Array.|null} [heartRateZones] DailyHeartRateZones heartRateZones + * @interface ICaloriesInHeartRateZoneRollupValue + * @property {Array.|null} [caloriesInHeartRateZones] CaloriesInHeartRateZoneRollupValue caloriesInHeartRateZones */ /** - * Constructs a new DailyHeartRateZones. + * Constructs a new CaloriesInHeartRateZoneRollupValue. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a DailyHeartRateZones. - * @implements IDailyHeartRateZones + * @classdesc Represents a CaloriesInHeartRateZoneRollupValue. + * @implements ICaloriesInHeartRateZoneRollupValue * @constructor - * @param {google.devicesandservices.health.v4.IDailyHeartRateZones=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue=} [properties] Properties to set */ - function DailyHeartRateZones(properties) { - this.heartRateZones = []; + function CaloriesInHeartRateZoneRollupValue(properties) { + this.caloriesInHeartRateZones = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5435,94 +5950,80 @@ } /** - * DailyHeartRateZones date. - * @member {google.type.IDate|null|undefined} date - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones - * @instance - */ - DailyHeartRateZones.prototype.date = null; - - /** - * DailyHeartRateZones heartRateZones. - * @member {Array.} heartRateZones - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones + * CaloriesInHeartRateZoneRollupValue caloriesInHeartRateZones. + * @member {Array.} caloriesInHeartRateZones + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue * @instance */ - DailyHeartRateZones.prototype.heartRateZones = $util.emptyArray; + CaloriesInHeartRateZoneRollupValue.prototype.caloriesInHeartRateZones = $util.emptyArray; /** - * Creates a new DailyHeartRateZones instance using the specified properties. + * Creates a new CaloriesInHeartRateZoneRollupValue instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue * @static - * @param {google.devicesandservices.health.v4.IDailyHeartRateZones=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.DailyHeartRateZones} DailyHeartRateZones instance + * @param {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue} CaloriesInHeartRateZoneRollupValue instance */ - DailyHeartRateZones.create = function create(properties) { - return new DailyHeartRateZones(properties); + CaloriesInHeartRateZoneRollupValue.create = function create(properties) { + return new CaloriesInHeartRateZoneRollupValue(properties); }; /** - * Encodes the specified DailyHeartRateZones message. Does not implicitly {@link google.devicesandservices.health.v4.DailyHeartRateZones.verify|verify} messages. + * Encodes the specified CaloriesInHeartRateZoneRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue * @static - * @param {google.devicesandservices.health.v4.IDailyHeartRateZones} message DailyHeartRateZones message or plain object to encode + * @param {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue} message CaloriesInHeartRateZoneRollupValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DailyHeartRateZones.encode = function encode(message, writer) { + CaloriesInHeartRateZoneRollupValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.date != null && Object.hasOwnProperty.call(message, "date")) - $root.google.type.Date.encode(message.date, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.heartRateZones != null && message.heartRateZones.length) - for (var i = 0; i < message.heartRateZones.length; ++i) - $root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone.encode(message.heartRateZones[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.caloriesInHeartRateZones != null && message.caloriesInHeartRateZones.length) + for (var i = 0; i < message.caloriesInHeartRateZones.length; ++i) + $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue.encode(message.caloriesInHeartRateZones[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified DailyHeartRateZones message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyHeartRateZones.verify|verify} messages. + * Encodes the specified CaloriesInHeartRateZoneRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue * @static - * @param {google.devicesandservices.health.v4.IDailyHeartRateZones} message DailyHeartRateZones message or plain object to encode + * @param {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue} message CaloriesInHeartRateZoneRollupValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DailyHeartRateZones.encodeDelimited = function encodeDelimited(message, writer) { + CaloriesInHeartRateZoneRollupValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DailyHeartRateZones message from the specified reader or buffer. + * Decodes a CaloriesInHeartRateZoneRollupValue message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.DailyHeartRateZones} DailyHeartRateZones + * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue} CaloriesInHeartRateZoneRollupValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DailyHeartRateZones.decode = function decode(reader, length, error) { + CaloriesInHeartRateZoneRollupValue.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DailyHeartRateZones(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.date = $root.google.type.Date.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.heartRateZones && message.heartRateZones.length)) - message.heartRateZones = []; - message.heartRateZones.push($root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone.decode(reader, reader.uint32())); + if (!(message.caloriesInHeartRateZones && message.caloriesInHeartRateZones.length)) + message.caloriesInHeartRateZones = []; + message.caloriesInHeartRateZones.push($root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue.decode(reader, reader.uint32())); break; } default: @@ -5534,152 +6035,137 @@ }; /** - * Decodes a DailyHeartRateZones message from the specified reader or buffer, length delimited. + * Decodes a CaloriesInHeartRateZoneRollupValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.DailyHeartRateZones} DailyHeartRateZones + * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue} CaloriesInHeartRateZoneRollupValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DailyHeartRateZones.decodeDelimited = function decodeDelimited(reader) { + CaloriesInHeartRateZoneRollupValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DailyHeartRateZones message. + * Verifies a CaloriesInHeartRateZoneRollupValue message. * @function verify - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DailyHeartRateZones.verify = function verify(message) { + CaloriesInHeartRateZoneRollupValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.date != null && message.hasOwnProperty("date")) { - var error = $root.google.type.Date.verify(message.date); - if (error) - return "date." + error; - } - if (message.heartRateZones != null && message.hasOwnProperty("heartRateZones")) { - if (!Array.isArray(message.heartRateZones)) - return "heartRateZones: array expected"; - for (var i = 0; i < message.heartRateZones.length; ++i) { - var error = $root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone.verify(message.heartRateZones[i]); + if (message.caloriesInHeartRateZones != null && message.hasOwnProperty("caloriesInHeartRateZones")) { + if (!Array.isArray(message.caloriesInHeartRateZones)) + return "caloriesInHeartRateZones: array expected"; + for (var i = 0; i < message.caloriesInHeartRateZones.length; ++i) { + var error = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue.verify(message.caloriesInHeartRateZones[i]); if (error) - return "heartRateZones." + error; + return "caloriesInHeartRateZones." + error; } } return null; }; /** - * Creates a DailyHeartRateZones message from a plain object. Also converts values to their respective internal types. + * Creates a CaloriesInHeartRateZoneRollupValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.DailyHeartRateZones} DailyHeartRateZones + * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue} CaloriesInHeartRateZoneRollupValue */ - DailyHeartRateZones.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.DailyHeartRateZones) + CaloriesInHeartRateZoneRollupValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue) return object; - var message = new $root.google.devicesandservices.health.v4.DailyHeartRateZones(); - if (object.date != null) { - if (typeof object.date !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyHeartRateZones.date: object expected"); - message.date = $root.google.type.Date.fromObject(object.date); - } - if (object.heartRateZones) { - if (!Array.isArray(object.heartRateZones)) - throw TypeError(".google.devicesandservices.health.v4.DailyHeartRateZones.heartRateZones: array expected"); - message.heartRateZones = []; - for (var i = 0; i < object.heartRateZones.length; ++i) { - if (typeof object.heartRateZones[i] !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyHeartRateZones.heartRateZones: object expected"); - message.heartRateZones[i] = $root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone.fromObject(object.heartRateZones[i]); + var message = new $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue(); + if (object.caloriesInHeartRateZones) { + if (!Array.isArray(object.caloriesInHeartRateZones)) + throw TypeError(".google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.caloriesInHeartRateZones: array expected"); + message.caloriesInHeartRateZones = []; + for (var i = 0; i < object.caloriesInHeartRateZones.length; ++i) { + if (typeof object.caloriesInHeartRateZones[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.caloriesInHeartRateZones: object expected"); + message.caloriesInHeartRateZones[i] = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue.fromObject(object.caloriesInHeartRateZones[i]); } } return message; }; /** - * Creates a plain object from a DailyHeartRateZones message. Also converts values to other types if specified. + * Creates a plain object from a CaloriesInHeartRateZoneRollupValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue * @static - * @param {google.devicesandservices.health.v4.DailyHeartRateZones} message DailyHeartRateZones + * @param {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue} message CaloriesInHeartRateZoneRollupValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DailyHeartRateZones.toObject = function toObject(message, options) { + CaloriesInHeartRateZoneRollupValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.heartRateZones = []; - if (options.defaults) - object.date = null; - if (message.date != null && message.hasOwnProperty("date")) - object.date = $root.google.type.Date.toObject(message.date, options); - if (message.heartRateZones && message.heartRateZones.length) { - object.heartRateZones = []; - for (var j = 0; j < message.heartRateZones.length; ++j) - object.heartRateZones[j] = $root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone.toObject(message.heartRateZones[j], options); + object.caloriesInHeartRateZones = []; + if (message.caloriesInHeartRateZones && message.caloriesInHeartRateZones.length) { + object.caloriesInHeartRateZones = []; + for (var j = 0; j < message.caloriesInHeartRateZones.length; ++j) + object.caloriesInHeartRateZones[j] = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue.toObject(message.caloriesInHeartRateZones[j], options); } return object; }; /** - * Converts this DailyHeartRateZones to JSON. + * Converts this CaloriesInHeartRateZoneRollupValue to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue * @instance * @returns {Object.} JSON object */ - DailyHeartRateZones.prototype.toJSON = function toJSON() { + CaloriesInHeartRateZoneRollupValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DailyHeartRateZones + * Gets the default type url for CaloriesInHeartRateZoneRollupValue * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DailyHeartRateZones.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CaloriesInHeartRateZoneRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.DailyHeartRateZones"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue"; }; - DailyHeartRateZones.HeartRateZone = (function() { + CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue = (function() { /** - * Properties of a HeartRateZone. - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones - * @interface IHeartRateZone - * @property {google.devicesandservices.health.v4.HeartRateZoneType|null} [heartRateZoneType] HeartRateZone heartRateZoneType - * @property {number|Long|null} [minBeatsPerMinute] HeartRateZone minBeatsPerMinute - * @property {number|Long|null} [maxBeatsPerMinute] HeartRateZone maxBeatsPerMinute + * Properties of a CaloriesInHeartRateZoneValue. + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue + * @interface ICaloriesInHeartRateZoneValue + * @property {google.devicesandservices.health.v4.HeartRateZoneType|null} [heartRateZone] CaloriesInHeartRateZoneValue heartRateZone + * @property {number|null} [kcal] CaloriesInHeartRateZoneValue kcal */ /** - * Constructs a new HeartRateZone. - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones - * @classdesc Represents a HeartRateZone. - * @implements IHeartRateZone + * Constructs a new CaloriesInHeartRateZoneValue. + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue + * @classdesc Represents a CaloriesInHeartRateZoneValue. + * @implements ICaloriesInHeartRateZoneValue * @constructor - * @param {google.devicesandservices.health.v4.DailyHeartRateZones.IHeartRateZone=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.ICaloriesInHeartRateZoneValue=} [properties] Properties to set */ - function HeartRateZone(properties) { + function CaloriesInHeartRateZoneValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5687,105 +6173,100 @@ } /** - * HeartRateZone heartRateZoneType. - * @member {google.devicesandservices.health.v4.HeartRateZoneType} heartRateZoneType - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * CaloriesInHeartRateZoneValue heartRateZone. + * @member {google.devicesandservices.health.v4.HeartRateZoneType} heartRateZone + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue * @instance */ - HeartRateZone.prototype.heartRateZoneType = 0; + CaloriesInHeartRateZoneValue.prototype.heartRateZone = 0; /** - * HeartRateZone minBeatsPerMinute. - * @member {number|Long} minBeatsPerMinute - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * CaloriesInHeartRateZoneValue kcal. + * @member {number|null|undefined} kcal + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue * @instance */ - HeartRateZone.prototype.minBeatsPerMinute = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + CaloriesInHeartRateZoneValue.prototype.kcal = null; - /** - * HeartRateZone maxBeatsPerMinute. - * @member {number|Long} maxBeatsPerMinute - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone - * @instance - */ - HeartRateZone.prototype.maxBeatsPerMinute = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CaloriesInHeartRateZoneValue.prototype, "_kcal", { + get: $util.oneOfGetter($oneOfFields = ["kcal"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new HeartRateZone instance using the specified properties. + * Creates a new CaloriesInHeartRateZoneValue instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue * @static - * @param {google.devicesandservices.health.v4.DailyHeartRateZones.IHeartRateZone=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone} HeartRateZone instance + * @param {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.ICaloriesInHeartRateZoneValue=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue} CaloriesInHeartRateZoneValue instance */ - HeartRateZone.create = function create(properties) { - return new HeartRateZone(properties); + CaloriesInHeartRateZoneValue.create = function create(properties) { + return new CaloriesInHeartRateZoneValue(properties); }; /** - * Encodes the specified HeartRateZone message. Does not implicitly {@link google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone.verify|verify} messages. + * Encodes the specified CaloriesInHeartRateZoneValue message. Does not implicitly {@link google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue * @static - * @param {google.devicesandservices.health.v4.DailyHeartRateZones.IHeartRateZone} message HeartRateZone message or plain object to encode + * @param {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.ICaloriesInHeartRateZoneValue} message CaloriesInHeartRateZoneValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HeartRateZone.encode = function encode(message, writer) { + CaloriesInHeartRateZoneValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.heartRateZoneType != null && Object.hasOwnProperty.call(message, "heartRateZoneType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.heartRateZoneType); - if (message.minBeatsPerMinute != null && Object.hasOwnProperty.call(message, "minBeatsPerMinute")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.minBeatsPerMinute); - if (message.maxBeatsPerMinute != null && Object.hasOwnProperty.call(message, "maxBeatsPerMinute")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.maxBeatsPerMinute); + if (message.heartRateZone != null && Object.hasOwnProperty.call(message, "heartRateZone")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.heartRateZone); + if (message.kcal != null && Object.hasOwnProperty.call(message, "kcal")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.kcal); return writer; }; /** - * Encodes the specified HeartRateZone message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone.verify|verify} messages. + * Encodes the specified CaloriesInHeartRateZoneValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue * @static - * @param {google.devicesandservices.health.v4.DailyHeartRateZones.IHeartRateZone} message HeartRateZone message or plain object to encode + * @param {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.ICaloriesInHeartRateZoneValue} message CaloriesInHeartRateZoneValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HeartRateZone.encodeDelimited = function encodeDelimited(message, writer) { + CaloriesInHeartRateZoneValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HeartRateZone message from the specified reader or buffer. + * Decodes a CaloriesInHeartRateZoneValue message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone} HeartRateZone + * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue} CaloriesInHeartRateZoneValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HeartRateZone.decode = function decode(reader, length, error) { + CaloriesInHeartRateZoneValue.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.heartRateZoneType = reader.int32(); + message.heartRateZone = reader.int32(); break; } case 2: { - message.minBeatsPerMinute = reader.int64(); - break; - } - case 3: { - message.maxBeatsPerMinute = reader.int64(); + message.kcal = reader.double(); break; } default: @@ -5797,36 +6278,37 @@ }; /** - * Decodes a HeartRateZone message from the specified reader or buffer, length delimited. + * Decodes a CaloriesInHeartRateZoneValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone} HeartRateZone + * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue} CaloriesInHeartRateZoneValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HeartRateZone.decodeDelimited = function decodeDelimited(reader) { + CaloriesInHeartRateZoneValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HeartRateZone message. + * Verifies a CaloriesInHeartRateZoneValue message. * @function verify - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HeartRateZone.verify = function verify(message) { + CaloriesInHeartRateZoneValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.heartRateZoneType != null && message.hasOwnProperty("heartRateZoneType")) - switch (message.heartRateZoneType) { + var properties = {}; + if (message.heartRateZone != null && message.hasOwnProperty("heartRateZone")) + switch (message.heartRateZone) { default: - return "heartRateZoneType: enum value expected"; + return "heartRateZone: enum value expected"; case 0: case 1: case 2: @@ -5834,171 +6316,136 @@ case 4: break; } - if (message.minBeatsPerMinute != null && message.hasOwnProperty("minBeatsPerMinute")) - if (!$util.isInteger(message.minBeatsPerMinute) && !(message.minBeatsPerMinute && $util.isInteger(message.minBeatsPerMinute.low) && $util.isInteger(message.minBeatsPerMinute.high))) - return "minBeatsPerMinute: integer|Long expected"; - if (message.maxBeatsPerMinute != null && message.hasOwnProperty("maxBeatsPerMinute")) - if (!$util.isInteger(message.maxBeatsPerMinute) && !(message.maxBeatsPerMinute && $util.isInteger(message.maxBeatsPerMinute.low) && $util.isInteger(message.maxBeatsPerMinute.high))) - return "maxBeatsPerMinute: integer|Long expected"; + if (message.kcal != null && message.hasOwnProperty("kcal")) { + properties._kcal = 1; + if (typeof message.kcal !== "number") + return "kcal: number expected"; + } return null; }; /** - * Creates a HeartRateZone message from a plain object. Also converts values to their respective internal types. + * Creates a CaloriesInHeartRateZoneValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone} HeartRateZone + * @returns {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue} CaloriesInHeartRateZoneValue */ - HeartRateZone.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone) + CaloriesInHeartRateZoneValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue) return object; - var message = new $root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone(); - switch (object.heartRateZoneType) { + var message = new $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue(); + switch (object.heartRateZone) { default: - if (typeof object.heartRateZoneType === "number") { - message.heartRateZoneType = object.heartRateZoneType; + if (typeof object.heartRateZone === "number") { + message.heartRateZone = object.heartRateZone; break; } break; case "HEART_RATE_ZONE_TYPE_UNSPECIFIED": case 0: - message.heartRateZoneType = 0; + message.heartRateZone = 0; break; case "LIGHT": case 1: - message.heartRateZoneType = 1; + message.heartRateZone = 1; break; case "MODERATE": case 2: - message.heartRateZoneType = 2; + message.heartRateZone = 2; break; case "VIGOROUS": case 3: - message.heartRateZoneType = 3; + message.heartRateZone = 3; break; case "PEAK": case 4: - message.heartRateZoneType = 4; + message.heartRateZone = 4; break; } - if (object.minBeatsPerMinute != null) - if ($util.Long) - (message.minBeatsPerMinute = $util.Long.fromValue(object.minBeatsPerMinute)).unsigned = false; - else if (typeof object.minBeatsPerMinute === "string") - message.minBeatsPerMinute = parseInt(object.minBeatsPerMinute, 10); - else if (typeof object.minBeatsPerMinute === "number") - message.minBeatsPerMinute = object.minBeatsPerMinute; - else if (typeof object.minBeatsPerMinute === "object") - message.minBeatsPerMinute = new $util.LongBits(object.minBeatsPerMinute.low >>> 0, object.minBeatsPerMinute.high >>> 0).toNumber(); - if (object.maxBeatsPerMinute != null) - if ($util.Long) - (message.maxBeatsPerMinute = $util.Long.fromValue(object.maxBeatsPerMinute)).unsigned = false; - else if (typeof object.maxBeatsPerMinute === "string") - message.maxBeatsPerMinute = parseInt(object.maxBeatsPerMinute, 10); - else if (typeof object.maxBeatsPerMinute === "number") - message.maxBeatsPerMinute = object.maxBeatsPerMinute; - else if (typeof object.maxBeatsPerMinute === "object") - message.maxBeatsPerMinute = new $util.LongBits(object.maxBeatsPerMinute.low >>> 0, object.maxBeatsPerMinute.high >>> 0).toNumber(); + if (object.kcal != null) + message.kcal = Number(object.kcal); return message; }; /** - * Creates a plain object from a HeartRateZone message. Also converts values to other types if specified. + * Creates a plain object from a CaloriesInHeartRateZoneValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue * @static - * @param {google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone} message HeartRateZone + * @param {google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue} message CaloriesInHeartRateZoneValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HeartRateZone.toObject = function toObject(message, options) { + CaloriesInHeartRateZoneValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.heartRateZoneType = options.enums === String ? "HEART_RATE_ZONE_TYPE_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.minBeatsPerMinute = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.minBeatsPerMinute = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxBeatsPerMinute = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxBeatsPerMinute = options.longs === String ? "0" : 0; + if (options.defaults) + object.heartRateZone = options.enums === String ? "HEART_RATE_ZONE_TYPE_UNSPECIFIED" : 0; + if (message.heartRateZone != null && message.hasOwnProperty("heartRateZone")) + object.heartRateZone = options.enums === String ? $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZone] === undefined ? message.heartRateZone : $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZone] : message.heartRateZone; + if (message.kcal != null && message.hasOwnProperty("kcal")) { + object.kcal = options.json && !isFinite(message.kcal) ? String(message.kcal) : message.kcal; + if (options.oneofs) + object._kcal = "kcal"; } - if (message.heartRateZoneType != null && message.hasOwnProperty("heartRateZoneType")) - object.heartRateZoneType = options.enums === String ? $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZoneType] === undefined ? message.heartRateZoneType : $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZoneType] : message.heartRateZoneType; - if (message.minBeatsPerMinute != null && message.hasOwnProperty("minBeatsPerMinute")) - if (typeof message.minBeatsPerMinute === "number") - object.minBeatsPerMinute = options.longs === String ? String(message.minBeatsPerMinute) : message.minBeatsPerMinute; - else - object.minBeatsPerMinute = options.longs === String ? $util.Long.prototype.toString.call(message.minBeatsPerMinute) : options.longs === Number ? new $util.LongBits(message.minBeatsPerMinute.low >>> 0, message.minBeatsPerMinute.high >>> 0).toNumber() : message.minBeatsPerMinute; - if (message.maxBeatsPerMinute != null && message.hasOwnProperty("maxBeatsPerMinute")) - if (typeof message.maxBeatsPerMinute === "number") - object.maxBeatsPerMinute = options.longs === String ? String(message.maxBeatsPerMinute) : message.maxBeatsPerMinute; - else - object.maxBeatsPerMinute = options.longs === String ? $util.Long.prototype.toString.call(message.maxBeatsPerMinute) : options.longs === Number ? new $util.LongBits(message.maxBeatsPerMinute.low >>> 0, message.maxBeatsPerMinute.high >>> 0).toNumber() : message.maxBeatsPerMinute; return object; }; /** - * Converts this HeartRateZone to JSON. + * Converts this CaloriesInHeartRateZoneValue to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue * @instance * @returns {Object.} JSON object */ - HeartRateZone.prototype.toJSON = function toJSON() { + CaloriesInHeartRateZoneValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for HeartRateZone + * Gets the default type url for CaloriesInHeartRateZoneValue * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @memberof google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - HeartRateZone.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CaloriesInHeartRateZoneValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.CaloriesInHeartRateZoneValue"; }; - return HeartRateZone; + return CaloriesInHeartRateZoneValue; })(); - return DailyHeartRateZones; + return CaloriesInHeartRateZoneRollupValue; })(); - v4.DailyHeartRateVariability = (function() { + v4.DailyHeartRateZones = (function() { /** - * Properties of a DailyHeartRateVariability. + * Properties of a DailyHeartRateZones. * @memberof google.devicesandservices.health.v4 - * @interface IDailyHeartRateVariability - * @property {google.type.IDate|null} [date] DailyHeartRateVariability date - * @property {number|null} [averageHeartRateVariabilityMilliseconds] DailyHeartRateVariability averageHeartRateVariabilityMilliseconds - * @property {number|Long|null} [nonRemHeartRateBeatsPerMinute] DailyHeartRateVariability nonRemHeartRateBeatsPerMinute - * @property {number|null} [entropy] DailyHeartRateVariability entropy - * @property {number|null} [deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds] DailyHeartRateVariability deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds + * @interface IDailyHeartRateZones + * @property {google.type.IDate|null} [date] DailyHeartRateZones date + * @property {Array.|null} [heartRateZones] DailyHeartRateZones heartRateZones */ /** - * Constructs a new DailyHeartRateVariability. + * Constructs a new DailyHeartRateZones. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a DailyHeartRateVariability. - * @implements IDailyHeartRateVariability + * @classdesc Represents a DailyHeartRateZones. + * @implements IDailyHeartRateZones * @constructor - * @param {google.devicesandservices.health.v4.IDailyHeartRateVariability=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IDailyHeartRateZones=} [properties] Properties to set */ - function DailyHeartRateVariability(properties) { + function DailyHeartRateZones(properties) { + this.heartRateZones = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6006,160 +6453,94 @@ } /** - * DailyHeartRateVariability date. + * DailyHeartRateZones date. * @member {google.type.IDate|null|undefined} date - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability - * @instance - */ - DailyHeartRateVariability.prototype.date = null; - - /** - * DailyHeartRateVariability averageHeartRateVariabilityMilliseconds. - * @member {number|null|undefined} averageHeartRateVariabilityMilliseconds - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability - * @instance - */ - DailyHeartRateVariability.prototype.averageHeartRateVariabilityMilliseconds = null; - - /** - * DailyHeartRateVariability nonRemHeartRateBeatsPerMinute. - * @member {number|Long|null|undefined} nonRemHeartRateBeatsPerMinute - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability - * @instance - */ - DailyHeartRateVariability.prototype.nonRemHeartRateBeatsPerMinute = null; - - /** - * DailyHeartRateVariability entropy. - * @member {number|null|undefined} entropy - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones * @instance */ - DailyHeartRateVariability.prototype.entropy = null; + DailyHeartRateZones.prototype.date = null; /** - * DailyHeartRateVariability deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds. - * @member {number|null|undefined} deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * DailyHeartRateZones heartRateZones. + * @member {Array.} heartRateZones + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones * @instance */ - DailyHeartRateVariability.prototype.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DailyHeartRateVariability.prototype, "_averageHeartRateVariabilityMilliseconds", { - get: $util.oneOfGetter($oneOfFields = ["averageHeartRateVariabilityMilliseconds"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DailyHeartRateVariability.prototype, "_nonRemHeartRateBeatsPerMinute", { - get: $util.oneOfGetter($oneOfFields = ["nonRemHeartRateBeatsPerMinute"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DailyHeartRateVariability.prototype, "_entropy", { - get: $util.oneOfGetter($oneOfFields = ["entropy"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DailyHeartRateVariability.prototype, "_deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds", { - get: $util.oneOfGetter($oneOfFields = ["deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds"]), - set: $util.oneOfSetter($oneOfFields) - }); + DailyHeartRateZones.prototype.heartRateZones = $util.emptyArray; /** - * Creates a new DailyHeartRateVariability instance using the specified properties. + * Creates a new DailyHeartRateZones instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones * @static - * @param {google.devicesandservices.health.v4.IDailyHeartRateVariability=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.DailyHeartRateVariability} DailyHeartRateVariability instance + * @param {google.devicesandservices.health.v4.IDailyHeartRateZones=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DailyHeartRateZones} DailyHeartRateZones instance */ - DailyHeartRateVariability.create = function create(properties) { - return new DailyHeartRateVariability(properties); + DailyHeartRateZones.create = function create(properties) { + return new DailyHeartRateZones(properties); }; /** - * Encodes the specified DailyHeartRateVariability message. Does not implicitly {@link google.devicesandservices.health.v4.DailyHeartRateVariability.verify|verify} messages. + * Encodes the specified DailyHeartRateZones message. Does not implicitly {@link google.devicesandservices.health.v4.DailyHeartRateZones.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones * @static - * @param {google.devicesandservices.health.v4.IDailyHeartRateVariability} message DailyHeartRateVariability message or plain object to encode + * @param {google.devicesandservices.health.v4.IDailyHeartRateZones} message DailyHeartRateZones message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DailyHeartRateVariability.encode = function encode(message, writer) { + DailyHeartRateZones.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.date != null && Object.hasOwnProperty.call(message, "date")) - $root.google.type.Date.encode(message.date, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.averageHeartRateVariabilityMilliseconds != null && Object.hasOwnProperty.call(message, "averageHeartRateVariabilityMilliseconds")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.averageHeartRateVariabilityMilliseconds); - if (message.nonRemHeartRateBeatsPerMinute != null && Object.hasOwnProperty.call(message, "nonRemHeartRateBeatsPerMinute")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.nonRemHeartRateBeatsPerMinute); - if (message.entropy != null && Object.hasOwnProperty.call(message, "entropy")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.entropy); - if (message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds != null && Object.hasOwnProperty.call(message, "deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds")) - writer.uint32(/* id 7, wireType 1 =*/57).double(message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds); + $root.google.type.Date.encode(message.date, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.heartRateZones != null && message.heartRateZones.length) + for (var i = 0; i < message.heartRateZones.length; ++i) + $root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone.encode(message.heartRateZones[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified DailyHeartRateVariability message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyHeartRateVariability.verify|verify} messages. + * Encodes the specified DailyHeartRateZones message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyHeartRateZones.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones * @static - * @param {google.devicesandservices.health.v4.IDailyHeartRateVariability} message DailyHeartRateVariability message or plain object to encode + * @param {google.devicesandservices.health.v4.IDailyHeartRateZones} message DailyHeartRateZones message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DailyHeartRateVariability.encodeDelimited = function encodeDelimited(message, writer) { + DailyHeartRateZones.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DailyHeartRateVariability message from the specified reader or buffer. + * Decodes a DailyHeartRateZones message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.DailyHeartRateVariability} DailyHeartRateVariability + * @returns {google.devicesandservices.health.v4.DailyHeartRateZones} DailyHeartRateZones * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DailyHeartRateVariability.decode = function decode(reader, length, error) { + DailyHeartRateZones.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DailyHeartRateVariability(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DailyHeartRateZones(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 2: { + case 1: { message.date = $root.google.type.Date.decode(reader, reader.uint32()); break; } - case 4: { - message.averageHeartRateVariabilityMilliseconds = reader.double(); - break; - } - case 5: { - message.nonRemHeartRateBeatsPerMinute = reader.int64(); - break; - } - case 6: { - message.entropy = reader.double(); - break; - } - case 7: { - message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds = reader.double(); + case 2: { + if (!(message.heartRateZones && message.heartRateZones.length)) + message.heartRateZones = []; + message.heartRateZones.push($root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone.decode(reader, reader.uint32())); break; } default: @@ -6171,279 +6552,647 @@ }; /** - * Decodes a DailyHeartRateVariability message from the specified reader or buffer, length delimited. + * Decodes a DailyHeartRateZones message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.DailyHeartRateVariability} DailyHeartRateVariability + * @returns {google.devicesandservices.health.v4.DailyHeartRateZones} DailyHeartRateZones * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DailyHeartRateVariability.decodeDelimited = function decodeDelimited(reader) { + DailyHeartRateZones.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DailyHeartRateVariability message. + * Verifies a DailyHeartRateZones message. * @function verify - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DailyHeartRateVariability.verify = function verify(message) { + DailyHeartRateZones.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; if (message.date != null && message.hasOwnProperty("date")) { var error = $root.google.type.Date.verify(message.date); if (error) return "date." + error; } - if (message.averageHeartRateVariabilityMilliseconds != null && message.hasOwnProperty("averageHeartRateVariabilityMilliseconds")) { - properties._averageHeartRateVariabilityMilliseconds = 1; - if (typeof message.averageHeartRateVariabilityMilliseconds !== "number") - return "averageHeartRateVariabilityMilliseconds: number expected"; - } - if (message.nonRemHeartRateBeatsPerMinute != null && message.hasOwnProperty("nonRemHeartRateBeatsPerMinute")) { - properties._nonRemHeartRateBeatsPerMinute = 1; - if (!$util.isInteger(message.nonRemHeartRateBeatsPerMinute) && !(message.nonRemHeartRateBeatsPerMinute && $util.isInteger(message.nonRemHeartRateBeatsPerMinute.low) && $util.isInteger(message.nonRemHeartRateBeatsPerMinute.high))) - return "nonRemHeartRateBeatsPerMinute: integer|Long expected"; - } - if (message.entropy != null && message.hasOwnProperty("entropy")) { - properties._entropy = 1; - if (typeof message.entropy !== "number") - return "entropy: number expected"; - } - if (message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds != null && message.hasOwnProperty("deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds")) { - properties._deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds = 1; - if (typeof message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds !== "number") - return "deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds: number expected"; + if (message.heartRateZones != null && message.hasOwnProperty("heartRateZones")) { + if (!Array.isArray(message.heartRateZones)) + return "heartRateZones: array expected"; + for (var i = 0; i < message.heartRateZones.length; ++i) { + var error = $root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone.verify(message.heartRateZones[i]); + if (error) + return "heartRateZones." + error; + } } return null; }; /** - * Creates a DailyHeartRateVariability message from a plain object. Also converts values to their respective internal types. + * Creates a DailyHeartRateZones message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.DailyHeartRateVariability} DailyHeartRateVariability + * @returns {google.devicesandservices.health.v4.DailyHeartRateZones} DailyHeartRateZones */ - DailyHeartRateVariability.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.DailyHeartRateVariability) + DailyHeartRateZones.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DailyHeartRateZones) return object; - var message = new $root.google.devicesandservices.health.v4.DailyHeartRateVariability(); + var message = new $root.google.devicesandservices.health.v4.DailyHeartRateZones(); if (object.date != null) { if (typeof object.date !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyHeartRateVariability.date: object expected"); + throw TypeError(".google.devicesandservices.health.v4.DailyHeartRateZones.date: object expected"); message.date = $root.google.type.Date.fromObject(object.date); } - if (object.averageHeartRateVariabilityMilliseconds != null) - message.averageHeartRateVariabilityMilliseconds = Number(object.averageHeartRateVariabilityMilliseconds); - if (object.nonRemHeartRateBeatsPerMinute != null) - if ($util.Long) - (message.nonRemHeartRateBeatsPerMinute = $util.Long.fromValue(object.nonRemHeartRateBeatsPerMinute)).unsigned = false; - else if (typeof object.nonRemHeartRateBeatsPerMinute === "string") - message.nonRemHeartRateBeatsPerMinute = parseInt(object.nonRemHeartRateBeatsPerMinute, 10); - else if (typeof object.nonRemHeartRateBeatsPerMinute === "number") - message.nonRemHeartRateBeatsPerMinute = object.nonRemHeartRateBeatsPerMinute; - else if (typeof object.nonRemHeartRateBeatsPerMinute === "object") - message.nonRemHeartRateBeatsPerMinute = new $util.LongBits(object.nonRemHeartRateBeatsPerMinute.low >>> 0, object.nonRemHeartRateBeatsPerMinute.high >>> 0).toNumber(); - if (object.entropy != null) - message.entropy = Number(object.entropy); - if (object.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds != null) - message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds = Number(object.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds); + if (object.heartRateZones) { + if (!Array.isArray(object.heartRateZones)) + throw TypeError(".google.devicesandservices.health.v4.DailyHeartRateZones.heartRateZones: array expected"); + message.heartRateZones = []; + for (var i = 0; i < object.heartRateZones.length; ++i) { + if (typeof object.heartRateZones[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyHeartRateZones.heartRateZones: object expected"); + message.heartRateZones[i] = $root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone.fromObject(object.heartRateZones[i]); + } + } return message; }; /** - * Creates a plain object from a DailyHeartRateVariability message. Also converts values to other types if specified. + * Creates a plain object from a DailyHeartRateZones message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones * @static - * @param {google.devicesandservices.health.v4.DailyHeartRateVariability} message DailyHeartRateVariability + * @param {google.devicesandservices.health.v4.DailyHeartRateZones} message DailyHeartRateZones * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DailyHeartRateVariability.toObject = function toObject(message, options) { + DailyHeartRateZones.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.heartRateZones = []; if (options.defaults) object.date = null; if (message.date != null && message.hasOwnProperty("date")) object.date = $root.google.type.Date.toObject(message.date, options); - if (message.averageHeartRateVariabilityMilliseconds != null && message.hasOwnProperty("averageHeartRateVariabilityMilliseconds")) { - object.averageHeartRateVariabilityMilliseconds = options.json && !isFinite(message.averageHeartRateVariabilityMilliseconds) ? String(message.averageHeartRateVariabilityMilliseconds) : message.averageHeartRateVariabilityMilliseconds; - if (options.oneofs) - object._averageHeartRateVariabilityMilliseconds = "averageHeartRateVariabilityMilliseconds"; - } - if (message.nonRemHeartRateBeatsPerMinute != null && message.hasOwnProperty("nonRemHeartRateBeatsPerMinute")) { - if (typeof message.nonRemHeartRateBeatsPerMinute === "number") - object.nonRemHeartRateBeatsPerMinute = options.longs === String ? String(message.nonRemHeartRateBeatsPerMinute) : message.nonRemHeartRateBeatsPerMinute; - else - object.nonRemHeartRateBeatsPerMinute = options.longs === String ? $util.Long.prototype.toString.call(message.nonRemHeartRateBeatsPerMinute) : options.longs === Number ? new $util.LongBits(message.nonRemHeartRateBeatsPerMinute.low >>> 0, message.nonRemHeartRateBeatsPerMinute.high >>> 0).toNumber() : message.nonRemHeartRateBeatsPerMinute; - if (options.oneofs) - object._nonRemHeartRateBeatsPerMinute = "nonRemHeartRateBeatsPerMinute"; - } - if (message.entropy != null && message.hasOwnProperty("entropy")) { - object.entropy = options.json && !isFinite(message.entropy) ? String(message.entropy) : message.entropy; - if (options.oneofs) - object._entropy = "entropy"; - } - if (message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds != null && message.hasOwnProperty("deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds")) { - object.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds = options.json && !isFinite(message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds) ? String(message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds) : message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds; - if (options.oneofs) - object._deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds = "deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds"; + if (message.heartRateZones && message.heartRateZones.length) { + object.heartRateZones = []; + for (var j = 0; j < message.heartRateZones.length; ++j) + object.heartRateZones[j] = $root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone.toObject(message.heartRateZones[j], options); } return object; }; /** - * Converts this DailyHeartRateVariability to JSON. + * Converts this DailyHeartRateZones to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones * @instance * @returns {Object.} JSON object */ - DailyHeartRateVariability.prototype.toJSON = function toJSON() { + DailyHeartRateZones.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DailyHeartRateVariability + * Gets the default type url for DailyHeartRateZones * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DailyHeartRateVariability.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DailyHeartRateZones.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.DailyHeartRateVariability"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.DailyHeartRateZones"; }; - return DailyHeartRateVariability; - })(); + DailyHeartRateZones.HeartRateZone = (function() { - v4.DailyRespiratoryRate = (function() { + /** + * Properties of a HeartRateZone. + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones + * @interface IHeartRateZone + * @property {google.devicesandservices.health.v4.HeartRateZoneType|null} [heartRateZoneType] HeartRateZone heartRateZoneType + * @property {number|Long|null} [minBeatsPerMinute] HeartRateZone minBeatsPerMinute + * @property {number|Long|null} [maxBeatsPerMinute] HeartRateZone maxBeatsPerMinute + */ - /** - * Properties of a DailyRespiratoryRate. - * @memberof google.devicesandservices.health.v4 - * @interface IDailyRespiratoryRate - * @property {google.type.IDate|null} [date] DailyRespiratoryRate date - * @property {number|null} [breathsPerMinute] DailyRespiratoryRate breathsPerMinute - */ + /** + * Constructs a new HeartRateZone. + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones + * @classdesc Represents a HeartRateZone. + * @implements IHeartRateZone + * @constructor + * @param {google.devicesandservices.health.v4.DailyHeartRateZones.IHeartRateZone=} [properties] Properties to set + */ + function HeartRateZone(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new DailyRespiratoryRate. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a DailyRespiratoryRate. - * @implements IDailyRespiratoryRate - * @constructor - * @param {google.devicesandservices.health.v4.IDailyRespiratoryRate=} [properties] Properties to set - */ - function DailyRespiratoryRate(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * HeartRateZone heartRateZoneType. + * @member {google.devicesandservices.health.v4.HeartRateZoneType} heartRateZoneType + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @instance + */ + HeartRateZone.prototype.heartRateZoneType = 0; - /** - * DailyRespiratoryRate date. - * @member {google.type.IDate|null|undefined} date - * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate - * @instance - */ - DailyRespiratoryRate.prototype.date = null; + /** + * HeartRateZone minBeatsPerMinute. + * @member {number|Long|null|undefined} minBeatsPerMinute + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @instance + */ + HeartRateZone.prototype.minBeatsPerMinute = null; - /** - * DailyRespiratoryRate breathsPerMinute. - * @member {number} breathsPerMinute - * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate - * @instance - */ - DailyRespiratoryRate.prototype.breathsPerMinute = 0; + /** + * HeartRateZone maxBeatsPerMinute. + * @member {number|Long|null|undefined} maxBeatsPerMinute + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @instance + */ + HeartRateZone.prototype.maxBeatsPerMinute = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HeartRateZone.prototype, "_minBeatsPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["minBeatsPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HeartRateZone.prototype, "_maxBeatsPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["maxBeatsPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HeartRateZone instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @static + * @param {google.devicesandservices.health.v4.DailyHeartRateZones.IHeartRateZone=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone} HeartRateZone instance + */ + HeartRateZone.create = function create(properties) { + return new HeartRateZone(properties); + }; + + /** + * Encodes the specified HeartRateZone message. Does not implicitly {@link google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @static + * @param {google.devicesandservices.health.v4.DailyHeartRateZones.IHeartRateZone} message HeartRateZone message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeartRateZone.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.heartRateZoneType != null && Object.hasOwnProperty.call(message, "heartRateZoneType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.heartRateZoneType); + if (message.minBeatsPerMinute != null && Object.hasOwnProperty.call(message, "minBeatsPerMinute")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.minBeatsPerMinute); + if (message.maxBeatsPerMinute != null && Object.hasOwnProperty.call(message, "maxBeatsPerMinute")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.maxBeatsPerMinute); + return writer; + }; + + /** + * Encodes the specified HeartRateZone message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @static + * @param {google.devicesandservices.health.v4.DailyHeartRateZones.IHeartRateZone} message HeartRateZone message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeartRateZone.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HeartRateZone message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone} HeartRateZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeartRateZone.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.heartRateZoneType = reader.int32(); + break; + } + case 2: { + message.minBeatsPerMinute = reader.int64(); + break; + } + case 3: { + message.maxBeatsPerMinute = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HeartRateZone message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone} HeartRateZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeartRateZone.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HeartRateZone message. + * @function verify + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HeartRateZone.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.heartRateZoneType != null && message.hasOwnProperty("heartRateZoneType")) + switch (message.heartRateZoneType) { + default: + return "heartRateZoneType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.minBeatsPerMinute != null && message.hasOwnProperty("minBeatsPerMinute")) { + properties._minBeatsPerMinute = 1; + if (!$util.isInteger(message.minBeatsPerMinute) && !(message.minBeatsPerMinute && $util.isInteger(message.minBeatsPerMinute.low) && $util.isInteger(message.minBeatsPerMinute.high))) + return "minBeatsPerMinute: integer|Long expected"; + } + if (message.maxBeatsPerMinute != null && message.hasOwnProperty("maxBeatsPerMinute")) { + properties._maxBeatsPerMinute = 1; + if (!$util.isInteger(message.maxBeatsPerMinute) && !(message.maxBeatsPerMinute && $util.isInteger(message.maxBeatsPerMinute.low) && $util.isInteger(message.maxBeatsPerMinute.high))) + return "maxBeatsPerMinute: integer|Long expected"; + } + return null; + }; + + /** + * Creates a HeartRateZone message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone} HeartRateZone + */ + HeartRateZone.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone) + return object; + var message = new $root.google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone(); + switch (object.heartRateZoneType) { + default: + if (typeof object.heartRateZoneType === "number") { + message.heartRateZoneType = object.heartRateZoneType; + break; + } + break; + case "HEART_RATE_ZONE_TYPE_UNSPECIFIED": + case 0: + message.heartRateZoneType = 0; + break; + case "LIGHT": + case 1: + message.heartRateZoneType = 1; + break; + case "MODERATE": + case 2: + message.heartRateZoneType = 2; + break; + case "VIGOROUS": + case 3: + message.heartRateZoneType = 3; + break; + case "PEAK": + case 4: + message.heartRateZoneType = 4; + break; + } + if (object.minBeatsPerMinute != null) + if ($util.Long) + (message.minBeatsPerMinute = $util.Long.fromValue(object.minBeatsPerMinute)).unsigned = false; + else if (typeof object.minBeatsPerMinute === "string") + message.minBeatsPerMinute = parseInt(object.minBeatsPerMinute, 10); + else if (typeof object.minBeatsPerMinute === "number") + message.minBeatsPerMinute = object.minBeatsPerMinute; + else if (typeof object.minBeatsPerMinute === "object") + message.minBeatsPerMinute = new $util.LongBits(object.minBeatsPerMinute.low >>> 0, object.minBeatsPerMinute.high >>> 0).toNumber(); + if (object.maxBeatsPerMinute != null) + if ($util.Long) + (message.maxBeatsPerMinute = $util.Long.fromValue(object.maxBeatsPerMinute)).unsigned = false; + else if (typeof object.maxBeatsPerMinute === "string") + message.maxBeatsPerMinute = parseInt(object.maxBeatsPerMinute, 10); + else if (typeof object.maxBeatsPerMinute === "number") + message.maxBeatsPerMinute = object.maxBeatsPerMinute; + else if (typeof object.maxBeatsPerMinute === "object") + message.maxBeatsPerMinute = new $util.LongBits(object.maxBeatsPerMinute.low >>> 0, object.maxBeatsPerMinute.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a HeartRateZone message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @static + * @param {google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone} message HeartRateZone + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HeartRateZone.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.heartRateZoneType = options.enums === String ? "HEART_RATE_ZONE_TYPE_UNSPECIFIED" : 0; + if (message.heartRateZoneType != null && message.hasOwnProperty("heartRateZoneType")) + object.heartRateZoneType = options.enums === String ? $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZoneType] === undefined ? message.heartRateZoneType : $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZoneType] : message.heartRateZoneType; + if (message.minBeatsPerMinute != null && message.hasOwnProperty("minBeatsPerMinute")) { + if (typeof message.minBeatsPerMinute === "number") + object.minBeatsPerMinute = options.longs === String ? String(message.minBeatsPerMinute) : message.minBeatsPerMinute; + else + object.minBeatsPerMinute = options.longs === String ? $util.Long.prototype.toString.call(message.minBeatsPerMinute) : options.longs === Number ? new $util.LongBits(message.minBeatsPerMinute.low >>> 0, message.minBeatsPerMinute.high >>> 0).toNumber() : message.minBeatsPerMinute; + if (options.oneofs) + object._minBeatsPerMinute = "minBeatsPerMinute"; + } + if (message.maxBeatsPerMinute != null && message.hasOwnProperty("maxBeatsPerMinute")) { + if (typeof message.maxBeatsPerMinute === "number") + object.maxBeatsPerMinute = options.longs === String ? String(message.maxBeatsPerMinute) : message.maxBeatsPerMinute; + else + object.maxBeatsPerMinute = options.longs === String ? $util.Long.prototype.toString.call(message.maxBeatsPerMinute) : options.longs === Number ? new $util.LongBits(message.maxBeatsPerMinute.low >>> 0, message.maxBeatsPerMinute.high >>> 0).toNumber() : message.maxBeatsPerMinute; + if (options.oneofs) + object._maxBeatsPerMinute = "maxBeatsPerMinute"; + } + return object; + }; + + /** + * Converts this HeartRateZone to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @instance + * @returns {Object.} JSON object + */ + HeartRateZone.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HeartRateZone + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HeartRateZone.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.DailyHeartRateZones.HeartRateZone"; + }; + + return HeartRateZone; + })(); + + return DailyHeartRateZones; + })(); + + v4.DailyHeartRateVariability = (function() { /** - * Creates a new DailyRespiratoryRate instance using the specified properties. + * Properties of a DailyHeartRateVariability. + * @memberof google.devicesandservices.health.v4 + * @interface IDailyHeartRateVariability + * @property {google.type.IDate|null} [date] DailyHeartRateVariability date + * @property {number|null} [averageHeartRateVariabilityMilliseconds] DailyHeartRateVariability averageHeartRateVariabilityMilliseconds + * @property {number|Long|null} [nonRemHeartRateBeatsPerMinute] DailyHeartRateVariability nonRemHeartRateBeatsPerMinute + * @property {number|null} [entropy] DailyHeartRateVariability entropy + * @property {number|null} [deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds] DailyHeartRateVariability deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds + */ + + /** + * Constructs a new DailyHeartRateVariability. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a DailyHeartRateVariability. + * @implements IDailyHeartRateVariability + * @constructor + * @param {google.devicesandservices.health.v4.IDailyHeartRateVariability=} [properties] Properties to set + */ + function DailyHeartRateVariability(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DailyHeartRateVariability date. + * @member {google.type.IDate|null|undefined} date + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @instance + */ + DailyHeartRateVariability.prototype.date = null; + + /** + * DailyHeartRateVariability averageHeartRateVariabilityMilliseconds. + * @member {number|null|undefined} averageHeartRateVariabilityMilliseconds + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @instance + */ + DailyHeartRateVariability.prototype.averageHeartRateVariabilityMilliseconds = null; + + /** + * DailyHeartRateVariability nonRemHeartRateBeatsPerMinute. + * @member {number|Long|null|undefined} nonRemHeartRateBeatsPerMinute + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @instance + */ + DailyHeartRateVariability.prototype.nonRemHeartRateBeatsPerMinute = null; + + /** + * DailyHeartRateVariability entropy. + * @member {number|null|undefined} entropy + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @instance + */ + DailyHeartRateVariability.prototype.entropy = null; + + /** + * DailyHeartRateVariability deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds. + * @member {number|null|undefined} deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @instance + */ + DailyHeartRateVariability.prototype.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailyHeartRateVariability.prototype, "_averageHeartRateVariabilityMilliseconds", { + get: $util.oneOfGetter($oneOfFields = ["averageHeartRateVariabilityMilliseconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailyHeartRateVariability.prototype, "_nonRemHeartRateBeatsPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["nonRemHeartRateBeatsPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailyHeartRateVariability.prototype, "_entropy", { + get: $util.oneOfGetter($oneOfFields = ["entropy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailyHeartRateVariability.prototype, "_deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds", { + get: $util.oneOfGetter($oneOfFields = ["deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DailyHeartRateVariability instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability * @static - * @param {google.devicesandservices.health.v4.IDailyRespiratoryRate=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.DailyRespiratoryRate} DailyRespiratoryRate instance + * @param {google.devicesandservices.health.v4.IDailyHeartRateVariability=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DailyHeartRateVariability} DailyHeartRateVariability instance */ - DailyRespiratoryRate.create = function create(properties) { - return new DailyRespiratoryRate(properties); + DailyHeartRateVariability.create = function create(properties) { + return new DailyHeartRateVariability(properties); }; /** - * Encodes the specified DailyRespiratoryRate message. Does not implicitly {@link google.devicesandservices.health.v4.DailyRespiratoryRate.verify|verify} messages. + * Encodes the specified DailyHeartRateVariability message. Does not implicitly {@link google.devicesandservices.health.v4.DailyHeartRateVariability.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability * @static - * @param {google.devicesandservices.health.v4.IDailyRespiratoryRate} message DailyRespiratoryRate message or plain object to encode + * @param {google.devicesandservices.health.v4.IDailyHeartRateVariability} message DailyHeartRateVariability message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DailyRespiratoryRate.encode = function encode(message, writer) { + DailyHeartRateVariability.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.date != null && Object.hasOwnProperty.call(message, "date")) - $root.google.type.Date.encode(message.date, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.breathsPerMinute != null && Object.hasOwnProperty.call(message, "breathsPerMinute")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.breathsPerMinute); + $root.google.type.Date.encode(message.date, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.averageHeartRateVariabilityMilliseconds != null && Object.hasOwnProperty.call(message, "averageHeartRateVariabilityMilliseconds")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.averageHeartRateVariabilityMilliseconds); + if (message.nonRemHeartRateBeatsPerMinute != null && Object.hasOwnProperty.call(message, "nonRemHeartRateBeatsPerMinute")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.nonRemHeartRateBeatsPerMinute); + if (message.entropy != null && Object.hasOwnProperty.call(message, "entropy")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.entropy); + if (message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds != null && Object.hasOwnProperty.call(message, "deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds")) + writer.uint32(/* id 7, wireType 1 =*/57).double(message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds); return writer; }; /** - * Encodes the specified DailyRespiratoryRate message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyRespiratoryRate.verify|verify} messages. + * Encodes the specified DailyHeartRateVariability message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyHeartRateVariability.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability * @static - * @param {google.devicesandservices.health.v4.IDailyRespiratoryRate} message DailyRespiratoryRate message or plain object to encode + * @param {google.devicesandservices.health.v4.IDailyHeartRateVariability} message DailyHeartRateVariability message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DailyRespiratoryRate.encodeDelimited = function encodeDelimited(message, writer) { + DailyHeartRateVariability.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DailyRespiratoryRate message from the specified reader or buffer. + * Decodes a DailyHeartRateVariability message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.DailyRespiratoryRate} DailyRespiratoryRate + * @returns {google.devicesandservices.health.v4.DailyHeartRateVariability} DailyHeartRateVariability * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DailyRespiratoryRate.decode = function decode(reader, length, error) { + DailyHeartRateVariability.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DailyRespiratoryRate(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DailyHeartRateVariability(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 1: { + case 2: { message.date = $root.google.type.Date.decode(reader, reader.uint32()); break; } - case 2: { - message.breathsPerMinute = reader.double(); + case 4: { + message.averageHeartRateVariabilityMilliseconds = reader.double(); + break; + } + case 5: { + message.nonRemHeartRateBeatsPerMinute = reader.int64(); + break; + } + case 6: { + message.entropy = reader.double(); + break; + } + case 7: { + message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds = reader.double(); break; } default: @@ -6455,86 +7204,383 @@ }; /** - * Decodes a DailyRespiratoryRate message from the specified reader or buffer, length delimited. + * Decodes a DailyHeartRateVariability message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.DailyRespiratoryRate} DailyRespiratoryRate + * @returns {google.devicesandservices.health.v4.DailyHeartRateVariability} DailyHeartRateVariability * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DailyRespiratoryRate.decodeDelimited = function decodeDelimited(reader) { + DailyHeartRateVariability.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DailyRespiratoryRate message. + * Verifies a DailyHeartRateVariability message. * @function verify - * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DailyRespiratoryRate.verify = function verify(message) { + DailyHeartRateVariability.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.date != null && message.hasOwnProperty("date")) { var error = $root.google.type.Date.verify(message.date); if (error) return "date." + error; } - if (message.breathsPerMinute != null && message.hasOwnProperty("breathsPerMinute")) - if (typeof message.breathsPerMinute !== "number") - return "breathsPerMinute: number expected"; + if (message.averageHeartRateVariabilityMilliseconds != null && message.hasOwnProperty("averageHeartRateVariabilityMilliseconds")) { + properties._averageHeartRateVariabilityMilliseconds = 1; + if (typeof message.averageHeartRateVariabilityMilliseconds !== "number") + return "averageHeartRateVariabilityMilliseconds: number expected"; + } + if (message.nonRemHeartRateBeatsPerMinute != null && message.hasOwnProperty("nonRemHeartRateBeatsPerMinute")) { + properties._nonRemHeartRateBeatsPerMinute = 1; + if (!$util.isInteger(message.nonRemHeartRateBeatsPerMinute) && !(message.nonRemHeartRateBeatsPerMinute && $util.isInteger(message.nonRemHeartRateBeatsPerMinute.low) && $util.isInteger(message.nonRemHeartRateBeatsPerMinute.high))) + return "nonRemHeartRateBeatsPerMinute: integer|Long expected"; + } + if (message.entropy != null && message.hasOwnProperty("entropy")) { + properties._entropy = 1; + if (typeof message.entropy !== "number") + return "entropy: number expected"; + } + if (message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds != null && message.hasOwnProperty("deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds")) { + properties._deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds = 1; + if (typeof message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds !== "number") + return "deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds: number expected"; + } return null; }; /** - * Creates a DailyRespiratoryRate message from a plain object. Also converts values to their respective internal types. + * Creates a DailyHeartRateVariability message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.DailyRespiratoryRate} DailyRespiratoryRate + * @returns {google.devicesandservices.health.v4.DailyHeartRateVariability} DailyHeartRateVariability */ - DailyRespiratoryRate.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.DailyRespiratoryRate) + DailyHeartRateVariability.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DailyHeartRateVariability) return object; - var message = new $root.google.devicesandservices.health.v4.DailyRespiratoryRate(); + var message = new $root.google.devicesandservices.health.v4.DailyHeartRateVariability(); if (object.date != null) { if (typeof object.date !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRespiratoryRate.date: object expected"); + throw TypeError(".google.devicesandservices.health.v4.DailyHeartRateVariability.date: object expected"); message.date = $root.google.type.Date.fromObject(object.date); } - if (object.breathsPerMinute != null) - message.breathsPerMinute = Number(object.breathsPerMinute); + if (object.averageHeartRateVariabilityMilliseconds != null) + message.averageHeartRateVariabilityMilliseconds = Number(object.averageHeartRateVariabilityMilliseconds); + if (object.nonRemHeartRateBeatsPerMinute != null) + if ($util.Long) + (message.nonRemHeartRateBeatsPerMinute = $util.Long.fromValue(object.nonRemHeartRateBeatsPerMinute)).unsigned = false; + else if (typeof object.nonRemHeartRateBeatsPerMinute === "string") + message.nonRemHeartRateBeatsPerMinute = parseInt(object.nonRemHeartRateBeatsPerMinute, 10); + else if (typeof object.nonRemHeartRateBeatsPerMinute === "number") + message.nonRemHeartRateBeatsPerMinute = object.nonRemHeartRateBeatsPerMinute; + else if (typeof object.nonRemHeartRateBeatsPerMinute === "object") + message.nonRemHeartRateBeatsPerMinute = new $util.LongBits(object.nonRemHeartRateBeatsPerMinute.low >>> 0, object.nonRemHeartRateBeatsPerMinute.high >>> 0).toNumber(); + if (object.entropy != null) + message.entropy = Number(object.entropy); + if (object.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds != null) + message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds = Number(object.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds); return message; }; /** - * Creates a plain object from a DailyRespiratoryRate message. Also converts values to other types if specified. + * Creates a plain object from a DailyHeartRateVariability message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability * @static - * @param {google.devicesandservices.health.v4.DailyRespiratoryRate} message DailyRespiratoryRate + * @param {google.devicesandservices.health.v4.DailyHeartRateVariability} message DailyHeartRateVariability * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DailyRespiratoryRate.toObject = function toObject(message, options) { + DailyHeartRateVariability.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.date = null; - object.breathsPerMinute = 0; - } if (message.date != null && message.hasOwnProperty("date")) object.date = $root.google.type.Date.toObject(message.date, options); - if (message.breathsPerMinute != null && message.hasOwnProperty("breathsPerMinute")) + if (message.averageHeartRateVariabilityMilliseconds != null && message.hasOwnProperty("averageHeartRateVariabilityMilliseconds")) { + object.averageHeartRateVariabilityMilliseconds = options.json && !isFinite(message.averageHeartRateVariabilityMilliseconds) ? String(message.averageHeartRateVariabilityMilliseconds) : message.averageHeartRateVariabilityMilliseconds; + if (options.oneofs) + object._averageHeartRateVariabilityMilliseconds = "averageHeartRateVariabilityMilliseconds"; + } + if (message.nonRemHeartRateBeatsPerMinute != null && message.hasOwnProperty("nonRemHeartRateBeatsPerMinute")) { + if (typeof message.nonRemHeartRateBeatsPerMinute === "number") + object.nonRemHeartRateBeatsPerMinute = options.longs === String ? String(message.nonRemHeartRateBeatsPerMinute) : message.nonRemHeartRateBeatsPerMinute; + else + object.nonRemHeartRateBeatsPerMinute = options.longs === String ? $util.Long.prototype.toString.call(message.nonRemHeartRateBeatsPerMinute) : options.longs === Number ? new $util.LongBits(message.nonRemHeartRateBeatsPerMinute.low >>> 0, message.nonRemHeartRateBeatsPerMinute.high >>> 0).toNumber() : message.nonRemHeartRateBeatsPerMinute; + if (options.oneofs) + object._nonRemHeartRateBeatsPerMinute = "nonRemHeartRateBeatsPerMinute"; + } + if (message.entropy != null && message.hasOwnProperty("entropy")) { + object.entropy = options.json && !isFinite(message.entropy) ? String(message.entropy) : message.entropy; + if (options.oneofs) + object._entropy = "entropy"; + } + if (message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds != null && message.hasOwnProperty("deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds")) { + object.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds = options.json && !isFinite(message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds) ? String(message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds) : message.deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds; + if (options.oneofs) + object._deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds = "deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds"; + } + return object; + }; + + /** + * Converts this DailyHeartRateVariability to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @instance + * @returns {Object.} JSON object + */ + DailyHeartRateVariability.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DailyHeartRateVariability + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.DailyHeartRateVariability + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DailyHeartRateVariability.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.DailyHeartRateVariability"; + }; + + return DailyHeartRateVariability; + })(); + + v4.DailyRespiratoryRate = (function() { + + /** + * Properties of a DailyRespiratoryRate. + * @memberof google.devicesandservices.health.v4 + * @interface IDailyRespiratoryRate + * @property {google.type.IDate|null} [date] DailyRespiratoryRate date + * @property {number|null} [breathsPerMinute] DailyRespiratoryRate breathsPerMinute + */ + + /** + * Constructs a new DailyRespiratoryRate. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a DailyRespiratoryRate. + * @implements IDailyRespiratoryRate + * @constructor + * @param {google.devicesandservices.health.v4.IDailyRespiratoryRate=} [properties] Properties to set + */ + function DailyRespiratoryRate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DailyRespiratoryRate date. + * @member {google.type.IDate|null|undefined} date + * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @instance + */ + DailyRespiratoryRate.prototype.date = null; + + /** + * DailyRespiratoryRate breathsPerMinute. + * @member {number|null|undefined} breathsPerMinute + * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @instance + */ + DailyRespiratoryRate.prototype.breathsPerMinute = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailyRespiratoryRate.prototype, "_breathsPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["breathsPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DailyRespiratoryRate instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @static + * @param {google.devicesandservices.health.v4.IDailyRespiratoryRate=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DailyRespiratoryRate} DailyRespiratoryRate instance + */ + DailyRespiratoryRate.create = function create(properties) { + return new DailyRespiratoryRate(properties); + }; + + /** + * Encodes the specified DailyRespiratoryRate message. Does not implicitly {@link google.devicesandservices.health.v4.DailyRespiratoryRate.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @static + * @param {google.devicesandservices.health.v4.IDailyRespiratoryRate} message DailyRespiratoryRate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DailyRespiratoryRate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.date != null && Object.hasOwnProperty.call(message, "date")) + $root.google.type.Date.encode(message.date, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.breathsPerMinute != null && Object.hasOwnProperty.call(message, "breathsPerMinute")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.breathsPerMinute); + return writer; + }; + + /** + * Encodes the specified DailyRespiratoryRate message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyRespiratoryRate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @static + * @param {google.devicesandservices.health.v4.IDailyRespiratoryRate} message DailyRespiratoryRate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DailyRespiratoryRate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DailyRespiratoryRate message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.DailyRespiratoryRate} DailyRespiratoryRate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DailyRespiratoryRate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DailyRespiratoryRate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.date = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 2: { + message.breathsPerMinute = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DailyRespiratoryRate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.DailyRespiratoryRate} DailyRespiratoryRate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DailyRespiratoryRate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DailyRespiratoryRate message. + * @function verify + * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DailyRespiratoryRate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.date != null && message.hasOwnProperty("date")) { + var error = $root.google.type.Date.verify(message.date); + if (error) + return "date." + error; + } + if (message.breathsPerMinute != null && message.hasOwnProperty("breathsPerMinute")) { + properties._breathsPerMinute = 1; + if (typeof message.breathsPerMinute !== "number") + return "breathsPerMinute: number expected"; + } + return null; + }; + + /** + * Creates a DailyRespiratoryRate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.DailyRespiratoryRate} DailyRespiratoryRate + */ + DailyRespiratoryRate.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DailyRespiratoryRate) + return object; + var message = new $root.google.devicesandservices.health.v4.DailyRespiratoryRate(); + if (object.date != null) { + if (typeof object.date !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRespiratoryRate.date: object expected"); + message.date = $root.google.type.Date.fromObject(object.date); + } + if (object.breathsPerMinute != null) + message.breathsPerMinute = Number(object.breathsPerMinute); + return message; + }; + + /** + * Creates a plain object from a DailyRespiratoryRate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.DailyRespiratoryRate + * @static + * @param {google.devicesandservices.health.v4.DailyRespiratoryRate} message DailyRespiratoryRate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DailyRespiratoryRate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.date = null; + if (message.date != null && message.hasOwnProperty("date")) + object.date = $root.google.type.Date.toObject(message.date, options); + if (message.breathsPerMinute != null && message.hasOwnProperty("breathsPerMinute")) { object.breathsPerMinute = options.json && !isFinite(message.breathsPerMinute) ? String(message.breathsPerMinute) : message.breathsPerMinute; + if (options.oneofs) + object._breathsPerMinute = "breathsPerMinute"; + } return object; }; @@ -6605,35 +7651,62 @@ /** * DailyOxygenSaturation averagePercentage. - * @member {number} averagePercentage + * @member {number|null|undefined} averagePercentage * @memberof google.devicesandservices.health.v4.DailyOxygenSaturation * @instance */ - DailyOxygenSaturation.prototype.averagePercentage = 0; + DailyOxygenSaturation.prototype.averagePercentage = null; /** * DailyOxygenSaturation lowerBoundPercentage. - * @member {number} lowerBoundPercentage + * @member {number|null|undefined} lowerBoundPercentage * @memberof google.devicesandservices.health.v4.DailyOxygenSaturation * @instance */ - DailyOxygenSaturation.prototype.lowerBoundPercentage = 0; + DailyOxygenSaturation.prototype.lowerBoundPercentage = null; /** * DailyOxygenSaturation upperBoundPercentage. - * @member {number} upperBoundPercentage + * @member {number|null|undefined} upperBoundPercentage * @memberof google.devicesandservices.health.v4.DailyOxygenSaturation * @instance */ - DailyOxygenSaturation.prototype.upperBoundPercentage = 0; + DailyOxygenSaturation.prototype.upperBoundPercentage = null; /** * DailyOxygenSaturation standardDeviationPercentage. - * @member {number} standardDeviationPercentage + * @member {number|null|undefined} standardDeviationPercentage * @memberof google.devicesandservices.health.v4.DailyOxygenSaturation * @instance */ - DailyOxygenSaturation.prototype.standardDeviationPercentage = 0; + DailyOxygenSaturation.prototype.standardDeviationPercentage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailyOxygenSaturation.prototype, "_averagePercentage", { + get: $util.oneOfGetter($oneOfFields = ["averagePercentage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailyOxygenSaturation.prototype, "_lowerBoundPercentage", { + get: $util.oneOfGetter($oneOfFields = ["lowerBoundPercentage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailyOxygenSaturation.prototype, "_upperBoundPercentage", { + get: $util.oneOfGetter($oneOfFields = ["upperBoundPercentage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailyOxygenSaturation.prototype, "_standardDeviationPercentage", { + get: $util.oneOfGetter($oneOfFields = ["standardDeviationPercentage"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new DailyOxygenSaturation instance using the specified properties. @@ -6760,23 +7833,32 @@ DailyOxygenSaturation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.date != null && message.hasOwnProperty("date")) { var error = $root.google.type.Date.verify(message.date); if (error) return "date." + error; } - if (message.averagePercentage != null && message.hasOwnProperty("averagePercentage")) + if (message.averagePercentage != null && message.hasOwnProperty("averagePercentage")) { + properties._averagePercentage = 1; if (typeof message.averagePercentage !== "number") return "averagePercentage: number expected"; - if (message.lowerBoundPercentage != null && message.hasOwnProperty("lowerBoundPercentage")) + } + if (message.lowerBoundPercentage != null && message.hasOwnProperty("lowerBoundPercentage")) { + properties._lowerBoundPercentage = 1; if (typeof message.lowerBoundPercentage !== "number") return "lowerBoundPercentage: number expected"; - if (message.upperBoundPercentage != null && message.hasOwnProperty("upperBoundPercentage")) + } + if (message.upperBoundPercentage != null && message.hasOwnProperty("upperBoundPercentage")) { + properties._upperBoundPercentage = 1; if (typeof message.upperBoundPercentage !== "number") return "upperBoundPercentage: number expected"; - if (message.standardDeviationPercentage != null && message.hasOwnProperty("standardDeviationPercentage")) + } + if (message.standardDeviationPercentage != null && message.hasOwnProperty("standardDeviationPercentage")) { + properties._standardDeviationPercentage = 1; if (typeof message.standardDeviationPercentage !== "number") return "standardDeviationPercentage: number expected"; + } return null; }; @@ -6821,23 +7903,30 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.date = null; - object.averagePercentage = 0; - object.lowerBoundPercentage = 0; - object.upperBoundPercentage = 0; - object.standardDeviationPercentage = 0; - } if (message.date != null && message.hasOwnProperty("date")) object.date = $root.google.type.Date.toObject(message.date, options); - if (message.averagePercentage != null && message.hasOwnProperty("averagePercentage")) + if (message.averagePercentage != null && message.hasOwnProperty("averagePercentage")) { object.averagePercentage = options.json && !isFinite(message.averagePercentage) ? String(message.averagePercentage) : message.averagePercentage; - if (message.lowerBoundPercentage != null && message.hasOwnProperty("lowerBoundPercentage")) + if (options.oneofs) + object._averagePercentage = "averagePercentage"; + } + if (message.lowerBoundPercentage != null && message.hasOwnProperty("lowerBoundPercentage")) { object.lowerBoundPercentage = options.json && !isFinite(message.lowerBoundPercentage) ? String(message.lowerBoundPercentage) : message.lowerBoundPercentage; - if (message.upperBoundPercentage != null && message.hasOwnProperty("upperBoundPercentage")) + if (options.oneofs) + object._lowerBoundPercentage = "lowerBoundPercentage"; + } + if (message.upperBoundPercentage != null && message.hasOwnProperty("upperBoundPercentage")) { object.upperBoundPercentage = options.json && !isFinite(message.upperBoundPercentage) ? String(message.upperBoundPercentage) : message.upperBoundPercentage; - if (message.standardDeviationPercentage != null && message.hasOwnProperty("standardDeviationPercentage")) + if (options.oneofs) + object._upperBoundPercentage = "upperBoundPercentage"; + } + if (message.standardDeviationPercentage != null && message.hasOwnProperty("standardDeviationPercentage")) { object.standardDeviationPercentage = options.json && !isFinite(message.standardDeviationPercentage) ? String(message.standardDeviationPercentage) : message.standardDeviationPercentage; + if (options.oneofs) + object._standardDeviationPercentage = "standardDeviationPercentage"; + } return object; }; @@ -6906,11 +7995,11 @@ /** * DailyRestingHeartRate beatsPerMinute. - * @member {number|Long} beatsPerMinute + * @member {number|Long|null|undefined} beatsPerMinute * @memberof google.devicesandservices.health.v4.DailyRestingHeartRate * @instance */ - DailyRestingHeartRate.prototype.beatsPerMinute = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DailyRestingHeartRate.prototype.beatsPerMinute = null; /** * DailyRestingHeartRate dailyRestingHeartRateMetadata. @@ -6920,6 +8009,15 @@ */ DailyRestingHeartRate.prototype.dailyRestingHeartRateMetadata = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailyRestingHeartRate.prototype, "_beatsPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["beatsPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new DailyRestingHeartRate instance using the specified properties. * @function create @@ -7033,14 +8131,17 @@ DailyRestingHeartRate.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.date != null && message.hasOwnProperty("date")) { var error = $root.google.type.Date.verify(message.date); if (error) return "date." + error; } - if (message.beatsPerMinute != null && message.hasOwnProperty("beatsPerMinute")) + if (message.beatsPerMinute != null && message.hasOwnProperty("beatsPerMinute")) { + properties._beatsPerMinute = 1; if (!$util.isInteger(message.beatsPerMinute) && !(message.beatsPerMinute && $util.isInteger(message.beatsPerMinute.low) && $util.isInteger(message.beatsPerMinute.high))) return "beatsPerMinute: integer|Long expected"; + } if (message.dailyRestingHeartRateMetadata != null && message.hasOwnProperty("dailyRestingHeartRateMetadata")) { var error = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.DailyRestingHeartRateMetadata.verify(message.dailyRestingHeartRateMetadata); if (error) @@ -7098,20 +8199,18 @@ var object = {}; if (options.defaults) { object.date = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.beatsPerMinute = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.beatsPerMinute = options.longs === String ? "0" : 0; object.dailyRestingHeartRateMetadata = null; } if (message.date != null && message.hasOwnProperty("date")) object.date = $root.google.type.Date.toObject(message.date, options); - if (message.beatsPerMinute != null && message.hasOwnProperty("beatsPerMinute")) + if (message.beatsPerMinute != null && message.hasOwnProperty("beatsPerMinute")) { if (typeof message.beatsPerMinute === "number") object.beatsPerMinute = options.longs === String ? String(message.beatsPerMinute) : message.beatsPerMinute; else object.beatsPerMinute = options.longs === String ? $util.Long.prototype.toString.call(message.beatsPerMinute) : options.longs === Number ? new $util.LongBits(message.beatsPerMinute.low >>> 0, message.beatsPerMinute.high >>> 0).toNumber() : message.beatsPerMinute; + if (options.oneofs) + object._beatsPerMinute = "beatsPerMinute"; + } if (message.dailyRestingHeartRateMetadata != null && message.hasOwnProperty("dailyRestingHeartRateMetadata")) object.dailyRestingHeartRateMetadata = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.DailyRestingHeartRateMetadata.toObject(message.dailyRestingHeartRateMetadata, options); return object; @@ -7428,27 +8527,48 @@ /** * DailySleepTemperatureDerivations nightlyTemperatureCelsius. - * @member {number} nightlyTemperatureCelsius + * @member {number|null|undefined} nightlyTemperatureCelsius * @memberof google.devicesandservices.health.v4.DailySleepTemperatureDerivations * @instance */ - DailySleepTemperatureDerivations.prototype.nightlyTemperatureCelsius = 0; + DailySleepTemperatureDerivations.prototype.nightlyTemperatureCelsius = null; /** * DailySleepTemperatureDerivations baselineTemperatureCelsius. - * @member {number} baselineTemperatureCelsius + * @member {number|null|undefined} baselineTemperatureCelsius * @memberof google.devicesandservices.health.v4.DailySleepTemperatureDerivations * @instance */ - DailySleepTemperatureDerivations.prototype.baselineTemperatureCelsius = 0; + DailySleepTemperatureDerivations.prototype.baselineTemperatureCelsius = null; /** * DailySleepTemperatureDerivations relativeNightlyStddev_30dCelsius. - * @member {number} relativeNightlyStddev_30dCelsius + * @member {number|null|undefined} relativeNightlyStddev_30dCelsius * @memberof google.devicesandservices.health.v4.DailySleepTemperatureDerivations * @instance */ - DailySleepTemperatureDerivations.prototype.relativeNightlyStddev_30dCelsius = 0; + DailySleepTemperatureDerivations.prototype.relativeNightlyStddev_30dCelsius = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailySleepTemperatureDerivations.prototype, "_nightlyTemperatureCelsius", { + get: $util.oneOfGetter($oneOfFields = ["nightlyTemperatureCelsius"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailySleepTemperatureDerivations.prototype, "_baselineTemperatureCelsius", { + get: $util.oneOfGetter($oneOfFields = ["baselineTemperatureCelsius"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailySleepTemperatureDerivations.prototype, "_relativeNightlyStddev_30dCelsius", { + get: $util.oneOfGetter($oneOfFields = ["relativeNightlyStddev_30dCelsius"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new DailySleepTemperatureDerivations instance using the specified properties. @@ -7569,20 +8689,27 @@ DailySleepTemperatureDerivations.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.date != null && message.hasOwnProperty("date")) { var error = $root.google.type.Date.verify(message.date); if (error) return "date." + error; } - if (message.nightlyTemperatureCelsius != null && message.hasOwnProperty("nightlyTemperatureCelsius")) + if (message.nightlyTemperatureCelsius != null && message.hasOwnProperty("nightlyTemperatureCelsius")) { + properties._nightlyTemperatureCelsius = 1; if (typeof message.nightlyTemperatureCelsius !== "number") return "nightlyTemperatureCelsius: number expected"; - if (message.baselineTemperatureCelsius != null && message.hasOwnProperty("baselineTemperatureCelsius")) + } + if (message.baselineTemperatureCelsius != null && message.hasOwnProperty("baselineTemperatureCelsius")) { + properties._baselineTemperatureCelsius = 1; if (typeof message.baselineTemperatureCelsius !== "number") return "baselineTemperatureCelsius: number expected"; - if (message.relativeNightlyStddev_30dCelsius != null && message.hasOwnProperty("relativeNightlyStddev_30dCelsius")) + } + if (message.relativeNightlyStddev_30dCelsius != null && message.hasOwnProperty("relativeNightlyStddev_30dCelsius")) { + properties._relativeNightlyStddev_30dCelsius = 1; if (typeof message.relativeNightlyStddev_30dCelsius !== "number") return "relativeNightlyStddev_30dCelsius: number expected"; + } return null; }; @@ -7625,20 +8752,25 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.date = null; - object.nightlyTemperatureCelsius = 0; - object.baselineTemperatureCelsius = 0; - object.relativeNightlyStddev_30dCelsius = 0; - } if (message.date != null && message.hasOwnProperty("date")) object.date = $root.google.type.Date.toObject(message.date, options); - if (message.nightlyTemperatureCelsius != null && message.hasOwnProperty("nightlyTemperatureCelsius")) + if (message.nightlyTemperatureCelsius != null && message.hasOwnProperty("nightlyTemperatureCelsius")) { object.nightlyTemperatureCelsius = options.json && !isFinite(message.nightlyTemperatureCelsius) ? String(message.nightlyTemperatureCelsius) : message.nightlyTemperatureCelsius; - if (message.baselineTemperatureCelsius != null && message.hasOwnProperty("baselineTemperatureCelsius")) + if (options.oneofs) + object._nightlyTemperatureCelsius = "nightlyTemperatureCelsius"; + } + if (message.baselineTemperatureCelsius != null && message.hasOwnProperty("baselineTemperatureCelsius")) { object.baselineTemperatureCelsius = options.json && !isFinite(message.baselineTemperatureCelsius) ? String(message.baselineTemperatureCelsius) : message.baselineTemperatureCelsius; - if (message.relativeNightlyStddev_30dCelsius != null && message.hasOwnProperty("relativeNightlyStddev_30dCelsius")) + if (options.oneofs) + object._baselineTemperatureCelsius = "baselineTemperatureCelsius"; + } + if (message.relativeNightlyStddev_30dCelsius != null && message.hasOwnProperty("relativeNightlyStddev_30dCelsius")) { object.relativeNightlyStddev_30dCelsius = options.json && !isFinite(message.relativeNightlyStddev_30dCelsius) ? String(message.relativeNightlyStddev_30dCelsius) : message.relativeNightlyStddev_30dCelsius; + if (options.oneofs) + object._relativeNightlyStddev_30dCelsius = "relativeNightlyStddev_30dCelsius"; + } return object; }; @@ -7709,11 +8841,11 @@ /** * DailyVO2Max vo2Max. - * @member {number} vo2Max + * @member {number|null|undefined} vo2Max * @memberof google.devicesandservices.health.v4.DailyVO2Max * @instance */ - DailyVO2Max.prototype.vo2Max = 0; + DailyVO2Max.prototype.vo2Max = null; /** * DailyVO2Max estimated. @@ -7733,11 +8865,26 @@ /** * DailyVO2Max vo2MaxCovariance. - * @member {number} vo2MaxCovariance + * @member {number|null|undefined} vo2MaxCovariance * @memberof google.devicesandservices.health.v4.DailyVO2Max * @instance */ - DailyVO2Max.prototype.vo2MaxCovariance = 0; + DailyVO2Max.prototype.vo2MaxCovariance = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailyVO2Max.prototype, "_vo2Max", { + get: $util.oneOfGetter($oneOfFields = ["vo2Max"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DailyVO2Max.prototype, "_vo2MaxCovariance", { + get: $util.oneOfGetter($oneOfFields = ["vo2MaxCovariance"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new DailyVO2Max instance using the specified properties. @@ -7864,14 +9011,17 @@ DailyVO2Max.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.date != null && message.hasOwnProperty("date")) { var error = $root.google.type.Date.verify(message.date); if (error) return "date." + error; } - if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) + if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) { + properties._vo2Max = 1; if (typeof message.vo2Max !== "number") return "vo2Max: number expected"; + } if (message.estimated != null && message.hasOwnProperty("estimated")) if (typeof message.estimated !== "boolean") return "estimated: boolean expected"; @@ -7888,9 +9038,11 @@ case 6: break; } - if (message.vo2MaxCovariance != null && message.hasOwnProperty("vo2MaxCovariance")) + if (message.vo2MaxCovariance != null && message.hasOwnProperty("vo2MaxCovariance")) { + properties._vo2MaxCovariance = 1; if (typeof message.vo2MaxCovariance !== "number") return "vo2MaxCovariance: number expected"; + } return null; }; @@ -7971,21 +9123,25 @@ var object = {}; if (options.defaults) { object.date = null; - object.vo2Max = 0; object.estimated = false; object.cardioFitnessLevel = options.enums === String ? "CARDIO_FITNESS_LEVEL_UNSPECIFIED" : 0; - object.vo2MaxCovariance = 0; } if (message.date != null && message.hasOwnProperty("date")) object.date = $root.google.type.Date.toObject(message.date, options); - if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) + if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) { object.vo2Max = options.json && !isFinite(message.vo2Max) ? String(message.vo2Max) : message.vo2Max; + if (options.oneofs) + object._vo2Max = "vo2Max"; + } if (message.estimated != null && message.hasOwnProperty("estimated")) object.estimated = message.estimated; if (message.cardioFitnessLevel != null && message.hasOwnProperty("cardioFitnessLevel")) object.cardioFitnessLevel = options.enums === String ? $root.google.devicesandservices.health.v4.DailyVO2Max.CardioFitnessLevel[message.cardioFitnessLevel] === undefined ? message.cardioFitnessLevel : $root.google.devicesandservices.health.v4.DailyVO2Max.CardioFitnessLevel[message.cardioFitnessLevel] : message.cardioFitnessLevel; - if (message.vo2MaxCovariance != null && message.hasOwnProperty("vo2MaxCovariance")) + if (message.vo2MaxCovariance != null && message.hasOwnProperty("vo2MaxCovariance")) { object.vo2MaxCovariance = options.json && !isFinite(message.vo2MaxCovariance) ? String(message.vo2MaxCovariance) : message.vo2MaxCovariance; + if (options.oneofs) + object._vo2MaxCovariance = "vo2MaxCovariance"; + } return object; }; @@ -8077,11 +9233,20 @@ /** * Distance millimeters. - * @member {number|Long} millimeters + * @member {number|Long|null|undefined} millimeters * @memberof google.devicesandservices.health.v4.Distance * @instance */ - Distance.prototype.millimeters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Distance.prototype.millimeters = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Distance.prototype, "_millimeters", { + get: $util.oneOfGetter($oneOfFields = ["millimeters"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new Distance instance using the specified properties. @@ -8190,14 +9355,17 @@ Distance.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.interval != null && message.hasOwnProperty("interval")) { var error = $root.google.devicesandservices.health.v4.ObservationTimeInterval.verify(message.interval); if (error) return "interval." + error; } - if (message.millimeters != null && message.hasOwnProperty("millimeters")) + if (message.millimeters != null && message.hasOwnProperty("millimeters")) { + properties._millimeters = 1; if (!$util.isInteger(message.millimeters) && !(message.millimeters && $util.isInteger(message.millimeters.low) && $util.isInteger(message.millimeters.high))) return "millimeters: integer|Long expected"; + } return null; }; @@ -8243,21 +9411,18 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.interval = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.millimeters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.millimeters = options.longs === String ? "0" : 0; - } if (message.interval != null && message.hasOwnProperty("interval")) object.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.toObject(message.interval, options); - if (message.millimeters != null && message.hasOwnProperty("millimeters")) + if (message.millimeters != null && message.hasOwnProperty("millimeters")) { if (typeof message.millimeters === "number") object.millimeters = options.longs === String ? String(message.millimeters) : message.millimeters; else object.millimeters = options.longs === String ? $util.Long.prototype.toString.call(message.millimeters) : options.longs === Number ? new $util.LongBits(message.millimeters.low >>> 0, message.millimeters.high >>> 0).toNumber() : message.millimeters; + if (options.oneofs) + object._millimeters = "millimeters"; + } return object; }; @@ -8316,11 +9481,20 @@ /** * DistanceRollupValue millimetersSum. - * @member {number|Long} millimetersSum + * @member {number|Long|null|undefined} millimetersSum * @memberof google.devicesandservices.health.v4.DistanceRollupValue * @instance */ - DistanceRollupValue.prototype.millimetersSum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DistanceRollupValue.prototype.millimetersSum = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DistanceRollupValue.prototype, "_millimetersSum", { + get: $util.oneOfGetter($oneOfFields = ["millimetersSum"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new DistanceRollupValue instance using the specified properties. @@ -8423,9 +9597,12 @@ DistanceRollupValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.millimetersSum != null && message.hasOwnProperty("millimetersSum")) + var properties = {}; + if (message.millimetersSum != null && message.hasOwnProperty("millimetersSum")) { + properties._millimetersSum = 1; if (!$util.isInteger(message.millimetersSum) && !(message.millimetersSum && $util.isInteger(message.millimetersSum.low) && $util.isInteger(message.millimetersSum.high))) return "millimetersSum: integer|Long expected"; + } return null; }; @@ -8466,17 +9643,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.millimetersSum = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.millimetersSum = options.longs === String ? "0" : 0; - if (message.millimetersSum != null && message.hasOwnProperty("millimetersSum")) + if (message.millimetersSum != null && message.hasOwnProperty("millimetersSum")) { if (typeof message.millimetersSum === "number") object.millimetersSum = options.longs === String ? String(message.millimetersSum) : message.millimetersSum; else object.millimetersSum = options.longs === String ? $util.Long.prototype.toString.call(message.millimetersSum) : options.longs === Number ? new $util.LongBits(message.millimetersSum.low >>> 0, message.millimetersSum.high >>> 0).toNumber() : message.millimetersSum; + if (options.oneofs) + object._millimetersSum = "millimetersSum"; + } return object; }; @@ -8509,6 +9683,537 @@ return DistanceRollupValue; })(); + v4.Electrocardiogram = (function() { + + /** + * Properties of an Electrocardiogram. + * @memberof google.devicesandservices.health.v4 + * @interface IElectrocardiogram + * @property {google.devicesandservices.health.v4.ISessionTimeInterval|null} [interval] Electrocardiogram interval + * @property {number|Long|null} [beatsPerMinuteAvg] Electrocardiogram beatsPerMinuteAvg + * @property {google.devicesandservices.health.v4.Electrocardiogram.ResultClassification|null} [resultClassification] Electrocardiogram resultClassification + * @property {Array.|null} [waveformSamples] Electrocardiogram waveformSamples + * @property {number|null} [samplingFrequencyHertz] Electrocardiogram samplingFrequencyHertz + * @property {number|null} [millivoltsScalingFactor] Electrocardiogram millivoltsScalingFactor + * @property {number|null} [leadNumber] Electrocardiogram leadNumber + * @property {google.devicesandservices.health.v4.IMedicalDeviceInfo|null} [medicalDeviceInfo] Electrocardiogram medicalDeviceInfo + */ + + /** + * Constructs a new Electrocardiogram. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents an Electrocardiogram. + * @implements IElectrocardiogram + * @constructor + * @param {google.devicesandservices.health.v4.IElectrocardiogram=} [properties] Properties to set + */ + function Electrocardiogram(properties) { + this.waveformSamples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Electrocardiogram interval. + * @member {google.devicesandservices.health.v4.ISessionTimeInterval|null|undefined} interval + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @instance + */ + Electrocardiogram.prototype.interval = null; + + /** + * Electrocardiogram beatsPerMinuteAvg. + * @member {number|Long|null|undefined} beatsPerMinuteAvg + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @instance + */ + Electrocardiogram.prototype.beatsPerMinuteAvg = null; + + /** + * Electrocardiogram resultClassification. + * @member {google.devicesandservices.health.v4.Electrocardiogram.ResultClassification} resultClassification + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @instance + */ + Electrocardiogram.prototype.resultClassification = 0; + + /** + * Electrocardiogram waveformSamples. + * @member {Array.} waveformSamples + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @instance + */ + Electrocardiogram.prototype.waveformSamples = $util.emptyArray; + + /** + * Electrocardiogram samplingFrequencyHertz. + * @member {number|null|undefined} samplingFrequencyHertz + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @instance + */ + Electrocardiogram.prototype.samplingFrequencyHertz = null; + + /** + * Electrocardiogram millivoltsScalingFactor. + * @member {number|null|undefined} millivoltsScalingFactor + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @instance + */ + Electrocardiogram.prototype.millivoltsScalingFactor = null; + + /** + * Electrocardiogram leadNumber. + * @member {number|null|undefined} leadNumber + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @instance + */ + Electrocardiogram.prototype.leadNumber = null; + + /** + * Electrocardiogram medicalDeviceInfo. + * @member {google.devicesandservices.health.v4.IMedicalDeviceInfo|null|undefined} medicalDeviceInfo + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @instance + */ + Electrocardiogram.prototype.medicalDeviceInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Electrocardiogram.prototype, "_beatsPerMinuteAvg", { + get: $util.oneOfGetter($oneOfFields = ["beatsPerMinuteAvg"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Electrocardiogram.prototype, "_samplingFrequencyHertz", { + get: $util.oneOfGetter($oneOfFields = ["samplingFrequencyHertz"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Electrocardiogram.prototype, "_millivoltsScalingFactor", { + get: $util.oneOfGetter($oneOfFields = ["millivoltsScalingFactor"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Electrocardiogram.prototype, "_leadNumber", { + get: $util.oneOfGetter($oneOfFields = ["leadNumber"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Electrocardiogram instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @static + * @param {google.devicesandservices.health.v4.IElectrocardiogram=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Electrocardiogram} Electrocardiogram instance + */ + Electrocardiogram.create = function create(properties) { + return new Electrocardiogram(properties); + }; + + /** + * Encodes the specified Electrocardiogram message. Does not implicitly {@link google.devicesandservices.health.v4.Electrocardiogram.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @static + * @param {google.devicesandservices.health.v4.IElectrocardiogram} message Electrocardiogram message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Electrocardiogram.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.devicesandservices.health.v4.SessionTimeInterval.encode(message.interval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.beatsPerMinuteAvg != null && Object.hasOwnProperty.call(message, "beatsPerMinuteAvg")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.beatsPerMinuteAvg); + if (message.resultClassification != null && Object.hasOwnProperty.call(message, "resultClassification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.resultClassification); + if (message.waveformSamples != null && message.waveformSamples.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.waveformSamples.length; ++i) + writer.sint32(message.waveformSamples[i]); + writer.ldelim(); + } + if (message.samplingFrequencyHertz != null && Object.hasOwnProperty.call(message, "samplingFrequencyHertz")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.samplingFrequencyHertz); + if (message.millivoltsScalingFactor != null && Object.hasOwnProperty.call(message, "millivoltsScalingFactor")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.millivoltsScalingFactor); + if (message.leadNumber != null && Object.hasOwnProperty.call(message, "leadNumber")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.leadNumber); + if (message.medicalDeviceInfo != null && Object.hasOwnProperty.call(message, "medicalDeviceInfo")) + $root.google.devicesandservices.health.v4.MedicalDeviceInfo.encode(message.medicalDeviceInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Electrocardiogram message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Electrocardiogram.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @static + * @param {google.devicesandservices.health.v4.IElectrocardiogram} message Electrocardiogram message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Electrocardiogram.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Electrocardiogram message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.Electrocardiogram} Electrocardiogram + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Electrocardiogram.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Electrocardiogram(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.decode(reader, reader.uint32()); + break; + } + case 2: { + message.beatsPerMinuteAvg = reader.int64(); + break; + } + case 3: { + message.resultClassification = reader.int32(); + break; + } + case 4: { + if (!(message.waveformSamples && message.waveformSamples.length)) + message.waveformSamples = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.waveformSamples.push(reader.sint32()); + } else + message.waveformSamples.push(reader.sint32()); + break; + } + case 5: { + message.samplingFrequencyHertz = reader.int32(); + break; + } + case 6: { + message.millivoltsScalingFactor = reader.int32(); + break; + } + case 7: { + message.leadNumber = reader.int32(); + break; + } + case 8: { + message.medicalDeviceInfo = $root.google.devicesandservices.health.v4.MedicalDeviceInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Electrocardiogram message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.Electrocardiogram} Electrocardiogram + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Electrocardiogram.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Electrocardiogram message. + * @function verify + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Electrocardiogram.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.interval != null && message.hasOwnProperty("interval")) { + var error = $root.google.devicesandservices.health.v4.SessionTimeInterval.verify(message.interval); + if (error) + return "interval." + error; + } + if (message.beatsPerMinuteAvg != null && message.hasOwnProperty("beatsPerMinuteAvg")) { + properties._beatsPerMinuteAvg = 1; + if (!$util.isInteger(message.beatsPerMinuteAvg) && !(message.beatsPerMinuteAvg && $util.isInteger(message.beatsPerMinuteAvg.low) && $util.isInteger(message.beatsPerMinuteAvg.high))) + return "beatsPerMinuteAvg: integer|Long expected"; + } + if (message.resultClassification != null && message.hasOwnProperty("resultClassification")) + switch (message.resultClassification) { + default: + return "resultClassification: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.waveformSamples != null && message.hasOwnProperty("waveformSamples")) { + if (!Array.isArray(message.waveformSamples)) + return "waveformSamples: array expected"; + for (var i = 0; i < message.waveformSamples.length; ++i) + if (!$util.isInteger(message.waveformSamples[i])) + return "waveformSamples: integer[] expected"; + } + if (message.samplingFrequencyHertz != null && message.hasOwnProperty("samplingFrequencyHertz")) { + properties._samplingFrequencyHertz = 1; + if (!$util.isInteger(message.samplingFrequencyHertz)) + return "samplingFrequencyHertz: integer expected"; + } + if (message.millivoltsScalingFactor != null && message.hasOwnProperty("millivoltsScalingFactor")) { + properties._millivoltsScalingFactor = 1; + if (!$util.isInteger(message.millivoltsScalingFactor)) + return "millivoltsScalingFactor: integer expected"; + } + if (message.leadNumber != null && message.hasOwnProperty("leadNumber")) { + properties._leadNumber = 1; + if (!$util.isInteger(message.leadNumber)) + return "leadNumber: integer expected"; + } + if (message.medicalDeviceInfo != null && message.hasOwnProperty("medicalDeviceInfo")) { + var error = $root.google.devicesandservices.health.v4.MedicalDeviceInfo.verify(message.medicalDeviceInfo); + if (error) + return "medicalDeviceInfo." + error; + } + return null; + }; + + /** + * Creates an Electrocardiogram message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.Electrocardiogram} Electrocardiogram + */ + Electrocardiogram.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Electrocardiogram) + return object; + var message = new $root.google.devicesandservices.health.v4.Electrocardiogram(); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.devicesandservices.health.v4.Electrocardiogram.interval: object expected"); + message.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.fromObject(object.interval); + } + if (object.beatsPerMinuteAvg != null) + if ($util.Long) + (message.beatsPerMinuteAvg = $util.Long.fromValue(object.beatsPerMinuteAvg)).unsigned = false; + else if (typeof object.beatsPerMinuteAvg === "string") + message.beatsPerMinuteAvg = parseInt(object.beatsPerMinuteAvg, 10); + else if (typeof object.beatsPerMinuteAvg === "number") + message.beatsPerMinuteAvg = object.beatsPerMinuteAvg; + else if (typeof object.beatsPerMinuteAvg === "object") + message.beatsPerMinuteAvg = new $util.LongBits(object.beatsPerMinuteAvg.low >>> 0, object.beatsPerMinuteAvg.high >>> 0).toNumber(); + switch (object.resultClassification) { + default: + if (typeof object.resultClassification === "number") { + message.resultClassification = object.resultClassification; + break; + } + break; + case "RESULT_CLASSIFICATION_UNSPECIFIED": + case 0: + message.resultClassification = 0; + break; + case "NORMAL_SINUS_RHYTHM": + case 1: + message.resultClassification = 1; + break; + case "ATRIAL_FIBRILLATION": + case 2: + message.resultClassification = 2; + break; + case "INCONCLUSIVE": + case 3: + message.resultClassification = 3; + break; + case "INCONCLUSIVE_HIGH_HEART_RATE": + case 4: + message.resultClassification = 4; + break; + case "INCONCLUSIVE_LOW_HEART_RATE": + case 5: + message.resultClassification = 5; + break; + case "UNREADABLE": + case 6: + message.resultClassification = 6; + break; + case "NOT_ANALYZED": + case 7: + message.resultClassification = 7; + break; + } + if (object.waveformSamples) { + if (!Array.isArray(object.waveformSamples)) + throw TypeError(".google.devicesandservices.health.v4.Electrocardiogram.waveformSamples: array expected"); + message.waveformSamples = []; + for (var i = 0; i < object.waveformSamples.length; ++i) + message.waveformSamples[i] = object.waveformSamples[i] | 0; + } + if (object.samplingFrequencyHertz != null) + message.samplingFrequencyHertz = object.samplingFrequencyHertz | 0; + if (object.millivoltsScalingFactor != null) + message.millivoltsScalingFactor = object.millivoltsScalingFactor | 0; + if (object.leadNumber != null) + message.leadNumber = object.leadNumber | 0; + if (object.medicalDeviceInfo != null) { + if (typeof object.medicalDeviceInfo !== "object") + throw TypeError(".google.devicesandservices.health.v4.Electrocardiogram.medicalDeviceInfo: object expected"); + message.medicalDeviceInfo = $root.google.devicesandservices.health.v4.MedicalDeviceInfo.fromObject(object.medicalDeviceInfo); + } + return message; + }; + + /** + * Creates a plain object from an Electrocardiogram message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @static + * @param {google.devicesandservices.health.v4.Electrocardiogram} message Electrocardiogram + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Electrocardiogram.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.waveformSamples = []; + if (options.defaults) { + object.interval = null; + object.resultClassification = options.enums === String ? "RESULT_CLASSIFICATION_UNSPECIFIED" : 0; + object.medicalDeviceInfo = null; + } + if (message.interval != null && message.hasOwnProperty("interval")) + object.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.toObject(message.interval, options); + if (message.beatsPerMinuteAvg != null && message.hasOwnProperty("beatsPerMinuteAvg")) { + if (typeof message.beatsPerMinuteAvg === "number") + object.beatsPerMinuteAvg = options.longs === String ? String(message.beatsPerMinuteAvg) : message.beatsPerMinuteAvg; + else + object.beatsPerMinuteAvg = options.longs === String ? $util.Long.prototype.toString.call(message.beatsPerMinuteAvg) : options.longs === Number ? new $util.LongBits(message.beatsPerMinuteAvg.low >>> 0, message.beatsPerMinuteAvg.high >>> 0).toNumber() : message.beatsPerMinuteAvg; + if (options.oneofs) + object._beatsPerMinuteAvg = "beatsPerMinuteAvg"; + } + if (message.resultClassification != null && message.hasOwnProperty("resultClassification")) + object.resultClassification = options.enums === String ? $root.google.devicesandservices.health.v4.Electrocardiogram.ResultClassification[message.resultClassification] === undefined ? message.resultClassification : $root.google.devicesandservices.health.v4.Electrocardiogram.ResultClassification[message.resultClassification] : message.resultClassification; + if (message.waveformSamples && message.waveformSamples.length) { + object.waveformSamples = []; + for (var j = 0; j < message.waveformSamples.length; ++j) + object.waveformSamples[j] = message.waveformSamples[j]; + } + if (message.samplingFrequencyHertz != null && message.hasOwnProperty("samplingFrequencyHertz")) { + object.samplingFrequencyHertz = message.samplingFrequencyHertz; + if (options.oneofs) + object._samplingFrequencyHertz = "samplingFrequencyHertz"; + } + if (message.millivoltsScalingFactor != null && message.hasOwnProperty("millivoltsScalingFactor")) { + object.millivoltsScalingFactor = message.millivoltsScalingFactor; + if (options.oneofs) + object._millivoltsScalingFactor = "millivoltsScalingFactor"; + } + if (message.leadNumber != null && message.hasOwnProperty("leadNumber")) { + object.leadNumber = message.leadNumber; + if (options.oneofs) + object._leadNumber = "leadNumber"; + } + if (message.medicalDeviceInfo != null && message.hasOwnProperty("medicalDeviceInfo")) + object.medicalDeviceInfo = $root.google.devicesandservices.health.v4.MedicalDeviceInfo.toObject(message.medicalDeviceInfo, options); + return object; + }; + + /** + * Converts this Electrocardiogram to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @instance + * @returns {Object.} JSON object + */ + Electrocardiogram.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Electrocardiogram + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.Electrocardiogram + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Electrocardiogram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.Electrocardiogram"; + }; + + /** + * ResultClassification enum. + * @name google.devicesandservices.health.v4.Electrocardiogram.ResultClassification + * @enum {number} + * @property {number} RESULT_CLASSIFICATION_UNSPECIFIED=0 RESULT_CLASSIFICATION_UNSPECIFIED value + * @property {number} NORMAL_SINUS_RHYTHM=1 NORMAL_SINUS_RHYTHM value + * @property {number} ATRIAL_FIBRILLATION=2 ATRIAL_FIBRILLATION value + * @property {number} INCONCLUSIVE=3 INCONCLUSIVE value + * @property {number} INCONCLUSIVE_HIGH_HEART_RATE=4 INCONCLUSIVE_HIGH_HEART_RATE value + * @property {number} INCONCLUSIVE_LOW_HEART_RATE=5 INCONCLUSIVE_LOW_HEART_RATE value + * @property {number} UNREADABLE=6 UNREADABLE value + * @property {number} NOT_ANALYZED=7 NOT_ANALYZED value + */ + Electrocardiogram.ResultClassification = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESULT_CLASSIFICATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "NORMAL_SINUS_RHYTHM"] = 1; + values[valuesById[2] = "ATRIAL_FIBRILLATION"] = 2; + values[valuesById[3] = "INCONCLUSIVE"] = 3; + values[valuesById[4] = "INCONCLUSIVE_HIGH_HEART_RATE"] = 4; + values[valuesById[5] = "INCONCLUSIVE_LOW_HEART_RATE"] = 5; + values[valuesById[6] = "UNREADABLE"] = 6; + values[valuesById[7] = "NOT_ANALYZED"] = 7; + return values; + })(); + + return Electrocardiogram; + })(); + v4.Exercise = (function() { /** @@ -9919,11 +11624,11 @@ /** * ExerciseMetadata poolLengthMillimeters. - * @member {number|Long} poolLengthMillimeters + * @member {number|Long|null|undefined} poolLengthMillimeters * @memberof google.devicesandservices.health.v4.Exercise.ExerciseMetadata * @instance */ - ExerciseMetadata.prototype.poolLengthMillimeters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ExerciseMetadata.prototype.poolLengthMillimeters = null; /** * ExerciseMetadata hasGps. @@ -9933,6 +11638,15 @@ */ ExerciseMetadata.prototype.hasGps = false; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExerciseMetadata.prototype, "_poolLengthMillimeters", { + get: $util.oneOfGetter($oneOfFields = ["poolLengthMillimeters"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new ExerciseMetadata instance using the specified properties. * @function create @@ -10040,9 +11754,12 @@ ExerciseMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.poolLengthMillimeters != null && message.hasOwnProperty("poolLengthMillimeters")) + var properties = {}; + if (message.poolLengthMillimeters != null && message.hasOwnProperty("poolLengthMillimeters")) { + properties._poolLengthMillimeters = 1; if (!$util.isInteger(message.poolLengthMillimeters) && !(message.poolLengthMillimeters && $util.isInteger(message.poolLengthMillimeters.low) && $util.isInteger(message.poolLengthMillimeters.high))) return "poolLengthMillimeters: integer|Long expected"; + } if (message.hasGps != null && message.hasOwnProperty("hasGps")) if (typeof message.hasGps !== "boolean") return "hasGps: boolean expected"; @@ -10088,19 +11805,16 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.poolLengthMillimeters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.poolLengthMillimeters = options.longs === String ? "0" : 0; + if (options.defaults) object.hasGps = false; - } - if (message.poolLengthMillimeters != null && message.hasOwnProperty("poolLengthMillimeters")) + if (message.poolLengthMillimeters != null && message.hasOwnProperty("poolLengthMillimeters")) { if (typeof message.poolLengthMillimeters === "number") object.poolLengthMillimeters = options.longs === String ? String(message.poolLengthMillimeters) : message.poolLengthMillimeters; else object.poolLengthMillimeters = options.longs === String ? $util.Long.prototype.toString.call(message.poolLengthMillimeters) : options.longs === Number ? new $util.LongBits(message.poolLengthMillimeters.low >>> 0, message.poolLengthMillimeters.high >>> 0).toNumber() : message.poolLengthMillimeters; + if (options.oneofs) + object._poolLengthMillimeters = "poolLengthMillimeters"; + } if (message.hasGps != null && message.hasOwnProperty("hasGps")) object.hasGps = message.hasGps; return object; @@ -10209,11 +11923,20 @@ /** * Floors count. - * @member {number|Long} count + * @member {number|Long|null|undefined} count * @memberof google.devicesandservices.health.v4.Floors * @instance */ - Floors.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Floors.prototype.count = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Floors.prototype, "_count", { + get: $util.oneOfGetter($oneOfFields = ["count"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new Floors instance using the specified properties. @@ -10322,14 +12045,17 @@ Floors.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.interval != null && message.hasOwnProperty("interval")) { var error = $root.google.devicesandservices.health.v4.ObservationTimeInterval.verify(message.interval); if (error) return "interval." + error; } - if (message.count != null && message.hasOwnProperty("count")) + if (message.count != null && message.hasOwnProperty("count")) { + properties._count = 1; if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) return "count: integer|Long expected"; + } return null; }; @@ -10375,21 +12101,18 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.interval = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - } if (message.interval != null && message.hasOwnProperty("interval")) object.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.toObject(message.interval, options); - if (message.count != null && message.hasOwnProperty("count")) + if (message.count != null && message.hasOwnProperty("count")) { if (typeof message.count === "number") object.count = options.longs === String ? String(message.count) : message.count; else object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (options.oneofs) + object._count = "count"; + } return object; }; @@ -10448,11 +12171,20 @@ /** * FloorsRollupValue countSum. - * @member {number|Long} countSum + * @member {number|Long|null|undefined} countSum * @memberof google.devicesandservices.health.v4.FloorsRollupValue * @instance */ - FloorsRollupValue.prototype.countSum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + FloorsRollupValue.prototype.countSum = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FloorsRollupValue.prototype, "_countSum", { + get: $util.oneOfGetter($oneOfFields = ["countSum"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new FloorsRollupValue instance using the specified properties. @@ -10555,9 +12287,12 @@ FloorsRollupValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.countSum != null && message.hasOwnProperty("countSum")) + var properties = {}; + if (message.countSum != null && message.hasOwnProperty("countSum")) { + properties._countSum = 1; if (!$util.isInteger(message.countSum) && !(message.countSum && $util.isInteger(message.countSum.low) && $util.isInteger(message.countSum.high))) return "countSum: integer|Long expected"; + } return null; }; @@ -10598,17 +12333,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.countSum = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.countSum = options.longs === String ? "0" : 0; - if (message.countSum != null && message.hasOwnProperty("countSum")) + if (message.countSum != null && message.hasOwnProperty("countSum")) { if (typeof message.countSum === "number") object.countSum = options.longs === String ? String(message.countSum) : message.countSum; else object.countSum = options.longs === String ? $util.Long.prototype.toString.call(message.countSum) : options.longs === Number ? new $util.LongBits(message.countSum.low >>> 0, message.countSum.high >>> 0).toNumber() : message.countSum; + if (options.oneofs) + object._countSum = "countSum"; + } return object; }; @@ -10667,11 +12399,20 @@ /** * AltitudeRollupValue gainMillimetersSum. - * @member {number|Long} gainMillimetersSum + * @member {number|Long|null|undefined} gainMillimetersSum * @memberof google.devicesandservices.health.v4.AltitudeRollupValue * @instance */ - AltitudeRollupValue.prototype.gainMillimetersSum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + AltitudeRollupValue.prototype.gainMillimetersSum = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AltitudeRollupValue.prototype, "_gainMillimetersSum", { + get: $util.oneOfGetter($oneOfFields = ["gainMillimetersSum"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new AltitudeRollupValue instance using the specified properties. @@ -10774,9 +12515,12 @@ AltitudeRollupValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.gainMillimetersSum != null && message.hasOwnProperty("gainMillimetersSum")) + var properties = {}; + if (message.gainMillimetersSum != null && message.hasOwnProperty("gainMillimetersSum")) { + properties._gainMillimetersSum = 1; if (!$util.isInteger(message.gainMillimetersSum) && !(message.gainMillimetersSum && $util.isInteger(message.gainMillimetersSum.low) && $util.isInteger(message.gainMillimetersSum.high))) return "gainMillimetersSum: integer|Long expected"; + } return null; }; @@ -10817,17 +12561,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.gainMillimetersSum = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.gainMillimetersSum = options.longs === String ? "0" : 0; - if (message.gainMillimetersSum != null && message.hasOwnProperty("gainMillimetersSum")) + if (message.gainMillimetersSum != null && message.hasOwnProperty("gainMillimetersSum")) { if (typeof message.gainMillimetersSum === "number") object.gainMillimetersSum = options.longs === String ? String(message.gainMillimetersSum) : message.gainMillimetersSum; else object.gainMillimetersSum = options.longs === String ? $util.Long.prototype.toString.call(message.gainMillimetersSum) : options.longs === Number ? new $util.LongBits(message.gainMillimetersSum.low >>> 0, message.gainMillimetersSum.high >>> 0).toNumber() : message.gainMillimetersSum; + if (options.oneofs) + object._gainMillimetersSum = "gainMillimetersSum"; + } return object; }; @@ -10896,11 +12637,11 @@ /** * HeartRate beatsPerMinute. - * @member {number|Long} beatsPerMinute + * @member {number|Long|null|undefined} beatsPerMinute * @memberof google.devicesandservices.health.v4.HeartRate * @instance */ - HeartRate.prototype.beatsPerMinute = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + HeartRate.prototype.beatsPerMinute = null; /** * HeartRate metadata. @@ -10910,6 +12651,15 @@ */ HeartRate.prototype.metadata = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HeartRate.prototype, "_beatsPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["beatsPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new HeartRate instance using the specified properties. * @function create @@ -11023,14 +12773,17 @@ HeartRate.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); if (error) return "sampleTime." + error; } - if (message.beatsPerMinute != null && message.hasOwnProperty("beatsPerMinute")) + if (message.beatsPerMinute != null && message.hasOwnProperty("beatsPerMinute")) { + properties._beatsPerMinute = 1; if (!$util.isInteger(message.beatsPerMinute) && !(message.beatsPerMinute && $util.isInteger(message.beatsPerMinute.low) && $util.isInteger(message.beatsPerMinute.high))) return "beatsPerMinute: integer|Long expected"; + } if (message.metadata != null && message.hasOwnProperty("metadata")) { var error = $root.google.devicesandservices.health.v4.HeartRate.HeartRateMetadata.verify(message.metadata); if (error) @@ -11088,20 +12841,18 @@ var object = {}; if (options.defaults) { object.sampleTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.beatsPerMinute = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.beatsPerMinute = options.longs === String ? "0" : 0; object.metadata = null; } if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); - if (message.beatsPerMinute != null && message.hasOwnProperty("beatsPerMinute")) + if (message.beatsPerMinute != null && message.hasOwnProperty("beatsPerMinute")) { if (typeof message.beatsPerMinute === "number") object.beatsPerMinute = options.longs === String ? String(message.beatsPerMinute) : message.beatsPerMinute; else object.beatsPerMinute = options.longs === String ? $util.Long.prototype.toString.call(message.beatsPerMinute) : options.longs === Number ? new $util.LongBits(message.beatsPerMinute.low >>> 0, message.beatsPerMinute.high >>> 0).toNumber() : message.beatsPerMinute; + if (options.oneofs) + object._beatsPerMinute = "beatsPerMinute"; + } if (message.metadata != null && message.hasOwnProperty("metadata")) object.metadata = $root.google.devicesandservices.health.v4.HeartRate.HeartRateMetadata.toObject(message.metadata, options); return object; @@ -11785,27 +13536,48 @@ /** * RunVO2MaxRollupValue rateMin. - * @member {number} rateMin + * @member {number|null|undefined} rateMin * @memberof google.devicesandservices.health.v4.RunVO2MaxRollupValue * @instance */ - RunVO2MaxRollupValue.prototype.rateMin = 0; + RunVO2MaxRollupValue.prototype.rateMin = null; /** * RunVO2MaxRollupValue rateMax. - * @member {number} rateMax + * @member {number|null|undefined} rateMax * @memberof google.devicesandservices.health.v4.RunVO2MaxRollupValue * @instance */ - RunVO2MaxRollupValue.prototype.rateMax = 0; + RunVO2MaxRollupValue.prototype.rateMax = null; /** * RunVO2MaxRollupValue rateAvg. - * @member {number} rateAvg + * @member {number|null|undefined} rateAvg * @memberof google.devicesandservices.health.v4.RunVO2MaxRollupValue * @instance */ - RunVO2MaxRollupValue.prototype.rateAvg = 0; + RunVO2MaxRollupValue.prototype.rateAvg = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RunVO2MaxRollupValue.prototype, "_rateMin", { + get: $util.oneOfGetter($oneOfFields = ["rateMin"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RunVO2MaxRollupValue.prototype, "_rateMax", { + get: $util.oneOfGetter($oneOfFields = ["rateMax"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RunVO2MaxRollupValue.prototype, "_rateAvg", { + get: $util.oneOfGetter($oneOfFields = ["rateAvg"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new RunVO2MaxRollupValue instance using the specified properties. @@ -11920,15 +13692,22 @@ RunVO2MaxRollupValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.rateMin != null && message.hasOwnProperty("rateMin")) + var properties = {}; + if (message.rateMin != null && message.hasOwnProperty("rateMin")) { + properties._rateMin = 1; if (typeof message.rateMin !== "number") return "rateMin: number expected"; - if (message.rateMax != null && message.hasOwnProperty("rateMax")) + } + if (message.rateMax != null && message.hasOwnProperty("rateMax")) { + properties._rateMax = 1; if (typeof message.rateMax !== "number") return "rateMax: number expected"; - if (message.rateAvg != null && message.hasOwnProperty("rateAvg")) + } + if (message.rateAvg != null && message.hasOwnProperty("rateAvg")) { + properties._rateAvg = 1; if (typeof message.rateAvg !== "number") return "rateAvg: number expected"; + } return null; }; @@ -11966,17 +13745,21 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { - object.rateMin = 0; - object.rateMax = 0; - object.rateAvg = 0; - } - if (message.rateMin != null && message.hasOwnProperty("rateMin")) + if (message.rateMin != null && message.hasOwnProperty("rateMin")) { object.rateMin = options.json && !isFinite(message.rateMin) ? String(message.rateMin) : message.rateMin; - if (message.rateMax != null && message.hasOwnProperty("rateMax")) + if (options.oneofs) + object._rateMin = "rateMin"; + } + if (message.rateMax != null && message.hasOwnProperty("rateMax")) { object.rateMax = options.json && !isFinite(message.rateMax) ? String(message.rateMax) : message.rateMax; - if (message.rateAvg != null && message.hasOwnProperty("rateAvg")) + if (options.oneofs) + object._rateMax = "rateMax"; + } + if (message.rateAvg != null && message.hasOwnProperty("rateAvg")) { object.rateAvg = options.json && !isFinite(message.rateAvg) ? String(message.rateAvg) : message.rateAvg; + if (options.oneofs) + object._rateAvg = "rateAvg"; + } return object; }; @@ -12044,11 +13827,20 @@ /** * RunVO2Max runVo2Max. - * @member {number} runVo2Max + * @member {number|null|undefined} runVo2Max * @memberof google.devicesandservices.health.v4.RunVO2Max * @instance */ - RunVO2Max.prototype.runVo2Max = 0; + RunVO2Max.prototype.runVo2Max = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RunVO2Max.prototype, "_runVo2Max", { + get: $util.oneOfGetter($oneOfFields = ["runVo2Max"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new RunVO2Max instance using the specified properties. @@ -12157,14 +13949,17 @@ RunVO2Max.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); if (error) return "sampleTime." + error; } - if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) + if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { + properties._runVo2Max = 1; if (typeof message.runVo2Max !== "number") return "runVo2Max: number expected"; + } return null; }; @@ -12203,14 +13998,15 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.sampleTime = null; - object.runVo2Max = 0; - } if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); - if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) + if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { object.runVo2Max = options.json && !isFinite(message.runVo2Max) ? String(message.runVo2Max) : message.runVo2Max; + if (options.oneofs) + object._runVo2Max = "runVo2Max"; + } return object; }; @@ -12529,11 +14325,20 @@ /** * Height heightMillimeters. - * @member {number|Long} heightMillimeters + * @member {number|Long|null|undefined} heightMillimeters * @memberof google.devicesandservices.health.v4.Height * @instance */ - Height.prototype.heightMillimeters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Height.prototype.heightMillimeters = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Height.prototype, "_heightMillimeters", { + get: $util.oneOfGetter($oneOfFields = ["heightMillimeters"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new Height instance using the specified properties. @@ -12642,14 +14447,17 @@ Height.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); if (error) return "sampleTime." + error; } - if (message.heightMillimeters != null && message.hasOwnProperty("heightMillimeters")) + if (message.heightMillimeters != null && message.hasOwnProperty("heightMillimeters")) { + properties._heightMillimeters = 1; if (!$util.isInteger(message.heightMillimeters) && !(message.heightMillimeters && $util.isInteger(message.heightMillimeters.low) && $util.isInteger(message.heightMillimeters.high))) return "heightMillimeters: integer|Long expected"; + } return null; }; @@ -12695,21 +14503,18 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.sampleTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.heightMillimeters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.heightMillimeters = options.longs === String ? "0" : 0; - } if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); - if (message.heightMillimeters != null && message.hasOwnProperty("heightMillimeters")) + if (message.heightMillimeters != null && message.hasOwnProperty("heightMillimeters")) { if (typeof message.heightMillimeters === "number") object.heightMillimeters = options.longs === String ? String(message.heightMillimeters) : message.heightMillimeters; else object.heightMillimeters = options.longs === String ? $util.Long.prototype.toString.call(message.heightMillimeters) : options.longs === Number ? new $util.LongBits(message.heightMillimeters.low >>> 0, message.heightMillimeters.high >>> 0).toNumber() : message.heightMillimeters; + if (options.oneofs) + object._heightMillimeters = "heightMillimeters"; + } return object; }; @@ -12778,19 +14583,34 @@ /** * HeartRateVariability rootMeanSquareOfSuccessiveDifferencesMilliseconds. - * @member {number} rootMeanSquareOfSuccessiveDifferencesMilliseconds + * @member {number|null|undefined} rootMeanSquareOfSuccessiveDifferencesMilliseconds * @memberof google.devicesandservices.health.v4.HeartRateVariability * @instance */ - HeartRateVariability.prototype.rootMeanSquareOfSuccessiveDifferencesMilliseconds = 0; + HeartRateVariability.prototype.rootMeanSquareOfSuccessiveDifferencesMilliseconds = null; /** * HeartRateVariability standardDeviationMilliseconds. - * @member {number} standardDeviationMilliseconds + * @member {number|null|undefined} standardDeviationMilliseconds * @memberof google.devicesandservices.health.v4.HeartRateVariability * @instance */ - HeartRateVariability.prototype.standardDeviationMilliseconds = 0; + HeartRateVariability.prototype.standardDeviationMilliseconds = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HeartRateVariability.prototype, "_rootMeanSquareOfSuccessiveDifferencesMilliseconds", { + get: $util.oneOfGetter($oneOfFields = ["rootMeanSquareOfSuccessiveDifferencesMilliseconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HeartRateVariability.prototype, "_standardDeviationMilliseconds", { + get: $util.oneOfGetter($oneOfFields = ["standardDeviationMilliseconds"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new HeartRateVariability instance using the specified properties. @@ -12905,17 +14725,22 @@ HeartRateVariability.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); if (error) return "sampleTime." + error; } - if (message.rootMeanSquareOfSuccessiveDifferencesMilliseconds != null && message.hasOwnProperty("rootMeanSquareOfSuccessiveDifferencesMilliseconds")) + if (message.rootMeanSquareOfSuccessiveDifferencesMilliseconds != null && message.hasOwnProperty("rootMeanSquareOfSuccessiveDifferencesMilliseconds")) { + properties._rootMeanSquareOfSuccessiveDifferencesMilliseconds = 1; if (typeof message.rootMeanSquareOfSuccessiveDifferencesMilliseconds !== "number") return "rootMeanSquareOfSuccessiveDifferencesMilliseconds: number expected"; - if (message.standardDeviationMilliseconds != null && message.hasOwnProperty("standardDeviationMilliseconds")) + } + if (message.standardDeviationMilliseconds != null && message.hasOwnProperty("standardDeviationMilliseconds")) { + properties._standardDeviationMilliseconds = 1; if (typeof message.standardDeviationMilliseconds !== "number") return "standardDeviationMilliseconds: number expected"; + } return null; }; @@ -12956,17 +14781,20 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.sampleTime = null; - object.rootMeanSquareOfSuccessiveDifferencesMilliseconds = 0; - object.standardDeviationMilliseconds = 0; - } if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); - if (message.rootMeanSquareOfSuccessiveDifferencesMilliseconds != null && message.hasOwnProperty("rootMeanSquareOfSuccessiveDifferencesMilliseconds")) + if (message.rootMeanSquareOfSuccessiveDifferencesMilliseconds != null && message.hasOwnProperty("rootMeanSquareOfSuccessiveDifferencesMilliseconds")) { object.rootMeanSquareOfSuccessiveDifferencesMilliseconds = options.json && !isFinite(message.rootMeanSquareOfSuccessiveDifferencesMilliseconds) ? String(message.rootMeanSquareOfSuccessiveDifferencesMilliseconds) : message.rootMeanSquareOfSuccessiveDifferencesMilliseconds; - if (message.standardDeviationMilliseconds != null && message.hasOwnProperty("standardDeviationMilliseconds")) + if (options.oneofs) + object._rootMeanSquareOfSuccessiveDifferencesMilliseconds = "rootMeanSquareOfSuccessiveDifferencesMilliseconds"; + } + if (message.standardDeviationMilliseconds != null && message.hasOwnProperty("standardDeviationMilliseconds")) { object.standardDeviationMilliseconds = options.json && !isFinite(message.standardDeviationMilliseconds) ? String(message.standardDeviationMilliseconds) : message.standardDeviationMilliseconds; + if (options.oneofs) + object._standardDeviationMilliseconds = "standardDeviationMilliseconds"; + } return object; }; @@ -13026,11 +14854,11 @@ /** * VolumeQuantity milliliters. - * @member {number} milliliters + * @member {number|null|undefined} milliliters * @memberof google.devicesandservices.health.v4.VolumeQuantity * @instance */ - VolumeQuantity.prototype.milliliters = 0; + VolumeQuantity.prototype.milliliters = null; /** * VolumeQuantity userProvidedUnit. @@ -13040,6 +14868,15 @@ */ VolumeQuantity.prototype.userProvidedUnit = 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VolumeQuantity.prototype, "_milliliters", { + get: $util.oneOfGetter($oneOfFields = ["milliliters"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new VolumeQuantity instance using the specified properties. * @function create @@ -13147,9 +14984,12 @@ VolumeQuantity.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.milliliters != null && message.hasOwnProperty("milliliters")) + var properties = {}; + if (message.milliliters != null && message.hasOwnProperty("milliliters")) { + properties._milliliters = 1; if (typeof message.milliliters !== "number") return "milliliters: number expected"; + } if (message.userProvidedUnit != null && message.hasOwnProperty("userProvidedUnit")) switch (message.userProvidedUnit) { default: @@ -13242,12 +15082,13 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { - object.milliliters = 0; + if (options.defaults) object.userProvidedUnit = options.enums === String ? "VOLUME_UNIT_UNSPECIFIED" : 0; - } - if (message.milliliters != null && message.hasOwnProperty("milliliters")) + if (message.milliliters != null && message.hasOwnProperty("milliliters")) { object.milliliters = options.json && !isFinite(message.milliliters) ? String(message.milliliters) : message.milliliters; + if (options.oneofs) + object._milliliters = "milliliters"; + } if (message.userProvidedUnit != null && message.hasOwnProperty("userProvidedUnit")) object.userProvidedUnit = options.enums === String ? $root.google.devicesandservices.health.v4.VolumeUnit[message.userProvidedUnit] === undefined ? message.userProvidedUnit : $root.google.devicesandservices.health.v4.VolumeUnit[message.userProvidedUnit] : message.userProvidedUnit; return object; @@ -13755,11 +15596,11 @@ /** * VolumeQuantityRollup millilitersSum. - * @member {number} millilitersSum + * @member {number|null|undefined} millilitersSum * @memberof google.devicesandservices.health.v4.HydrationLogRollupValue.VolumeQuantityRollup * @instance */ - VolumeQuantityRollup.prototype.millilitersSum = 0; + VolumeQuantityRollup.prototype.millilitersSum = null; /** * VolumeQuantityRollup userProvidedUnitLast. @@ -13769,6 +15610,15 @@ */ VolumeQuantityRollup.prototype.userProvidedUnitLast = 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VolumeQuantityRollup.prototype, "_millilitersSum", { + get: $util.oneOfGetter($oneOfFields = ["millilitersSum"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new VolumeQuantityRollup instance using the specified properties. * @function create @@ -13876,9 +15726,12 @@ VolumeQuantityRollup.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.millilitersSum != null && message.hasOwnProperty("millilitersSum")) + var properties = {}; + if (message.millilitersSum != null && message.hasOwnProperty("millilitersSum")) { + properties._millilitersSum = 1; if (typeof message.millilitersSum !== "number") return "millilitersSum: number expected"; + } if (message.userProvidedUnitLast != null && message.hasOwnProperty("userProvidedUnitLast")) switch (message.userProvidedUnitLast) { default: @@ -13971,12 +15824,13 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { - object.millilitersSum = 0; + if (options.defaults) object.userProvidedUnitLast = options.enums === String ? "VOLUME_UNIT_UNSPECIFIED" : 0; - } - if (message.millilitersSum != null && message.hasOwnProperty("millilitersSum")) + if (message.millilitersSum != null && message.hasOwnProperty("millilitersSum")) { object.millilitersSum = options.json && !isFinite(message.millilitersSum) ? String(message.millilitersSum) : message.millilitersSum; + if (options.oneofs) + object._millilitersSum = "millilitersSum"; + } if (message.userProvidedUnitLast != null && message.hasOwnProperty("userProvidedUnitLast")) object.userProvidedUnitLast = options.enums === String ? $root.google.devicesandservices.health.v4.VolumeUnit[message.userProvidedUnitLast] === undefined ? message.userProvidedUnitLast : $root.google.devicesandservices.health.v4.VolumeUnit[message.userProvidedUnitLast] : message.userProvidedUnitLast; return object; @@ -14014,35 +15868,27 @@ return HydrationLogRollupValue; })(); - v4.MetricsSummary = (function() { + v4.IrregularRhythmNotification = (function() { /** - * Properties of a MetricsSummary. + * Properties of an IrregularRhythmNotification. * @memberof google.devicesandservices.health.v4 - * @interface IMetricsSummary - * @property {number|null} [caloriesKcal] MetricsSummary caloriesKcal - * @property {number|null} [distanceMillimeters] MetricsSummary distanceMillimeters - * @property {number|Long|null} [steps] MetricsSummary steps - * @property {number|null} [averageSpeedMillimetersPerSecond] MetricsSummary averageSpeedMillimetersPerSecond - * @property {number|null} [averagePaceSecondsPerMeter] MetricsSummary averagePaceSecondsPerMeter - * @property {number|Long|null} [averageHeartRateBeatsPerMinute] MetricsSummary averageHeartRateBeatsPerMinute - * @property {number|null} [elevationGainMillimeters] MetricsSummary elevationGainMillimeters - * @property {number|Long|null} [activeZoneMinutes] MetricsSummary activeZoneMinutes - * @property {number|null} [runVo2Max] MetricsSummary runVo2Max - * @property {number|null} [totalSwimLengths] MetricsSummary totalSwimLengths - * @property {google.devicesandservices.health.v4.MetricsSummary.ITimeInHeartRateZones|null} [heartRateZoneDurations] MetricsSummary heartRateZoneDurations - * @property {google.devicesandservices.health.v4.MetricsSummary.IMobilityMetrics|null} [mobilityMetrics] MetricsSummary mobilityMetrics + * @interface IIrregularRhythmNotification + * @property {google.devicesandservices.health.v4.ISessionTimeInterval|null} [interval] IrregularRhythmNotification interval + * @property {Array.|null} [alertWindows] IrregularRhythmNotification alertWindows + * @property {google.devicesandservices.health.v4.IMedicalDeviceInfo|null} [medicalDeviceInfo] IrregularRhythmNotification medicalDeviceInfo */ /** - * Constructs a new MetricsSummary. + * Constructs a new IrregularRhythmNotification. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a MetricsSummary. - * @implements IMetricsSummary + * @classdesc Represents an IrregularRhythmNotification. + * @implements IIrregularRhythmNotification * @constructor - * @param {google.devicesandservices.health.v4.IMetricsSummary=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IIrregularRhythmNotification=} [properties] Properties to set */ - function MetricsSummary(properties) { + function IrregularRhythmNotification(properties) { + this.alertWindows = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14050,294 +15896,108 @@ } /** - * MetricsSummary caloriesKcal. - * @member {number|null|undefined} caloriesKcal - * @memberof google.devicesandservices.health.v4.MetricsSummary - * @instance - */ - MetricsSummary.prototype.caloriesKcal = null; - - /** - * MetricsSummary distanceMillimeters. - * @member {number|null|undefined} distanceMillimeters - * @memberof google.devicesandservices.health.v4.MetricsSummary - * @instance - */ - MetricsSummary.prototype.distanceMillimeters = null; - - /** - * MetricsSummary steps. - * @member {number|Long|null|undefined} steps - * @memberof google.devicesandservices.health.v4.MetricsSummary - * @instance - */ - MetricsSummary.prototype.steps = null; - - /** - * MetricsSummary averageSpeedMillimetersPerSecond. - * @member {number|null|undefined} averageSpeedMillimetersPerSecond - * @memberof google.devicesandservices.health.v4.MetricsSummary - * @instance - */ - MetricsSummary.prototype.averageSpeedMillimetersPerSecond = null; - - /** - * MetricsSummary averagePaceSecondsPerMeter. - * @member {number|null|undefined} averagePaceSecondsPerMeter - * @memberof google.devicesandservices.health.v4.MetricsSummary - * @instance - */ - MetricsSummary.prototype.averagePaceSecondsPerMeter = null; - - /** - * MetricsSummary averageHeartRateBeatsPerMinute. - * @member {number|Long|null|undefined} averageHeartRateBeatsPerMinute - * @memberof google.devicesandservices.health.v4.MetricsSummary - * @instance - */ - MetricsSummary.prototype.averageHeartRateBeatsPerMinute = null; - - /** - * MetricsSummary elevationGainMillimeters. - * @member {number|null|undefined} elevationGainMillimeters - * @memberof google.devicesandservices.health.v4.MetricsSummary - * @instance - */ - MetricsSummary.prototype.elevationGainMillimeters = null; - - /** - * MetricsSummary activeZoneMinutes. - * @member {number|Long|null|undefined} activeZoneMinutes - * @memberof google.devicesandservices.health.v4.MetricsSummary - * @instance - */ - MetricsSummary.prototype.activeZoneMinutes = null; - - /** - * MetricsSummary runVo2Max. - * @member {number|null|undefined} runVo2Max - * @memberof google.devicesandservices.health.v4.MetricsSummary - * @instance - */ - MetricsSummary.prototype.runVo2Max = null; - - /** - * MetricsSummary totalSwimLengths. - * @member {number|null|undefined} totalSwimLengths - * @memberof google.devicesandservices.health.v4.MetricsSummary + * IrregularRhythmNotification interval. + * @member {google.devicesandservices.health.v4.ISessionTimeInterval|null|undefined} interval + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification * @instance */ - MetricsSummary.prototype.totalSwimLengths = null; + IrregularRhythmNotification.prototype.interval = null; /** - * MetricsSummary heartRateZoneDurations. - * @member {google.devicesandservices.health.v4.MetricsSummary.ITimeInHeartRateZones|null|undefined} heartRateZoneDurations - * @memberof google.devicesandservices.health.v4.MetricsSummary + * IrregularRhythmNotification alertWindows. + * @member {Array.} alertWindows + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification * @instance */ - MetricsSummary.prototype.heartRateZoneDurations = null; + IrregularRhythmNotification.prototype.alertWindows = $util.emptyArray; /** - * MetricsSummary mobilityMetrics. - * @member {google.devicesandservices.health.v4.MetricsSummary.IMobilityMetrics|null|undefined} mobilityMetrics - * @memberof google.devicesandservices.health.v4.MetricsSummary + * IrregularRhythmNotification medicalDeviceInfo. + * @member {google.devicesandservices.health.v4.IMedicalDeviceInfo|null|undefined} medicalDeviceInfo + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification * @instance */ - MetricsSummary.prototype.mobilityMetrics = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MetricsSummary.prototype, "_caloriesKcal", { - get: $util.oneOfGetter($oneOfFields = ["caloriesKcal"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MetricsSummary.prototype, "_distanceMillimeters", { - get: $util.oneOfGetter($oneOfFields = ["distanceMillimeters"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MetricsSummary.prototype, "_steps", { - get: $util.oneOfGetter($oneOfFields = ["steps"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MetricsSummary.prototype, "_averageSpeedMillimetersPerSecond", { - get: $util.oneOfGetter($oneOfFields = ["averageSpeedMillimetersPerSecond"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MetricsSummary.prototype, "_averagePaceSecondsPerMeter", { - get: $util.oneOfGetter($oneOfFields = ["averagePaceSecondsPerMeter"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MetricsSummary.prototype, "_averageHeartRateBeatsPerMinute", { - get: $util.oneOfGetter($oneOfFields = ["averageHeartRateBeatsPerMinute"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MetricsSummary.prototype, "_elevationGainMillimeters", { - get: $util.oneOfGetter($oneOfFields = ["elevationGainMillimeters"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MetricsSummary.prototype, "_activeZoneMinutes", { - get: $util.oneOfGetter($oneOfFields = ["activeZoneMinutes"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MetricsSummary.prototype, "_runVo2Max", { - get: $util.oneOfGetter($oneOfFields = ["runVo2Max"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MetricsSummary.prototype, "_totalSwimLengths", { - get: $util.oneOfGetter($oneOfFields = ["totalSwimLengths"]), - set: $util.oneOfSetter($oneOfFields) - }); + IrregularRhythmNotification.prototype.medicalDeviceInfo = null; /** - * Creates a new MetricsSummary instance using the specified properties. + * Creates a new IrregularRhythmNotification instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.MetricsSummary + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification * @static - * @param {google.devicesandservices.health.v4.IMetricsSummary=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.MetricsSummary} MetricsSummary instance + * @param {google.devicesandservices.health.v4.IIrregularRhythmNotification=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.IrregularRhythmNotification} IrregularRhythmNotification instance */ - MetricsSummary.create = function create(properties) { - return new MetricsSummary(properties); + IrregularRhythmNotification.create = function create(properties) { + return new IrregularRhythmNotification(properties); }; /** - * Encodes the specified MetricsSummary message. Does not implicitly {@link google.devicesandservices.health.v4.MetricsSummary.verify|verify} messages. + * Encodes the specified IrregularRhythmNotification message. Does not implicitly {@link google.devicesandservices.health.v4.IrregularRhythmNotification.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.MetricsSummary + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification * @static - * @param {google.devicesandservices.health.v4.IMetricsSummary} message MetricsSummary message or plain object to encode + * @param {google.devicesandservices.health.v4.IIrregularRhythmNotification} message IrregularRhythmNotification message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MetricsSummary.encode = function encode(message, writer) { + IrregularRhythmNotification.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.caloriesKcal != null && Object.hasOwnProperty.call(message, "caloriesKcal")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.caloriesKcal); - if (message.distanceMillimeters != null && Object.hasOwnProperty.call(message, "distanceMillimeters")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.distanceMillimeters); - if (message.steps != null && Object.hasOwnProperty.call(message, "steps")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.steps); - if (message.averageSpeedMillimetersPerSecond != null && Object.hasOwnProperty.call(message, "averageSpeedMillimetersPerSecond")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.averageSpeedMillimetersPerSecond); - if (message.averagePaceSecondsPerMeter != null && Object.hasOwnProperty.call(message, "averagePaceSecondsPerMeter")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.averagePaceSecondsPerMeter); - if (message.averageHeartRateBeatsPerMinute != null && Object.hasOwnProperty.call(message, "averageHeartRateBeatsPerMinute")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.averageHeartRateBeatsPerMinute); - if (message.elevationGainMillimeters != null && Object.hasOwnProperty.call(message, "elevationGainMillimeters")) - writer.uint32(/* id 7, wireType 1 =*/57).double(message.elevationGainMillimeters); - if (message.activeZoneMinutes != null && Object.hasOwnProperty.call(message, "activeZoneMinutes")) - writer.uint32(/* id 9, wireType 0 =*/72).int64(message.activeZoneMinutes); - if (message.runVo2Max != null && Object.hasOwnProperty.call(message, "runVo2Max")) - writer.uint32(/* id 10, wireType 1 =*/81).double(message.runVo2Max); - if (message.totalSwimLengths != null && Object.hasOwnProperty.call(message, "totalSwimLengths")) - writer.uint32(/* id 11, wireType 1 =*/89).double(message.totalSwimLengths); - if (message.heartRateZoneDurations != null && Object.hasOwnProperty.call(message, "heartRateZoneDurations")) - $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.encode(message.heartRateZoneDurations, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.mobilityMetrics != null && Object.hasOwnProperty.call(message, "mobilityMetrics")) - $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.encode(message.mobilityMetrics, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.devicesandservices.health.v4.SessionTimeInterval.encode(message.interval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.alertWindows != null && message.alertWindows.length) + for (var i = 0; i < message.alertWindows.length; ++i) + $root.google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.encode(message.alertWindows[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.medicalDeviceInfo != null && Object.hasOwnProperty.call(message, "medicalDeviceInfo")) + $root.google.devicesandservices.health.v4.MedicalDeviceInfo.encode(message.medicalDeviceInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified MetricsSummary message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.MetricsSummary.verify|verify} messages. + * Encodes the specified IrregularRhythmNotification message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.IrregularRhythmNotification.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.MetricsSummary + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification * @static - * @param {google.devicesandservices.health.v4.IMetricsSummary} message MetricsSummary message or plain object to encode + * @param {google.devicesandservices.health.v4.IIrregularRhythmNotification} message IrregularRhythmNotification message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MetricsSummary.encodeDelimited = function encodeDelimited(message, writer) { + IrregularRhythmNotification.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MetricsSummary message from the specified reader or buffer. + * Decodes an IrregularRhythmNotification message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.MetricsSummary + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.MetricsSummary} MetricsSummary + * @returns {google.devicesandservices.health.v4.IrregularRhythmNotification} IrregularRhythmNotification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MetricsSummary.decode = function decode(reader, length, error) { + IrregularRhythmNotification.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.MetricsSummary(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.IrregularRhythmNotification(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.caloriesKcal = reader.double(); - break; - } - case 2: { - message.distanceMillimeters = reader.double(); - break; - } - case 3: { - message.steps = reader.int64(); - break; - } - case 4: { - message.averageSpeedMillimetersPerSecond = reader.double(); + message.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.decode(reader, reader.uint32()); break; } case 5: { - message.averagePaceSecondsPerMeter = reader.double(); + if (!(message.alertWindows && message.alertWindows.length)) + message.alertWindows = []; + message.alertWindows.push($root.google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.decode(reader, reader.uint32())); break; } case 6: { - message.averageHeartRateBeatsPerMinute = reader.int64(); - break; - } - case 7: { - message.elevationGainMillimeters = reader.double(); - break; - } - case 9: { - message.activeZoneMinutes = reader.int64(); - break; - } - case 10: { - message.runVo2Max = reader.double(); - break; - } - case 11: { - message.totalSwimLengths = reader.double(); - break; - } - case 12: { - message.heartRateZoneDurations = $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.decode(reader, reader.uint32()); - break; - } - case 13: { - message.mobilityMetrics = $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.decode(reader, reader.uint32()); + message.medicalDeviceInfo = $root.google.devicesandservices.health.v4.MedicalDeviceInfo.decode(reader, reader.uint32()); break; } default: @@ -14349,292 +16009,167 @@ }; /** - * Decodes a MetricsSummary message from the specified reader or buffer, length delimited. + * Decodes an IrregularRhythmNotification message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.MetricsSummary + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.MetricsSummary} MetricsSummary + * @returns {google.devicesandservices.health.v4.IrregularRhythmNotification} IrregularRhythmNotification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MetricsSummary.decodeDelimited = function decodeDelimited(reader) { + IrregularRhythmNotification.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MetricsSummary message. + * Verifies an IrregularRhythmNotification message. * @function verify - * @memberof google.devicesandservices.health.v4.MetricsSummary + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MetricsSummary.verify = function verify(message) { + IrregularRhythmNotification.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.caloriesKcal != null && message.hasOwnProperty("caloriesKcal")) { - properties._caloriesKcal = 1; - if (typeof message.caloriesKcal !== "number") - return "caloriesKcal: number expected"; - } - if (message.distanceMillimeters != null && message.hasOwnProperty("distanceMillimeters")) { - properties._distanceMillimeters = 1; - if (typeof message.distanceMillimeters !== "number") - return "distanceMillimeters: number expected"; - } - if (message.steps != null && message.hasOwnProperty("steps")) { - properties._steps = 1; - if (!$util.isInteger(message.steps) && !(message.steps && $util.isInteger(message.steps.low) && $util.isInteger(message.steps.high))) - return "steps: integer|Long expected"; - } - if (message.averageSpeedMillimetersPerSecond != null && message.hasOwnProperty("averageSpeedMillimetersPerSecond")) { - properties._averageSpeedMillimetersPerSecond = 1; - if (typeof message.averageSpeedMillimetersPerSecond !== "number") - return "averageSpeedMillimetersPerSecond: number expected"; - } - if (message.averagePaceSecondsPerMeter != null && message.hasOwnProperty("averagePaceSecondsPerMeter")) { - properties._averagePaceSecondsPerMeter = 1; - if (typeof message.averagePaceSecondsPerMeter !== "number") - return "averagePaceSecondsPerMeter: number expected"; - } - if (message.averageHeartRateBeatsPerMinute != null && message.hasOwnProperty("averageHeartRateBeatsPerMinute")) { - properties._averageHeartRateBeatsPerMinute = 1; - if (!$util.isInteger(message.averageHeartRateBeatsPerMinute) && !(message.averageHeartRateBeatsPerMinute && $util.isInteger(message.averageHeartRateBeatsPerMinute.low) && $util.isInteger(message.averageHeartRateBeatsPerMinute.high))) - return "averageHeartRateBeatsPerMinute: integer|Long expected"; - } - if (message.elevationGainMillimeters != null && message.hasOwnProperty("elevationGainMillimeters")) { - properties._elevationGainMillimeters = 1; - if (typeof message.elevationGainMillimeters !== "number") - return "elevationGainMillimeters: number expected"; - } - if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { - properties._activeZoneMinutes = 1; - if (!$util.isInteger(message.activeZoneMinutes) && !(message.activeZoneMinutes && $util.isInteger(message.activeZoneMinutes.low) && $util.isInteger(message.activeZoneMinutes.high))) - return "activeZoneMinutes: integer|Long expected"; - } - if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { - properties._runVo2Max = 1; - if (typeof message.runVo2Max !== "number") - return "runVo2Max: number expected"; - } - if (message.totalSwimLengths != null && message.hasOwnProperty("totalSwimLengths")) { - properties._totalSwimLengths = 1; - if (typeof message.totalSwimLengths !== "number") - return "totalSwimLengths: number expected"; - } - if (message.heartRateZoneDurations != null && message.hasOwnProperty("heartRateZoneDurations")) { - var error = $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.verify(message.heartRateZoneDurations); + if (message.interval != null && message.hasOwnProperty("interval")) { + var error = $root.google.devicesandservices.health.v4.SessionTimeInterval.verify(message.interval); if (error) - return "heartRateZoneDurations." + error; + return "interval." + error; } - if (message.mobilityMetrics != null && message.hasOwnProperty("mobilityMetrics")) { - var error = $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.verify(message.mobilityMetrics); + if (message.alertWindows != null && message.hasOwnProperty("alertWindows")) { + if (!Array.isArray(message.alertWindows)) + return "alertWindows: array expected"; + for (var i = 0; i < message.alertWindows.length; ++i) { + var error = $root.google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.verify(message.alertWindows[i]); + if (error) + return "alertWindows." + error; + } + } + if (message.medicalDeviceInfo != null && message.hasOwnProperty("medicalDeviceInfo")) { + var error = $root.google.devicesandservices.health.v4.MedicalDeviceInfo.verify(message.medicalDeviceInfo); if (error) - return "mobilityMetrics." + error; + return "medicalDeviceInfo." + error; } return null; }; /** - * Creates a MetricsSummary message from a plain object. Also converts values to their respective internal types. + * Creates an IrregularRhythmNotification message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.MetricsSummary + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.MetricsSummary} MetricsSummary + * @returns {google.devicesandservices.health.v4.IrregularRhythmNotification} IrregularRhythmNotification */ - MetricsSummary.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.MetricsSummary) + IrregularRhythmNotification.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.IrregularRhythmNotification) return object; - var message = new $root.google.devicesandservices.health.v4.MetricsSummary(); - if (object.caloriesKcal != null) - message.caloriesKcal = Number(object.caloriesKcal); - if (object.distanceMillimeters != null) - message.distanceMillimeters = Number(object.distanceMillimeters); - if (object.steps != null) - if ($util.Long) - (message.steps = $util.Long.fromValue(object.steps)).unsigned = false; - else if (typeof object.steps === "string") - message.steps = parseInt(object.steps, 10); - else if (typeof object.steps === "number") - message.steps = object.steps; - else if (typeof object.steps === "object") - message.steps = new $util.LongBits(object.steps.low >>> 0, object.steps.high >>> 0).toNumber(); - if (object.averageSpeedMillimetersPerSecond != null) - message.averageSpeedMillimetersPerSecond = Number(object.averageSpeedMillimetersPerSecond); - if (object.averagePaceSecondsPerMeter != null) - message.averagePaceSecondsPerMeter = Number(object.averagePaceSecondsPerMeter); - if (object.averageHeartRateBeatsPerMinute != null) - if ($util.Long) - (message.averageHeartRateBeatsPerMinute = $util.Long.fromValue(object.averageHeartRateBeatsPerMinute)).unsigned = false; - else if (typeof object.averageHeartRateBeatsPerMinute === "string") - message.averageHeartRateBeatsPerMinute = parseInt(object.averageHeartRateBeatsPerMinute, 10); - else if (typeof object.averageHeartRateBeatsPerMinute === "number") - message.averageHeartRateBeatsPerMinute = object.averageHeartRateBeatsPerMinute; - else if (typeof object.averageHeartRateBeatsPerMinute === "object") - message.averageHeartRateBeatsPerMinute = new $util.LongBits(object.averageHeartRateBeatsPerMinute.low >>> 0, object.averageHeartRateBeatsPerMinute.high >>> 0).toNumber(); - if (object.elevationGainMillimeters != null) - message.elevationGainMillimeters = Number(object.elevationGainMillimeters); - if (object.activeZoneMinutes != null) - if ($util.Long) - (message.activeZoneMinutes = $util.Long.fromValue(object.activeZoneMinutes)).unsigned = false; - else if (typeof object.activeZoneMinutes === "string") - message.activeZoneMinutes = parseInt(object.activeZoneMinutes, 10); - else if (typeof object.activeZoneMinutes === "number") - message.activeZoneMinutes = object.activeZoneMinutes; - else if (typeof object.activeZoneMinutes === "object") - message.activeZoneMinutes = new $util.LongBits(object.activeZoneMinutes.low >>> 0, object.activeZoneMinutes.high >>> 0).toNumber(); - if (object.runVo2Max != null) - message.runVo2Max = Number(object.runVo2Max); - if (object.totalSwimLengths != null) - message.totalSwimLengths = Number(object.totalSwimLengths); - if (object.heartRateZoneDurations != null) { - if (typeof object.heartRateZoneDurations !== "object") - throw TypeError(".google.devicesandservices.health.v4.MetricsSummary.heartRateZoneDurations: object expected"); - message.heartRateZoneDurations = $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.fromObject(object.heartRateZoneDurations); + var message = new $root.google.devicesandservices.health.v4.IrregularRhythmNotification(); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.interval: object expected"); + message.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.fromObject(object.interval); } - if (object.mobilityMetrics != null) { - if (typeof object.mobilityMetrics !== "object") - throw TypeError(".google.devicesandservices.health.v4.MetricsSummary.mobilityMetrics: object expected"); - message.mobilityMetrics = $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.fromObject(object.mobilityMetrics); + if (object.alertWindows) { + if (!Array.isArray(object.alertWindows)) + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.alertWindows: array expected"); + message.alertWindows = []; + for (var i = 0; i < object.alertWindows.length; ++i) { + if (typeof object.alertWindows[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.alertWindows: object expected"); + message.alertWindows[i] = $root.google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.fromObject(object.alertWindows[i]); + } + } + if (object.medicalDeviceInfo != null) { + if (typeof object.medicalDeviceInfo !== "object") + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.medicalDeviceInfo: object expected"); + message.medicalDeviceInfo = $root.google.devicesandservices.health.v4.MedicalDeviceInfo.fromObject(object.medicalDeviceInfo); } return message; }; /** - * Creates a plain object from a MetricsSummary message. Also converts values to other types if specified. + * Creates a plain object from an IrregularRhythmNotification message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.MetricsSummary + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification * @static - * @param {google.devicesandservices.health.v4.MetricsSummary} message MetricsSummary + * @param {google.devicesandservices.health.v4.IrregularRhythmNotification} message IrregularRhythmNotification * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MetricsSummary.toObject = function toObject(message, options) { + IrregularRhythmNotification.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.alertWindows = []; if (options.defaults) { - object.heartRateZoneDurations = null; - object.mobilityMetrics = null; - } - if (message.caloriesKcal != null && message.hasOwnProperty("caloriesKcal")) { - object.caloriesKcal = options.json && !isFinite(message.caloriesKcal) ? String(message.caloriesKcal) : message.caloriesKcal; - if (options.oneofs) - object._caloriesKcal = "caloriesKcal"; - } - if (message.distanceMillimeters != null && message.hasOwnProperty("distanceMillimeters")) { - object.distanceMillimeters = options.json && !isFinite(message.distanceMillimeters) ? String(message.distanceMillimeters) : message.distanceMillimeters; - if (options.oneofs) - object._distanceMillimeters = "distanceMillimeters"; - } - if (message.steps != null && message.hasOwnProperty("steps")) { - if (typeof message.steps === "number") - object.steps = options.longs === String ? String(message.steps) : message.steps; - else - object.steps = options.longs === String ? $util.Long.prototype.toString.call(message.steps) : options.longs === Number ? new $util.LongBits(message.steps.low >>> 0, message.steps.high >>> 0).toNumber() : message.steps; - if (options.oneofs) - object._steps = "steps"; - } - if (message.averageSpeedMillimetersPerSecond != null && message.hasOwnProperty("averageSpeedMillimetersPerSecond")) { - object.averageSpeedMillimetersPerSecond = options.json && !isFinite(message.averageSpeedMillimetersPerSecond) ? String(message.averageSpeedMillimetersPerSecond) : message.averageSpeedMillimetersPerSecond; - if (options.oneofs) - object._averageSpeedMillimetersPerSecond = "averageSpeedMillimetersPerSecond"; - } - if (message.averagePaceSecondsPerMeter != null && message.hasOwnProperty("averagePaceSecondsPerMeter")) { - object.averagePaceSecondsPerMeter = options.json && !isFinite(message.averagePaceSecondsPerMeter) ? String(message.averagePaceSecondsPerMeter) : message.averagePaceSecondsPerMeter; - if (options.oneofs) - object._averagePaceSecondsPerMeter = "averagePaceSecondsPerMeter"; - } - if (message.averageHeartRateBeatsPerMinute != null && message.hasOwnProperty("averageHeartRateBeatsPerMinute")) { - if (typeof message.averageHeartRateBeatsPerMinute === "number") - object.averageHeartRateBeatsPerMinute = options.longs === String ? String(message.averageHeartRateBeatsPerMinute) : message.averageHeartRateBeatsPerMinute; - else - object.averageHeartRateBeatsPerMinute = options.longs === String ? $util.Long.prototype.toString.call(message.averageHeartRateBeatsPerMinute) : options.longs === Number ? new $util.LongBits(message.averageHeartRateBeatsPerMinute.low >>> 0, message.averageHeartRateBeatsPerMinute.high >>> 0).toNumber() : message.averageHeartRateBeatsPerMinute; - if (options.oneofs) - object._averageHeartRateBeatsPerMinute = "averageHeartRateBeatsPerMinute"; - } - if (message.elevationGainMillimeters != null && message.hasOwnProperty("elevationGainMillimeters")) { - object.elevationGainMillimeters = options.json && !isFinite(message.elevationGainMillimeters) ? String(message.elevationGainMillimeters) : message.elevationGainMillimeters; - if (options.oneofs) - object._elevationGainMillimeters = "elevationGainMillimeters"; - } - if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { - if (typeof message.activeZoneMinutes === "number") - object.activeZoneMinutes = options.longs === String ? String(message.activeZoneMinutes) : message.activeZoneMinutes; - else - object.activeZoneMinutes = options.longs === String ? $util.Long.prototype.toString.call(message.activeZoneMinutes) : options.longs === Number ? new $util.LongBits(message.activeZoneMinutes.low >>> 0, message.activeZoneMinutes.high >>> 0).toNumber() : message.activeZoneMinutes; - if (options.oneofs) - object._activeZoneMinutes = "activeZoneMinutes"; - } - if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { - object.runVo2Max = options.json && !isFinite(message.runVo2Max) ? String(message.runVo2Max) : message.runVo2Max; - if (options.oneofs) - object._runVo2Max = "runVo2Max"; + object.interval = null; + object.medicalDeviceInfo = null; } - if (message.totalSwimLengths != null && message.hasOwnProperty("totalSwimLengths")) { - object.totalSwimLengths = options.json && !isFinite(message.totalSwimLengths) ? String(message.totalSwimLengths) : message.totalSwimLengths; - if (options.oneofs) - object._totalSwimLengths = "totalSwimLengths"; + if (message.interval != null && message.hasOwnProperty("interval")) + object.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.toObject(message.interval, options); + if (message.alertWindows && message.alertWindows.length) { + object.alertWindows = []; + for (var j = 0; j < message.alertWindows.length; ++j) + object.alertWindows[j] = $root.google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.toObject(message.alertWindows[j], options); } - if (message.heartRateZoneDurations != null && message.hasOwnProperty("heartRateZoneDurations")) - object.heartRateZoneDurations = $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.toObject(message.heartRateZoneDurations, options); - if (message.mobilityMetrics != null && message.hasOwnProperty("mobilityMetrics")) - object.mobilityMetrics = $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.toObject(message.mobilityMetrics, options); + if (message.medicalDeviceInfo != null && message.hasOwnProperty("medicalDeviceInfo")) + object.medicalDeviceInfo = $root.google.devicesandservices.health.v4.MedicalDeviceInfo.toObject(message.medicalDeviceInfo, options); return object; }; /** - * Converts this MetricsSummary to JSON. + * Converts this IrregularRhythmNotification to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.MetricsSummary + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification * @instance * @returns {Object.} JSON object */ - MetricsSummary.prototype.toJSON = function toJSON() { + IrregularRhythmNotification.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MetricsSummary + * Gets the default type url for IrregularRhythmNotification * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.MetricsSummary + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MetricsSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + IrregularRhythmNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.MetricsSummary"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.IrregularRhythmNotification"; }; - MetricsSummary.TimeInHeartRateZones = (function() { + IrregularRhythmNotification.HeartBeat = (function() { /** - * Properties of a TimeInHeartRateZones. - * @memberof google.devicesandservices.health.v4.MetricsSummary - * @interface ITimeInHeartRateZones - * @property {google.protobuf.IDuration|null} [lightTime] TimeInHeartRateZones lightTime - * @property {google.protobuf.IDuration|null} [moderateTime] TimeInHeartRateZones moderateTime - * @property {google.protobuf.IDuration|null} [vigorousTime] TimeInHeartRateZones vigorousTime - * @property {google.protobuf.IDuration|null} [peakTime] TimeInHeartRateZones peakTime + * Properties of a HeartBeat. + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification + * @interface IHeartBeat + * @property {google.protobuf.ITimestamp|null} [physicalTime] HeartBeat physicalTime + * @property {google.protobuf.IDuration|null} [utcOffset] HeartBeat utcOffset + * @property {google.devicesandservices.health.v4.ICivilDateTime|null} [civilTime] HeartBeat civilTime + * @property {number|null} [beatsPerMinute] HeartBeat beatsPerMinute */ /** - * Constructs a new TimeInHeartRateZones. - * @memberof google.devicesandservices.health.v4.MetricsSummary - * @classdesc Represents a TimeInHeartRateZones. - * @implements ITimeInHeartRateZones + * Constructs a new HeartBeat. + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification + * @classdesc Represents a HeartBeat. + * @implements IHeartBeat * @constructor - * @param {google.devicesandservices.health.v4.MetricsSummary.ITimeInHeartRateZones=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IrregularRhythmNotification.IHeartBeat=} [properties] Properties to set */ - function TimeInHeartRateZones(properties) { + function HeartBeat(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14642,119 +16177,128 @@ } /** - * TimeInHeartRateZones lightTime. - * @member {google.protobuf.IDuration|null|undefined} lightTime - * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * HeartBeat physicalTime. + * @member {google.protobuf.ITimestamp|null|undefined} physicalTime + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat * @instance */ - TimeInHeartRateZones.prototype.lightTime = null; + HeartBeat.prototype.physicalTime = null; /** - * TimeInHeartRateZones moderateTime. - * @member {google.protobuf.IDuration|null|undefined} moderateTime - * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * HeartBeat utcOffset. + * @member {google.protobuf.IDuration|null|undefined} utcOffset + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat * @instance */ - TimeInHeartRateZones.prototype.moderateTime = null; + HeartBeat.prototype.utcOffset = null; /** - * TimeInHeartRateZones vigorousTime. - * @member {google.protobuf.IDuration|null|undefined} vigorousTime - * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * HeartBeat civilTime. + * @member {google.devicesandservices.health.v4.ICivilDateTime|null|undefined} civilTime + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat * @instance */ - TimeInHeartRateZones.prototype.vigorousTime = null; + HeartBeat.prototype.civilTime = null; /** - * TimeInHeartRateZones peakTime. - * @member {google.protobuf.IDuration|null|undefined} peakTime - * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * HeartBeat beatsPerMinute. + * @member {number|null|undefined} beatsPerMinute + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat * @instance */ - TimeInHeartRateZones.prototype.peakTime = null; + HeartBeat.prototype.beatsPerMinute = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HeartBeat.prototype, "_beatsPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["beatsPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new TimeInHeartRateZones instance using the specified properties. + * Creates a new HeartBeat instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat * @static - * @param {google.devicesandservices.health.v4.MetricsSummary.ITimeInHeartRateZones=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones} TimeInHeartRateZones instance + * @param {google.devicesandservices.health.v4.IrregularRhythmNotification.IHeartBeat=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat} HeartBeat instance */ - TimeInHeartRateZones.create = function create(properties) { - return new TimeInHeartRateZones(properties); + HeartBeat.create = function create(properties) { + return new HeartBeat(properties); }; /** - * Encodes the specified TimeInHeartRateZones message. Does not implicitly {@link google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.verify|verify} messages. + * Encodes the specified HeartBeat message. Does not implicitly {@link google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat * @static - * @param {google.devicesandservices.health.v4.MetricsSummary.ITimeInHeartRateZones} message TimeInHeartRateZones message or plain object to encode + * @param {google.devicesandservices.health.v4.IrregularRhythmNotification.IHeartBeat} message HeartBeat message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeInHeartRateZones.encode = function encode(message, writer) { + HeartBeat.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.lightTime != null && Object.hasOwnProperty.call(message, "lightTime")) - $root.google.protobuf.Duration.encode(message.lightTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.moderateTime != null && Object.hasOwnProperty.call(message, "moderateTime")) - $root.google.protobuf.Duration.encode(message.moderateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.vigorousTime != null && Object.hasOwnProperty.call(message, "vigorousTime")) - $root.google.protobuf.Duration.encode(message.vigorousTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.peakTime != null && Object.hasOwnProperty.call(message, "peakTime")) - $root.google.protobuf.Duration.encode(message.peakTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.physicalTime != null && Object.hasOwnProperty.call(message, "physicalTime")) + $root.google.protobuf.Timestamp.encode(message.physicalTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.utcOffset != null && Object.hasOwnProperty.call(message, "utcOffset")) + $root.google.protobuf.Duration.encode(message.utcOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.civilTime != null && Object.hasOwnProperty.call(message, "civilTime")) + $root.google.devicesandservices.health.v4.CivilDateTime.encode(message.civilTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.beatsPerMinute != null && Object.hasOwnProperty.call(message, "beatsPerMinute")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.beatsPerMinute); return writer; }; /** - * Encodes the specified TimeInHeartRateZones message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.verify|verify} messages. + * Encodes the specified HeartBeat message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat * @static - * @param {google.devicesandservices.health.v4.MetricsSummary.ITimeInHeartRateZones} message TimeInHeartRateZones message or plain object to encode + * @param {google.devicesandservices.health.v4.IrregularRhythmNotification.IHeartBeat} message HeartBeat message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeInHeartRateZones.encodeDelimited = function encodeDelimited(message, writer) { + HeartBeat.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeInHeartRateZones message from the specified reader or buffer. + * Decodes a HeartBeat message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones} TimeInHeartRateZones + * @returns {google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat} HeartBeat * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeInHeartRateZones.decode = function decode(reader, length, error) { + HeartBeat.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.lightTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.physicalTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 2: { - message.moderateTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.utcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } case 3: { - message.vigorousTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.civilTime = $root.google.devicesandservices.health.v4.CivilDateTime.decode(reader, reader.uint32()); break; } case 4: { - message.peakTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.beatsPerMinute = reader.int32(); break; } default: @@ -14766,171 +16310,175 @@ }; /** - * Decodes a TimeInHeartRateZones message from the specified reader or buffer, length delimited. + * Decodes a HeartBeat message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones} TimeInHeartRateZones + * @returns {google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat} HeartBeat * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeInHeartRateZones.decodeDelimited = function decodeDelimited(reader) { + HeartBeat.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeInHeartRateZones message. + * Verifies a HeartBeat message. * @function verify - * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TimeInHeartRateZones.verify = function verify(message) { + HeartBeat.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.lightTime != null && message.hasOwnProperty("lightTime")) { - var error = $root.google.protobuf.Duration.verify(message.lightTime); + var properties = {}; + if (message.physicalTime != null && message.hasOwnProperty("physicalTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.physicalTime); if (error) - return "lightTime." + error; + return "physicalTime." + error; } - if (message.moderateTime != null && message.hasOwnProperty("moderateTime")) { - var error = $root.google.protobuf.Duration.verify(message.moderateTime); + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { + var error = $root.google.protobuf.Duration.verify(message.utcOffset); if (error) - return "moderateTime." + error; + return "utcOffset." + error; } - if (message.vigorousTime != null && message.hasOwnProperty("vigorousTime")) { - var error = $root.google.protobuf.Duration.verify(message.vigorousTime); + if (message.civilTime != null && message.hasOwnProperty("civilTime")) { + var error = $root.google.devicesandservices.health.v4.CivilDateTime.verify(message.civilTime); if (error) - return "vigorousTime." + error; + return "civilTime." + error; } - if (message.peakTime != null && message.hasOwnProperty("peakTime")) { - var error = $root.google.protobuf.Duration.verify(message.peakTime); - if (error) - return "peakTime." + error; + if (message.beatsPerMinute != null && message.hasOwnProperty("beatsPerMinute")) { + properties._beatsPerMinute = 1; + if (!$util.isInteger(message.beatsPerMinute)) + return "beatsPerMinute: integer expected"; } return null; }; /** - * Creates a TimeInHeartRateZones message from a plain object. Also converts values to their respective internal types. + * Creates a HeartBeat message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones} TimeInHeartRateZones + * @returns {google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat} HeartBeat */ - TimeInHeartRateZones.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones) + HeartBeat.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat) return object; - var message = new $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones(); - if (object.lightTime != null) { - if (typeof object.lightTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.lightTime: object expected"); - message.lightTime = $root.google.protobuf.Duration.fromObject(object.lightTime); - } - if (object.moderateTime != null) { - if (typeof object.moderateTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.moderateTime: object expected"); - message.moderateTime = $root.google.protobuf.Duration.fromObject(object.moderateTime); + var message = new $root.google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat(); + if (object.physicalTime != null) { + if (typeof object.physicalTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat.physicalTime: object expected"); + message.physicalTime = $root.google.protobuf.Timestamp.fromObject(object.physicalTime); } - if (object.vigorousTime != null) { - if (typeof object.vigorousTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.vigorousTime: object expected"); - message.vigorousTime = $root.google.protobuf.Duration.fromObject(object.vigorousTime); + if (object.utcOffset != null) { + if (typeof object.utcOffset !== "object") + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat.utcOffset: object expected"); + message.utcOffset = $root.google.protobuf.Duration.fromObject(object.utcOffset); } - if (object.peakTime != null) { - if (typeof object.peakTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.peakTime: object expected"); - message.peakTime = $root.google.protobuf.Duration.fromObject(object.peakTime); + if (object.civilTime != null) { + if (typeof object.civilTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat.civilTime: object expected"); + message.civilTime = $root.google.devicesandservices.health.v4.CivilDateTime.fromObject(object.civilTime); } + if (object.beatsPerMinute != null) + message.beatsPerMinute = object.beatsPerMinute | 0; return message; }; /** - * Creates a plain object from a TimeInHeartRateZones message. Also converts values to other types if specified. + * Creates a plain object from a HeartBeat message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat * @static - * @param {google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones} message TimeInHeartRateZones + * @param {google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat} message HeartBeat * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeInHeartRateZones.toObject = function toObject(message, options) { + HeartBeat.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.lightTime = null; - object.moderateTime = null; - object.vigorousTime = null; - object.peakTime = null; + object.physicalTime = null; + object.utcOffset = null; + object.civilTime = null; + } + if (message.physicalTime != null && message.hasOwnProperty("physicalTime")) + object.physicalTime = $root.google.protobuf.Timestamp.toObject(message.physicalTime, options); + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) + object.utcOffset = $root.google.protobuf.Duration.toObject(message.utcOffset, options); + if (message.civilTime != null && message.hasOwnProperty("civilTime")) + object.civilTime = $root.google.devicesandservices.health.v4.CivilDateTime.toObject(message.civilTime, options); + if (message.beatsPerMinute != null && message.hasOwnProperty("beatsPerMinute")) { + object.beatsPerMinute = message.beatsPerMinute; + if (options.oneofs) + object._beatsPerMinute = "beatsPerMinute"; } - if (message.lightTime != null && message.hasOwnProperty("lightTime")) - object.lightTime = $root.google.protobuf.Duration.toObject(message.lightTime, options); - if (message.moderateTime != null && message.hasOwnProperty("moderateTime")) - object.moderateTime = $root.google.protobuf.Duration.toObject(message.moderateTime, options); - if (message.vigorousTime != null && message.hasOwnProperty("vigorousTime")) - object.vigorousTime = $root.google.protobuf.Duration.toObject(message.vigorousTime, options); - if (message.peakTime != null && message.hasOwnProperty("peakTime")) - object.peakTime = $root.google.protobuf.Duration.toObject(message.peakTime, options); return object; }; /** - * Converts this TimeInHeartRateZones to JSON. + * Converts this HeartBeat to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat * @instance * @returns {Object.} JSON object */ - TimeInHeartRateZones.prototype.toJSON = function toJSON() { + HeartBeat.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TimeInHeartRateZones + * Gets the default type url for HeartBeat * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TimeInHeartRateZones.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + HeartBeat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat"; }; - return TimeInHeartRateZones; + return HeartBeat; })(); - MetricsSummary.MobilityMetrics = (function() { + IrregularRhythmNotification.AlertWindow = (function() { /** - * Properties of a MobilityMetrics. - * @memberof google.devicesandservices.health.v4.MetricsSummary - * @interface IMobilityMetrics - * @property {number|null} [avgCadenceStepsPerMinute] MobilityMetrics avgCadenceStepsPerMinute - * @property {number|Long|null} [avgStrideLengthMillimeters] MobilityMetrics avgStrideLengthMillimeters - * @property {number|Long|null} [avgVerticalOscillationMillimeters] MobilityMetrics avgVerticalOscillationMillimeters - * @property {number|null} [avgVerticalRatio] MobilityMetrics avgVerticalRatio - * @property {google.protobuf.IDuration|null} [avgGroundContactTimeDuration] MobilityMetrics avgGroundContactTimeDuration + * Properties of an AlertWindow. + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification + * @interface IAlertWindow + * @property {google.protobuf.ITimestamp|null} [startTime] AlertWindow startTime + * @property {google.protobuf.IDuration|null} [startUtcOffset] AlertWindow startUtcOffset + * @property {google.protobuf.ITimestamp|null} [endTime] AlertWindow endTime + * @property {google.protobuf.IDuration|null} [endUtcOffset] AlertWindow endUtcOffset + * @property {google.devicesandservices.health.v4.ICivilDateTime|null} [civilStartTime] AlertWindow civilStartTime + * @property {google.devicesandservices.health.v4.ICivilDateTime|null} [civilEndTime] AlertWindow civilEndTime + * @property {boolean|null} [positive] AlertWindow positive + * @property {Array.|null} [heartBeats] AlertWindow heartBeats */ /** - * Constructs a new MobilityMetrics. - * @memberof google.devicesandservices.health.v4.MetricsSummary - * @classdesc Represents a MobilityMetrics. - * @implements IMobilityMetrics + * Constructs a new AlertWindow. + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification + * @classdesc Represents an AlertWindow. + * @implements IAlertWindow * @constructor - * @param {google.devicesandservices.health.v4.MetricsSummary.IMobilityMetrics=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IrregularRhythmNotification.IAlertWindow=} [properties] Properties to set */ - function MobilityMetrics(properties) { + function AlertWindow(properties) { + this.heartBeats = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14938,160 +16486,178 @@ } /** - * MobilityMetrics avgCadenceStepsPerMinute. - * @member {number|null|undefined} avgCadenceStepsPerMinute - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * AlertWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @instance */ - MobilityMetrics.prototype.avgCadenceStepsPerMinute = null; + AlertWindow.prototype.startTime = null; /** - * MobilityMetrics avgStrideLengthMillimeters. - * @member {number|Long|null|undefined} avgStrideLengthMillimeters - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * AlertWindow startUtcOffset. + * @member {google.protobuf.IDuration|null|undefined} startUtcOffset + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @instance */ - MobilityMetrics.prototype.avgStrideLengthMillimeters = null; + AlertWindow.prototype.startUtcOffset = null; /** - * MobilityMetrics avgVerticalOscillationMillimeters. - * @member {number|Long|null|undefined} avgVerticalOscillationMillimeters - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * AlertWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @instance */ - MobilityMetrics.prototype.avgVerticalOscillationMillimeters = null; + AlertWindow.prototype.endTime = null; /** - * MobilityMetrics avgVerticalRatio. - * @member {number|null|undefined} avgVerticalRatio - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * AlertWindow endUtcOffset. + * @member {google.protobuf.IDuration|null|undefined} endUtcOffset + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @instance */ - MobilityMetrics.prototype.avgVerticalRatio = null; + AlertWindow.prototype.endUtcOffset = null; /** - * MobilityMetrics avgGroundContactTimeDuration. - * @member {google.protobuf.IDuration|null|undefined} avgGroundContactTimeDuration - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * AlertWindow civilStartTime. + * @member {google.devicesandservices.health.v4.ICivilDateTime|null|undefined} civilStartTime + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @instance */ - MobilityMetrics.prototype.avgGroundContactTimeDuration = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MobilityMetrics.prototype, "_avgCadenceStepsPerMinute", { - get: $util.oneOfGetter($oneOfFields = ["avgCadenceStepsPerMinute"]), - set: $util.oneOfSetter($oneOfFields) - }); + AlertWindow.prototype.civilStartTime = null; - // Virtual OneOf for proto3 optional field - Object.defineProperty(MobilityMetrics.prototype, "_avgStrideLengthMillimeters", { - get: $util.oneOfGetter($oneOfFields = ["avgStrideLengthMillimeters"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * AlertWindow civilEndTime. + * @member {google.devicesandservices.health.v4.ICivilDateTime|null|undefined} civilEndTime + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow + * @instance + */ + AlertWindow.prototype.civilEndTime = null; - // Virtual OneOf for proto3 optional field - Object.defineProperty(MobilityMetrics.prototype, "_avgVerticalOscillationMillimeters", { - get: $util.oneOfGetter($oneOfFields = ["avgVerticalOscillationMillimeters"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * AlertWindow positive. + * @member {boolean} positive + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow + * @instance + */ + AlertWindow.prototype.positive = false; - // Virtual OneOf for proto3 optional field - Object.defineProperty(MobilityMetrics.prototype, "_avgVerticalRatio", { - get: $util.oneOfGetter($oneOfFields = ["avgVerticalRatio"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * AlertWindow heartBeats. + * @member {Array.} heartBeats + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow + * @instance + */ + AlertWindow.prototype.heartBeats = $util.emptyArray; /** - * Creates a new MobilityMetrics instance using the specified properties. + * Creates a new AlertWindow instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @static - * @param {google.devicesandservices.health.v4.MetricsSummary.IMobilityMetrics=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics} MobilityMetrics instance + * @param {google.devicesandservices.health.v4.IrregularRhythmNotification.IAlertWindow=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow} AlertWindow instance */ - MobilityMetrics.create = function create(properties) { - return new MobilityMetrics(properties); + AlertWindow.create = function create(properties) { + return new AlertWindow(properties); }; /** - * Encodes the specified MobilityMetrics message. Does not implicitly {@link google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.verify|verify} messages. + * Encodes the specified AlertWindow message. Does not implicitly {@link google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @static - * @param {google.devicesandservices.health.v4.MetricsSummary.IMobilityMetrics} message MobilityMetrics message or plain object to encode + * @param {google.devicesandservices.health.v4.IrregularRhythmNotification.IAlertWindow} message AlertWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MobilityMetrics.encode = function encode(message, writer) { + AlertWindow.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.avgCadenceStepsPerMinute != null && Object.hasOwnProperty.call(message, "avgCadenceStepsPerMinute")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.avgCadenceStepsPerMinute); - if (message.avgStrideLengthMillimeters != null && Object.hasOwnProperty.call(message, "avgStrideLengthMillimeters")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.avgStrideLengthMillimeters); - if (message.avgVerticalOscillationMillimeters != null && Object.hasOwnProperty.call(message, "avgVerticalOscillationMillimeters")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.avgVerticalOscillationMillimeters); - if (message.avgVerticalRatio != null && Object.hasOwnProperty.call(message, "avgVerticalRatio")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.avgVerticalRatio); - if (message.avgGroundContactTimeDuration != null && Object.hasOwnProperty.call(message, "avgGroundContactTimeDuration")) - $root.google.protobuf.Duration.encode(message.avgGroundContactTimeDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startUtcOffset != null && Object.hasOwnProperty.call(message, "startUtcOffset")) + $root.google.protobuf.Duration.encode(message.startUtcOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endUtcOffset != null && Object.hasOwnProperty.call(message, "endUtcOffset")) + $root.google.protobuf.Duration.encode(message.endUtcOffset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.civilStartTime != null && Object.hasOwnProperty.call(message, "civilStartTime")) + $root.google.devicesandservices.health.v4.CivilDateTime.encode(message.civilStartTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.civilEndTime != null && Object.hasOwnProperty.call(message, "civilEndTime")) + $root.google.devicesandservices.health.v4.CivilDateTime.encode(message.civilEndTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.positive != null && Object.hasOwnProperty.call(message, "positive")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.positive); + if (message.heartBeats != null && message.heartBeats.length) + for (var i = 0; i < message.heartBeats.length; ++i) + $root.google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat.encode(message.heartBeats[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified MobilityMetrics message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.verify|verify} messages. + * Encodes the specified AlertWindow message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @static - * @param {google.devicesandservices.health.v4.MetricsSummary.IMobilityMetrics} message MobilityMetrics message or plain object to encode + * @param {google.devicesandservices.health.v4.IrregularRhythmNotification.IAlertWindow} message AlertWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MobilityMetrics.encodeDelimited = function encodeDelimited(message, writer) { + AlertWindow.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MobilityMetrics message from the specified reader or buffer. + * Decodes an AlertWindow message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics} MobilityMetrics + * @returns {google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow} AlertWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MobilityMetrics.decode = function decode(reader, length, error) { + AlertWindow.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.avgCadenceStepsPerMinute = reader.double(); + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 2: { - message.avgStrideLengthMillimeters = reader.int64(); + message.startUtcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } case 3: { - message.avgVerticalOscillationMillimeters = reader.int64(); + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 4: { - message.avgVerticalRatio = reader.double(); + message.endUtcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } case 5: { - message.avgGroundContactTimeDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.civilStartTime = $root.google.devicesandservices.health.v4.CivilDateTime.decode(reader, reader.uint32()); + break; + } + case 6: { + message.civilEndTime = $root.google.devicesandservices.health.v4.CivilDateTime.decode(reader, reader.uint32()); + break; + } + case 7: { + message.positive = reader.bool(); + break; + } + case 8: { + if (!(message.heartBeats && message.heartBeats.length)) + message.heartBeats = []; + message.heartBeats.push($root.google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat.decode(reader, reader.uint32())); break; } default: @@ -15103,200 +16669,241 @@ }; /** - * Decodes a MobilityMetrics message from the specified reader or buffer, length delimited. + * Decodes an AlertWindow message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics} MobilityMetrics + * @returns {google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow} AlertWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MobilityMetrics.decodeDelimited = function decodeDelimited(reader) { + AlertWindow.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MobilityMetrics message. + * Verifies an AlertWindow message. * @function verify - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MobilityMetrics.verify = function verify(message) { + AlertWindow.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.avgCadenceStepsPerMinute != null && message.hasOwnProperty("avgCadenceStepsPerMinute")) { - properties._avgCadenceStepsPerMinute = 1; - if (typeof message.avgCadenceStepsPerMinute !== "number") - return "avgCadenceStepsPerMinute: number expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; } - if (message.avgStrideLengthMillimeters != null && message.hasOwnProperty("avgStrideLengthMillimeters")) { - properties._avgStrideLengthMillimeters = 1; - if (!$util.isInteger(message.avgStrideLengthMillimeters) && !(message.avgStrideLengthMillimeters && $util.isInteger(message.avgStrideLengthMillimeters.low) && $util.isInteger(message.avgStrideLengthMillimeters.high))) - return "avgStrideLengthMillimeters: integer|Long expected"; + if (message.startUtcOffset != null && message.hasOwnProperty("startUtcOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startUtcOffset); + if (error) + return "startUtcOffset." + error; } - if (message.avgVerticalOscillationMillimeters != null && message.hasOwnProperty("avgVerticalOscillationMillimeters")) { - properties._avgVerticalOscillationMillimeters = 1; - if (!$util.isInteger(message.avgVerticalOscillationMillimeters) && !(message.avgVerticalOscillationMillimeters && $util.isInteger(message.avgVerticalOscillationMillimeters.low) && $util.isInteger(message.avgVerticalOscillationMillimeters.high))) - return "avgVerticalOscillationMillimeters: integer|Long expected"; + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; } - if (message.avgVerticalRatio != null && message.hasOwnProperty("avgVerticalRatio")) { - properties._avgVerticalRatio = 1; - if (typeof message.avgVerticalRatio !== "number") - return "avgVerticalRatio: number expected"; + if (message.endUtcOffset != null && message.hasOwnProperty("endUtcOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endUtcOffset); + if (error) + return "endUtcOffset." + error; } - if (message.avgGroundContactTimeDuration != null && message.hasOwnProperty("avgGroundContactTimeDuration")) { - var error = $root.google.protobuf.Duration.verify(message.avgGroundContactTimeDuration); + if (message.civilStartTime != null && message.hasOwnProperty("civilStartTime")) { + var error = $root.google.devicesandservices.health.v4.CivilDateTime.verify(message.civilStartTime); if (error) - return "avgGroundContactTimeDuration." + error; + return "civilStartTime." + error; + } + if (message.civilEndTime != null && message.hasOwnProperty("civilEndTime")) { + var error = $root.google.devicesandservices.health.v4.CivilDateTime.verify(message.civilEndTime); + if (error) + return "civilEndTime." + error; + } + if (message.positive != null && message.hasOwnProperty("positive")) + if (typeof message.positive !== "boolean") + return "positive: boolean expected"; + if (message.heartBeats != null && message.hasOwnProperty("heartBeats")) { + if (!Array.isArray(message.heartBeats)) + return "heartBeats: array expected"; + for (var i = 0; i < message.heartBeats.length; ++i) { + var error = $root.google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat.verify(message.heartBeats[i]); + if (error) + return "heartBeats." + error; + } } return null; }; /** - * Creates a MobilityMetrics message from a plain object. Also converts values to their respective internal types. + * Creates an AlertWindow message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics} MobilityMetrics + * @returns {google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow} AlertWindow */ - MobilityMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics) + AlertWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow) return object; - var message = new $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics(); - if (object.avgCadenceStepsPerMinute != null) - message.avgCadenceStepsPerMinute = Number(object.avgCadenceStepsPerMinute); - if (object.avgStrideLengthMillimeters != null) - if ($util.Long) - (message.avgStrideLengthMillimeters = $util.Long.fromValue(object.avgStrideLengthMillimeters)).unsigned = false; - else if (typeof object.avgStrideLengthMillimeters === "string") - message.avgStrideLengthMillimeters = parseInt(object.avgStrideLengthMillimeters, 10); - else if (typeof object.avgStrideLengthMillimeters === "number") - message.avgStrideLengthMillimeters = object.avgStrideLengthMillimeters; - else if (typeof object.avgStrideLengthMillimeters === "object") - message.avgStrideLengthMillimeters = new $util.LongBits(object.avgStrideLengthMillimeters.low >>> 0, object.avgStrideLengthMillimeters.high >>> 0).toNumber(); - if (object.avgVerticalOscillationMillimeters != null) - if ($util.Long) - (message.avgVerticalOscillationMillimeters = $util.Long.fromValue(object.avgVerticalOscillationMillimeters)).unsigned = false; - else if (typeof object.avgVerticalOscillationMillimeters === "string") - message.avgVerticalOscillationMillimeters = parseInt(object.avgVerticalOscillationMillimeters, 10); - else if (typeof object.avgVerticalOscillationMillimeters === "number") - message.avgVerticalOscillationMillimeters = object.avgVerticalOscillationMillimeters; - else if (typeof object.avgVerticalOscillationMillimeters === "object") - message.avgVerticalOscillationMillimeters = new $util.LongBits(object.avgVerticalOscillationMillimeters.low >>> 0, object.avgVerticalOscillationMillimeters.high >>> 0).toNumber(); - if (object.avgVerticalRatio != null) - message.avgVerticalRatio = Number(object.avgVerticalRatio); - if (object.avgGroundContactTimeDuration != null) { - if (typeof object.avgGroundContactTimeDuration !== "object") - throw TypeError(".google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.avgGroundContactTimeDuration: object expected"); - message.avgGroundContactTimeDuration = $root.google.protobuf.Duration.fromObject(object.avgGroundContactTimeDuration); + var message = new $root.google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.startUtcOffset != null) { + if (typeof object.startUtcOffset !== "object") + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.startUtcOffset: object expected"); + message.startUtcOffset = $root.google.protobuf.Duration.fromObject(object.startUtcOffset); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.endUtcOffset != null) { + if (typeof object.endUtcOffset !== "object") + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.endUtcOffset: object expected"); + message.endUtcOffset = $root.google.protobuf.Duration.fromObject(object.endUtcOffset); + } + if (object.civilStartTime != null) { + if (typeof object.civilStartTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.civilStartTime: object expected"); + message.civilStartTime = $root.google.devicesandservices.health.v4.CivilDateTime.fromObject(object.civilStartTime); + } + if (object.civilEndTime != null) { + if (typeof object.civilEndTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.civilEndTime: object expected"); + message.civilEndTime = $root.google.devicesandservices.health.v4.CivilDateTime.fromObject(object.civilEndTime); + } + if (object.positive != null) + message.positive = Boolean(object.positive); + if (object.heartBeats) { + if (!Array.isArray(object.heartBeats)) + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.heartBeats: array expected"); + message.heartBeats = []; + for (var i = 0; i < object.heartBeats.length; ++i) { + if (typeof object.heartBeats[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow.heartBeats: object expected"); + message.heartBeats[i] = $root.google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat.fromObject(object.heartBeats[i]); + } } return message; }; /** - * Creates a plain object from a MobilityMetrics message. Also converts values to other types if specified. + * Creates a plain object from an AlertWindow message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @static - * @param {google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics} message MobilityMetrics + * @param {google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow} message AlertWindow * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MobilityMetrics.toObject = function toObject(message, options) { + AlertWindow.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.avgGroundContactTimeDuration = null; - if (message.avgCadenceStepsPerMinute != null && message.hasOwnProperty("avgCadenceStepsPerMinute")) { - object.avgCadenceStepsPerMinute = options.json && !isFinite(message.avgCadenceStepsPerMinute) ? String(message.avgCadenceStepsPerMinute) : message.avgCadenceStepsPerMinute; - if (options.oneofs) - object._avgCadenceStepsPerMinute = "avgCadenceStepsPerMinute"; + if (options.arrays || options.defaults) + object.heartBeats = []; + if (options.defaults) { + object.startTime = null; + object.startUtcOffset = null; + object.endTime = null; + object.endUtcOffset = null; + object.civilStartTime = null; + object.civilEndTime = null; + object.positive = false; } - if (message.avgStrideLengthMillimeters != null && message.hasOwnProperty("avgStrideLengthMillimeters")) { - if (typeof message.avgStrideLengthMillimeters === "number") - object.avgStrideLengthMillimeters = options.longs === String ? String(message.avgStrideLengthMillimeters) : message.avgStrideLengthMillimeters; - else - object.avgStrideLengthMillimeters = options.longs === String ? $util.Long.prototype.toString.call(message.avgStrideLengthMillimeters) : options.longs === Number ? new $util.LongBits(message.avgStrideLengthMillimeters.low >>> 0, message.avgStrideLengthMillimeters.high >>> 0).toNumber() : message.avgStrideLengthMillimeters; - if (options.oneofs) - object._avgStrideLengthMillimeters = "avgStrideLengthMillimeters"; - } - if (message.avgVerticalOscillationMillimeters != null && message.hasOwnProperty("avgVerticalOscillationMillimeters")) { - if (typeof message.avgVerticalOscillationMillimeters === "number") - object.avgVerticalOscillationMillimeters = options.longs === String ? String(message.avgVerticalOscillationMillimeters) : message.avgVerticalOscillationMillimeters; - else - object.avgVerticalOscillationMillimeters = options.longs === String ? $util.Long.prototype.toString.call(message.avgVerticalOscillationMillimeters) : options.longs === Number ? new $util.LongBits(message.avgVerticalOscillationMillimeters.low >>> 0, message.avgVerticalOscillationMillimeters.high >>> 0).toNumber() : message.avgVerticalOscillationMillimeters; - if (options.oneofs) - object._avgVerticalOscillationMillimeters = "avgVerticalOscillationMillimeters"; - } - if (message.avgVerticalRatio != null && message.hasOwnProperty("avgVerticalRatio")) { - object.avgVerticalRatio = options.json && !isFinite(message.avgVerticalRatio) ? String(message.avgVerticalRatio) : message.avgVerticalRatio; - if (options.oneofs) - object._avgVerticalRatio = "avgVerticalRatio"; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.startUtcOffset != null && message.hasOwnProperty("startUtcOffset")) + object.startUtcOffset = $root.google.protobuf.Duration.toObject(message.startUtcOffset, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.endUtcOffset != null && message.hasOwnProperty("endUtcOffset")) + object.endUtcOffset = $root.google.protobuf.Duration.toObject(message.endUtcOffset, options); + if (message.civilStartTime != null && message.hasOwnProperty("civilStartTime")) + object.civilStartTime = $root.google.devicesandservices.health.v4.CivilDateTime.toObject(message.civilStartTime, options); + if (message.civilEndTime != null && message.hasOwnProperty("civilEndTime")) + object.civilEndTime = $root.google.devicesandservices.health.v4.CivilDateTime.toObject(message.civilEndTime, options); + if (message.positive != null && message.hasOwnProperty("positive")) + object.positive = message.positive; + if (message.heartBeats && message.heartBeats.length) { + object.heartBeats = []; + for (var j = 0; j < message.heartBeats.length; ++j) + object.heartBeats[j] = $root.google.devicesandservices.health.v4.IrregularRhythmNotification.HeartBeat.toObject(message.heartBeats[j], options); } - if (message.avgGroundContactTimeDuration != null && message.hasOwnProperty("avgGroundContactTimeDuration")) - object.avgGroundContactTimeDuration = $root.google.protobuf.Duration.toObject(message.avgGroundContactTimeDuration, options); return object; }; /** - * Converts this MobilityMetrics to JSON. + * Converts this AlertWindow to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @instance * @returns {Object.} JSON object */ - MobilityMetrics.prototype.toJSON = function toJSON() { + AlertWindow.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MobilityMetrics + * Gets the default type url for AlertWindow * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * @memberof google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MobilityMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AlertWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.IrregularRhythmNotification.AlertWindow"; }; - return MobilityMetrics; + return AlertWindow; })(); - return MetricsSummary; + return IrregularRhythmNotification; })(); - v4.OxygenSaturation = (function() { + v4.MetricsSummary = (function() { /** - * Properties of an OxygenSaturation. + * Properties of a MetricsSummary. * @memberof google.devicesandservices.health.v4 - * @interface IOxygenSaturation - * @property {google.devicesandservices.health.v4.IObservationSampleTime|null} [sampleTime] OxygenSaturation sampleTime - * @property {number|null} [percentage] OxygenSaturation percentage + * @interface IMetricsSummary + * @property {number|null} [caloriesKcal] MetricsSummary caloriesKcal + * @property {number|null} [distanceMillimeters] MetricsSummary distanceMillimeters + * @property {number|Long|null} [steps] MetricsSummary steps + * @property {number|null} [averageSpeedMillimetersPerSecond] MetricsSummary averageSpeedMillimetersPerSecond + * @property {number|null} [averagePaceSecondsPerMeter] MetricsSummary averagePaceSecondsPerMeter + * @property {number|Long|null} [averageHeartRateBeatsPerMinute] MetricsSummary averageHeartRateBeatsPerMinute + * @property {number|null} [elevationGainMillimeters] MetricsSummary elevationGainMillimeters + * @property {number|Long|null} [activeZoneMinutes] MetricsSummary activeZoneMinutes + * @property {number|null} [runVo2Max] MetricsSummary runVo2Max + * @property {number|null} [totalSwimLengths] MetricsSummary totalSwimLengths + * @property {google.devicesandservices.health.v4.MetricsSummary.ITimeInHeartRateZones|null} [heartRateZoneDurations] MetricsSummary heartRateZoneDurations + * @property {google.devicesandservices.health.v4.MetricsSummary.IMobilityMetrics|null} [mobilityMetrics] MetricsSummary mobilityMetrics */ /** - * Constructs a new OxygenSaturation. + * Constructs a new MetricsSummary. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents an OxygenSaturation. - * @implements IOxygenSaturation + * @classdesc Represents a MetricsSummary. + * @implements IMetricsSummary * @constructor - * @param {google.devicesandservices.health.v4.IOxygenSaturation=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IMetricsSummary=} [properties] Properties to set */ - function OxygenSaturation(properties) { + function MetricsSummary(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15304,340 +16911,294 @@ } /** - * OxygenSaturation sampleTime. - * @member {google.devicesandservices.health.v4.IObservationSampleTime|null|undefined} sampleTime - * @memberof google.devicesandservices.health.v4.OxygenSaturation + * MetricsSummary caloriesKcal. + * @member {number|null|undefined} caloriesKcal + * @memberof google.devicesandservices.health.v4.MetricsSummary * @instance */ - OxygenSaturation.prototype.sampleTime = null; + MetricsSummary.prototype.caloriesKcal = null; /** - * OxygenSaturation percentage. - * @member {number} percentage - * @memberof google.devicesandservices.health.v4.OxygenSaturation + * MetricsSummary distanceMillimeters. + * @member {number|null|undefined} distanceMillimeters + * @memberof google.devicesandservices.health.v4.MetricsSummary * @instance */ - OxygenSaturation.prototype.percentage = 0; + MetricsSummary.prototype.distanceMillimeters = null; /** - * Creates a new OxygenSaturation instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.OxygenSaturation - * @static - * @param {google.devicesandservices.health.v4.IOxygenSaturation=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.OxygenSaturation} OxygenSaturation instance + * MetricsSummary steps. + * @member {number|Long|null|undefined} steps + * @memberof google.devicesandservices.health.v4.MetricsSummary + * @instance */ - OxygenSaturation.create = function create(properties) { - return new OxygenSaturation(properties); - }; + MetricsSummary.prototype.steps = null; /** - * Encodes the specified OxygenSaturation message. Does not implicitly {@link google.devicesandservices.health.v4.OxygenSaturation.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.OxygenSaturation - * @static - * @param {google.devicesandservices.health.v4.IOxygenSaturation} message OxygenSaturation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * MetricsSummary averageSpeedMillimetersPerSecond. + * @member {number|null|undefined} averageSpeedMillimetersPerSecond + * @memberof google.devicesandservices.health.v4.MetricsSummary + * @instance */ - OxygenSaturation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sampleTime != null && Object.hasOwnProperty.call(message, "sampleTime")) - $root.google.devicesandservices.health.v4.ObservationSampleTime.encode(message.sampleTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.percentage != null && Object.hasOwnProperty.call(message, "percentage")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.percentage); - return writer; - }; + MetricsSummary.prototype.averageSpeedMillimetersPerSecond = null; /** - * Encodes the specified OxygenSaturation message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.OxygenSaturation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.OxygenSaturation - * @static - * @param {google.devicesandservices.health.v4.IOxygenSaturation} message OxygenSaturation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * MetricsSummary averagePaceSecondsPerMeter. + * @member {number|null|undefined} averagePaceSecondsPerMeter + * @memberof google.devicesandservices.health.v4.MetricsSummary + * @instance */ - OxygenSaturation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + MetricsSummary.prototype.averagePaceSecondsPerMeter = null; /** - * Decodes an OxygenSaturation message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.OxygenSaturation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.OxygenSaturation} OxygenSaturation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * MetricsSummary averageHeartRateBeatsPerMinute. + * @member {number|Long|null|undefined} averageHeartRateBeatsPerMinute + * @memberof google.devicesandservices.health.v4.MetricsSummary + * @instance */ - OxygenSaturation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.OxygenSaturation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.decode(reader, reader.uint32()); - break; - } - case 2: { - message.percentage = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + MetricsSummary.prototype.averageHeartRateBeatsPerMinute = null; /** - * Decodes an OxygenSaturation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.OxygenSaturation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.OxygenSaturation} OxygenSaturation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * MetricsSummary elevationGainMillimeters. + * @member {number|null|undefined} elevationGainMillimeters + * @memberof google.devicesandservices.health.v4.MetricsSummary + * @instance */ - OxygenSaturation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + MetricsSummary.prototype.elevationGainMillimeters = null; /** - * Verifies an OxygenSaturation message. - * @function verify - * @memberof google.devicesandservices.health.v4.OxygenSaturation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * MetricsSummary activeZoneMinutes. + * @member {number|Long|null|undefined} activeZoneMinutes + * @memberof google.devicesandservices.health.v4.MetricsSummary + * @instance */ - OxygenSaturation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { - var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); - if (error) - return "sampleTime." + error; - } - if (message.percentage != null && message.hasOwnProperty("percentage")) - if (typeof message.percentage !== "number") - return "percentage: number expected"; - return null; - }; + MetricsSummary.prototype.activeZoneMinutes = null; /** - * Creates an OxygenSaturation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.OxygenSaturation - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.OxygenSaturation} OxygenSaturation + * MetricsSummary runVo2Max. + * @member {number|null|undefined} runVo2Max + * @memberof google.devicesandservices.health.v4.MetricsSummary + * @instance */ - OxygenSaturation.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.OxygenSaturation) - return object; - var message = new $root.google.devicesandservices.health.v4.OxygenSaturation(); - if (object.sampleTime != null) { - if (typeof object.sampleTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.OxygenSaturation.sampleTime: object expected"); - message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.fromObject(object.sampleTime); - } - if (object.percentage != null) - message.percentage = Number(object.percentage); - return message; - }; + MetricsSummary.prototype.runVo2Max = null; /** - * Creates a plain object from an OxygenSaturation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.OxygenSaturation - * @static - * @param {google.devicesandservices.health.v4.OxygenSaturation} message OxygenSaturation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * MetricsSummary totalSwimLengths. + * @member {number|null|undefined} totalSwimLengths + * @memberof google.devicesandservices.health.v4.MetricsSummary + * @instance */ - OxygenSaturation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sampleTime = null; - object.percentage = 0; - } - if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) - object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); - if (message.percentage != null && message.hasOwnProperty("percentage")) - object.percentage = options.json && !isFinite(message.percentage) ? String(message.percentage) : message.percentage; - return object; - }; + MetricsSummary.prototype.totalSwimLengths = null; /** - * Converts this OxygenSaturation to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.OxygenSaturation + * MetricsSummary heartRateZoneDurations. + * @member {google.devicesandservices.health.v4.MetricsSummary.ITimeInHeartRateZones|null|undefined} heartRateZoneDurations + * @memberof google.devicesandservices.health.v4.MetricsSummary * @instance - * @returns {Object.} JSON object */ - OxygenSaturation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + MetricsSummary.prototype.heartRateZoneDurations = null; /** - * Gets the default type url for OxygenSaturation - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.OxygenSaturation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * MetricsSummary mobilityMetrics. + * @member {google.devicesandservices.health.v4.MetricsSummary.IMobilityMetrics|null|undefined} mobilityMetrics + * @memberof google.devicesandservices.health.v4.MetricsSummary + * @instance */ - OxygenSaturation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.OxygenSaturation"; - }; + MetricsSummary.prototype.mobilityMetrics = null; - return OxygenSaturation; - })(); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - v4.RestingHeartRatePersonalRangeRollupValue = (function() { + // Virtual OneOf for proto3 optional field + Object.defineProperty(MetricsSummary.prototype, "_caloriesKcal", { + get: $util.oneOfGetter($oneOfFields = ["caloriesKcal"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Properties of a RestingHeartRatePersonalRangeRollupValue. - * @memberof google.devicesandservices.health.v4 - * @interface IRestingHeartRatePersonalRangeRollupValue - * @property {number|null} [beatsPerMinuteMin] RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMin - * @property {number|null} [beatsPerMinuteMax] RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMax - */ + // Virtual OneOf for proto3 optional field + Object.defineProperty(MetricsSummary.prototype, "_distanceMillimeters", { + get: $util.oneOfGetter($oneOfFields = ["distanceMillimeters"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Constructs a new RestingHeartRatePersonalRangeRollupValue. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a RestingHeartRatePersonalRangeRollupValue. - * @implements IRestingHeartRatePersonalRangeRollupValue - * @constructor - * @param {google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue=} [properties] Properties to set - */ - function RestingHeartRatePersonalRangeRollupValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + // Virtual OneOf for proto3 optional field + Object.defineProperty(MetricsSummary.prototype, "_steps", { + get: $util.oneOfGetter($oneOfFields = ["steps"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMin. - * @member {number|null|undefined} beatsPerMinuteMin - * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue - * @instance - */ - RestingHeartRatePersonalRangeRollupValue.prototype.beatsPerMinuteMin = null; + // Virtual OneOf for proto3 optional field + Object.defineProperty(MetricsSummary.prototype, "_averageSpeedMillimetersPerSecond", { + get: $util.oneOfGetter($oneOfFields = ["averageSpeedMillimetersPerSecond"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMax. - * @member {number|null|undefined} beatsPerMinuteMax - * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue - * @instance - */ - RestingHeartRatePersonalRangeRollupValue.prototype.beatsPerMinuteMax = null; + // Virtual OneOf for proto3 optional field + Object.defineProperty(MetricsSummary.prototype, "_averagePaceSecondsPerMeter", { + get: $util.oneOfGetter($oneOfFields = ["averagePaceSecondsPerMeter"]), + set: $util.oneOfSetter($oneOfFields) + }); - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(MetricsSummary.prototype, "_averageHeartRateBeatsPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["averageHeartRateBeatsPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); // Virtual OneOf for proto3 optional field - Object.defineProperty(RestingHeartRatePersonalRangeRollupValue.prototype, "_beatsPerMinuteMin", { - get: $util.oneOfGetter($oneOfFields = ["beatsPerMinuteMin"]), + Object.defineProperty(MetricsSummary.prototype, "_elevationGainMillimeters", { + get: $util.oneOfGetter($oneOfFields = ["elevationGainMillimeters"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field - Object.defineProperty(RestingHeartRatePersonalRangeRollupValue.prototype, "_beatsPerMinuteMax", { - get: $util.oneOfGetter($oneOfFields = ["beatsPerMinuteMax"]), + Object.defineProperty(MetricsSummary.prototype, "_activeZoneMinutes", { + get: $util.oneOfGetter($oneOfFields = ["activeZoneMinutes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MetricsSummary.prototype, "_runVo2Max", { + get: $util.oneOfGetter($oneOfFields = ["runVo2Max"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MetricsSummary.prototype, "_totalSwimLengths", { + get: $util.oneOfGetter($oneOfFields = ["totalSwimLengths"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new RestingHeartRatePersonalRangeRollupValue instance using the specified properties. + * Creates a new MetricsSummary instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue + * @memberof google.devicesandservices.health.v4.MetricsSummary * @static - * @param {google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue} RestingHeartRatePersonalRangeRollupValue instance + * @param {google.devicesandservices.health.v4.IMetricsSummary=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.MetricsSummary} MetricsSummary instance */ - RestingHeartRatePersonalRangeRollupValue.create = function create(properties) { - return new RestingHeartRatePersonalRangeRollupValue(properties); + MetricsSummary.create = function create(properties) { + return new MetricsSummary(properties); }; /** - * Encodes the specified RestingHeartRatePersonalRangeRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.verify|verify} messages. + * Encodes the specified MetricsSummary message. Does not implicitly {@link google.devicesandservices.health.v4.MetricsSummary.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue + * @memberof google.devicesandservices.health.v4.MetricsSummary * @static - * @param {google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue} message RestingHeartRatePersonalRangeRollupValue message or plain object to encode + * @param {google.devicesandservices.health.v4.IMetricsSummary} message MetricsSummary message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestingHeartRatePersonalRangeRollupValue.encode = function encode(message, writer) { + MetricsSummary.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.beatsPerMinuteMin != null && Object.hasOwnProperty.call(message, "beatsPerMinuteMin")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.beatsPerMinuteMin); - if (message.beatsPerMinuteMax != null && Object.hasOwnProperty.call(message, "beatsPerMinuteMax")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.beatsPerMinuteMax); + if (message.caloriesKcal != null && Object.hasOwnProperty.call(message, "caloriesKcal")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.caloriesKcal); + if (message.distanceMillimeters != null && Object.hasOwnProperty.call(message, "distanceMillimeters")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.distanceMillimeters); + if (message.steps != null && Object.hasOwnProperty.call(message, "steps")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.steps); + if (message.averageSpeedMillimetersPerSecond != null && Object.hasOwnProperty.call(message, "averageSpeedMillimetersPerSecond")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.averageSpeedMillimetersPerSecond); + if (message.averagePaceSecondsPerMeter != null && Object.hasOwnProperty.call(message, "averagePaceSecondsPerMeter")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.averagePaceSecondsPerMeter); + if (message.averageHeartRateBeatsPerMinute != null && Object.hasOwnProperty.call(message, "averageHeartRateBeatsPerMinute")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.averageHeartRateBeatsPerMinute); + if (message.elevationGainMillimeters != null && Object.hasOwnProperty.call(message, "elevationGainMillimeters")) + writer.uint32(/* id 7, wireType 1 =*/57).double(message.elevationGainMillimeters); + if (message.activeZoneMinutes != null && Object.hasOwnProperty.call(message, "activeZoneMinutes")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.activeZoneMinutes); + if (message.runVo2Max != null && Object.hasOwnProperty.call(message, "runVo2Max")) + writer.uint32(/* id 10, wireType 1 =*/81).double(message.runVo2Max); + if (message.totalSwimLengths != null && Object.hasOwnProperty.call(message, "totalSwimLengths")) + writer.uint32(/* id 11, wireType 1 =*/89).double(message.totalSwimLengths); + if (message.heartRateZoneDurations != null && Object.hasOwnProperty.call(message, "heartRateZoneDurations")) + $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.encode(message.heartRateZoneDurations, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.mobilityMetrics != null && Object.hasOwnProperty.call(message, "mobilityMetrics")) + $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.encode(message.mobilityMetrics, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; /** - * Encodes the specified RestingHeartRatePersonalRangeRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.verify|verify} messages. + * Encodes the specified MetricsSummary message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.MetricsSummary.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue + * @memberof google.devicesandservices.health.v4.MetricsSummary * @static - * @param {google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue} message RestingHeartRatePersonalRangeRollupValue message or plain object to encode + * @param {google.devicesandservices.health.v4.IMetricsSummary} message MetricsSummary message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestingHeartRatePersonalRangeRollupValue.encodeDelimited = function encodeDelimited(message, writer) { + MetricsSummary.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RestingHeartRatePersonalRangeRollupValue message from the specified reader or buffer. + * Decodes a MetricsSummary message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue + * @memberof google.devicesandservices.health.v4.MetricsSummary * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue} RestingHeartRatePersonalRangeRollupValue + * @returns {google.devicesandservices.health.v4.MetricsSummary} MetricsSummary * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestingHeartRatePersonalRangeRollupValue.decode = function decode(reader, length, error) { + MetricsSummary.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.MetricsSummary(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.beatsPerMinuteMin = reader.double(); + message.caloriesKcal = reader.double(); break; } case 2: { - message.beatsPerMinuteMax = reader.double(); + message.distanceMillimeters = reader.double(); + break; + } + case 3: { + message.steps = reader.int64(); + break; + } + case 4: { + message.averageSpeedMillimetersPerSecond = reader.double(); + break; + } + case 5: { + message.averagePaceSecondsPerMeter = reader.double(); + break; + } + case 6: { + message.averageHeartRateBeatsPerMinute = reader.int64(); + break; + } + case 7: { + message.elevationGainMillimeters = reader.double(); + break; + } + case 9: { + message.activeZoneMinutes = reader.int64(); + break; + } + case 10: { + message.runVo2Max = reader.double(); + break; + } + case 11: { + message.totalSwimLengths = reader.double(); + break; + } + case 12: { + message.heartRateZoneDurations = $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.decode(reader, reader.uint32()); + break; + } + case 13: { + message.mobilityMetrics = $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.decode(reader, reader.uint32()); break; } default: @@ -15649,460 +17210,588 @@ }; /** - * Decodes a RestingHeartRatePersonalRangeRollupValue message from the specified reader or buffer, length delimited. + * Decodes a MetricsSummary message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue + * @memberof google.devicesandservices.health.v4.MetricsSummary * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue} RestingHeartRatePersonalRangeRollupValue + * @returns {google.devicesandservices.health.v4.MetricsSummary} MetricsSummary * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestingHeartRatePersonalRangeRollupValue.decodeDelimited = function decodeDelimited(reader) { + MetricsSummary.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RestingHeartRatePersonalRangeRollupValue message. + * Verifies a MetricsSummary message. * @function verify - * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue + * @memberof google.devicesandservices.health.v4.MetricsSummary * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RestingHeartRatePersonalRangeRollupValue.verify = function verify(message) { + MetricsSummary.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.beatsPerMinuteMin != null && message.hasOwnProperty("beatsPerMinuteMin")) { - properties._beatsPerMinuteMin = 1; - if (typeof message.beatsPerMinuteMin !== "number") - return "beatsPerMinuteMin: number expected"; + if (message.caloriesKcal != null && message.hasOwnProperty("caloriesKcal")) { + properties._caloriesKcal = 1; + if (typeof message.caloriesKcal !== "number") + return "caloriesKcal: number expected"; } - if (message.beatsPerMinuteMax != null && message.hasOwnProperty("beatsPerMinuteMax")) { - properties._beatsPerMinuteMax = 1; - if (typeof message.beatsPerMinuteMax !== "number") - return "beatsPerMinuteMax: number expected"; + if (message.distanceMillimeters != null && message.hasOwnProperty("distanceMillimeters")) { + properties._distanceMillimeters = 1; + if (typeof message.distanceMillimeters !== "number") + return "distanceMillimeters: number expected"; + } + if (message.steps != null && message.hasOwnProperty("steps")) { + properties._steps = 1; + if (!$util.isInteger(message.steps) && !(message.steps && $util.isInteger(message.steps.low) && $util.isInteger(message.steps.high))) + return "steps: integer|Long expected"; + } + if (message.averageSpeedMillimetersPerSecond != null && message.hasOwnProperty("averageSpeedMillimetersPerSecond")) { + properties._averageSpeedMillimetersPerSecond = 1; + if (typeof message.averageSpeedMillimetersPerSecond !== "number") + return "averageSpeedMillimetersPerSecond: number expected"; + } + if (message.averagePaceSecondsPerMeter != null && message.hasOwnProperty("averagePaceSecondsPerMeter")) { + properties._averagePaceSecondsPerMeter = 1; + if (typeof message.averagePaceSecondsPerMeter !== "number") + return "averagePaceSecondsPerMeter: number expected"; + } + if (message.averageHeartRateBeatsPerMinute != null && message.hasOwnProperty("averageHeartRateBeatsPerMinute")) { + properties._averageHeartRateBeatsPerMinute = 1; + if (!$util.isInteger(message.averageHeartRateBeatsPerMinute) && !(message.averageHeartRateBeatsPerMinute && $util.isInteger(message.averageHeartRateBeatsPerMinute.low) && $util.isInteger(message.averageHeartRateBeatsPerMinute.high))) + return "averageHeartRateBeatsPerMinute: integer|Long expected"; + } + if (message.elevationGainMillimeters != null && message.hasOwnProperty("elevationGainMillimeters")) { + properties._elevationGainMillimeters = 1; + if (typeof message.elevationGainMillimeters !== "number") + return "elevationGainMillimeters: number expected"; + } + if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { + properties._activeZoneMinutes = 1; + if (!$util.isInteger(message.activeZoneMinutes) && !(message.activeZoneMinutes && $util.isInteger(message.activeZoneMinutes.low) && $util.isInteger(message.activeZoneMinutes.high))) + return "activeZoneMinutes: integer|Long expected"; + } + if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { + properties._runVo2Max = 1; + if (typeof message.runVo2Max !== "number") + return "runVo2Max: number expected"; + } + if (message.totalSwimLengths != null && message.hasOwnProperty("totalSwimLengths")) { + properties._totalSwimLengths = 1; + if (typeof message.totalSwimLengths !== "number") + return "totalSwimLengths: number expected"; + } + if (message.heartRateZoneDurations != null && message.hasOwnProperty("heartRateZoneDurations")) { + var error = $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.verify(message.heartRateZoneDurations); + if (error) + return "heartRateZoneDurations." + error; + } + if (message.mobilityMetrics != null && message.hasOwnProperty("mobilityMetrics")) { + var error = $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.verify(message.mobilityMetrics); + if (error) + return "mobilityMetrics." + error; } return null; }; /** - * Creates a RestingHeartRatePersonalRangeRollupValue message from a plain object. Also converts values to their respective internal types. + * Creates a MetricsSummary message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue + * @memberof google.devicesandservices.health.v4.MetricsSummary * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue} RestingHeartRatePersonalRangeRollupValue + * @returns {google.devicesandservices.health.v4.MetricsSummary} MetricsSummary */ - RestingHeartRatePersonalRangeRollupValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue) + MetricsSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.MetricsSummary) return object; - var message = new $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue(); - if (object.beatsPerMinuteMin != null) - message.beatsPerMinuteMin = Number(object.beatsPerMinuteMin); - if (object.beatsPerMinuteMax != null) - message.beatsPerMinuteMax = Number(object.beatsPerMinuteMax); + var message = new $root.google.devicesandservices.health.v4.MetricsSummary(); + if (object.caloriesKcal != null) + message.caloriesKcal = Number(object.caloriesKcal); + if (object.distanceMillimeters != null) + message.distanceMillimeters = Number(object.distanceMillimeters); + if (object.steps != null) + if ($util.Long) + (message.steps = $util.Long.fromValue(object.steps)).unsigned = false; + else if (typeof object.steps === "string") + message.steps = parseInt(object.steps, 10); + else if (typeof object.steps === "number") + message.steps = object.steps; + else if (typeof object.steps === "object") + message.steps = new $util.LongBits(object.steps.low >>> 0, object.steps.high >>> 0).toNumber(); + if (object.averageSpeedMillimetersPerSecond != null) + message.averageSpeedMillimetersPerSecond = Number(object.averageSpeedMillimetersPerSecond); + if (object.averagePaceSecondsPerMeter != null) + message.averagePaceSecondsPerMeter = Number(object.averagePaceSecondsPerMeter); + if (object.averageHeartRateBeatsPerMinute != null) + if ($util.Long) + (message.averageHeartRateBeatsPerMinute = $util.Long.fromValue(object.averageHeartRateBeatsPerMinute)).unsigned = false; + else if (typeof object.averageHeartRateBeatsPerMinute === "string") + message.averageHeartRateBeatsPerMinute = parseInt(object.averageHeartRateBeatsPerMinute, 10); + else if (typeof object.averageHeartRateBeatsPerMinute === "number") + message.averageHeartRateBeatsPerMinute = object.averageHeartRateBeatsPerMinute; + else if (typeof object.averageHeartRateBeatsPerMinute === "object") + message.averageHeartRateBeatsPerMinute = new $util.LongBits(object.averageHeartRateBeatsPerMinute.low >>> 0, object.averageHeartRateBeatsPerMinute.high >>> 0).toNumber(); + if (object.elevationGainMillimeters != null) + message.elevationGainMillimeters = Number(object.elevationGainMillimeters); + if (object.activeZoneMinutes != null) + if ($util.Long) + (message.activeZoneMinutes = $util.Long.fromValue(object.activeZoneMinutes)).unsigned = false; + else if (typeof object.activeZoneMinutes === "string") + message.activeZoneMinutes = parseInt(object.activeZoneMinutes, 10); + else if (typeof object.activeZoneMinutes === "number") + message.activeZoneMinutes = object.activeZoneMinutes; + else if (typeof object.activeZoneMinutes === "object") + message.activeZoneMinutes = new $util.LongBits(object.activeZoneMinutes.low >>> 0, object.activeZoneMinutes.high >>> 0).toNumber(); + if (object.runVo2Max != null) + message.runVo2Max = Number(object.runVo2Max); + if (object.totalSwimLengths != null) + message.totalSwimLengths = Number(object.totalSwimLengths); + if (object.heartRateZoneDurations != null) { + if (typeof object.heartRateZoneDurations !== "object") + throw TypeError(".google.devicesandservices.health.v4.MetricsSummary.heartRateZoneDurations: object expected"); + message.heartRateZoneDurations = $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.fromObject(object.heartRateZoneDurations); + } + if (object.mobilityMetrics != null) { + if (typeof object.mobilityMetrics !== "object") + throw TypeError(".google.devicesandservices.health.v4.MetricsSummary.mobilityMetrics: object expected"); + message.mobilityMetrics = $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.fromObject(object.mobilityMetrics); + } return message; }; /** - * Creates a plain object from a RestingHeartRatePersonalRangeRollupValue message. Also converts values to other types if specified. + * Creates a plain object from a MetricsSummary message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue + * @memberof google.devicesandservices.health.v4.MetricsSummary * @static - * @param {google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue} message RestingHeartRatePersonalRangeRollupValue + * @param {google.devicesandservices.health.v4.MetricsSummary} message MetricsSummary * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestingHeartRatePersonalRangeRollupValue.toObject = function toObject(message, options) { + MetricsSummary.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.beatsPerMinuteMin != null && message.hasOwnProperty("beatsPerMinuteMin")) { - object.beatsPerMinuteMin = options.json && !isFinite(message.beatsPerMinuteMin) ? String(message.beatsPerMinuteMin) : message.beatsPerMinuteMin; + if (options.defaults) { + object.heartRateZoneDurations = null; + object.mobilityMetrics = null; + } + if (message.caloriesKcal != null && message.hasOwnProperty("caloriesKcal")) { + object.caloriesKcal = options.json && !isFinite(message.caloriesKcal) ? String(message.caloriesKcal) : message.caloriesKcal; if (options.oneofs) - object._beatsPerMinuteMin = "beatsPerMinuteMin"; + object._caloriesKcal = "caloriesKcal"; } - if (message.beatsPerMinuteMax != null && message.hasOwnProperty("beatsPerMinuteMax")) { - object.beatsPerMinuteMax = options.json && !isFinite(message.beatsPerMinuteMax) ? String(message.beatsPerMinuteMax) : message.beatsPerMinuteMax; + if (message.distanceMillimeters != null && message.hasOwnProperty("distanceMillimeters")) { + object.distanceMillimeters = options.json && !isFinite(message.distanceMillimeters) ? String(message.distanceMillimeters) : message.distanceMillimeters; if (options.oneofs) - object._beatsPerMinuteMax = "beatsPerMinuteMax"; + object._distanceMillimeters = "distanceMillimeters"; + } + if (message.steps != null && message.hasOwnProperty("steps")) { + if (typeof message.steps === "number") + object.steps = options.longs === String ? String(message.steps) : message.steps; + else + object.steps = options.longs === String ? $util.Long.prototype.toString.call(message.steps) : options.longs === Number ? new $util.LongBits(message.steps.low >>> 0, message.steps.high >>> 0).toNumber() : message.steps; + if (options.oneofs) + object._steps = "steps"; + } + if (message.averageSpeedMillimetersPerSecond != null && message.hasOwnProperty("averageSpeedMillimetersPerSecond")) { + object.averageSpeedMillimetersPerSecond = options.json && !isFinite(message.averageSpeedMillimetersPerSecond) ? String(message.averageSpeedMillimetersPerSecond) : message.averageSpeedMillimetersPerSecond; + if (options.oneofs) + object._averageSpeedMillimetersPerSecond = "averageSpeedMillimetersPerSecond"; + } + if (message.averagePaceSecondsPerMeter != null && message.hasOwnProperty("averagePaceSecondsPerMeter")) { + object.averagePaceSecondsPerMeter = options.json && !isFinite(message.averagePaceSecondsPerMeter) ? String(message.averagePaceSecondsPerMeter) : message.averagePaceSecondsPerMeter; + if (options.oneofs) + object._averagePaceSecondsPerMeter = "averagePaceSecondsPerMeter"; + } + if (message.averageHeartRateBeatsPerMinute != null && message.hasOwnProperty("averageHeartRateBeatsPerMinute")) { + if (typeof message.averageHeartRateBeatsPerMinute === "number") + object.averageHeartRateBeatsPerMinute = options.longs === String ? String(message.averageHeartRateBeatsPerMinute) : message.averageHeartRateBeatsPerMinute; + else + object.averageHeartRateBeatsPerMinute = options.longs === String ? $util.Long.prototype.toString.call(message.averageHeartRateBeatsPerMinute) : options.longs === Number ? new $util.LongBits(message.averageHeartRateBeatsPerMinute.low >>> 0, message.averageHeartRateBeatsPerMinute.high >>> 0).toNumber() : message.averageHeartRateBeatsPerMinute; + if (options.oneofs) + object._averageHeartRateBeatsPerMinute = "averageHeartRateBeatsPerMinute"; + } + if (message.elevationGainMillimeters != null && message.hasOwnProperty("elevationGainMillimeters")) { + object.elevationGainMillimeters = options.json && !isFinite(message.elevationGainMillimeters) ? String(message.elevationGainMillimeters) : message.elevationGainMillimeters; + if (options.oneofs) + object._elevationGainMillimeters = "elevationGainMillimeters"; + } + if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { + if (typeof message.activeZoneMinutes === "number") + object.activeZoneMinutes = options.longs === String ? String(message.activeZoneMinutes) : message.activeZoneMinutes; + else + object.activeZoneMinutes = options.longs === String ? $util.Long.prototype.toString.call(message.activeZoneMinutes) : options.longs === Number ? new $util.LongBits(message.activeZoneMinutes.low >>> 0, message.activeZoneMinutes.high >>> 0).toNumber() : message.activeZoneMinutes; + if (options.oneofs) + object._activeZoneMinutes = "activeZoneMinutes"; + } + if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { + object.runVo2Max = options.json && !isFinite(message.runVo2Max) ? String(message.runVo2Max) : message.runVo2Max; + if (options.oneofs) + object._runVo2Max = "runVo2Max"; + } + if (message.totalSwimLengths != null && message.hasOwnProperty("totalSwimLengths")) { + object.totalSwimLengths = options.json && !isFinite(message.totalSwimLengths) ? String(message.totalSwimLengths) : message.totalSwimLengths; + if (options.oneofs) + object._totalSwimLengths = "totalSwimLengths"; } + if (message.heartRateZoneDurations != null && message.hasOwnProperty("heartRateZoneDurations")) + object.heartRateZoneDurations = $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.toObject(message.heartRateZoneDurations, options); + if (message.mobilityMetrics != null && message.hasOwnProperty("mobilityMetrics")) + object.mobilityMetrics = $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.toObject(message.mobilityMetrics, options); return object; }; /** - * Converts this RestingHeartRatePersonalRangeRollupValue to JSON. + * Converts this MetricsSummary to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue + * @memberof google.devicesandservices.health.v4.MetricsSummary * @instance * @returns {Object.} JSON object */ - RestingHeartRatePersonalRangeRollupValue.prototype.toJSON = function toJSON() { + MetricsSummary.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RestingHeartRatePersonalRangeRollupValue + * Gets the default type url for MetricsSummary * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue + * @memberof google.devicesandservices.health.v4.MetricsSummary * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RestingHeartRatePersonalRangeRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MetricsSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.MetricsSummary"; }; - return RestingHeartRatePersonalRangeRollupValue; - })(); - - v4.RespiratoryRateSleepSummary = (function() { - - /** - * Properties of a RespiratoryRateSleepSummary. - * @memberof google.devicesandservices.health.v4 - * @interface IRespiratoryRateSleepSummary - * @property {google.devicesandservices.health.v4.IObservationSampleTime|null} [sampleTime] RespiratoryRateSleepSummary sampleTime - * @property {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null} [deepSleepStats] RespiratoryRateSleepSummary deepSleepStats - * @property {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null} [lightSleepStats] RespiratoryRateSleepSummary lightSleepStats - * @property {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null} [remSleepStats] RespiratoryRateSleepSummary remSleepStats - * @property {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null} [fullSleepStats] RespiratoryRateSleepSummary fullSleepStats - */ + MetricsSummary.TimeInHeartRateZones = (function() { - /** - * Constructs a new RespiratoryRateSleepSummary. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a RespiratoryRateSleepSummary. - * @implements IRespiratoryRateSleepSummary - * @constructor - * @param {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary=} [properties] Properties to set - */ - function RespiratoryRateSleepSummary(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a TimeInHeartRateZones. + * @memberof google.devicesandservices.health.v4.MetricsSummary + * @interface ITimeInHeartRateZones + * @property {google.protobuf.IDuration|null} [lightTime] TimeInHeartRateZones lightTime + * @property {google.protobuf.IDuration|null} [moderateTime] TimeInHeartRateZones moderateTime + * @property {google.protobuf.IDuration|null} [vigorousTime] TimeInHeartRateZones vigorousTime + * @property {google.protobuf.IDuration|null} [peakTime] TimeInHeartRateZones peakTime + */ - /** - * RespiratoryRateSleepSummary sampleTime. - * @member {google.devicesandservices.health.v4.IObservationSampleTime|null|undefined} sampleTime - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @instance - */ - RespiratoryRateSleepSummary.prototype.sampleTime = null; + /** + * Constructs a new TimeInHeartRateZones. + * @memberof google.devicesandservices.health.v4.MetricsSummary + * @classdesc Represents a TimeInHeartRateZones. + * @implements ITimeInHeartRateZones + * @constructor + * @param {google.devicesandservices.health.v4.MetricsSummary.ITimeInHeartRateZones=} [properties] Properties to set + */ + function TimeInHeartRateZones(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * RespiratoryRateSleepSummary deepSleepStats. - * @member {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null|undefined} deepSleepStats - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @instance - */ - RespiratoryRateSleepSummary.prototype.deepSleepStats = null; + /** + * TimeInHeartRateZones lightTime. + * @member {google.protobuf.IDuration|null|undefined} lightTime + * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @instance + */ + TimeInHeartRateZones.prototype.lightTime = null; - /** - * RespiratoryRateSleepSummary lightSleepStats. - * @member {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null|undefined} lightSleepStats - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @instance - */ - RespiratoryRateSleepSummary.prototype.lightSleepStats = null; + /** + * TimeInHeartRateZones moderateTime. + * @member {google.protobuf.IDuration|null|undefined} moderateTime + * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @instance + */ + TimeInHeartRateZones.prototype.moderateTime = null; - /** - * RespiratoryRateSleepSummary remSleepStats. - * @member {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null|undefined} remSleepStats - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @instance - */ - RespiratoryRateSleepSummary.prototype.remSleepStats = null; + /** + * TimeInHeartRateZones vigorousTime. + * @member {google.protobuf.IDuration|null|undefined} vigorousTime + * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @instance + */ + TimeInHeartRateZones.prototype.vigorousTime = null; - /** - * RespiratoryRateSleepSummary fullSleepStats. - * @member {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null|undefined} fullSleepStats - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @instance - */ - RespiratoryRateSleepSummary.prototype.fullSleepStats = null; + /** + * TimeInHeartRateZones peakTime. + * @member {google.protobuf.IDuration|null|undefined} peakTime + * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @instance + */ + TimeInHeartRateZones.prototype.peakTime = null; - /** - * Creates a new RespiratoryRateSleepSummary instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @static - * @param {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary} RespiratoryRateSleepSummary instance - */ - RespiratoryRateSleepSummary.create = function create(properties) { - return new RespiratoryRateSleepSummary(properties); - }; + /** + * Creates a new TimeInHeartRateZones instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @static + * @param {google.devicesandservices.health.v4.MetricsSummary.ITimeInHeartRateZones=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones} TimeInHeartRateZones instance + */ + TimeInHeartRateZones.create = function create(properties) { + return new TimeInHeartRateZones(properties); + }; - /** - * Encodes the specified RespiratoryRateSleepSummary message. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @static - * @param {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary} message RespiratoryRateSleepSummary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RespiratoryRateSleepSummary.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sampleTime != null && Object.hasOwnProperty.call(message, "sampleTime")) - $root.google.devicesandservices.health.v4.ObservationSampleTime.encode(message.sampleTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deepSleepStats != null && Object.hasOwnProperty.call(message, "deepSleepStats")) - $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.encode(message.deepSleepStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.lightSleepStats != null && Object.hasOwnProperty.call(message, "lightSleepStats")) - $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.encode(message.lightSleepStats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.remSleepStats != null && Object.hasOwnProperty.call(message, "remSleepStats")) - $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.encode(message.remSleepStats, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.fullSleepStats != null && Object.hasOwnProperty.call(message, "fullSleepStats")) - $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.encode(message.fullSleepStats, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified TimeInHeartRateZones message. Does not implicitly {@link google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @static + * @param {google.devicesandservices.health.v4.MetricsSummary.ITimeInHeartRateZones} message TimeInHeartRateZones message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeInHeartRateZones.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lightTime != null && Object.hasOwnProperty.call(message, "lightTime")) + $root.google.protobuf.Duration.encode(message.lightTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.moderateTime != null && Object.hasOwnProperty.call(message, "moderateTime")) + $root.google.protobuf.Duration.encode(message.moderateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.vigorousTime != null && Object.hasOwnProperty.call(message, "vigorousTime")) + $root.google.protobuf.Duration.encode(message.vigorousTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.peakTime != null && Object.hasOwnProperty.call(message, "peakTime")) + $root.google.protobuf.Duration.encode(message.peakTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified RespiratoryRateSleepSummary message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @static - * @param {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary} message RespiratoryRateSleepSummary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RespiratoryRateSleepSummary.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified TimeInHeartRateZones message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @static + * @param {google.devicesandservices.health.v4.MetricsSummary.ITimeInHeartRateZones} message TimeInHeartRateZones message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeInHeartRateZones.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a RespiratoryRateSleepSummary message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary} RespiratoryRateSleepSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RespiratoryRateSleepSummary.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.decode(reader, reader.uint32()); - break; - } - case 2: { - message.deepSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.decode(reader, reader.uint32()); - break; - } - case 3: { - message.lightSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.decode(reader, reader.uint32()); - break; - } - case 4: { - message.remSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.decode(reader, reader.uint32()); + /** + * Decodes a TimeInHeartRateZones message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones} TimeInHeartRateZones + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeInHeartRateZones.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; - } - case 5: { - message.fullSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.decode(reader, reader.uint32()); + switch (tag >>> 3) { + case 1: { + message.lightTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.moderateTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.vigorousTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.peakTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a RespiratoryRateSleepSummary message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary} RespiratoryRateSleepSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RespiratoryRateSleepSummary.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a TimeInHeartRateZones message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones} TimeInHeartRateZones + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeInHeartRateZones.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a RespiratoryRateSleepSummary message. - * @function verify - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RespiratoryRateSleepSummary.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { - var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); - if (error) - return "sampleTime." + error; - } - if (message.deepSleepStats != null && message.hasOwnProperty("deepSleepStats")) { - var error = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify(message.deepSleepStats); - if (error) - return "deepSleepStats." + error; - } - if (message.lightSleepStats != null && message.hasOwnProperty("lightSleepStats")) { - var error = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify(message.lightSleepStats); - if (error) - return "lightSleepStats." + error; - } - if (message.remSleepStats != null && message.hasOwnProperty("remSleepStats")) { - var error = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify(message.remSleepStats); - if (error) - return "remSleepStats." + error; - } - if (message.fullSleepStats != null && message.hasOwnProperty("fullSleepStats")) { - var error = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify(message.fullSleepStats); - if (error) - return "fullSleepStats." + error; - } - return null; - }; + /** + * Verifies a TimeInHeartRateZones message. + * @function verify + * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeInHeartRateZones.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lightTime != null && message.hasOwnProperty("lightTime")) { + var error = $root.google.protobuf.Duration.verify(message.lightTime); + if (error) + return "lightTime." + error; + } + if (message.moderateTime != null && message.hasOwnProperty("moderateTime")) { + var error = $root.google.protobuf.Duration.verify(message.moderateTime); + if (error) + return "moderateTime." + error; + } + if (message.vigorousTime != null && message.hasOwnProperty("vigorousTime")) { + var error = $root.google.protobuf.Duration.verify(message.vigorousTime); + if (error) + return "vigorousTime." + error; + } + if (message.peakTime != null && message.hasOwnProperty("peakTime")) { + var error = $root.google.protobuf.Duration.verify(message.peakTime); + if (error) + return "peakTime." + error; + } + return null; + }; - /** - * Creates a RespiratoryRateSleepSummary message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary} RespiratoryRateSleepSummary - */ - RespiratoryRateSleepSummary.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary) + /** + * Creates a TimeInHeartRateZones message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones} TimeInHeartRateZones + */ + TimeInHeartRateZones.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones) + return object; + var message = new $root.google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones(); + if (object.lightTime != null) { + if (typeof object.lightTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.lightTime: object expected"); + message.lightTime = $root.google.protobuf.Duration.fromObject(object.lightTime); + } + if (object.moderateTime != null) { + if (typeof object.moderateTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.moderateTime: object expected"); + message.moderateTime = $root.google.protobuf.Duration.fromObject(object.moderateTime); + } + if (object.vigorousTime != null) { + if (typeof object.vigorousTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.vigorousTime: object expected"); + message.vigorousTime = $root.google.protobuf.Duration.fromObject(object.vigorousTime); + } + if (object.peakTime != null) { + if (typeof object.peakTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones.peakTime: object expected"); + message.peakTime = $root.google.protobuf.Duration.fromObject(object.peakTime); + } + return message; + }; + + /** + * Creates a plain object from a TimeInHeartRateZones message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @static + * @param {google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones} message TimeInHeartRateZones + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeInHeartRateZones.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lightTime = null; + object.moderateTime = null; + object.vigorousTime = null; + object.peakTime = null; + } + if (message.lightTime != null && message.hasOwnProperty("lightTime")) + object.lightTime = $root.google.protobuf.Duration.toObject(message.lightTime, options); + if (message.moderateTime != null && message.hasOwnProperty("moderateTime")) + object.moderateTime = $root.google.protobuf.Duration.toObject(message.moderateTime, options); + if (message.vigorousTime != null && message.hasOwnProperty("vigorousTime")) + object.vigorousTime = $root.google.protobuf.Duration.toObject(message.vigorousTime, options); + if (message.peakTime != null && message.hasOwnProperty("peakTime")) + object.peakTime = $root.google.protobuf.Duration.toObject(message.peakTime, options); return object; - var message = new $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary(); - if (object.sampleTime != null) { - if (typeof object.sampleTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.RespiratoryRateSleepSummary.sampleTime: object expected"); - message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.fromObject(object.sampleTime); - } - if (object.deepSleepStats != null) { - if (typeof object.deepSleepStats !== "object") - throw TypeError(".google.devicesandservices.health.v4.RespiratoryRateSleepSummary.deepSleepStats: object expected"); - message.deepSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.fromObject(object.deepSleepStats); - } - if (object.lightSleepStats != null) { - if (typeof object.lightSleepStats !== "object") - throw TypeError(".google.devicesandservices.health.v4.RespiratoryRateSleepSummary.lightSleepStats: object expected"); - message.lightSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.fromObject(object.lightSleepStats); - } - if (object.remSleepStats != null) { - if (typeof object.remSleepStats !== "object") - throw TypeError(".google.devicesandservices.health.v4.RespiratoryRateSleepSummary.remSleepStats: object expected"); - message.remSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.fromObject(object.remSleepStats); - } - if (object.fullSleepStats != null) { - if (typeof object.fullSleepStats !== "object") - throw TypeError(".google.devicesandservices.health.v4.RespiratoryRateSleepSummary.fullSleepStats: object expected"); - message.fullSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.fromObject(object.fullSleepStats); - } - return message; - }; + }; - /** - * Creates a plain object from a RespiratoryRateSleepSummary message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @static - * @param {google.devicesandservices.health.v4.RespiratoryRateSleepSummary} message RespiratoryRateSleepSummary - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RespiratoryRateSleepSummary.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sampleTime = null; - object.deepSleepStats = null; - object.lightSleepStats = null; - object.remSleepStats = null; - object.fullSleepStats = null; - } - if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) - object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); - if (message.deepSleepStats != null && message.hasOwnProperty("deepSleepStats")) - object.deepSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.toObject(message.deepSleepStats, options); - if (message.lightSleepStats != null && message.hasOwnProperty("lightSleepStats")) - object.lightSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.toObject(message.lightSleepStats, options); - if (message.remSleepStats != null && message.hasOwnProperty("remSleepStats")) - object.remSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.toObject(message.remSleepStats, options); - if (message.fullSleepStats != null && message.hasOwnProperty("fullSleepStats")) - object.fullSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.toObject(message.fullSleepStats, options); - return object; - }; + /** + * Converts this TimeInHeartRateZones to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @instance + * @returns {Object.} JSON object + */ + TimeInHeartRateZones.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this RespiratoryRateSleepSummary to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @instance - * @returns {Object.} JSON object - */ - RespiratoryRateSleepSummary.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for TimeInHeartRateZones + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeInHeartRateZones.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.MetricsSummary.TimeInHeartRateZones"; + }; - /** - * Gets the default type url for RespiratoryRateSleepSummary - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RespiratoryRateSleepSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.RespiratoryRateSleepSummary"; - }; + return TimeInHeartRateZones; + })(); - RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics = (function() { + MetricsSummary.MobilityMetrics = (function() { /** - * Properties of a RespiratoryRateSleepSummaryStatistics. - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @interface IRespiratoryRateSleepSummaryStatistics - * @property {number|null} [breathsPerMinute] RespiratoryRateSleepSummaryStatistics breathsPerMinute - * @property {number|null} [standardDeviation] RespiratoryRateSleepSummaryStatistics standardDeviation - * @property {number|null} [signalToNoise] RespiratoryRateSleepSummaryStatistics signalToNoise + * Properties of a MobilityMetrics. + * @memberof google.devicesandservices.health.v4.MetricsSummary + * @interface IMobilityMetrics + * @property {number|null} [avgCadenceStepsPerMinute] MobilityMetrics avgCadenceStepsPerMinute + * @property {number|Long|null} [avgStrideLengthMillimeters] MobilityMetrics avgStrideLengthMillimeters + * @property {number|Long|null} [avgVerticalOscillationMillimeters] MobilityMetrics avgVerticalOscillationMillimeters + * @property {number|null} [avgVerticalRatio] MobilityMetrics avgVerticalRatio + * @property {google.protobuf.IDuration|null} [avgGroundContactTimeDuration] MobilityMetrics avgGroundContactTimeDuration */ /** - * Constructs a new RespiratoryRateSleepSummaryStatistics. - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary - * @classdesc Represents a RespiratoryRateSleepSummaryStatistics. - * @implements IRespiratoryRateSleepSummaryStatistics + * Constructs a new MobilityMetrics. + * @memberof google.devicesandservices.health.v4.MetricsSummary + * @classdesc Represents a MobilityMetrics. + * @implements IMobilityMetrics * @constructor - * @param {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.MetricsSummary.IMobilityMetrics=} [properties] Properties to set */ - function RespiratoryRateSleepSummaryStatistics(properties) { + function MobilityMetrics(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16110,105 +17799,160 @@ } /** - * RespiratoryRateSleepSummaryStatistics breathsPerMinute. - * @member {number} breathsPerMinute - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics + * MobilityMetrics avgCadenceStepsPerMinute. + * @member {number|null|undefined} avgCadenceStepsPerMinute + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics * @instance */ - RespiratoryRateSleepSummaryStatistics.prototype.breathsPerMinute = 0; + MobilityMetrics.prototype.avgCadenceStepsPerMinute = null; /** - * RespiratoryRateSleepSummaryStatistics standardDeviation. - * @member {number} standardDeviation - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics + * MobilityMetrics avgStrideLengthMillimeters. + * @member {number|Long|null|undefined} avgStrideLengthMillimeters + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics * @instance */ - RespiratoryRateSleepSummaryStatistics.prototype.standardDeviation = 0; + MobilityMetrics.prototype.avgStrideLengthMillimeters = null; /** - * RespiratoryRateSleepSummaryStatistics signalToNoise. - * @member {number} signalToNoise - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics + * MobilityMetrics avgVerticalOscillationMillimeters. + * @member {number|Long|null|undefined} avgVerticalOscillationMillimeters + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics * @instance */ - RespiratoryRateSleepSummaryStatistics.prototype.signalToNoise = 0; + MobilityMetrics.prototype.avgVerticalOscillationMillimeters = null; /** - * Creates a new RespiratoryRateSleepSummaryStatistics instance using the specified properties. + * MobilityMetrics avgVerticalRatio. + * @member {number|null|undefined} avgVerticalRatio + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * @instance + */ + MobilityMetrics.prototype.avgVerticalRatio = null; + + /** + * MobilityMetrics avgGroundContactTimeDuration. + * @member {google.protobuf.IDuration|null|undefined} avgGroundContactTimeDuration + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * @instance + */ + MobilityMetrics.prototype.avgGroundContactTimeDuration = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MobilityMetrics.prototype, "_avgCadenceStepsPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["avgCadenceStepsPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MobilityMetrics.prototype, "_avgStrideLengthMillimeters", { + get: $util.oneOfGetter($oneOfFields = ["avgStrideLengthMillimeters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MobilityMetrics.prototype, "_avgVerticalOscillationMillimeters", { + get: $util.oneOfGetter($oneOfFields = ["avgVerticalOscillationMillimeters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MobilityMetrics.prototype, "_avgVerticalRatio", { + get: $util.oneOfGetter($oneOfFields = ["avgVerticalRatio"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MobilityMetrics instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics * @static - * @param {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics} RespiratoryRateSleepSummaryStatistics instance + * @param {google.devicesandservices.health.v4.MetricsSummary.IMobilityMetrics=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics} MobilityMetrics instance */ - RespiratoryRateSleepSummaryStatistics.create = function create(properties) { - return new RespiratoryRateSleepSummaryStatistics(properties); + MobilityMetrics.create = function create(properties) { + return new MobilityMetrics(properties); }; /** - * Encodes the specified RespiratoryRateSleepSummaryStatistics message. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify|verify} messages. + * Encodes the specified MobilityMetrics message. Does not implicitly {@link google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics * @static - * @param {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics} message RespiratoryRateSleepSummaryStatistics message or plain object to encode + * @param {google.devicesandservices.health.v4.MetricsSummary.IMobilityMetrics} message MobilityMetrics message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RespiratoryRateSleepSummaryStatistics.encode = function encode(message, writer) { + MobilityMetrics.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.breathsPerMinute != null && Object.hasOwnProperty.call(message, "breathsPerMinute")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.breathsPerMinute); - if (message.standardDeviation != null && Object.hasOwnProperty.call(message, "standardDeviation")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.standardDeviation); - if (message.signalToNoise != null && Object.hasOwnProperty.call(message, "signalToNoise")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.signalToNoise); + if (message.avgCadenceStepsPerMinute != null && Object.hasOwnProperty.call(message, "avgCadenceStepsPerMinute")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.avgCadenceStepsPerMinute); + if (message.avgStrideLengthMillimeters != null && Object.hasOwnProperty.call(message, "avgStrideLengthMillimeters")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.avgStrideLengthMillimeters); + if (message.avgVerticalOscillationMillimeters != null && Object.hasOwnProperty.call(message, "avgVerticalOscillationMillimeters")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.avgVerticalOscillationMillimeters); + if (message.avgVerticalRatio != null && Object.hasOwnProperty.call(message, "avgVerticalRatio")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.avgVerticalRatio); + if (message.avgGroundContactTimeDuration != null && Object.hasOwnProperty.call(message, "avgGroundContactTimeDuration")) + $root.google.protobuf.Duration.encode(message.avgGroundContactTimeDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified RespiratoryRateSleepSummaryStatistics message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify|verify} messages. + * Encodes the specified MobilityMetrics message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics * @static - * @param {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics} message RespiratoryRateSleepSummaryStatistics message or plain object to encode + * @param {google.devicesandservices.health.v4.MetricsSummary.IMobilityMetrics} message MobilityMetrics message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RespiratoryRateSleepSummaryStatistics.encodeDelimited = function encodeDelimited(message, writer) { + MobilityMetrics.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RespiratoryRateSleepSummaryStatistics message from the specified reader or buffer. + * Decodes a MobilityMetrics message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics} RespiratoryRateSleepSummaryStatistics + * @returns {google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics} MobilityMetrics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RespiratoryRateSleepSummaryStatistics.decode = function decode(reader, length, error) { + MobilityMetrics.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.breathsPerMinute = reader.double(); + message.avgCadenceStepsPerMinute = reader.double(); break; } case 2: { - message.standardDeviation = reader.double(); + message.avgStrideLengthMillimeters = reader.int64(); break; } case 3: { - message.signalToNoise = reader.double(); + message.avgVerticalOscillationMillimeters = reader.int64(); + break; + } + case 4: { + message.avgVerticalRatio = reader.double(); + break; + } + case 5: { + message.avgGroundContactTimeDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } default: @@ -16220,151 +17964,200 @@ }; /** - * Decodes a RespiratoryRateSleepSummaryStatistics message from the specified reader or buffer, length delimited. + * Decodes a MobilityMetrics message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics} RespiratoryRateSleepSummaryStatistics + * @returns {google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics} MobilityMetrics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RespiratoryRateSleepSummaryStatistics.decodeDelimited = function decodeDelimited(reader) { + MobilityMetrics.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RespiratoryRateSleepSummaryStatistics message. + * Verifies a MobilityMetrics message. * @function verify - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RespiratoryRateSleepSummaryStatistics.verify = function verify(message) { + MobilityMetrics.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.breathsPerMinute != null && message.hasOwnProperty("breathsPerMinute")) - if (typeof message.breathsPerMinute !== "number") - return "breathsPerMinute: number expected"; - if (message.standardDeviation != null && message.hasOwnProperty("standardDeviation")) - if (typeof message.standardDeviation !== "number") - return "standardDeviation: number expected"; - if (message.signalToNoise != null && message.hasOwnProperty("signalToNoise")) - if (typeof message.signalToNoise !== "number") - return "signalToNoise: number expected"; + var properties = {}; + if (message.avgCadenceStepsPerMinute != null && message.hasOwnProperty("avgCadenceStepsPerMinute")) { + properties._avgCadenceStepsPerMinute = 1; + if (typeof message.avgCadenceStepsPerMinute !== "number") + return "avgCadenceStepsPerMinute: number expected"; + } + if (message.avgStrideLengthMillimeters != null && message.hasOwnProperty("avgStrideLengthMillimeters")) { + properties._avgStrideLengthMillimeters = 1; + if (!$util.isInteger(message.avgStrideLengthMillimeters) && !(message.avgStrideLengthMillimeters && $util.isInteger(message.avgStrideLengthMillimeters.low) && $util.isInteger(message.avgStrideLengthMillimeters.high))) + return "avgStrideLengthMillimeters: integer|Long expected"; + } + if (message.avgVerticalOscillationMillimeters != null && message.hasOwnProperty("avgVerticalOscillationMillimeters")) { + properties._avgVerticalOscillationMillimeters = 1; + if (!$util.isInteger(message.avgVerticalOscillationMillimeters) && !(message.avgVerticalOscillationMillimeters && $util.isInteger(message.avgVerticalOscillationMillimeters.low) && $util.isInteger(message.avgVerticalOscillationMillimeters.high))) + return "avgVerticalOscillationMillimeters: integer|Long expected"; + } + if (message.avgVerticalRatio != null && message.hasOwnProperty("avgVerticalRatio")) { + properties._avgVerticalRatio = 1; + if (typeof message.avgVerticalRatio !== "number") + return "avgVerticalRatio: number expected"; + } + if (message.avgGroundContactTimeDuration != null && message.hasOwnProperty("avgGroundContactTimeDuration")) { + var error = $root.google.protobuf.Duration.verify(message.avgGroundContactTimeDuration); + if (error) + return "avgGroundContactTimeDuration." + error; + } return null; }; /** - * Creates a RespiratoryRateSleepSummaryStatistics message from a plain object. Also converts values to their respective internal types. + * Creates a MobilityMetrics message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics} RespiratoryRateSleepSummaryStatistics + * @returns {google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics} MobilityMetrics */ - RespiratoryRateSleepSummaryStatistics.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics) + MobilityMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics) return object; - var message = new $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics(); - if (object.breathsPerMinute != null) - message.breathsPerMinute = Number(object.breathsPerMinute); - if (object.standardDeviation != null) - message.standardDeviation = Number(object.standardDeviation); - if (object.signalToNoise != null) - message.signalToNoise = Number(object.signalToNoise); - return message; - }; - - /** - * Creates a plain object from a RespiratoryRateSleepSummaryStatistics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics - * @static - * @param {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics} message RespiratoryRateSleepSummaryStatistics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RespiratoryRateSleepSummaryStatistics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.breathsPerMinute = 0; - object.standardDeviation = 0; - object.signalToNoise = 0; + var message = new $root.google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics(); + if (object.avgCadenceStepsPerMinute != null) + message.avgCadenceStepsPerMinute = Number(object.avgCadenceStepsPerMinute); + if (object.avgStrideLengthMillimeters != null) + if ($util.Long) + (message.avgStrideLengthMillimeters = $util.Long.fromValue(object.avgStrideLengthMillimeters)).unsigned = false; + else if (typeof object.avgStrideLengthMillimeters === "string") + message.avgStrideLengthMillimeters = parseInt(object.avgStrideLengthMillimeters, 10); + else if (typeof object.avgStrideLengthMillimeters === "number") + message.avgStrideLengthMillimeters = object.avgStrideLengthMillimeters; + else if (typeof object.avgStrideLengthMillimeters === "object") + message.avgStrideLengthMillimeters = new $util.LongBits(object.avgStrideLengthMillimeters.low >>> 0, object.avgStrideLengthMillimeters.high >>> 0).toNumber(); + if (object.avgVerticalOscillationMillimeters != null) + if ($util.Long) + (message.avgVerticalOscillationMillimeters = $util.Long.fromValue(object.avgVerticalOscillationMillimeters)).unsigned = false; + else if (typeof object.avgVerticalOscillationMillimeters === "string") + message.avgVerticalOscillationMillimeters = parseInt(object.avgVerticalOscillationMillimeters, 10); + else if (typeof object.avgVerticalOscillationMillimeters === "number") + message.avgVerticalOscillationMillimeters = object.avgVerticalOscillationMillimeters; + else if (typeof object.avgVerticalOscillationMillimeters === "object") + message.avgVerticalOscillationMillimeters = new $util.LongBits(object.avgVerticalOscillationMillimeters.low >>> 0, object.avgVerticalOscillationMillimeters.high >>> 0).toNumber(); + if (object.avgVerticalRatio != null) + message.avgVerticalRatio = Number(object.avgVerticalRatio); + if (object.avgGroundContactTimeDuration != null) { + if (typeof object.avgGroundContactTimeDuration !== "object") + throw TypeError(".google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics.avgGroundContactTimeDuration: object expected"); + message.avgGroundContactTimeDuration = $root.google.protobuf.Duration.fromObject(object.avgGroundContactTimeDuration); } - if (message.breathsPerMinute != null && message.hasOwnProperty("breathsPerMinute")) - object.breathsPerMinute = options.json && !isFinite(message.breathsPerMinute) ? String(message.breathsPerMinute) : message.breathsPerMinute; - if (message.standardDeviation != null && message.hasOwnProperty("standardDeviation")) - object.standardDeviation = options.json && !isFinite(message.standardDeviation) ? String(message.standardDeviation) : message.standardDeviation; - if (message.signalToNoise != null && message.hasOwnProperty("signalToNoise")) - object.signalToNoise = options.json && !isFinite(message.signalToNoise) ? String(message.signalToNoise) : message.signalToNoise; + return message; + }; + + /** + * Creates a plain object from a MobilityMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics + * @static + * @param {google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics} message MobilityMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MobilityMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.avgGroundContactTimeDuration = null; + if (message.avgCadenceStepsPerMinute != null && message.hasOwnProperty("avgCadenceStepsPerMinute")) { + object.avgCadenceStepsPerMinute = options.json && !isFinite(message.avgCadenceStepsPerMinute) ? String(message.avgCadenceStepsPerMinute) : message.avgCadenceStepsPerMinute; + if (options.oneofs) + object._avgCadenceStepsPerMinute = "avgCadenceStepsPerMinute"; + } + if (message.avgStrideLengthMillimeters != null && message.hasOwnProperty("avgStrideLengthMillimeters")) { + if (typeof message.avgStrideLengthMillimeters === "number") + object.avgStrideLengthMillimeters = options.longs === String ? String(message.avgStrideLengthMillimeters) : message.avgStrideLengthMillimeters; + else + object.avgStrideLengthMillimeters = options.longs === String ? $util.Long.prototype.toString.call(message.avgStrideLengthMillimeters) : options.longs === Number ? new $util.LongBits(message.avgStrideLengthMillimeters.low >>> 0, message.avgStrideLengthMillimeters.high >>> 0).toNumber() : message.avgStrideLengthMillimeters; + if (options.oneofs) + object._avgStrideLengthMillimeters = "avgStrideLengthMillimeters"; + } + if (message.avgVerticalOscillationMillimeters != null && message.hasOwnProperty("avgVerticalOscillationMillimeters")) { + if (typeof message.avgVerticalOscillationMillimeters === "number") + object.avgVerticalOscillationMillimeters = options.longs === String ? String(message.avgVerticalOscillationMillimeters) : message.avgVerticalOscillationMillimeters; + else + object.avgVerticalOscillationMillimeters = options.longs === String ? $util.Long.prototype.toString.call(message.avgVerticalOscillationMillimeters) : options.longs === Number ? new $util.LongBits(message.avgVerticalOscillationMillimeters.low >>> 0, message.avgVerticalOscillationMillimeters.high >>> 0).toNumber() : message.avgVerticalOscillationMillimeters; + if (options.oneofs) + object._avgVerticalOscillationMillimeters = "avgVerticalOscillationMillimeters"; + } + if (message.avgVerticalRatio != null && message.hasOwnProperty("avgVerticalRatio")) { + object.avgVerticalRatio = options.json && !isFinite(message.avgVerticalRatio) ? String(message.avgVerticalRatio) : message.avgVerticalRatio; + if (options.oneofs) + object._avgVerticalRatio = "avgVerticalRatio"; + } + if (message.avgGroundContactTimeDuration != null && message.hasOwnProperty("avgGroundContactTimeDuration")) + object.avgGroundContactTimeDuration = $root.google.protobuf.Duration.toObject(message.avgGroundContactTimeDuration, options); return object; }; /** - * Converts this RespiratoryRateSleepSummaryStatistics to JSON. + * Converts this MobilityMetrics to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics * @instance * @returns {Object.} JSON object */ - RespiratoryRateSleepSummaryStatistics.prototype.toJSON = function toJSON() { + MobilityMetrics.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RespiratoryRateSleepSummaryStatistics + * Gets the default type url for MobilityMetrics * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics + * @memberof google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RespiratoryRateSleepSummaryStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MobilityMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.MetricsSummary.MobilityMetrics"; }; - return RespiratoryRateSleepSummaryStatistics; + return MobilityMetrics; })(); - return RespiratoryRateSleepSummary; + return MetricsSummary; })(); - v4.Sleep = (function() { + v4.WeightQuantity = (function() { /** - * Properties of a Sleep. + * Properties of a WeightQuantity. * @memberof google.devicesandservices.health.v4 - * @interface ISleep - * @property {google.devicesandservices.health.v4.ISessionTimeInterval|null} [interval] Sleep interval - * @property {google.devicesandservices.health.v4.Sleep.SleepType|null} [type] Sleep type - * @property {Array.|null} [stages] Sleep stages - * @property {Array.|null} [outOfBedSegments] Sleep outOfBedSegments - * @property {google.devicesandservices.health.v4.Sleep.ISleepMetadata|null} [metadata] Sleep metadata - * @property {google.devicesandservices.health.v4.Sleep.ISleepSummary|null} [summary] Sleep summary - * @property {google.protobuf.ITimestamp|null} [createTime] Sleep createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Sleep updateTime + * @interface IWeightQuantity + * @property {number|null} [grams] WeightQuantity grams + * @property {google.devicesandservices.health.v4.WeightUnit|null} [userProvidedUnit] WeightQuantity userProvidedUnit */ /** - * Constructs a new Sleep. + * Constructs a new WeightQuantity. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a Sleep. - * @implements ISleep + * @classdesc Represents a WeightQuantity. + * @implements IWeightQuantity * @constructor - * @param {google.devicesandservices.health.v4.ISleep=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IWeightQuantity=} [properties] Properties to set */ - function Sleep(properties) { - this.stages = []; - this.outOfBedSegments = []; + function WeightQuantity(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16372,181 +18165,100 @@ } /** - * Sleep interval. - * @member {google.devicesandservices.health.v4.ISessionTimeInterval|null|undefined} interval - * @memberof google.devicesandservices.health.v4.Sleep - * @instance - */ - Sleep.prototype.interval = null; - - /** - * Sleep type. - * @member {google.devicesandservices.health.v4.Sleep.SleepType} type - * @memberof google.devicesandservices.health.v4.Sleep - * @instance - */ - Sleep.prototype.type = 0; - - /** - * Sleep stages. - * @member {Array.} stages - * @memberof google.devicesandservices.health.v4.Sleep - * @instance - */ - Sleep.prototype.stages = $util.emptyArray; - - /** - * Sleep outOfBedSegments. - * @member {Array.} outOfBedSegments - * @memberof google.devicesandservices.health.v4.Sleep - * @instance - */ - Sleep.prototype.outOfBedSegments = $util.emptyArray; - - /** - * Sleep metadata. - * @member {google.devicesandservices.health.v4.Sleep.ISleepMetadata|null|undefined} metadata - * @memberof google.devicesandservices.health.v4.Sleep + * WeightQuantity grams. + * @member {number|null|undefined} grams + * @memberof google.devicesandservices.health.v4.WeightQuantity * @instance */ - Sleep.prototype.metadata = null; + WeightQuantity.prototype.grams = null; /** - * Sleep summary. - * @member {google.devicesandservices.health.v4.Sleep.ISleepSummary|null|undefined} summary - * @memberof google.devicesandservices.health.v4.Sleep + * WeightQuantity userProvidedUnit. + * @member {google.devicesandservices.health.v4.WeightUnit} userProvidedUnit + * @memberof google.devicesandservices.health.v4.WeightQuantity * @instance */ - Sleep.prototype.summary = null; + WeightQuantity.prototype.userProvidedUnit = 0; - /** - * Sleep createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.devicesandservices.health.v4.Sleep - * @instance - */ - Sleep.prototype.createTime = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Sleep updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.devicesandservices.health.v4.Sleep - * @instance - */ - Sleep.prototype.updateTime = null; + // Virtual OneOf for proto3 optional field + Object.defineProperty(WeightQuantity.prototype, "_grams", { + get: $util.oneOfGetter($oneOfFields = ["grams"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Sleep instance using the specified properties. + * Creates a new WeightQuantity instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.Sleep + * @memberof google.devicesandservices.health.v4.WeightQuantity * @static - * @param {google.devicesandservices.health.v4.ISleep=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.Sleep} Sleep instance + * @param {google.devicesandservices.health.v4.IWeightQuantity=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.WeightQuantity} WeightQuantity instance */ - Sleep.create = function create(properties) { - return new Sleep(properties); + WeightQuantity.create = function create(properties) { + return new WeightQuantity(properties); }; /** - * Encodes the specified Sleep message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.verify|verify} messages. + * Encodes the specified WeightQuantity message. Does not implicitly {@link google.devicesandservices.health.v4.WeightQuantity.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.Sleep + * @memberof google.devicesandservices.health.v4.WeightQuantity * @static - * @param {google.devicesandservices.health.v4.ISleep} message Sleep message or plain object to encode + * @param {google.devicesandservices.health.v4.IWeightQuantity} message WeightQuantity message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Sleep.encode = function encode(message, writer) { + WeightQuantity.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) - $root.google.devicesandservices.health.v4.SessionTimeInterval.encode(message.interval, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); - if (message.stages != null && message.stages.length) - for (var i = 0; i < message.stages.length; ++i) - $root.google.devicesandservices.health.v4.Sleep.SleepStage.encode(message.stages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.outOfBedSegments != null && message.outOfBedSegments.length) - for (var i = 0; i < message.outOfBedSegments.length; ++i) - $root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment.encode(message.outOfBedSegments[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.devicesandservices.health.v4.Sleep.SleepMetadata.encode(message.metadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) - $root.google.devicesandservices.health.v4.Sleep.SleepSummary.encode(message.summary, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.grams != null && Object.hasOwnProperty.call(message, "grams")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.grams); + if (message.userProvidedUnit != null && Object.hasOwnProperty.call(message, "userProvidedUnit")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.userProvidedUnit); return writer; }; /** - * Encodes the specified Sleep message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.verify|verify} messages. + * Encodes the specified WeightQuantity message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.WeightQuantity.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.Sleep + * @memberof google.devicesandservices.health.v4.WeightQuantity * @static - * @param {google.devicesandservices.health.v4.ISleep} message Sleep message or plain object to encode + * @param {google.devicesandservices.health.v4.IWeightQuantity} message WeightQuantity message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Sleep.encodeDelimited = function encodeDelimited(message, writer) { + WeightQuantity.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Sleep message from the specified reader or buffer. + * Decodes a WeightQuantity message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.Sleep + * @memberof google.devicesandservices.health.v4.WeightQuantity * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.Sleep} Sleep + * @returns {google.devicesandservices.health.v4.WeightQuantity} WeightQuantity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Sleep.decode = function decode(reader, length, error) { + WeightQuantity.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Sleep(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.WeightQuantity(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 3: { - message.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.decode(reader, reader.uint32()); - break; - } - case 4: { - message.type = reader.int32(); - break; - } - case 5: { - if (!(message.stages && message.stages.length)) - message.stages = []; - message.stages.push($root.google.devicesandservices.health.v4.Sleep.SleepStage.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.outOfBedSegments && message.outOfBedSegments.length)) - message.outOfBedSegments = []; - message.outOfBedSegments.push($root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment.decode(reader, reader.uint32())); - break; - } - case 8: { - message.metadata = $root.google.devicesandservices.health.v4.Sleep.SleepMetadata.decode(reader, reader.uint32()); - break; - } - case 9: { - message.summary = $root.google.devicesandservices.health.v4.Sleep.SleepSummary.decode(reader, reader.uint32()); - break; - } - case 10: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 1: { + message.grams = reader.double(); break; } - case 11: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 2: { + message.userProvidedUnit = reader.int32(); break; } default: @@ -16558,1112 +18270,1551 @@ }; /** - * Decodes a Sleep message from the specified reader or buffer, length delimited. + * Decodes a WeightQuantity message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.Sleep + * @memberof google.devicesandservices.health.v4.WeightQuantity * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.Sleep} Sleep + * @returns {google.devicesandservices.health.v4.WeightQuantity} WeightQuantity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Sleep.decodeDelimited = function decodeDelimited(reader) { + WeightQuantity.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Sleep message. + * Verifies a WeightQuantity message. * @function verify - * @memberof google.devicesandservices.health.v4.Sleep + * @memberof google.devicesandservices.health.v4.WeightQuantity * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Sleep.verify = function verify(message) { + WeightQuantity.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.interval != null && message.hasOwnProperty("interval")) { - var error = $root.google.devicesandservices.health.v4.SessionTimeInterval.verify(message.interval); - if (error) - return "interval." + error; + var properties = {}; + if (message.grams != null && message.hasOwnProperty("grams")) { + properties._grams = 1; + if (typeof message.grams !== "number") + return "grams: number expected"; } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { + if (message.userProvidedUnit != null && message.hasOwnProperty("userProvidedUnit")) + switch (message.userProvidedUnit) { default: - return "type: enum value expected"; + return "userProvidedUnit: enum value expected"; case 0: case 1: case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: break; } - if (message.stages != null && message.hasOwnProperty("stages")) { - if (!Array.isArray(message.stages)) - return "stages: array expected"; - for (var i = 0; i < message.stages.length; ++i) { - var error = $root.google.devicesandservices.health.v4.Sleep.SleepStage.verify(message.stages[i]); - if (error) - return "stages." + error; - } - } - if (message.outOfBedSegments != null && message.hasOwnProperty("outOfBedSegments")) { - if (!Array.isArray(message.outOfBedSegments)) - return "outOfBedSegments: array expected"; - for (var i = 0; i < message.outOfBedSegments.length; ++i) { - var error = $root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment.verify(message.outOfBedSegments[i]); - if (error) - return "outOfBedSegments." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.devicesandservices.health.v4.Sleep.SleepMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.summary != null && message.hasOwnProperty("summary")) { - var error = $root.google.devicesandservices.health.v4.Sleep.SleepSummary.verify(message.summary); - if (error) - return "summary." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } return null; }; /** - * Creates a Sleep message from a plain object. Also converts values to their respective internal types. + * Creates a WeightQuantity message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.Sleep + * @memberof google.devicesandservices.health.v4.WeightQuantity * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.Sleep} Sleep + * @returns {google.devicesandservices.health.v4.WeightQuantity} WeightQuantity */ - Sleep.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.Sleep) + WeightQuantity.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.WeightQuantity) return object; - var message = new $root.google.devicesandservices.health.v4.Sleep(); - if (object.interval != null) { - if (typeof object.interval !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.interval: object expected"); - message.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.fromObject(object.interval); - } - switch (object.type) { + var message = new $root.google.devicesandservices.health.v4.WeightQuantity(); + if (object.grams != null) + message.grams = Number(object.grams); + switch (object.userProvidedUnit) { default: - if (typeof object.type === "number") { - message.type = object.type; + if (typeof object.userProvidedUnit === "number") { + message.userProvidedUnit = object.userProvidedUnit; break; } break; - case "SLEEP_TYPE_UNSPECIFIED": + case "WEIGHT_UNIT_UNSPECIFIED": case 0: - message.type = 0; + message.userProvidedUnit = 0; break; - case "CLASSIC": + case "GRAM": case 1: - message.type = 1; + message.userProvidedUnit = 1; break; - case "STAGES": + case "KILOGRAM": case 2: - message.type = 2; + message.userProvidedUnit = 2; + break; + case "OUNCE": + case 3: + message.userProvidedUnit = 3; + break; + case "POUND": + case 4: + message.userProvidedUnit = 4; + break; + case "STONE": + case 5: + message.userProvidedUnit = 5; + break; + case "MILLIGRAM": + case 6: + message.userProvidedUnit = 6; + break; + case "MICROGRAM": + case 7: + message.userProvidedUnit = 7; + break; + case "NANOGRAM": + case 8: + message.userProvidedUnit = 8; break; - } - if (object.stages) { - if (!Array.isArray(object.stages)) - throw TypeError(".google.devicesandservices.health.v4.Sleep.stages: array expected"); - message.stages = []; - for (var i = 0; i < object.stages.length; ++i) { - if (typeof object.stages[i] !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.stages: object expected"); - message.stages[i] = $root.google.devicesandservices.health.v4.Sleep.SleepStage.fromObject(object.stages[i]); - } - } - if (object.outOfBedSegments) { - if (!Array.isArray(object.outOfBedSegments)) - throw TypeError(".google.devicesandservices.health.v4.Sleep.outOfBedSegments: array expected"); - message.outOfBedSegments = []; - for (var i = 0; i < object.outOfBedSegments.length; ++i) { - if (typeof object.outOfBedSegments[i] !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.outOfBedSegments: object expected"); - message.outOfBedSegments[i] = $root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment.fromObject(object.outOfBedSegments[i]); - } - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.metadata: object expected"); - message.metadata = $root.google.devicesandservices.health.v4.Sleep.SleepMetadata.fromObject(object.metadata); - } - if (object.summary != null) { - if (typeof object.summary !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.summary: object expected"); - message.summary = $root.google.devicesandservices.health.v4.Sleep.SleepSummary.fromObject(object.summary); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } return message; }; /** - * Creates a plain object from a Sleep message. Also converts values to other types if specified. + * Creates a plain object from a WeightQuantity message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.Sleep + * @memberof google.devicesandservices.health.v4.WeightQuantity * @static - * @param {google.devicesandservices.health.v4.Sleep} message Sleep + * @param {google.devicesandservices.health.v4.WeightQuantity} message WeightQuantity * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Sleep.toObject = function toObject(message, options) { + WeightQuantity.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.stages = []; - object.outOfBedSegments = []; - } - if (options.defaults) { - object.interval = null; - object.type = options.enums === String ? "SLEEP_TYPE_UNSPECIFIED" : 0; - object.metadata = null; - object.summary = null; - object.createTime = null; - object.updateTime = null; - } - if (message.interval != null && message.hasOwnProperty("interval")) - object.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.toObject(message.interval, options); - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.devicesandservices.health.v4.Sleep.SleepType[message.type] === undefined ? message.type : $root.google.devicesandservices.health.v4.Sleep.SleepType[message.type] : message.type; - if (message.stages && message.stages.length) { - object.stages = []; - for (var j = 0; j < message.stages.length; ++j) - object.stages[j] = $root.google.devicesandservices.health.v4.Sleep.SleepStage.toObject(message.stages[j], options); - } - if (message.outOfBedSegments && message.outOfBedSegments.length) { - object.outOfBedSegments = []; - for (var j = 0; j < message.outOfBedSegments.length; ++j) - object.outOfBedSegments[j] = $root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment.toObject(message.outOfBedSegments[j], options); + if (options.defaults) + object.userProvidedUnit = options.enums === String ? "WEIGHT_UNIT_UNSPECIFIED" : 0; + if (message.grams != null && message.hasOwnProperty("grams")) { + object.grams = options.json && !isFinite(message.grams) ? String(message.grams) : message.grams; + if (options.oneofs) + object._grams = "grams"; } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.devicesandservices.health.v4.Sleep.SleepMetadata.toObject(message.metadata, options); - if (message.summary != null && message.hasOwnProperty("summary")) - object.summary = $root.google.devicesandservices.health.v4.Sleep.SleepSummary.toObject(message.summary, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.userProvidedUnit != null && message.hasOwnProperty("userProvidedUnit")) + object.userProvidedUnit = options.enums === String ? $root.google.devicesandservices.health.v4.WeightUnit[message.userProvidedUnit] === undefined ? message.userProvidedUnit : $root.google.devicesandservices.health.v4.WeightUnit[message.userProvidedUnit] : message.userProvidedUnit; return object; }; /** - * Converts this Sleep to JSON. + * Converts this WeightQuantity to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.Sleep + * @memberof google.devicesandservices.health.v4.WeightQuantity * @instance * @returns {Object.} JSON object */ - Sleep.prototype.toJSON = function toJSON() { + WeightQuantity.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Sleep + * Gets the default type url for WeightQuantity * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.Sleep + * @memberof google.devicesandservices.health.v4.WeightQuantity * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Sleep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + WeightQuantity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.Sleep"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.WeightQuantity"; }; - Sleep.SleepStage = (function() { + return WeightQuantity; + })(); - /** - * Properties of a SleepStage. - * @memberof google.devicesandservices.health.v4.Sleep - * @interface ISleepStage - * @property {google.protobuf.ITimestamp|null} [startTime] SleepStage startTime - * @property {google.protobuf.IDuration|null} [startUtcOffset] SleepStage startUtcOffset - * @property {google.protobuf.ITimestamp|null} [endTime] SleepStage endTime - * @property {google.protobuf.IDuration|null} [endUtcOffset] SleepStage endUtcOffset - * @property {google.devicesandservices.health.v4.Sleep.SleepStageType|null} [type] SleepStage type - * @property {google.protobuf.ITimestamp|null} [createTime] SleepStage createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] SleepStage updateTime - */ + v4.EnergyQuantity = (function() { - /** - * Constructs a new SleepStage. - * @memberof google.devicesandservices.health.v4.Sleep - * @classdesc Represents a SleepStage. - * @implements ISleepStage - * @constructor - * @param {google.devicesandservices.health.v4.Sleep.ISleepStage=} [properties] Properties to set - */ - function SleepStage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an EnergyQuantity. + * @memberof google.devicesandservices.health.v4 + * @interface IEnergyQuantity + * @property {number|null} [kcal] EnergyQuantity kcal + * @property {google.devicesandservices.health.v4.EnergyUnit|null} [userProvidedUnit] EnergyQuantity userProvidedUnit + */ - /** - * SleepStage startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @instance - */ - SleepStage.prototype.startTime = null; + /** + * Constructs a new EnergyQuantity. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents an EnergyQuantity. + * @implements IEnergyQuantity + * @constructor + * @param {google.devicesandservices.health.v4.IEnergyQuantity=} [properties] Properties to set + */ + function EnergyQuantity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * SleepStage startUtcOffset. - * @member {google.protobuf.IDuration|null|undefined} startUtcOffset - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @instance - */ - SleepStage.prototype.startUtcOffset = null; + /** + * EnergyQuantity kcal. + * @member {number|null|undefined} kcal + * @memberof google.devicesandservices.health.v4.EnergyQuantity + * @instance + */ + EnergyQuantity.prototype.kcal = null; - /** - * SleepStage endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @instance - */ - SleepStage.prototype.endTime = null; + /** + * EnergyQuantity userProvidedUnit. + * @member {google.devicesandservices.health.v4.EnergyUnit} userProvidedUnit + * @memberof google.devicesandservices.health.v4.EnergyQuantity + * @instance + */ + EnergyQuantity.prototype.userProvidedUnit = 0; - /** - * SleepStage endUtcOffset. - * @member {google.protobuf.IDuration|null|undefined} endUtcOffset - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @instance - */ - SleepStage.prototype.endUtcOffset = null; - - /** - * SleepStage type. - * @member {google.devicesandservices.health.v4.Sleep.SleepStageType} type - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @instance - */ - SleepStage.prototype.type = 0; - - /** - * SleepStage createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @instance - */ - SleepStage.prototype.createTime = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * SleepStage updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @instance - */ - SleepStage.prototype.updateTime = null; + // Virtual OneOf for proto3 optional field + Object.defineProperty(EnergyQuantity.prototype, "_kcal", { + get: $util.oneOfGetter($oneOfFields = ["kcal"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Creates a new SleepStage instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @static - * @param {google.devicesandservices.health.v4.Sleep.ISleepStage=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.Sleep.SleepStage} SleepStage instance - */ - SleepStage.create = function create(properties) { - return new SleepStage(properties); - }; + /** + * Creates a new EnergyQuantity instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.EnergyQuantity + * @static + * @param {google.devicesandservices.health.v4.IEnergyQuantity=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.EnergyQuantity} EnergyQuantity instance + */ + EnergyQuantity.create = function create(properties) { + return new EnergyQuantity(properties); + }; - /** - * Encodes the specified SleepStage message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepStage.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @static - * @param {google.devicesandservices.health.v4.Sleep.ISleepStage} message SleepStage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SleepStage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.startUtcOffset != null && Object.hasOwnProperty.call(message, "startUtcOffset")) - $root.google.protobuf.Duration.encode(message.startUtcOffset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.endUtcOffset != null && Object.hasOwnProperty.call(message, "endUtcOffset")) - $root.google.protobuf.Duration.encode(message.endUtcOffset, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.type); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified EnergyQuantity message. Does not implicitly {@link google.devicesandservices.health.v4.EnergyQuantity.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.EnergyQuantity + * @static + * @param {google.devicesandservices.health.v4.IEnergyQuantity} message EnergyQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnergyQuantity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kcal != null && Object.hasOwnProperty.call(message, "kcal")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.kcal); + if (message.userProvidedUnit != null && Object.hasOwnProperty.call(message, "userProvidedUnit")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.userProvidedUnit); + return writer; + }; - /** - * Encodes the specified SleepStage message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepStage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @static - * @param {google.devicesandservices.health.v4.Sleep.ISleepStage} message SleepStage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SleepStage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified EnergyQuantity message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.EnergyQuantity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.EnergyQuantity + * @static + * @param {google.devicesandservices.health.v4.IEnergyQuantity} message EnergyQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnergyQuantity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a SleepStage message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.Sleep.SleepStage} SleepStage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SleepStage.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Sleep.SleepStage(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.startUtcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.endUtcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 7: { - message.type = reader.int32(); - break; - } - case 8: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); + /** + * Decodes an EnergyQuantity message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.EnergyQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.EnergyQuantity} EnergyQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnergyQuantity.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.EnergyQuantity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kcal = reader.double(); break; } - } - return message; - }; - - /** - * Decodes a SleepStage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.Sleep.SleepStage} SleepStage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SleepStage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SleepStage message. - * @function verify - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SleepStage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.startUtcOffset != null && message.hasOwnProperty("startUtcOffset")) { - var error = $root.google.protobuf.Duration.verify(message.startUtcOffset); - if (error) - return "startUtcOffset." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.endUtcOffset != null && message.hasOwnProperty("endUtcOffset")) { - var error = $root.google.protobuf.Duration.verify(message.endUtcOffset); - if (error) - return "endUtcOffset." + error; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: + case 2: { + message.userProvidedUnit = reader.int32(); break; } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; + default: + reader.skipType(tag & 7); + break; } - return null; - }; + } + return message; + }; - /** - * Creates a SleepStage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.Sleep.SleepStage} SleepStage - */ - SleepStage.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.Sleep.SleepStage) - return object; - var message = new $root.google.devicesandservices.health.v4.Sleep.SleepStage(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepStage.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.startUtcOffset != null) { - if (typeof object.startUtcOffset !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepStage.startUtcOffset: object expected"); - message.startUtcOffset = $root.google.protobuf.Duration.fromObject(object.startUtcOffset); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepStage.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.endUtcOffset != null) { - if (typeof object.endUtcOffset !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepStage.endUtcOffset: object expected"); - message.endUtcOffset = $root.google.protobuf.Duration.fromObject(object.endUtcOffset); - } - switch (object.type) { + /** + * Decodes an EnergyQuantity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.EnergyQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.EnergyQuantity} EnergyQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnergyQuantity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnergyQuantity message. + * @function verify + * @memberof google.devicesandservices.health.v4.EnergyQuantity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnergyQuantity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.kcal != null && message.hasOwnProperty("kcal")) { + properties._kcal = 1; + if (typeof message.kcal !== "number") + return "kcal: number expected"; + } + if (message.userProvidedUnit != null && message.hasOwnProperty("userProvidedUnit")) + switch (message.userProvidedUnit) { default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "SLEEP_STAGE_TYPE_UNSPECIFIED": + return "userProvidedUnit: enum value expected"; case 0: - message.type = 0; - break; - case "AWAKE": case 1: - message.type = 1; - break; - case "LIGHT": case 2: - message.type = 2; - break; - case "DEEP": case 3: - message.type = 3; - break; - case "REM": case 4: - message.type = 4; - break; - case "ASLEEP": case 5: - message.type = 5; break; - case "RESTLESS": - case 6: - message.type = 6; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepStage.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepStage.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } - return message; - }; + return null; + }; - /** - * Creates a plain object from a SleepStage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @static - * @param {google.devicesandservices.health.v4.Sleep.SleepStage} message SleepStage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SleepStage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTime = null; - object.startUtcOffset = null; - object.endTime = null; - object.endUtcOffset = null; - object.type = options.enums === String ? "SLEEP_STAGE_TYPE_UNSPECIFIED" : 0; - object.createTime = null; - object.updateTime = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.startUtcOffset != null && message.hasOwnProperty("startUtcOffset")) - object.startUtcOffset = $root.google.protobuf.Duration.toObject(message.startUtcOffset, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.endUtcOffset != null && message.hasOwnProperty("endUtcOffset")) - object.endUtcOffset = $root.google.protobuf.Duration.toObject(message.endUtcOffset, options); - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.devicesandservices.health.v4.Sleep.SleepStageType[message.type] === undefined ? message.type : $root.google.devicesandservices.health.v4.Sleep.SleepStageType[message.type] : message.type; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + /** + * Creates an EnergyQuantity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.EnergyQuantity + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.EnergyQuantity} EnergyQuantity + */ + EnergyQuantity.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.EnergyQuantity) return object; - }; - - /** - * Converts this SleepStage to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @instance - * @returns {Object.} JSON object - */ - SleepStage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SleepStage - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.Sleep.SleepStage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SleepStage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + var message = new $root.google.devicesandservices.health.v4.EnergyQuantity(); + if (object.kcal != null) + message.kcal = Number(object.kcal); + switch (object.userProvidedUnit) { + default: + if (typeof object.userProvidedUnit === "number") { + message.userProvidedUnit = object.userProvidedUnit; + break; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.Sleep.SleepStage"; - }; - - return SleepStage; - })(); + break; + case "ENERGY_UNIT_UNSPECIFIED": + case 0: + message.userProvidedUnit = 0; + break; + case "JOULE": + case 1: + message.userProvidedUnit = 1; + break; + case "KILOJOULE": + case 2: + message.userProvidedUnit = 2; + break; + case "KILOCALORIE": + case 3: + message.userProvidedUnit = 3; + break; + case "SMALL_CALORIE": + case 4: + message.userProvidedUnit = 4; + break; + case "CALORIE": + case 5: + message.userProvidedUnit = 5; + break; + } + return message; + }; - Sleep.OutOfBedSegment = (function() { + /** + * Creates a plain object from an EnergyQuantity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.EnergyQuantity + * @static + * @param {google.devicesandservices.health.v4.EnergyQuantity} message EnergyQuantity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnergyQuantity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.userProvidedUnit = options.enums === String ? "ENERGY_UNIT_UNSPECIFIED" : 0; + if (message.kcal != null && message.hasOwnProperty("kcal")) { + object.kcal = options.json && !isFinite(message.kcal) ? String(message.kcal) : message.kcal; + if (options.oneofs) + object._kcal = "kcal"; + } + if (message.userProvidedUnit != null && message.hasOwnProperty("userProvidedUnit")) + object.userProvidedUnit = options.enums === String ? $root.google.devicesandservices.health.v4.EnergyUnit[message.userProvidedUnit] === undefined ? message.userProvidedUnit : $root.google.devicesandservices.health.v4.EnergyUnit[message.userProvidedUnit] : message.userProvidedUnit; + return object; + }; - /** - * Properties of an OutOfBedSegment. - * @memberof google.devicesandservices.health.v4.Sleep - * @interface IOutOfBedSegment - * @property {google.protobuf.ITimestamp|null} [startTime] OutOfBedSegment startTime - * @property {google.protobuf.IDuration|null} [startUtcOffset] OutOfBedSegment startUtcOffset - * @property {google.protobuf.ITimestamp|null} [endTime] OutOfBedSegment endTime - * @property {google.protobuf.IDuration|null} [endUtcOffset] OutOfBedSegment endUtcOffset - */ + /** + * Converts this EnergyQuantity to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.EnergyQuantity + * @instance + * @returns {Object.} JSON object + */ + EnergyQuantity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new OutOfBedSegment. - * @memberof google.devicesandservices.health.v4.Sleep - * @classdesc Represents an OutOfBedSegment. - * @implements IOutOfBedSegment - * @constructor - * @param {google.devicesandservices.health.v4.Sleep.IOutOfBedSegment=} [properties] Properties to set - */ - function OutOfBedSegment(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Gets the default type url for EnergyQuantity + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.EnergyQuantity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnergyQuantity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.devicesandservices.health.v4.EnergyQuantity"; + }; - /** - * OutOfBedSegment startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment - * @instance - */ - OutOfBedSegment.prototype.startTime = null; + return EnergyQuantity; + })(); - /** - * OutOfBedSegment startUtcOffset. - * @member {google.protobuf.IDuration|null|undefined} startUtcOffset - * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment - * @instance - */ - OutOfBedSegment.prototype.startUtcOffset = null; + v4.NutrientQuantity = (function() { - /** - * OutOfBedSegment endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment - * @instance - */ - OutOfBedSegment.prototype.endTime = null; + /** + * Properties of a NutrientQuantity. + * @memberof google.devicesandservices.health.v4 + * @interface INutrientQuantity + * @property {google.devicesandservices.health.v4.IWeightQuantity|null} [quantity] NutrientQuantity quantity + * @property {google.devicesandservices.health.v4.Nutrient|null} [nutrient] NutrientQuantity nutrient + */ - /** - * OutOfBedSegment endUtcOffset. - * @member {google.protobuf.IDuration|null|undefined} endUtcOffset - * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment - * @instance - */ - OutOfBedSegment.prototype.endUtcOffset = null; + /** + * Constructs a new NutrientQuantity. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a NutrientQuantity. + * @implements INutrientQuantity + * @constructor + * @param {google.devicesandservices.health.v4.INutrientQuantity=} [properties] Properties to set + */ + function NutrientQuantity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new OutOfBedSegment instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment - * @static - * @param {google.devicesandservices.health.v4.Sleep.IOutOfBedSegment=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.Sleep.OutOfBedSegment} OutOfBedSegment instance - */ - OutOfBedSegment.create = function create(properties) { - return new OutOfBedSegment(properties); - }; + /** + * NutrientQuantity quantity. + * @member {google.devicesandservices.health.v4.IWeightQuantity|null|undefined} quantity + * @memberof google.devicesandservices.health.v4.NutrientQuantity + * @instance + */ + NutrientQuantity.prototype.quantity = null; - /** - * Encodes the specified OutOfBedSegment message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.OutOfBedSegment.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment - * @static - * @param {google.devicesandservices.health.v4.Sleep.IOutOfBedSegment} message OutOfBedSegment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OutOfBedSegment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.startUtcOffset != null && Object.hasOwnProperty.call(message, "startUtcOffset")) - $root.google.protobuf.Duration.encode(message.startUtcOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endUtcOffset != null && Object.hasOwnProperty.call(message, "endUtcOffset")) - $root.google.protobuf.Duration.encode(message.endUtcOffset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * NutrientQuantity nutrient. + * @member {google.devicesandservices.health.v4.Nutrient} nutrient + * @memberof google.devicesandservices.health.v4.NutrientQuantity + * @instance + */ + NutrientQuantity.prototype.nutrient = 0; - /** - * Encodes the specified OutOfBedSegment message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.OutOfBedSegment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment - * @static - * @param {google.devicesandservices.health.v4.Sleep.IOutOfBedSegment} message OutOfBedSegment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OutOfBedSegment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new NutrientQuantity instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.NutrientQuantity + * @static + * @param {google.devicesandservices.health.v4.INutrientQuantity=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.NutrientQuantity} NutrientQuantity instance + */ + NutrientQuantity.create = function create(properties) { + return new NutrientQuantity(properties); + }; - /** - * Decodes an OutOfBedSegment message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.Sleep.OutOfBedSegment} OutOfBedSegment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OutOfBedSegment.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) + /** + * Encodes the specified NutrientQuantity message. Does not implicitly {@link google.devicesandservices.health.v4.NutrientQuantity.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.NutrientQuantity + * @static + * @param {google.devicesandservices.health.v4.INutrientQuantity} message NutrientQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NutrientQuantity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + $root.google.devicesandservices.health.v4.WeightQuantity.encode(message.quantity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nutrient != null && Object.hasOwnProperty.call(message, "nutrient")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nutrient); + return writer; + }; + + /** + * Encodes the specified NutrientQuantity message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.NutrientQuantity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.NutrientQuantity + * @static + * @param {google.devicesandservices.health.v4.INutrientQuantity} message NutrientQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NutrientQuantity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NutrientQuantity message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.NutrientQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.NutrientQuantity} NutrientQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NutrientQuantity.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.NutrientQuantity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.quantity = $root.google.devicesandservices.health.v4.WeightQuantity.decode(reader, reader.uint32()); break; - switch (tag >>> 3) { - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.startUtcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 3: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endUtcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); + } + case 2: { + message.nutrient = reader.int32(); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes an OutOfBedSegment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.Sleep.OutOfBedSegment} OutOfBedSegment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OutOfBedSegment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies an OutOfBedSegment message. - * @function verify - * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OutOfBedSegment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.startUtcOffset != null && message.hasOwnProperty("startUtcOffset")) { - var error = $root.google.protobuf.Duration.verify(message.startUtcOffset); - if (error) - return "startUtcOffset." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.endUtcOffset != null && message.hasOwnProperty("endUtcOffset")) { - var error = $root.google.protobuf.Duration.verify(message.endUtcOffset); - if (error) - return "endUtcOffset." + error; - } - return null; - }; + /** + * Decodes a NutrientQuantity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.NutrientQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.NutrientQuantity} NutrientQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NutrientQuantity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates an OutOfBedSegment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.Sleep.OutOfBedSegment} OutOfBedSegment - */ - OutOfBedSegment.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment) - return object; - var message = new $root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.OutOfBedSegment.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.startUtcOffset != null) { - if (typeof object.startUtcOffset !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.OutOfBedSegment.startUtcOffset: object expected"); - message.startUtcOffset = $root.google.protobuf.Duration.fromObject(object.startUtcOffset); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.OutOfBedSegment.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.endUtcOffset != null) { - if (typeof object.endUtcOffset !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.OutOfBedSegment.endUtcOffset: object expected"); - message.endUtcOffset = $root.google.protobuf.Duration.fromObject(object.endUtcOffset); + /** + * Verifies a NutrientQuantity message. + * @function verify + * @memberof google.devicesandservices.health.v4.NutrientQuantity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NutrientQuantity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) { + var error = $root.google.devicesandservices.health.v4.WeightQuantity.verify(message.quantity); + if (error) + return "quantity." + error; + } + if (message.nutrient != null && message.hasOwnProperty("nutrient")) + switch (message.nutrient) { + default: + return "nutrient: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + break; } - return message; - }; + return null; + }; - /** - * Creates a plain object from an OutOfBedSegment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment - * @static - * @param {google.devicesandservices.health.v4.Sleep.OutOfBedSegment} message OutOfBedSegment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OutOfBedSegment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTime = null; - object.startUtcOffset = null; - object.endTime = null; - object.endUtcOffset = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.startUtcOffset != null && message.hasOwnProperty("startUtcOffset")) - object.startUtcOffset = $root.google.protobuf.Duration.toObject(message.startUtcOffset, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.endUtcOffset != null && message.hasOwnProperty("endUtcOffset")) - object.endUtcOffset = $root.google.protobuf.Duration.toObject(message.endUtcOffset, options); + /** + * Creates a NutrientQuantity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.NutrientQuantity + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.NutrientQuantity} NutrientQuantity + */ + NutrientQuantity.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.NutrientQuantity) return object; - }; - - /** - * Converts this OutOfBedSegment to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment - * @instance - * @returns {Object.} JSON object - */ - OutOfBedSegment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OutOfBedSegment - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OutOfBedSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + var message = new $root.google.devicesandservices.health.v4.NutrientQuantity(); + if (object.quantity != null) { + if (typeof object.quantity !== "object") + throw TypeError(".google.devicesandservices.health.v4.NutrientQuantity.quantity: object expected"); + message.quantity = $root.google.devicesandservices.health.v4.WeightQuantity.fromObject(object.quantity); + } + switch (object.nutrient) { + default: + if (typeof object.nutrient === "number") { + message.nutrient = object.nutrient; + break; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.Sleep.OutOfBedSegment"; - }; - - return OutOfBedSegment; - })(); + break; + case "NUTRIENT_UNSPECIFIED": + case 0: + message.nutrient = 0; + break; + case "BIOTIN": + case 1: + message.nutrient = 1; + break; + case "CAFFEINE": + case 2: + message.nutrient = 2; + break; + case "CALCIUM": + case 3: + message.nutrient = 3; + break; + case "CHLORIDE": + case 4: + message.nutrient = 4; + break; + case "CARBOHYDRATES": + case 5: + message.nutrient = 5; + break; + case "CHOLESTEROL": + case 6: + message.nutrient = 6; + break; + case "CHROMIUM": + case 7: + message.nutrient = 7; + break; + case "COPPER": + case 8: + message.nutrient = 8; + break; + case "DIETARY_FIBER": + case 9: + message.nutrient = 9; + break; + case "FOLIC_ACID": + case 10: + message.nutrient = 10; + break; + case "IODINE": + case 11: + message.nutrient = 11; + break; + case "IRON": + case 12: + message.nutrient = 12; + break; + case "MAGNESIUM": + case 13: + message.nutrient = 13; + break; + case "MANGANESE": + case 14: + message.nutrient = 14; + break; + case "MOLYBDENUM": + case 15: + message.nutrient = 15; + break; + case "MONOUNSATURATED_FAT": + case 16: + message.nutrient = 16; + break; + case "NIACIN": + case 17: + message.nutrient = 17; + break; + case "PANTOTHENIC_ACID": + case 18: + message.nutrient = 18; + break; + case "PHOSPHORUS": + case 19: + message.nutrient = 19; + break; + case "POLYUNSATURATED_FAT": + case 20: + message.nutrient = 20; + break; + case "POTASSIUM": + case 21: + message.nutrient = 21; + break; + case "PROTEIN": + case 22: + message.nutrient = 22; + break; + case "RIBOFLAVIN": + case 23: + message.nutrient = 23; + break; + case "SATURATED_FAT": + case 24: + message.nutrient = 24; + break; + case "SELENIUM": + case 25: + message.nutrient = 25; + break; + case "SODIUM": + case 26: + message.nutrient = 26; + break; + case "SUGAR": + case 27: + message.nutrient = 27; + break; + case "THIAMIN": + case 28: + message.nutrient = 28; + break; + case "TRANS_FAT": + case 29: + message.nutrient = 29; + break; + case "UNSATURATED_FAT": + case 30: + message.nutrient = 30; + break; + case "VITAMIN_A": + case 31: + message.nutrient = 31; + break; + case "VITAMIN_B12": + case 32: + message.nutrient = 32; + break; + case "VITAMIN_B6": + case 33: + message.nutrient = 33; + break; + case "VITAMIN_C": + case 34: + message.nutrient = 34; + break; + case "VITAMIN_D": + case 35: + message.nutrient = 35; + break; + case "VITAMIN_E": + case 36: + message.nutrient = 36; + break; + case "VITAMIN_K": + case 37: + message.nutrient = 37; + break; + case "ZINC": + case 38: + message.nutrient = 38; + break; + case "FOLATE": + case 39: + message.nutrient = 39; + break; + } + return message; + }; - Sleep.SleepMetadata = (function() { + /** + * Creates a plain object from a NutrientQuantity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.NutrientQuantity + * @static + * @param {google.devicesandservices.health.v4.NutrientQuantity} message NutrientQuantity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NutrientQuantity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.quantity = null; + object.nutrient = options.enums === String ? "NUTRIENT_UNSPECIFIED" : 0; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) + object.quantity = $root.google.devicesandservices.health.v4.WeightQuantity.toObject(message.quantity, options); + if (message.nutrient != null && message.hasOwnProperty("nutrient")) + object.nutrient = options.enums === String ? $root.google.devicesandservices.health.v4.Nutrient[message.nutrient] === undefined ? message.nutrient : $root.google.devicesandservices.health.v4.Nutrient[message.nutrient] : message.nutrient; + return object; + }; - /** - * Properties of a SleepMetadata. - * @memberof google.devicesandservices.health.v4.Sleep - * @interface ISleepMetadata - * @property {google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState|null} [stagesStatus] SleepMetadata stagesStatus - * @property {boolean|null} [processed] SleepMetadata processed - * @property {boolean|null} [nap] SleepMetadata nap - * @property {boolean|null} [manuallyEdited] SleepMetadata manuallyEdited - * @property {string|null} [externalId] SleepMetadata externalId - */ + /** + * Converts this NutrientQuantity to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.NutrientQuantity + * @instance + * @returns {Object.} JSON object + */ + NutrientQuantity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new SleepMetadata. - * @memberof google.devicesandservices.health.v4.Sleep - * @classdesc Represents a SleepMetadata. - * @implements ISleepMetadata - * @constructor - * @param {google.devicesandservices.health.v4.Sleep.ISleepMetadata=} [properties] Properties to set - */ - function SleepMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Gets the default type url for NutrientQuantity + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.NutrientQuantity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NutrientQuantity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.devicesandservices.health.v4.NutrientQuantity"; + }; - /** - * SleepMetadata stagesStatus. - * @member {google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState} stagesStatus - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata - * @instance - */ - SleepMetadata.prototype.stagesStatus = 0; + return NutrientQuantity; + })(); - /** - * SleepMetadata processed. - * @member {boolean} processed - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata - * @instance - */ - SleepMetadata.prototype.processed = false; + v4.NutritionLog = (function() { - /** - * SleepMetadata nap. - * @member {boolean} nap - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata - * @instance - */ - SleepMetadata.prototype.nap = false; + /** + * Properties of a NutritionLog. + * @memberof google.devicesandservices.health.v4 + * @interface INutritionLog + * @property {google.devicesandservices.health.v4.ISessionTimeInterval|null} [interval] NutritionLog interval + * @property {Array.|null} [nutrients] NutritionLog nutrients + * @property {google.devicesandservices.health.v4.IEnergyQuantity|null} [energy] NutritionLog energy + * @property {google.devicesandservices.health.v4.IEnergyQuantity|null} [energyFromFat] NutritionLog energyFromFat + * @property {google.devicesandservices.health.v4.IWeightQuantity|null} [totalCarbohydrate] NutritionLog totalCarbohydrate + * @property {google.devicesandservices.health.v4.IWeightQuantity|null} [totalFat] NutritionLog totalFat + * @property {google.devicesandservices.health.v4.MealType|null} [mealType] NutritionLog mealType + * @property {google.devicesandservices.health.v4.NutritionLog.IServing|null} [serving] NutritionLog serving + * @property {string|null} [food] NutritionLog food + * @property {string|null} [foodDisplayName] NutritionLog foodDisplayName + */ - /** - * SleepMetadata manuallyEdited. - * @member {boolean} manuallyEdited - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata - * @instance - */ - SleepMetadata.prototype.manuallyEdited = false; + /** + * Constructs a new NutritionLog. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a NutritionLog. + * @implements INutritionLog + * @constructor + * @param {google.devicesandservices.health.v4.INutritionLog=} [properties] Properties to set + */ + function NutritionLog(properties) { + this.nutrients = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NutritionLog interval. + * @member {google.devicesandservices.health.v4.ISessionTimeInterval|null|undefined} interval + * @memberof google.devicesandservices.health.v4.NutritionLog + * @instance + */ + NutritionLog.prototype.interval = null; + + /** + * NutritionLog nutrients. + * @member {Array.} nutrients + * @memberof google.devicesandservices.health.v4.NutritionLog + * @instance + */ + NutritionLog.prototype.nutrients = $util.emptyArray; + + /** + * NutritionLog energy. + * @member {google.devicesandservices.health.v4.IEnergyQuantity|null|undefined} energy + * @memberof google.devicesandservices.health.v4.NutritionLog + * @instance + */ + NutritionLog.prototype.energy = null; + + /** + * NutritionLog energyFromFat. + * @member {google.devicesandservices.health.v4.IEnergyQuantity|null|undefined} energyFromFat + * @memberof google.devicesandservices.health.v4.NutritionLog + * @instance + */ + NutritionLog.prototype.energyFromFat = null; + + /** + * NutritionLog totalCarbohydrate. + * @member {google.devicesandservices.health.v4.IWeightQuantity|null|undefined} totalCarbohydrate + * @memberof google.devicesandservices.health.v4.NutritionLog + * @instance + */ + NutritionLog.prototype.totalCarbohydrate = null; + + /** + * NutritionLog totalFat. + * @member {google.devicesandservices.health.v4.IWeightQuantity|null|undefined} totalFat + * @memberof google.devicesandservices.health.v4.NutritionLog + * @instance + */ + NutritionLog.prototype.totalFat = null; + + /** + * NutritionLog mealType. + * @member {google.devicesandservices.health.v4.MealType} mealType + * @memberof google.devicesandservices.health.v4.NutritionLog + * @instance + */ + NutritionLog.prototype.mealType = 0; + + /** + * NutritionLog serving. + * @member {google.devicesandservices.health.v4.NutritionLog.IServing|null|undefined} serving + * @memberof google.devicesandservices.health.v4.NutritionLog + * @instance + */ + NutritionLog.prototype.serving = null; + + /** + * NutritionLog food. + * @member {string} food + * @memberof google.devicesandservices.health.v4.NutritionLog + * @instance + */ + NutritionLog.prototype.food = ""; + + /** + * NutritionLog foodDisplayName. + * @member {string} foodDisplayName + * @memberof google.devicesandservices.health.v4.NutritionLog + * @instance + */ + NutritionLog.prototype.foodDisplayName = ""; + + /** + * Creates a new NutritionLog instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.NutritionLog + * @static + * @param {google.devicesandservices.health.v4.INutritionLog=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.NutritionLog} NutritionLog instance + */ + NutritionLog.create = function create(properties) { + return new NutritionLog(properties); + }; + + /** + * Encodes the specified NutritionLog message. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLog.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.NutritionLog + * @static + * @param {google.devicesandservices.health.v4.INutritionLog} message NutritionLog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NutritionLog.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.devicesandservices.health.v4.SessionTimeInterval.encode(message.interval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nutrients != null && message.nutrients.length) + for (var i = 0; i < message.nutrients.length; ++i) + $root.google.devicesandservices.health.v4.NutrientQuantity.encode(message.nutrients[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.energy != null && Object.hasOwnProperty.call(message, "energy")) + $root.google.devicesandservices.health.v4.EnergyQuantity.encode(message.energy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.energyFromFat != null && Object.hasOwnProperty.call(message, "energyFromFat")) + $root.google.devicesandservices.health.v4.EnergyQuantity.encode(message.energyFromFat, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.totalCarbohydrate != null && Object.hasOwnProperty.call(message, "totalCarbohydrate")) + $root.google.devicesandservices.health.v4.WeightQuantity.encode(message.totalCarbohydrate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.totalFat != null && Object.hasOwnProperty.call(message, "totalFat")) + $root.google.devicesandservices.health.v4.WeightQuantity.encode(message.totalFat, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.mealType != null && Object.hasOwnProperty.call(message, "mealType")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.mealType); + if (message.serving != null && Object.hasOwnProperty.call(message, "serving")) + $root.google.devicesandservices.health.v4.NutritionLog.Serving.encode(message.serving, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.food != null && Object.hasOwnProperty.call(message, "food")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.food); + if (message.foodDisplayName != null && Object.hasOwnProperty.call(message, "foodDisplayName")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.foodDisplayName); + return writer; + }; + + /** + * Encodes the specified NutritionLog message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLog.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.NutritionLog + * @static + * @param {google.devicesandservices.health.v4.INutritionLog} message NutritionLog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NutritionLog.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NutritionLog message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.NutritionLog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.NutritionLog} NutritionLog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NutritionLog.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.NutritionLog(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.nutrients && message.nutrients.length)) + message.nutrients = []; + message.nutrients.push($root.google.devicesandservices.health.v4.NutrientQuantity.decode(reader, reader.uint32())); + break; + } + case 4: { + message.energy = $root.google.devicesandservices.health.v4.EnergyQuantity.decode(reader, reader.uint32()); + break; + } + case 5: { + message.energyFromFat = $root.google.devicesandservices.health.v4.EnergyQuantity.decode(reader, reader.uint32()); + break; + } + case 7: { + message.totalCarbohydrate = $root.google.devicesandservices.health.v4.WeightQuantity.decode(reader, reader.uint32()); + break; + } + case 8: { + message.totalFat = $root.google.devicesandservices.health.v4.WeightQuantity.decode(reader, reader.uint32()); + break; + } + case 13: { + message.mealType = reader.int32(); + break; + } + case 14: { + message.serving = $root.google.devicesandservices.health.v4.NutritionLog.Serving.decode(reader, reader.uint32()); + break; + } + case 15: { + message.food = reader.string(); + break; + } + case 16: { + message.foodDisplayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NutritionLog message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.NutritionLog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.NutritionLog} NutritionLog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NutritionLog.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NutritionLog message. + * @function verify + * @memberof google.devicesandservices.health.v4.NutritionLog + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NutritionLog.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interval != null && message.hasOwnProperty("interval")) { + var error = $root.google.devicesandservices.health.v4.SessionTimeInterval.verify(message.interval); + if (error) + return "interval." + error; + } + if (message.nutrients != null && message.hasOwnProperty("nutrients")) { + if (!Array.isArray(message.nutrients)) + return "nutrients: array expected"; + for (var i = 0; i < message.nutrients.length; ++i) { + var error = $root.google.devicesandservices.health.v4.NutrientQuantity.verify(message.nutrients[i]); + if (error) + return "nutrients." + error; + } + } + if (message.energy != null && message.hasOwnProperty("energy")) { + var error = $root.google.devicesandservices.health.v4.EnergyQuantity.verify(message.energy); + if (error) + return "energy." + error; + } + if (message.energyFromFat != null && message.hasOwnProperty("energyFromFat")) { + var error = $root.google.devicesandservices.health.v4.EnergyQuantity.verify(message.energyFromFat); + if (error) + return "energyFromFat." + error; + } + if (message.totalCarbohydrate != null && message.hasOwnProperty("totalCarbohydrate")) { + var error = $root.google.devicesandservices.health.v4.WeightQuantity.verify(message.totalCarbohydrate); + if (error) + return "totalCarbohydrate." + error; + } + if (message.totalFat != null && message.hasOwnProperty("totalFat")) { + var error = $root.google.devicesandservices.health.v4.WeightQuantity.verify(message.totalFat); + if (error) + return "totalFat." + error; + } + if (message.mealType != null && message.hasOwnProperty("mealType")) + switch (message.mealType) { + default: + return "mealType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.serving != null && message.hasOwnProperty("serving")) { + var error = $root.google.devicesandservices.health.v4.NutritionLog.Serving.verify(message.serving); + if (error) + return "serving." + error; + } + if (message.food != null && message.hasOwnProperty("food")) + if (!$util.isString(message.food)) + return "food: string expected"; + if (message.foodDisplayName != null && message.hasOwnProperty("foodDisplayName")) + if (!$util.isString(message.foodDisplayName)) + return "foodDisplayName: string expected"; + return null; + }; + + /** + * Creates a NutritionLog message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.NutritionLog + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.NutritionLog} NutritionLog + */ + NutritionLog.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.NutritionLog) + return object; + var message = new $root.google.devicesandservices.health.v4.NutritionLog(); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.devicesandservices.health.v4.NutritionLog.interval: object expected"); + message.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.fromObject(object.interval); + } + if (object.nutrients) { + if (!Array.isArray(object.nutrients)) + throw TypeError(".google.devicesandservices.health.v4.NutritionLog.nutrients: array expected"); + message.nutrients = []; + for (var i = 0; i < object.nutrients.length; ++i) { + if (typeof object.nutrients[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.NutritionLog.nutrients: object expected"); + message.nutrients[i] = $root.google.devicesandservices.health.v4.NutrientQuantity.fromObject(object.nutrients[i]); + } + } + if (object.energy != null) { + if (typeof object.energy !== "object") + throw TypeError(".google.devicesandservices.health.v4.NutritionLog.energy: object expected"); + message.energy = $root.google.devicesandservices.health.v4.EnergyQuantity.fromObject(object.energy); + } + if (object.energyFromFat != null) { + if (typeof object.energyFromFat !== "object") + throw TypeError(".google.devicesandservices.health.v4.NutritionLog.energyFromFat: object expected"); + message.energyFromFat = $root.google.devicesandservices.health.v4.EnergyQuantity.fromObject(object.energyFromFat); + } + if (object.totalCarbohydrate != null) { + if (typeof object.totalCarbohydrate !== "object") + throw TypeError(".google.devicesandservices.health.v4.NutritionLog.totalCarbohydrate: object expected"); + message.totalCarbohydrate = $root.google.devicesandservices.health.v4.WeightQuantity.fromObject(object.totalCarbohydrate); + } + if (object.totalFat != null) { + if (typeof object.totalFat !== "object") + throw TypeError(".google.devicesandservices.health.v4.NutritionLog.totalFat: object expected"); + message.totalFat = $root.google.devicesandservices.health.v4.WeightQuantity.fromObject(object.totalFat); + } + switch (object.mealType) { + default: + if (typeof object.mealType === "number") { + message.mealType = object.mealType; + break; + } + break; + case "MEAL_TYPE_UNSPECIFIED": + case 0: + message.mealType = 0; + break; + case "BEFORE_BREAKFAST": + case 1: + message.mealType = 1; + break; + case "BREAKFAST": + case 2: + message.mealType = 2; + break; + case "BEFORE_LUNCH": + case 3: + message.mealType = 3; + break; + case "LUNCH": + case 4: + message.mealType = 4; + break; + case "BEFORE_DINNER": + case 5: + message.mealType = 5; + break; + case "DINNER": + case 6: + message.mealType = 6; + break; + case "AFTER_DINNER": + case 7: + message.mealType = 7; + break; + case "SNACK": + case 8: + message.mealType = 8; + break; + case "ANYTIME": + case 9: + message.mealType = 9; + break; + } + if (object.serving != null) { + if (typeof object.serving !== "object") + throw TypeError(".google.devicesandservices.health.v4.NutritionLog.serving: object expected"); + message.serving = $root.google.devicesandservices.health.v4.NutritionLog.Serving.fromObject(object.serving); + } + if (object.food != null) + message.food = String(object.food); + if (object.foodDisplayName != null) + message.foodDisplayName = String(object.foodDisplayName); + return message; + }; + + /** + * Creates a plain object from a NutritionLog message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.NutritionLog + * @static + * @param {google.devicesandservices.health.v4.NutritionLog} message NutritionLog + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NutritionLog.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nutrients = []; + if (options.defaults) { + object.interval = null; + object.energy = null; + object.energyFromFat = null; + object.totalCarbohydrate = null; + object.totalFat = null; + object.mealType = options.enums === String ? "MEAL_TYPE_UNSPECIFIED" : 0; + object.serving = null; + object.food = ""; + object.foodDisplayName = ""; + } + if (message.interval != null && message.hasOwnProperty("interval")) + object.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.toObject(message.interval, options); + if (message.nutrients && message.nutrients.length) { + object.nutrients = []; + for (var j = 0; j < message.nutrients.length; ++j) + object.nutrients[j] = $root.google.devicesandservices.health.v4.NutrientQuantity.toObject(message.nutrients[j], options); + } + if (message.energy != null && message.hasOwnProperty("energy")) + object.energy = $root.google.devicesandservices.health.v4.EnergyQuantity.toObject(message.energy, options); + if (message.energyFromFat != null && message.hasOwnProperty("energyFromFat")) + object.energyFromFat = $root.google.devicesandservices.health.v4.EnergyQuantity.toObject(message.energyFromFat, options); + if (message.totalCarbohydrate != null && message.hasOwnProperty("totalCarbohydrate")) + object.totalCarbohydrate = $root.google.devicesandservices.health.v4.WeightQuantity.toObject(message.totalCarbohydrate, options); + if (message.totalFat != null && message.hasOwnProperty("totalFat")) + object.totalFat = $root.google.devicesandservices.health.v4.WeightQuantity.toObject(message.totalFat, options); + if (message.mealType != null && message.hasOwnProperty("mealType")) + object.mealType = options.enums === String ? $root.google.devicesandservices.health.v4.MealType[message.mealType] === undefined ? message.mealType : $root.google.devicesandservices.health.v4.MealType[message.mealType] : message.mealType; + if (message.serving != null && message.hasOwnProperty("serving")) + object.serving = $root.google.devicesandservices.health.v4.NutritionLog.Serving.toObject(message.serving, options); + if (message.food != null && message.hasOwnProperty("food")) + object.food = message.food; + if (message.foodDisplayName != null && message.hasOwnProperty("foodDisplayName")) + object.foodDisplayName = message.foodDisplayName; + return object; + }; + + /** + * Converts this NutritionLog to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.NutritionLog + * @instance + * @returns {Object.} JSON object + */ + NutritionLog.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NutritionLog + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.NutritionLog + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NutritionLog.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.NutritionLog"; + }; + + NutritionLog.Serving = (function() { /** - * SleepMetadata externalId. - * @member {string} externalId - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * Properties of a Serving. + * @memberof google.devicesandservices.health.v4.NutritionLog + * @interface IServing + * @property {number|null} [amount] Serving amount + * @property {string|null} [foodMeasurementUnit] Serving foodMeasurementUnit + * @property {string|null} [foodMeasurementUnitDisplayName] Serving foodMeasurementUnitDisplayName + */ + + /** + * Constructs a new Serving. + * @memberof google.devicesandservices.health.v4.NutritionLog + * @classdesc Represents a Serving. + * @implements IServing + * @constructor + * @param {google.devicesandservices.health.v4.NutritionLog.IServing=} [properties] Properties to set + */ + function Serving(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Serving amount. + * @member {number|null|undefined} amount + * @memberof google.devicesandservices.health.v4.NutritionLog.Serving * @instance */ - SleepMetadata.prototype.externalId = ""; + Serving.prototype.amount = null; /** - * Creates a new SleepMetadata instance using the specified properties. + * Serving foodMeasurementUnit. + * @member {string} foodMeasurementUnit + * @memberof google.devicesandservices.health.v4.NutritionLog.Serving + * @instance + */ + Serving.prototype.foodMeasurementUnit = ""; + + /** + * Serving foodMeasurementUnitDisplayName. + * @member {string} foodMeasurementUnitDisplayName + * @memberof google.devicesandservices.health.v4.NutritionLog.Serving + * @instance + */ + Serving.prototype.foodMeasurementUnitDisplayName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Serving.prototype, "_amount", { + get: $util.oneOfGetter($oneOfFields = ["amount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Serving instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @memberof google.devicesandservices.health.v4.NutritionLog.Serving * @static - * @param {google.devicesandservices.health.v4.Sleep.ISleepMetadata=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.Sleep.SleepMetadata} SleepMetadata instance + * @param {google.devicesandservices.health.v4.NutritionLog.IServing=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.NutritionLog.Serving} Serving instance */ - SleepMetadata.create = function create(properties) { - return new SleepMetadata(properties); + Serving.create = function create(properties) { + return new Serving(properties); }; /** - * Encodes the specified SleepMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepMetadata.verify|verify} messages. + * Encodes the specified Serving message. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLog.Serving.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @memberof google.devicesandservices.health.v4.NutritionLog.Serving * @static - * @param {google.devicesandservices.health.v4.Sleep.ISleepMetadata} message SleepMetadata message or plain object to encode + * @param {google.devicesandservices.health.v4.NutritionLog.IServing} message Serving message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SleepMetadata.encode = function encode(message, writer) { + Serving.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.stagesStatus != null && Object.hasOwnProperty.call(message, "stagesStatus")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stagesStatus); - if (message.processed != null && Object.hasOwnProperty.call(message, "processed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.processed); - if (message.nap != null && Object.hasOwnProperty.call(message, "nap")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.nap); - if (message.manuallyEdited != null && Object.hasOwnProperty.call(message, "manuallyEdited")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.manuallyEdited); - if (message.externalId != null && Object.hasOwnProperty.call(message, "externalId")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.externalId); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.amount); + if (message.foodMeasurementUnit != null && Object.hasOwnProperty.call(message, "foodMeasurementUnit")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.foodMeasurementUnit); + if (message.foodMeasurementUnitDisplayName != null && Object.hasOwnProperty.call(message, "foodMeasurementUnitDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.foodMeasurementUnitDisplayName); return writer; }; /** - * Encodes the specified SleepMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepMetadata.verify|verify} messages. + * Encodes the specified Serving message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLog.Serving.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @memberof google.devicesandservices.health.v4.NutritionLog.Serving * @static - * @param {google.devicesandservices.health.v4.Sleep.ISleepMetadata} message SleepMetadata message or plain object to encode + * @param {google.devicesandservices.health.v4.NutritionLog.IServing} message Serving message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SleepMetadata.encodeDelimited = function encodeDelimited(message, writer) { + Serving.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SleepMetadata message from the specified reader or buffer. + * Decodes a Serving message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @memberof google.devicesandservices.health.v4.NutritionLog.Serving * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.Sleep.SleepMetadata} SleepMetadata + * @returns {google.devicesandservices.health.v4.NutritionLog.Serving} Serving * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SleepMetadata.decode = function decode(reader, length, error) { + Serving.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Sleep.SleepMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.NutritionLog.Serving(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.stagesStatus = reader.int32(); + message.amount = reader.double(); break; } case 2: { - message.processed = reader.bool(); - break; - } - case 5: { - message.nap = reader.bool(); - break; - } - case 6: { - message.manuallyEdited = reader.bool(); + message.foodMeasurementUnit = reader.string(); break; } - case 7: { - message.externalId = reader.string(); + case 3: { + message.foodMeasurementUnitDisplayName = reader.string(); break; } default: @@ -17675,250 +19826,838 @@ }; /** - * Decodes a SleepMetadata message from the specified reader or buffer, length delimited. + * Decodes a Serving message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @memberof google.devicesandservices.health.v4.NutritionLog.Serving * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.Sleep.SleepMetadata} SleepMetadata + * @returns {google.devicesandservices.health.v4.NutritionLog.Serving} Serving * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SleepMetadata.decodeDelimited = function decodeDelimited(reader) { + Serving.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SleepMetadata message. + * Verifies a Serving message. * @function verify - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @memberof google.devicesandservices.health.v4.NutritionLog.Serving * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SleepMetadata.verify = function verify(message) { + Serving.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.stagesStatus != null && message.hasOwnProperty("stagesStatus")) - switch (message.stagesStatus) { - default: - return "stagesStatus: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.processed != null && message.hasOwnProperty("processed")) - if (typeof message.processed !== "boolean") - return "processed: boolean expected"; - if (message.nap != null && message.hasOwnProperty("nap")) - if (typeof message.nap !== "boolean") - return "nap: boolean expected"; - if (message.manuallyEdited != null && message.hasOwnProperty("manuallyEdited")) - if (typeof message.manuallyEdited !== "boolean") - return "manuallyEdited: boolean expected"; - if (message.externalId != null && message.hasOwnProperty("externalId")) - if (!$util.isString(message.externalId)) - return "externalId: string expected"; + var properties = {}; + if (message.amount != null && message.hasOwnProperty("amount")) { + properties._amount = 1; + if (typeof message.amount !== "number") + return "amount: number expected"; + } + if (message.foodMeasurementUnit != null && message.hasOwnProperty("foodMeasurementUnit")) + if (!$util.isString(message.foodMeasurementUnit)) + return "foodMeasurementUnit: string expected"; + if (message.foodMeasurementUnitDisplayName != null && message.hasOwnProperty("foodMeasurementUnitDisplayName")) + if (!$util.isString(message.foodMeasurementUnitDisplayName)) + return "foodMeasurementUnitDisplayName: string expected"; return null; }; /** - * Creates a SleepMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a Serving message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @memberof google.devicesandservices.health.v4.NutritionLog.Serving * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.Sleep.SleepMetadata} SleepMetadata + * @returns {google.devicesandservices.health.v4.NutritionLog.Serving} Serving */ - SleepMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.Sleep.SleepMetadata) + Serving.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.NutritionLog.Serving) return object; - var message = new $root.google.devicesandservices.health.v4.Sleep.SleepMetadata(); - switch (object.stagesStatus) { - default: - if (typeof object.stagesStatus === "number") { - message.stagesStatus = object.stagesStatus; - break; - } - break; - case "STAGES_STATE_UNSPECIFIED": - case 0: - message.stagesStatus = 0; - break; - case "REJECTED_COVERAGE": - case 1: - message.stagesStatus = 1; - break; - case "REJECTED_MAX_GAP": - case 2: - message.stagesStatus = 2; - break; - case "REJECTED_START_GAP": - case 3: - message.stagesStatus = 3; - break; - case "REJECTED_END_GAP": - case 4: - message.stagesStatus = 4; - break; - case "REJECTED_NAP": - case 5: - message.stagesStatus = 5; - break; - case "REJECTED_SERVER": - case 6: - message.stagesStatus = 6; - break; - case "TIMEOUT": - case 7: - message.stagesStatus = 7; - break; - case "SUCCEEDED": - case 8: - message.stagesStatus = 8; - break; - case "PROCESSING_INTERNAL_ERROR": - case 9: - message.stagesStatus = 9; - break; - } - if (object.processed != null) - message.processed = Boolean(object.processed); - if (object.nap != null) - message.nap = Boolean(object.nap); - if (object.manuallyEdited != null) - message.manuallyEdited = Boolean(object.manuallyEdited); - if (object.externalId != null) - message.externalId = String(object.externalId); + var message = new $root.google.devicesandservices.health.v4.NutritionLog.Serving(); + if (object.amount != null) + message.amount = Number(object.amount); + if (object.foodMeasurementUnit != null) + message.foodMeasurementUnit = String(object.foodMeasurementUnit); + if (object.foodMeasurementUnitDisplayName != null) + message.foodMeasurementUnitDisplayName = String(object.foodMeasurementUnitDisplayName); return message; }; /** - * Creates a plain object from a SleepMetadata message. Also converts values to other types if specified. + * Creates a plain object from a Serving message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @memberof google.devicesandservices.health.v4.NutritionLog.Serving * @static - * @param {google.devicesandservices.health.v4.Sleep.SleepMetadata} message SleepMetadata + * @param {google.devicesandservices.health.v4.NutritionLog.Serving} message Serving * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SleepMetadata.toObject = function toObject(message, options) { + Serving.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.stagesStatus = options.enums === String ? "STAGES_STATE_UNSPECIFIED" : 0; - object.processed = false; - object.nap = false; - object.manuallyEdited = false; - object.externalId = ""; + object.foodMeasurementUnit = ""; + object.foodMeasurementUnitDisplayName = ""; } - if (message.stagesStatus != null && message.hasOwnProperty("stagesStatus")) - object.stagesStatus = options.enums === String ? $root.google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState[message.stagesStatus] === undefined ? message.stagesStatus : $root.google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState[message.stagesStatus] : message.stagesStatus; - if (message.processed != null && message.hasOwnProperty("processed")) - object.processed = message.processed; - if (message.nap != null && message.hasOwnProperty("nap")) - object.nap = message.nap; - if (message.manuallyEdited != null && message.hasOwnProperty("manuallyEdited")) - object.manuallyEdited = message.manuallyEdited; - if (message.externalId != null && message.hasOwnProperty("externalId")) - object.externalId = message.externalId; + if (message.amount != null && message.hasOwnProperty("amount")) { + object.amount = options.json && !isFinite(message.amount) ? String(message.amount) : message.amount; + if (options.oneofs) + object._amount = "amount"; + } + if (message.foodMeasurementUnit != null && message.hasOwnProperty("foodMeasurementUnit")) + object.foodMeasurementUnit = message.foodMeasurementUnit; + if (message.foodMeasurementUnitDisplayName != null && message.hasOwnProperty("foodMeasurementUnitDisplayName")) + object.foodMeasurementUnitDisplayName = message.foodMeasurementUnitDisplayName; return object; }; /** - * Converts this SleepMetadata to JSON. + * Converts this Serving to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @memberof google.devicesandservices.health.v4.NutritionLog.Serving * @instance * @returns {Object.} JSON object */ - SleepMetadata.prototype.toJSON = function toJSON() { + Serving.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SleepMetadata + * Gets the default type url for Serving * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @memberof google.devicesandservices.health.v4.NutritionLog.Serving * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SleepMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Serving.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.Sleep.SleepMetadata"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.NutritionLog.Serving"; }; - /** - * StagesState enum. - * @name google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState - * @enum {number} - * @property {number} STAGES_STATE_UNSPECIFIED=0 STAGES_STATE_UNSPECIFIED value - * @property {number} REJECTED_COVERAGE=1 REJECTED_COVERAGE value - * @property {number} REJECTED_MAX_GAP=2 REJECTED_MAX_GAP value - * @property {number} REJECTED_START_GAP=3 REJECTED_START_GAP value - * @property {number} REJECTED_END_GAP=4 REJECTED_END_GAP value - * @property {number} REJECTED_NAP=5 REJECTED_NAP value - * @property {number} REJECTED_SERVER=6 REJECTED_SERVER value - * @property {number} TIMEOUT=7 TIMEOUT value - * @property {number} SUCCEEDED=8 SUCCEEDED value - * @property {number} PROCESSING_INTERNAL_ERROR=9 PROCESSING_INTERNAL_ERROR value - */ - SleepMetadata.StagesState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STAGES_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "REJECTED_COVERAGE"] = 1; - values[valuesById[2] = "REJECTED_MAX_GAP"] = 2; - values[valuesById[3] = "REJECTED_START_GAP"] = 3; - values[valuesById[4] = "REJECTED_END_GAP"] = 4; - values[valuesById[5] = "REJECTED_NAP"] = 5; - values[valuesById[6] = "REJECTED_SERVER"] = 6; - values[valuesById[7] = "TIMEOUT"] = 7; - values[valuesById[8] = "SUCCEEDED"] = 8; - values[valuesById[9] = "PROCESSING_INTERNAL_ERROR"] = 9; - return values; - })(); - - return SleepMetadata; + return Serving; })(); - Sleep.SleepSummary = (function() { + return NutritionLog; + })(); - /** - * Properties of a SleepSummary. - * @memberof google.devicesandservices.health.v4.Sleep - * @interface ISleepSummary - * @property {number|Long|null} [minutesInSleepPeriod] SleepSummary minutesInSleepPeriod - * @property {number|Long|null} [minutesAfterWakeUp] SleepSummary minutesAfterWakeUp - * @property {number|Long|null} [minutesToFallAsleep] SleepSummary minutesToFallAsleep - * @property {number|Long|null} [minutesAsleep] SleepSummary minutesAsleep - * @property {number|Long|null} [minutesAwake] SleepSummary minutesAwake - * @property {Array.|null} [stagesSummary] SleepSummary stagesSummary - */ + v4.Food = (function() { - /** - * Constructs a new SleepSummary. - * @memberof google.devicesandservices.health.v4.Sleep - * @classdesc Represents a SleepSummary. - * @implements ISleepSummary - * @constructor - * @param {google.devicesandservices.health.v4.Sleep.ISleepSummary=} [properties] Properties to set - */ - function SleepSummary(properties) { - this.stagesSummary = []; + /** + * Properties of a Food. + * @memberof google.devicesandservices.health.v4 + * @interface IFood + * @property {string|null} [displayName] Food displayName + * @property {string|null} [brand] Food brand + * @property {google.devicesandservices.health.v4.FoodAccessLevel|null} [accessLevel] Food accessLevel + * @property {string|null} [description] Food description + * @property {string|null} [languageCode] Food languageCode + * @property {google.devicesandservices.health.v4.MealType|null} [mealType] Food mealType + * @property {Array.|null} [nutrients] Food nutrients + * @property {google.devicesandservices.health.v4.IEnergyQuantity|null} [energyFromFat] Food energyFromFat + * @property {google.devicesandservices.health.v4.IWeightQuantity|null} [totalCarbohydrate] Food totalCarbohydrate + * @property {google.devicesandservices.health.v4.IWeightQuantity|null} [totalFat] Food totalFat + * @property {google.devicesandservices.health.v4.IEnergyQuantity|null} [energyMin] Food energyMin + * @property {google.devicesandservices.health.v4.IEnergyQuantity|null} [energyAvg] Food energyAvg + * @property {google.devicesandservices.health.v4.IEnergyQuantity|null} [energyMax] Food energyMax + * @property {google.devicesandservices.health.v4.Food.IFoodServing|null} [defaultServing] Food defaultServing + * @property {Array.|null} [servings] Food servings + */ + + /** + * Constructs a new Food. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a Food. + * @implements IFood + * @constructor + * @param {google.devicesandservices.health.v4.IFood=} [properties] Properties to set + */ + function Food(properties) { + this.nutrients = []; + this.servings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Food displayName. + * @member {string} displayName + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.displayName = ""; + + /** + * Food brand. + * @member {string} brand + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.brand = ""; + + /** + * Food accessLevel. + * @member {google.devicesandservices.health.v4.FoodAccessLevel} accessLevel + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.accessLevel = 0; + + /** + * Food description. + * @member {string} description + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.description = ""; + + /** + * Food languageCode. + * @member {string} languageCode + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.languageCode = ""; + + /** + * Food mealType. + * @member {google.devicesandservices.health.v4.MealType} mealType + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.mealType = 0; + + /** + * Food nutrients. + * @member {Array.} nutrients + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.nutrients = $util.emptyArray; + + /** + * Food energyFromFat. + * @member {google.devicesandservices.health.v4.IEnergyQuantity|null|undefined} energyFromFat + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.energyFromFat = null; + + /** + * Food totalCarbohydrate. + * @member {google.devicesandservices.health.v4.IWeightQuantity|null|undefined} totalCarbohydrate + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.totalCarbohydrate = null; + + /** + * Food totalFat. + * @member {google.devicesandservices.health.v4.IWeightQuantity|null|undefined} totalFat + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.totalFat = null; + + /** + * Food energyMin. + * @member {google.devicesandservices.health.v4.IEnergyQuantity|null|undefined} energyMin + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.energyMin = null; + + /** + * Food energyAvg. + * @member {google.devicesandservices.health.v4.IEnergyQuantity|null|undefined} energyAvg + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.energyAvg = null; + + /** + * Food energyMax. + * @member {google.devicesandservices.health.v4.IEnergyQuantity|null|undefined} energyMax + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.energyMax = null; + + /** + * Food defaultServing. + * @member {google.devicesandservices.health.v4.Food.IFoodServing|null|undefined} defaultServing + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.defaultServing = null; + + /** + * Food servings. + * @member {Array.} servings + * @memberof google.devicesandservices.health.v4.Food + * @instance + */ + Food.prototype.servings = $util.emptyArray; + + /** + * Creates a new Food instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.Food + * @static + * @param {google.devicesandservices.health.v4.IFood=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Food} Food instance + */ + Food.create = function create(properties) { + return new Food(properties); + }; + + /** + * Encodes the specified Food message. Does not implicitly {@link google.devicesandservices.health.v4.Food.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.Food + * @static + * @param {google.devicesandservices.health.v4.IFood} message Food message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Food.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.brand != null && Object.hasOwnProperty.call(message, "brand")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.brand); + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.accessLevel); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode); + if (message.mealType != null && Object.hasOwnProperty.call(message, "mealType")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.mealType); + if (message.nutrients != null && message.nutrients.length) + for (var i = 0; i < message.nutrients.length; ++i) + $root.google.devicesandservices.health.v4.NutrientQuantity.encode(message.nutrients[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.energyFromFat != null && Object.hasOwnProperty.call(message, "energyFromFat")) + $root.google.devicesandservices.health.v4.EnergyQuantity.encode(message.energyFromFat, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.totalCarbohydrate != null && Object.hasOwnProperty.call(message, "totalCarbohydrate")) + $root.google.devicesandservices.health.v4.WeightQuantity.encode(message.totalCarbohydrate, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.totalFat != null && Object.hasOwnProperty.call(message, "totalFat")) + $root.google.devicesandservices.health.v4.WeightQuantity.encode(message.totalFat, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.energyMin != null && Object.hasOwnProperty.call(message, "energyMin")) + $root.google.devicesandservices.health.v4.EnergyQuantity.encode(message.energyMin, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.energyAvg != null && Object.hasOwnProperty.call(message, "energyAvg")) + $root.google.devicesandservices.health.v4.EnergyQuantity.encode(message.energyAvg, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.energyMax != null && Object.hasOwnProperty.call(message, "energyMax")) + $root.google.devicesandservices.health.v4.EnergyQuantity.encode(message.energyMax, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.defaultServing != null && Object.hasOwnProperty.call(message, "defaultServing")) + $root.google.devicesandservices.health.v4.Food.FoodServing.encode(message.defaultServing, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.servings != null && message.servings.length) + for (var i = 0; i < message.servings.length; ++i) + $root.google.devicesandservices.health.v4.Food.FoodServing.encode(message.servings[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Food message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Food.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.Food + * @static + * @param {google.devicesandservices.health.v4.IFood} message Food message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Food.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Food message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.Food + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.Food} Food + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Food.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Food(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.brand = reader.string(); + break; + } + case 4: { + message.accessLevel = reader.int32(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.languageCode = reader.string(); + break; + } + case 10: { + message.mealType = reader.int32(); + break; + } + case 12: { + if (!(message.nutrients && message.nutrients.length)) + message.nutrients = []; + message.nutrients.push($root.google.devicesandservices.health.v4.NutrientQuantity.decode(reader, reader.uint32())); + break; + } + case 13: { + message.energyFromFat = $root.google.devicesandservices.health.v4.EnergyQuantity.decode(reader, reader.uint32()); + break; + } + case 14: { + message.totalCarbohydrate = $root.google.devicesandservices.health.v4.WeightQuantity.decode(reader, reader.uint32()); + break; + } + case 15: { + message.totalFat = $root.google.devicesandservices.health.v4.WeightQuantity.decode(reader, reader.uint32()); + break; + } + case 16: { + message.energyMin = $root.google.devicesandservices.health.v4.EnergyQuantity.decode(reader, reader.uint32()); + break; + } + case 17: { + message.energyAvg = $root.google.devicesandservices.health.v4.EnergyQuantity.decode(reader, reader.uint32()); + break; + } + case 18: { + message.energyMax = $root.google.devicesandservices.health.v4.EnergyQuantity.decode(reader, reader.uint32()); + break; + } + case 19: { + message.defaultServing = $root.google.devicesandservices.health.v4.Food.FoodServing.decode(reader, reader.uint32()); + break; + } + case 20: { + if (!(message.servings && message.servings.length)) + message.servings = []; + message.servings.push($root.google.devicesandservices.health.v4.Food.FoodServing.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Food message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.Food + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.Food} Food + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Food.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Food message. + * @function verify + * @memberof google.devicesandservices.health.v4.Food + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Food.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.brand != null && message.hasOwnProperty("brand")) + if (!$util.isString(message.brand)) + return "brand: string expected"; + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) + switch (message.accessLevel) { + default: + return "accessLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.mealType != null && message.hasOwnProperty("mealType")) + switch (message.mealType) { + default: + return "mealType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.nutrients != null && message.hasOwnProperty("nutrients")) { + if (!Array.isArray(message.nutrients)) + return "nutrients: array expected"; + for (var i = 0; i < message.nutrients.length; ++i) { + var error = $root.google.devicesandservices.health.v4.NutrientQuantity.verify(message.nutrients[i]); + if (error) + return "nutrients." + error; + } + } + if (message.energyFromFat != null && message.hasOwnProperty("energyFromFat")) { + var error = $root.google.devicesandservices.health.v4.EnergyQuantity.verify(message.energyFromFat); + if (error) + return "energyFromFat." + error; + } + if (message.totalCarbohydrate != null && message.hasOwnProperty("totalCarbohydrate")) { + var error = $root.google.devicesandservices.health.v4.WeightQuantity.verify(message.totalCarbohydrate); + if (error) + return "totalCarbohydrate." + error; + } + if (message.totalFat != null && message.hasOwnProperty("totalFat")) { + var error = $root.google.devicesandservices.health.v4.WeightQuantity.verify(message.totalFat); + if (error) + return "totalFat." + error; + } + if (message.energyMin != null && message.hasOwnProperty("energyMin")) { + var error = $root.google.devicesandservices.health.v4.EnergyQuantity.verify(message.energyMin); + if (error) + return "energyMin." + error; + } + if (message.energyAvg != null && message.hasOwnProperty("energyAvg")) { + var error = $root.google.devicesandservices.health.v4.EnergyQuantity.verify(message.energyAvg); + if (error) + return "energyAvg." + error; + } + if (message.energyMax != null && message.hasOwnProperty("energyMax")) { + var error = $root.google.devicesandservices.health.v4.EnergyQuantity.verify(message.energyMax); + if (error) + return "energyMax." + error; + } + if (message.defaultServing != null && message.hasOwnProperty("defaultServing")) { + var error = $root.google.devicesandservices.health.v4.Food.FoodServing.verify(message.defaultServing); + if (error) + return "defaultServing." + error; + } + if (message.servings != null && message.hasOwnProperty("servings")) { + if (!Array.isArray(message.servings)) + return "servings: array expected"; + for (var i = 0; i < message.servings.length; ++i) { + var error = $root.google.devicesandservices.health.v4.Food.FoodServing.verify(message.servings[i]); + if (error) + return "servings." + error; + } + } + return null; + }; + + /** + * Creates a Food message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.Food + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.Food} Food + */ + Food.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Food) + return object; + var message = new $root.google.devicesandservices.health.v4.Food(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.brand != null) + message.brand = String(object.brand); + switch (object.accessLevel) { + default: + if (typeof object.accessLevel === "number") { + message.accessLevel = object.accessLevel; + break; + } + break; + case "FOOD_ACCESS_LEVEL_UNSPECIFIED": + case 0: + message.accessLevel = 0; + break; + case "FOOD_ACCESS_LEVEL_PUBLIC": + case 1: + message.accessLevel = 1; + break; + case "FOOD_ACCESS_LEVEL_PRIVATE": + case 2: + message.accessLevel = 2; + break; + } + if (object.description != null) + message.description = String(object.description); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.mealType) { + default: + if (typeof object.mealType === "number") { + message.mealType = object.mealType; + break; + } + break; + case "MEAL_TYPE_UNSPECIFIED": + case 0: + message.mealType = 0; + break; + case "BEFORE_BREAKFAST": + case 1: + message.mealType = 1; + break; + case "BREAKFAST": + case 2: + message.mealType = 2; + break; + case "BEFORE_LUNCH": + case 3: + message.mealType = 3; + break; + case "LUNCH": + case 4: + message.mealType = 4; + break; + case "BEFORE_DINNER": + case 5: + message.mealType = 5; + break; + case "DINNER": + case 6: + message.mealType = 6; + break; + case "AFTER_DINNER": + case 7: + message.mealType = 7; + break; + case "SNACK": + case 8: + message.mealType = 8; + break; + case "ANYTIME": + case 9: + message.mealType = 9; + break; + } + if (object.nutrients) { + if (!Array.isArray(object.nutrients)) + throw TypeError(".google.devicesandservices.health.v4.Food.nutrients: array expected"); + message.nutrients = []; + for (var i = 0; i < object.nutrients.length; ++i) { + if (typeof object.nutrients[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.Food.nutrients: object expected"); + message.nutrients[i] = $root.google.devicesandservices.health.v4.NutrientQuantity.fromObject(object.nutrients[i]); + } + } + if (object.energyFromFat != null) { + if (typeof object.energyFromFat !== "object") + throw TypeError(".google.devicesandservices.health.v4.Food.energyFromFat: object expected"); + message.energyFromFat = $root.google.devicesandservices.health.v4.EnergyQuantity.fromObject(object.energyFromFat); + } + if (object.totalCarbohydrate != null) { + if (typeof object.totalCarbohydrate !== "object") + throw TypeError(".google.devicesandservices.health.v4.Food.totalCarbohydrate: object expected"); + message.totalCarbohydrate = $root.google.devicesandservices.health.v4.WeightQuantity.fromObject(object.totalCarbohydrate); + } + if (object.totalFat != null) { + if (typeof object.totalFat !== "object") + throw TypeError(".google.devicesandservices.health.v4.Food.totalFat: object expected"); + message.totalFat = $root.google.devicesandservices.health.v4.WeightQuantity.fromObject(object.totalFat); + } + if (object.energyMin != null) { + if (typeof object.energyMin !== "object") + throw TypeError(".google.devicesandservices.health.v4.Food.energyMin: object expected"); + message.energyMin = $root.google.devicesandservices.health.v4.EnergyQuantity.fromObject(object.energyMin); + } + if (object.energyAvg != null) { + if (typeof object.energyAvg !== "object") + throw TypeError(".google.devicesandservices.health.v4.Food.energyAvg: object expected"); + message.energyAvg = $root.google.devicesandservices.health.v4.EnergyQuantity.fromObject(object.energyAvg); + } + if (object.energyMax != null) { + if (typeof object.energyMax !== "object") + throw TypeError(".google.devicesandservices.health.v4.Food.energyMax: object expected"); + message.energyMax = $root.google.devicesandservices.health.v4.EnergyQuantity.fromObject(object.energyMax); + } + if (object.defaultServing != null) { + if (typeof object.defaultServing !== "object") + throw TypeError(".google.devicesandservices.health.v4.Food.defaultServing: object expected"); + message.defaultServing = $root.google.devicesandservices.health.v4.Food.FoodServing.fromObject(object.defaultServing); + } + if (object.servings) { + if (!Array.isArray(object.servings)) + throw TypeError(".google.devicesandservices.health.v4.Food.servings: array expected"); + message.servings = []; + for (var i = 0; i < object.servings.length; ++i) { + if (typeof object.servings[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.Food.servings: object expected"); + message.servings[i] = $root.google.devicesandservices.health.v4.Food.FoodServing.fromObject(object.servings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Food message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.Food + * @static + * @param {google.devicesandservices.health.v4.Food} message Food + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Food.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.nutrients = []; + object.servings = []; + } + if (options.defaults) { + object.displayName = ""; + object.brand = ""; + object.accessLevel = options.enums === String ? "FOOD_ACCESS_LEVEL_UNSPECIFIED" : 0; + object.description = ""; + object.languageCode = ""; + object.mealType = options.enums === String ? "MEAL_TYPE_UNSPECIFIED" : 0; + object.energyFromFat = null; + object.totalCarbohydrate = null; + object.totalFat = null; + object.energyMin = null; + object.energyAvg = null; + object.energyMax = null; + object.defaultServing = null; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.brand != null && message.hasOwnProperty("brand")) + object.brand = message.brand; + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) + object.accessLevel = options.enums === String ? $root.google.devicesandservices.health.v4.FoodAccessLevel[message.accessLevel] === undefined ? message.accessLevel : $root.google.devicesandservices.health.v4.FoodAccessLevel[message.accessLevel] : message.accessLevel; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.mealType != null && message.hasOwnProperty("mealType")) + object.mealType = options.enums === String ? $root.google.devicesandservices.health.v4.MealType[message.mealType] === undefined ? message.mealType : $root.google.devicesandservices.health.v4.MealType[message.mealType] : message.mealType; + if (message.nutrients && message.nutrients.length) { + object.nutrients = []; + for (var j = 0; j < message.nutrients.length; ++j) + object.nutrients[j] = $root.google.devicesandservices.health.v4.NutrientQuantity.toObject(message.nutrients[j], options); + } + if (message.energyFromFat != null && message.hasOwnProperty("energyFromFat")) + object.energyFromFat = $root.google.devicesandservices.health.v4.EnergyQuantity.toObject(message.energyFromFat, options); + if (message.totalCarbohydrate != null && message.hasOwnProperty("totalCarbohydrate")) + object.totalCarbohydrate = $root.google.devicesandservices.health.v4.WeightQuantity.toObject(message.totalCarbohydrate, options); + if (message.totalFat != null && message.hasOwnProperty("totalFat")) + object.totalFat = $root.google.devicesandservices.health.v4.WeightQuantity.toObject(message.totalFat, options); + if (message.energyMin != null && message.hasOwnProperty("energyMin")) + object.energyMin = $root.google.devicesandservices.health.v4.EnergyQuantity.toObject(message.energyMin, options); + if (message.energyAvg != null && message.hasOwnProperty("energyAvg")) + object.energyAvg = $root.google.devicesandservices.health.v4.EnergyQuantity.toObject(message.energyAvg, options); + if (message.energyMax != null && message.hasOwnProperty("energyMax")) + object.energyMax = $root.google.devicesandservices.health.v4.EnergyQuantity.toObject(message.energyMax, options); + if (message.defaultServing != null && message.hasOwnProperty("defaultServing")) + object.defaultServing = $root.google.devicesandservices.health.v4.Food.FoodServing.toObject(message.defaultServing, options); + if (message.servings && message.servings.length) { + object.servings = []; + for (var j = 0; j < message.servings.length; ++j) + object.servings[j] = $root.google.devicesandservices.health.v4.Food.FoodServing.toObject(message.servings[j], options); + } + return object; + }; + + /** + * Converts this Food to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.Food + * @instance + * @returns {Object.} JSON object + */ + Food.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Food + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.Food + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Food.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.Food"; + }; + + Food.FoodServing = (function() { + + /** + * Properties of a FoodServing. + * @memberof google.devicesandservices.health.v4.Food + * @interface IFoodServing + * @property {number|null} [amount] FoodServing amount + * @property {string|null} [foodMeasurementUnit] FoodServing foodMeasurementUnit + * @property {string|null} [foodMeasurementUnitDisplayName] FoodServing foodMeasurementUnitDisplayName + * @property {string|null} [foodMeasurementUnitDisplayNamePlural] FoodServing foodMeasurementUnitDisplayNamePlural + * @property {number|null} [multiplier] FoodServing multiplier + */ + + /** + * Constructs a new FoodServing. + * @memberof google.devicesandservices.health.v4.Food + * @classdesc Represents a FoodServing. + * @implements IFoodServing + * @constructor + * @param {google.devicesandservices.health.v4.Food.IFoodServing=} [properties] Properties to set + */ + function FoodServing(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17926,183 +20665,142 @@ } /** - * SleepSummary minutesInSleepPeriod. - * @member {number|Long|null|undefined} minutesInSleepPeriod - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary - * @instance - */ - SleepSummary.prototype.minutesInSleepPeriod = null; - - /** - * SleepSummary minutesAfterWakeUp. - * @member {number|Long|null|undefined} minutesAfterWakeUp - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * FoodServing amount. + * @member {number|null|undefined} amount + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @instance */ - SleepSummary.prototype.minutesAfterWakeUp = null; + FoodServing.prototype.amount = null; /** - * SleepSummary minutesToFallAsleep. - * @member {number|Long|null|undefined} minutesToFallAsleep - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * FoodServing foodMeasurementUnit. + * @member {string} foodMeasurementUnit + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @instance */ - SleepSummary.prototype.minutesToFallAsleep = null; + FoodServing.prototype.foodMeasurementUnit = ""; /** - * SleepSummary minutesAsleep. - * @member {number|Long|null|undefined} minutesAsleep - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * FoodServing foodMeasurementUnitDisplayName. + * @member {string} foodMeasurementUnitDisplayName + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @instance */ - SleepSummary.prototype.minutesAsleep = null; + FoodServing.prototype.foodMeasurementUnitDisplayName = ""; /** - * SleepSummary minutesAwake. - * @member {number|Long|null|undefined} minutesAwake - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * FoodServing foodMeasurementUnitDisplayNamePlural. + * @member {string} foodMeasurementUnitDisplayNamePlural + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @instance */ - SleepSummary.prototype.minutesAwake = null; + FoodServing.prototype.foodMeasurementUnitDisplayNamePlural = ""; /** - * SleepSummary stagesSummary. - * @member {Array.} stagesSummary - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * FoodServing multiplier. + * @member {number} multiplier + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @instance */ - SleepSummary.prototype.stagesSummary = $util.emptyArray; + FoodServing.prototype.multiplier = 0; // OneOf field names bound to virtual getters and setters var $oneOfFields; // Virtual OneOf for proto3 optional field - Object.defineProperty(SleepSummary.prototype, "_minutesInSleepPeriod", { - get: $util.oneOfGetter($oneOfFields = ["minutesInSleepPeriod"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SleepSummary.prototype, "_minutesAfterWakeUp", { - get: $util.oneOfGetter($oneOfFields = ["minutesAfterWakeUp"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SleepSummary.prototype, "_minutesToFallAsleep", { - get: $util.oneOfGetter($oneOfFields = ["minutesToFallAsleep"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SleepSummary.prototype, "_minutesAsleep", { - get: $util.oneOfGetter($oneOfFields = ["minutesAsleep"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SleepSummary.prototype, "_minutesAwake", { - get: $util.oneOfGetter($oneOfFields = ["minutesAwake"]), + Object.defineProperty(FoodServing.prototype, "_amount", { + get: $util.oneOfGetter($oneOfFields = ["amount"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new SleepSummary instance using the specified properties. + * Creates a new FoodServing instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @static - * @param {google.devicesandservices.health.v4.Sleep.ISleepSummary=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary} SleepSummary instance + * @param {google.devicesandservices.health.v4.Food.IFoodServing=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Food.FoodServing} FoodServing instance */ - SleepSummary.create = function create(properties) { - return new SleepSummary(properties); + FoodServing.create = function create(properties) { + return new FoodServing(properties); }; /** - * Encodes the specified SleepSummary message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.verify|verify} messages. + * Encodes the specified FoodServing message. Does not implicitly {@link google.devicesandservices.health.v4.Food.FoodServing.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @static - * @param {google.devicesandservices.health.v4.Sleep.ISleepSummary} message SleepSummary message or plain object to encode + * @param {google.devicesandservices.health.v4.Food.IFoodServing} message FoodServing message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SleepSummary.encode = function encode(message, writer) { + FoodServing.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.minutesInSleepPeriod != null && Object.hasOwnProperty.call(message, "minutesInSleepPeriod")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.minutesInSleepPeriod); - if (message.minutesAfterWakeUp != null && Object.hasOwnProperty.call(message, "minutesAfterWakeUp")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.minutesAfterWakeUp); - if (message.minutesToFallAsleep != null && Object.hasOwnProperty.call(message, "minutesToFallAsleep")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.minutesToFallAsleep); - if (message.minutesAsleep != null && Object.hasOwnProperty.call(message, "minutesAsleep")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.minutesAsleep); - if (message.minutesAwake != null && Object.hasOwnProperty.call(message, "minutesAwake")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.minutesAwake); - if (message.stagesSummary != null && message.stagesSummary.length) - for (var i = 0; i < message.stagesSummary.length; ++i) - $root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.encode(message.stagesSummary[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.amount); + if (message.foodMeasurementUnit != null && Object.hasOwnProperty.call(message, "foodMeasurementUnit")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.foodMeasurementUnit); + if (message.foodMeasurementUnitDisplayName != null && Object.hasOwnProperty.call(message, "foodMeasurementUnitDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.foodMeasurementUnitDisplayName); + if (message.foodMeasurementUnitDisplayNamePlural != null && Object.hasOwnProperty.call(message, "foodMeasurementUnitDisplayNamePlural")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.foodMeasurementUnitDisplayNamePlural); + if (message.multiplier != null && Object.hasOwnProperty.call(message, "multiplier")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.multiplier); return writer; }; /** - * Encodes the specified SleepSummary message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.verify|verify} messages. + * Encodes the specified FoodServing message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Food.FoodServing.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @static - * @param {google.devicesandservices.health.v4.Sleep.ISleepSummary} message SleepSummary message or plain object to encode + * @param {google.devicesandservices.health.v4.Food.IFoodServing} message FoodServing message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SleepSummary.encodeDelimited = function encodeDelimited(message, writer) { + FoodServing.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SleepSummary message from the specified reader or buffer. + * Decodes a FoodServing message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary} SleepSummary + * @returns {google.devicesandservices.health.v4.Food.FoodServing} FoodServing * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SleepSummary.decode = function decode(reader, length, error) { + FoodServing.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Sleep.SleepSummary(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Food.FoodServing(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.minutesInSleepPeriod = reader.int64(); + message.amount = reader.double(); break; } case 2: { - message.minutesAfterWakeUp = reader.int64(); + message.foodMeasurementUnit = reader.string(); break; } case 3: { - message.minutesToFallAsleep = reader.int64(); + message.foodMeasurementUnitDisplayName = reader.string(); break; } case 4: { - message.minutesAsleep = reader.int64(); + message.foodMeasurementUnitDisplayNamePlural = reader.string(); break; } case 5: { - message.minutesAwake = reader.int64(); - break; - } - case 6: { - if (!(message.stagesSummary && message.stagesSummary.length)) - message.stagesSummary = []; - message.stagesSummary.push($root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.decode(reader, reader.uint32())); + message.multiplier = reader.double(); break; } default: @@ -18114,618 +20812,168 @@ }; /** - * Decodes a SleepSummary message from the specified reader or buffer, length delimited. + * Decodes a FoodServing message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary} SleepSummary + * @returns {google.devicesandservices.health.v4.Food.FoodServing} FoodServing * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SleepSummary.decodeDelimited = function decodeDelimited(reader) { + FoodServing.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SleepSummary message. + * Verifies a FoodServing message. * @function verify - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SleepSummary.verify = function verify(message) { + FoodServing.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.minutesInSleepPeriod != null && message.hasOwnProperty("minutesInSleepPeriod")) { - properties._minutesInSleepPeriod = 1; - if (!$util.isInteger(message.minutesInSleepPeriod) && !(message.minutesInSleepPeriod && $util.isInteger(message.minutesInSleepPeriod.low) && $util.isInteger(message.minutesInSleepPeriod.high))) - return "minutesInSleepPeriod: integer|Long expected"; - } - if (message.minutesAfterWakeUp != null && message.hasOwnProperty("minutesAfterWakeUp")) { - properties._minutesAfterWakeUp = 1; - if (!$util.isInteger(message.minutesAfterWakeUp) && !(message.minutesAfterWakeUp && $util.isInteger(message.minutesAfterWakeUp.low) && $util.isInteger(message.minutesAfterWakeUp.high))) - return "minutesAfterWakeUp: integer|Long expected"; - } - if (message.minutesToFallAsleep != null && message.hasOwnProperty("minutesToFallAsleep")) { - properties._minutesToFallAsleep = 1; - if (!$util.isInteger(message.minutesToFallAsleep) && !(message.minutesToFallAsleep && $util.isInteger(message.minutesToFallAsleep.low) && $util.isInteger(message.minutesToFallAsleep.high))) - return "minutesToFallAsleep: integer|Long expected"; - } - if (message.minutesAsleep != null && message.hasOwnProperty("minutesAsleep")) { - properties._minutesAsleep = 1; - if (!$util.isInteger(message.minutesAsleep) && !(message.minutesAsleep && $util.isInteger(message.minutesAsleep.low) && $util.isInteger(message.minutesAsleep.high))) - return "minutesAsleep: integer|Long expected"; - } - if (message.minutesAwake != null && message.hasOwnProperty("minutesAwake")) { - properties._minutesAwake = 1; - if (!$util.isInteger(message.minutesAwake) && !(message.minutesAwake && $util.isInteger(message.minutesAwake.low) && $util.isInteger(message.minutesAwake.high))) - return "minutesAwake: integer|Long expected"; - } - if (message.stagesSummary != null && message.hasOwnProperty("stagesSummary")) { - if (!Array.isArray(message.stagesSummary)) - return "stagesSummary: array expected"; - for (var i = 0; i < message.stagesSummary.length; ++i) { - var error = $root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.verify(message.stagesSummary[i]); - if (error) - return "stagesSummary." + error; - } + if (message.amount != null && message.hasOwnProperty("amount")) { + properties._amount = 1; + if (typeof message.amount !== "number") + return "amount: number expected"; } + if (message.foodMeasurementUnit != null && message.hasOwnProperty("foodMeasurementUnit")) + if (!$util.isString(message.foodMeasurementUnit)) + return "foodMeasurementUnit: string expected"; + if (message.foodMeasurementUnitDisplayName != null && message.hasOwnProperty("foodMeasurementUnitDisplayName")) + if (!$util.isString(message.foodMeasurementUnitDisplayName)) + return "foodMeasurementUnitDisplayName: string expected"; + if (message.foodMeasurementUnitDisplayNamePlural != null && message.hasOwnProperty("foodMeasurementUnitDisplayNamePlural")) + if (!$util.isString(message.foodMeasurementUnitDisplayNamePlural)) + return "foodMeasurementUnitDisplayNamePlural: string expected"; + if (message.multiplier != null && message.hasOwnProperty("multiplier")) + if (typeof message.multiplier !== "number") + return "multiplier: number expected"; return null; }; /** - * Creates a SleepSummary message from a plain object. Also converts values to their respective internal types. + * Creates a FoodServing message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary} SleepSummary + * @returns {google.devicesandservices.health.v4.Food.FoodServing} FoodServing */ - SleepSummary.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.Sleep.SleepSummary) + FoodServing.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Food.FoodServing) return object; - var message = new $root.google.devicesandservices.health.v4.Sleep.SleepSummary(); - if (object.minutesInSleepPeriod != null) - if ($util.Long) - (message.minutesInSleepPeriod = $util.Long.fromValue(object.minutesInSleepPeriod)).unsigned = false; - else if (typeof object.minutesInSleepPeriod === "string") - message.minutesInSleepPeriod = parseInt(object.minutesInSleepPeriod, 10); - else if (typeof object.minutesInSleepPeriod === "number") - message.minutesInSleepPeriod = object.minutesInSleepPeriod; - else if (typeof object.minutesInSleepPeriod === "object") - message.minutesInSleepPeriod = new $util.LongBits(object.minutesInSleepPeriod.low >>> 0, object.minutesInSleepPeriod.high >>> 0).toNumber(); - if (object.minutesAfterWakeUp != null) - if ($util.Long) - (message.minutesAfterWakeUp = $util.Long.fromValue(object.minutesAfterWakeUp)).unsigned = false; - else if (typeof object.minutesAfterWakeUp === "string") - message.minutesAfterWakeUp = parseInt(object.minutesAfterWakeUp, 10); - else if (typeof object.minutesAfterWakeUp === "number") - message.minutesAfterWakeUp = object.minutesAfterWakeUp; - else if (typeof object.minutesAfterWakeUp === "object") - message.minutesAfterWakeUp = new $util.LongBits(object.minutesAfterWakeUp.low >>> 0, object.minutesAfterWakeUp.high >>> 0).toNumber(); - if (object.minutesToFallAsleep != null) - if ($util.Long) - (message.minutesToFallAsleep = $util.Long.fromValue(object.minutesToFallAsleep)).unsigned = false; - else if (typeof object.minutesToFallAsleep === "string") - message.minutesToFallAsleep = parseInt(object.minutesToFallAsleep, 10); - else if (typeof object.minutesToFallAsleep === "number") - message.minutesToFallAsleep = object.minutesToFallAsleep; - else if (typeof object.minutesToFallAsleep === "object") - message.minutesToFallAsleep = new $util.LongBits(object.minutesToFallAsleep.low >>> 0, object.minutesToFallAsleep.high >>> 0).toNumber(); - if (object.minutesAsleep != null) - if ($util.Long) - (message.minutesAsleep = $util.Long.fromValue(object.minutesAsleep)).unsigned = false; - else if (typeof object.minutesAsleep === "string") - message.minutesAsleep = parseInt(object.minutesAsleep, 10); - else if (typeof object.minutesAsleep === "number") - message.minutesAsleep = object.minutesAsleep; - else if (typeof object.minutesAsleep === "object") - message.minutesAsleep = new $util.LongBits(object.minutesAsleep.low >>> 0, object.minutesAsleep.high >>> 0).toNumber(); - if (object.minutesAwake != null) - if ($util.Long) - (message.minutesAwake = $util.Long.fromValue(object.minutesAwake)).unsigned = false; - else if (typeof object.minutesAwake === "string") - message.minutesAwake = parseInt(object.minutesAwake, 10); - else if (typeof object.minutesAwake === "number") - message.minutesAwake = object.minutesAwake; - else if (typeof object.minutesAwake === "object") - message.minutesAwake = new $util.LongBits(object.minutesAwake.low >>> 0, object.minutesAwake.high >>> 0).toNumber(); - if (object.stagesSummary) { - if (!Array.isArray(object.stagesSummary)) - throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepSummary.stagesSummary: array expected"); - message.stagesSummary = []; - for (var i = 0; i < object.stagesSummary.length; ++i) { - if (typeof object.stagesSummary[i] !== "object") - throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepSummary.stagesSummary: object expected"); - message.stagesSummary[i] = $root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.fromObject(object.stagesSummary[i]); - } - } + var message = new $root.google.devicesandservices.health.v4.Food.FoodServing(); + if (object.amount != null) + message.amount = Number(object.amount); + if (object.foodMeasurementUnit != null) + message.foodMeasurementUnit = String(object.foodMeasurementUnit); + if (object.foodMeasurementUnitDisplayName != null) + message.foodMeasurementUnitDisplayName = String(object.foodMeasurementUnitDisplayName); + if (object.foodMeasurementUnitDisplayNamePlural != null) + message.foodMeasurementUnitDisplayNamePlural = String(object.foodMeasurementUnitDisplayNamePlural); + if (object.multiplier != null) + message.multiplier = Number(object.multiplier); return message; }; /** - * Creates a plain object from a SleepSummary message. Also converts values to other types if specified. + * Creates a plain object from a FoodServing message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @static - * @param {google.devicesandservices.health.v4.Sleep.SleepSummary} message SleepSummary + * @param {google.devicesandservices.health.v4.Food.FoodServing} message FoodServing * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SleepSummary.toObject = function toObject(message, options) { + FoodServing.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.stagesSummary = []; - if (message.minutesInSleepPeriod != null && message.hasOwnProperty("minutesInSleepPeriod")) { - if (typeof message.minutesInSleepPeriod === "number") - object.minutesInSleepPeriod = options.longs === String ? String(message.minutesInSleepPeriod) : message.minutesInSleepPeriod; - else - object.minutesInSleepPeriod = options.longs === String ? $util.Long.prototype.toString.call(message.minutesInSleepPeriod) : options.longs === Number ? new $util.LongBits(message.minutesInSleepPeriod.low >>> 0, message.minutesInSleepPeriod.high >>> 0).toNumber() : message.minutesInSleepPeriod; - if (options.oneofs) - object._minutesInSleepPeriod = "minutesInSleepPeriod"; - } - if (message.minutesAfterWakeUp != null && message.hasOwnProperty("minutesAfterWakeUp")) { - if (typeof message.minutesAfterWakeUp === "number") - object.minutesAfterWakeUp = options.longs === String ? String(message.minutesAfterWakeUp) : message.minutesAfterWakeUp; - else - object.minutesAfterWakeUp = options.longs === String ? $util.Long.prototype.toString.call(message.minutesAfterWakeUp) : options.longs === Number ? new $util.LongBits(message.minutesAfterWakeUp.low >>> 0, message.minutesAfterWakeUp.high >>> 0).toNumber() : message.minutesAfterWakeUp; - if (options.oneofs) - object._minutesAfterWakeUp = "minutesAfterWakeUp"; - } - if (message.minutesToFallAsleep != null && message.hasOwnProperty("minutesToFallAsleep")) { - if (typeof message.minutesToFallAsleep === "number") - object.minutesToFallAsleep = options.longs === String ? String(message.minutesToFallAsleep) : message.minutesToFallAsleep; - else - object.minutesToFallAsleep = options.longs === String ? $util.Long.prototype.toString.call(message.minutesToFallAsleep) : options.longs === Number ? new $util.LongBits(message.minutesToFallAsleep.low >>> 0, message.minutesToFallAsleep.high >>> 0).toNumber() : message.minutesToFallAsleep; - if (options.oneofs) - object._minutesToFallAsleep = "minutesToFallAsleep"; - } - if (message.minutesAsleep != null && message.hasOwnProperty("minutesAsleep")) { - if (typeof message.minutesAsleep === "number") - object.minutesAsleep = options.longs === String ? String(message.minutesAsleep) : message.minutesAsleep; - else - object.minutesAsleep = options.longs === String ? $util.Long.prototype.toString.call(message.minutesAsleep) : options.longs === Number ? new $util.LongBits(message.minutesAsleep.low >>> 0, message.minutesAsleep.high >>> 0).toNumber() : message.minutesAsleep; - if (options.oneofs) - object._minutesAsleep = "minutesAsleep"; + if (options.defaults) { + object.foodMeasurementUnit = ""; + object.foodMeasurementUnitDisplayName = ""; + object.foodMeasurementUnitDisplayNamePlural = ""; + object.multiplier = 0; } - if (message.minutesAwake != null && message.hasOwnProperty("minutesAwake")) { - if (typeof message.minutesAwake === "number") - object.minutesAwake = options.longs === String ? String(message.minutesAwake) : message.minutesAwake; - else - object.minutesAwake = options.longs === String ? $util.Long.prototype.toString.call(message.minutesAwake) : options.longs === Number ? new $util.LongBits(message.minutesAwake.low >>> 0, message.minutesAwake.high >>> 0).toNumber() : message.minutesAwake; + if (message.amount != null && message.hasOwnProperty("amount")) { + object.amount = options.json && !isFinite(message.amount) ? String(message.amount) : message.amount; if (options.oneofs) - object._minutesAwake = "minutesAwake"; - } - if (message.stagesSummary && message.stagesSummary.length) { - object.stagesSummary = []; - for (var j = 0; j < message.stagesSummary.length; ++j) - object.stagesSummary[j] = $root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.toObject(message.stagesSummary[j], options); + object._amount = "amount"; } + if (message.foodMeasurementUnit != null && message.hasOwnProperty("foodMeasurementUnit")) + object.foodMeasurementUnit = message.foodMeasurementUnit; + if (message.foodMeasurementUnitDisplayName != null && message.hasOwnProperty("foodMeasurementUnitDisplayName")) + object.foodMeasurementUnitDisplayName = message.foodMeasurementUnitDisplayName; + if (message.foodMeasurementUnitDisplayNamePlural != null && message.hasOwnProperty("foodMeasurementUnitDisplayNamePlural")) + object.foodMeasurementUnitDisplayNamePlural = message.foodMeasurementUnitDisplayNamePlural; + if (message.multiplier != null && message.hasOwnProperty("multiplier")) + object.multiplier = options.json && !isFinite(message.multiplier) ? String(message.multiplier) : message.multiplier; return object; }; /** - * Converts this SleepSummary to JSON. + * Converts this FoodServing to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @instance * @returns {Object.} JSON object */ - SleepSummary.prototype.toJSON = function toJSON() { + FoodServing.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SleepSummary + * Gets the default type url for FoodServing * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @memberof google.devicesandservices.health.v4.Food.FoodServing * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SleepSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FoodServing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.Sleep.SleepSummary"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.Food.FoodServing"; }; - SleepSummary.StageSummary = (function() { - - /** - * Properties of a StageSummary. - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary - * @interface IStageSummary - * @property {google.devicesandservices.health.v4.Sleep.SleepStageType|null} [type] StageSummary type - * @property {number|Long|null} [minutes] StageSummary minutes - * @property {number|Long|null} [count] StageSummary count - */ - - /** - * Constructs a new StageSummary. - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary - * @classdesc Represents a StageSummary. - * @implements IStageSummary - * @constructor - * @param {google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary=} [properties] Properties to set - */ - function StageSummary(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StageSummary type. - * @member {google.devicesandservices.health.v4.Sleep.SleepStageType} type - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary - * @instance - */ - StageSummary.prototype.type = 0; - - /** - * StageSummary minutes. - * @member {number|Long} minutes - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary - * @instance - */ - StageSummary.prototype.minutes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * StageSummary count. - * @member {number|Long} count - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary - * @instance - */ - StageSummary.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new StageSummary instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary - * @static - * @param {google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary} StageSummary instance - */ - StageSummary.create = function create(properties) { - return new StageSummary(properties); - }; - - /** - * Encodes the specified StageSummary message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary - * @static - * @param {google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary} message StageSummary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageSummary.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.minutes); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); - return writer; - }; - - /** - * Encodes the specified StageSummary message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary - * @static - * @param {google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary} message StageSummary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageSummary.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StageSummary message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary} StageSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageSummary.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.minutes = reader.int64(); - break; - } - case 3: { - message.count = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StageSummary message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary} StageSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageSummary.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StageSummary message. - * @function verify - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StageSummary.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.minutes != null && message.hasOwnProperty("minutes")) - if (!$util.isInteger(message.minutes) && !(message.minutes && $util.isInteger(message.minutes.low) && $util.isInteger(message.minutes.high))) - return "minutes: integer|Long expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - return null; - }; - - /** - * Creates a StageSummary message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary} StageSummary - */ - StageSummary.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary) - return object; - var message = new $root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "SLEEP_STAGE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "AWAKE": - case 1: - message.type = 1; - break; - case "LIGHT": - case 2: - message.type = 2; - break; - case "DEEP": - case 3: - message.type = 3; - break; - case "REM": - case 4: - message.type = 4; - break; - case "ASLEEP": - case 5: - message.type = 5; - break; - case "RESTLESS": - case 6: - message.type = 6; - break; - } - if (object.minutes != null) - if ($util.Long) - (message.minutes = $util.Long.fromValue(object.minutes)).unsigned = false; - else if (typeof object.minutes === "string") - message.minutes = parseInt(object.minutes, 10); - else if (typeof object.minutes === "number") - message.minutes = object.minutes; - else if (typeof object.minutes === "object") - message.minutes = new $util.LongBits(object.minutes.low >>> 0, object.minutes.high >>> 0).toNumber(); - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a StageSummary message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary - * @static - * @param {google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary} message StageSummary - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StageSummary.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "SLEEP_STAGE_TYPE_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.minutes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.minutes = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.devicesandservices.health.v4.Sleep.SleepStageType[message.type] === undefined ? message.type : $root.google.devicesandservices.health.v4.Sleep.SleepStageType[message.type] : message.type; - if (message.minutes != null && message.hasOwnProperty("minutes")) - if (typeof message.minutes === "number") - object.minutes = options.longs === String ? String(message.minutes) : message.minutes; - else - object.minutes = options.longs === String ? $util.Long.prototype.toString.call(message.minutes) : options.longs === Number ? new $util.LongBits(message.minutes.low >>> 0, message.minutes.high >>> 0).toNumber() : message.minutes; - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - return object; - }; - - /** - * Converts this StageSummary to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary - * @instance - * @returns {Object.} JSON object - */ - StageSummary.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StageSummary - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StageSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary"; - }; - - return StageSummary; - })(); - - return SleepSummary; - })(); - - /** - * SleepType enum. - * @name google.devicesandservices.health.v4.Sleep.SleepType - * @enum {number} - * @property {number} SLEEP_TYPE_UNSPECIFIED=0 SLEEP_TYPE_UNSPECIFIED value - * @property {number} CLASSIC=1 CLASSIC value - * @property {number} STAGES=2 STAGES value - */ - Sleep.SleepType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SLEEP_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLASSIC"] = 1; - values[valuesById[2] = "STAGES"] = 2; - return values; - })(); - - /** - * SleepStageType enum. - * @name google.devicesandservices.health.v4.Sleep.SleepStageType - * @enum {number} - * @property {number} SLEEP_STAGE_TYPE_UNSPECIFIED=0 SLEEP_STAGE_TYPE_UNSPECIFIED value - * @property {number} AWAKE=1 AWAKE value - * @property {number} LIGHT=2 LIGHT value - * @property {number} DEEP=3 DEEP value - * @property {number} REM=4 REM value - * @property {number} ASLEEP=5 ASLEEP value - * @property {number} RESTLESS=6 RESTLESS value - */ - Sleep.SleepStageType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SLEEP_STAGE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "AWAKE"] = 1; - values[valuesById[2] = "LIGHT"] = 2; - values[valuesById[3] = "DEEP"] = 3; - values[valuesById[4] = "REM"] = 4; - values[valuesById[5] = "ASLEEP"] = 5; - values[valuesById[6] = "RESTLESS"] = 6; - return values; + return FoodServing; })(); - return Sleep; + return Food; })(); - v4.Steps = (function() { + v4.NutritionLogRollupValue = (function() { /** - * Properties of a Steps. + * Properties of a NutritionLogRollupValue. * @memberof google.devicesandservices.health.v4 - * @interface ISteps - * @property {google.devicesandservices.health.v4.IObservationTimeInterval|null} [interval] Steps interval - * @property {number|Long|null} [count] Steps count + * @interface INutritionLogRollupValue + * @property {Array.|null} [nutrients] NutritionLogRollupValue nutrients + * @property {google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup|null} [energy] NutritionLogRollupValue energy + * @property {google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup|null} [energyFromFat] NutritionLogRollupValue energyFromFat + * @property {google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup|null} [totalCarbohydrate] NutritionLogRollupValue totalCarbohydrate + * @property {google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup|null} [totalFat] NutritionLogRollupValue totalFat */ /** - * Constructs a new Steps. + * Constructs a new NutritionLogRollupValue. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a Steps. - * @implements ISteps + * @classdesc Represents a NutritionLogRollupValue. + * @implements INutritionLogRollupValue * @constructor - * @param {google.devicesandservices.health.v4.ISteps=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.INutritionLogRollupValue=} [properties] Properties to set */ - function Steps(properties) { + function NutritionLogRollupValue(properties) { + this.nutrients = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18733,91 +20981,136 @@ } /** - * Steps interval. - * @member {google.devicesandservices.health.v4.IObservationTimeInterval|null|undefined} interval - * @memberof google.devicesandservices.health.v4.Steps + * NutritionLogRollupValue nutrients. + * @member {Array.} nutrients + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue * @instance */ - Steps.prototype.interval = null; + NutritionLogRollupValue.prototype.nutrients = $util.emptyArray; /** - * Steps count. - * @member {number|Long} count - * @memberof google.devicesandservices.health.v4.Steps + * NutritionLogRollupValue energy. + * @member {google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup|null|undefined} energy + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue * @instance */ - Steps.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + NutritionLogRollupValue.prototype.energy = null; /** - * Creates a new Steps instance using the specified properties. + * NutritionLogRollupValue energyFromFat. + * @member {google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup|null|undefined} energyFromFat + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue + * @instance + */ + NutritionLogRollupValue.prototype.energyFromFat = null; + + /** + * NutritionLogRollupValue totalCarbohydrate. + * @member {google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup|null|undefined} totalCarbohydrate + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue + * @instance + */ + NutritionLogRollupValue.prototype.totalCarbohydrate = null; + + /** + * NutritionLogRollupValue totalFat. + * @member {google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup|null|undefined} totalFat + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue + * @instance + */ + NutritionLogRollupValue.prototype.totalFat = null; + + /** + * Creates a new NutritionLogRollupValue instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.Steps + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue * @static - * @param {google.devicesandservices.health.v4.ISteps=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.Steps} Steps instance + * @param {google.devicesandservices.health.v4.INutritionLogRollupValue=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue} NutritionLogRollupValue instance */ - Steps.create = function create(properties) { - return new Steps(properties); + NutritionLogRollupValue.create = function create(properties) { + return new NutritionLogRollupValue(properties); }; /** - * Encodes the specified Steps message. Does not implicitly {@link google.devicesandservices.health.v4.Steps.verify|verify} messages. + * Encodes the specified NutritionLogRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.Steps + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue * @static - * @param {google.devicesandservices.health.v4.ISteps} message Steps message or plain object to encode + * @param {google.devicesandservices.health.v4.INutritionLogRollupValue} message NutritionLogRollupValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Steps.encode = function encode(message, writer) { + NutritionLogRollupValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) - $root.google.devicesandservices.health.v4.ObservationTimeInterval.encode(message.interval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.count); + if (message.nutrients != null && message.nutrients.length) + for (var i = 0; i < message.nutrients.length; ++i) + $root.google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup.encode(message.nutrients[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.energy != null && Object.hasOwnProperty.call(message, "energy")) + $root.google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup.encode(message.energy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.energyFromFat != null && Object.hasOwnProperty.call(message, "energyFromFat")) + $root.google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup.encode(message.energyFromFat, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalCarbohydrate != null && Object.hasOwnProperty.call(message, "totalCarbohydrate")) + $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.encode(message.totalCarbohydrate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.totalFat != null && Object.hasOwnProperty.call(message, "totalFat")) + $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.encode(message.totalFat, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified Steps message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Steps.verify|verify} messages. + * Encodes the specified NutritionLogRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.Steps + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue * @static - * @param {google.devicesandservices.health.v4.ISteps} message Steps message or plain object to encode + * @param {google.devicesandservices.health.v4.INutritionLogRollupValue} message NutritionLogRollupValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Steps.encodeDelimited = function encodeDelimited(message, writer) { + NutritionLogRollupValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Steps message from the specified reader or buffer. + * Decodes a NutritionLogRollupValue message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.Steps + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.Steps} Steps + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue} NutritionLogRollupValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Steps.decode = function decode(reader, length, error) { + NutritionLogRollupValue.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Steps(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.NutritionLogRollupValue(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { + case 1: { + if (!(message.nutrients && message.nutrients.length)) + message.nutrients = []; + message.nutrients.push($root.google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup.decode(reader, reader.uint32())); + break; + } case 2: { - message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.decode(reader, reader.uint32()); + message.energy = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.energyFromFat = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup.decode(reader, reader.uint32()); break; } case 4: { - message.count = reader.int64(); + message.totalCarbohydrate = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.decode(reader, reader.uint32()); + break; + } + case 5: { + message.totalFat = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.decode(reader, reader.uint32()); break; } default: @@ -18829,477 +21122,1315 @@ }; /** - * Decodes a Steps message from the specified reader or buffer, length delimited. + * Decodes a NutritionLogRollupValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.Steps + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.Steps} Steps + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue} NutritionLogRollupValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Steps.decodeDelimited = function decodeDelimited(reader) { + NutritionLogRollupValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Steps message. + * Verifies a NutritionLogRollupValue message. * @function verify - * @memberof google.devicesandservices.health.v4.Steps + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Steps.verify = function verify(message) { + NutritionLogRollupValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.interval != null && message.hasOwnProperty("interval")) { - var error = $root.google.devicesandservices.health.v4.ObservationTimeInterval.verify(message.interval); + if (message.nutrients != null && message.hasOwnProperty("nutrients")) { + if (!Array.isArray(message.nutrients)) + return "nutrients: array expected"; + for (var i = 0; i < message.nutrients.length; ++i) { + var error = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup.verify(message.nutrients[i]); + if (error) + return "nutrients." + error; + } + } + if (message.energy != null && message.hasOwnProperty("energy")) { + var error = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup.verify(message.energy); if (error) - return "interval." + error; + return "energy." + error; + } + if (message.energyFromFat != null && message.hasOwnProperty("energyFromFat")) { + var error = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup.verify(message.energyFromFat); + if (error) + return "energyFromFat." + error; + } + if (message.totalCarbohydrate != null && message.hasOwnProperty("totalCarbohydrate")) { + var error = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.verify(message.totalCarbohydrate); + if (error) + return "totalCarbohydrate." + error; + } + if (message.totalFat != null && message.hasOwnProperty("totalFat")) { + var error = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.verify(message.totalFat); + if (error) + return "totalFat." + error; } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; return null; }; /** - * Creates a Steps message from a plain object. Also converts values to their respective internal types. + * Creates a NutritionLogRollupValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.Steps + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.Steps} Steps + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue} NutritionLogRollupValue */ - Steps.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.Steps) + NutritionLogRollupValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.NutritionLogRollupValue) return object; - var message = new $root.google.devicesandservices.health.v4.Steps(); - if (object.interval != null) { - if (typeof object.interval !== "object") - throw TypeError(".google.devicesandservices.health.v4.Steps.interval: object expected"); - message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.fromObject(object.interval); + var message = new $root.google.devicesandservices.health.v4.NutritionLogRollupValue(); + if (object.nutrients) { + if (!Array.isArray(object.nutrients)) + throw TypeError(".google.devicesandservices.health.v4.NutritionLogRollupValue.nutrients: array expected"); + message.nutrients = []; + for (var i = 0; i < object.nutrients.length; ++i) { + if (typeof object.nutrients[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.NutritionLogRollupValue.nutrients: object expected"); + message.nutrients[i] = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup.fromObject(object.nutrients[i]); + } + } + if (object.energy != null) { + if (typeof object.energy !== "object") + throw TypeError(".google.devicesandservices.health.v4.NutritionLogRollupValue.energy: object expected"); + message.energy = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup.fromObject(object.energy); + } + if (object.energyFromFat != null) { + if (typeof object.energyFromFat !== "object") + throw TypeError(".google.devicesandservices.health.v4.NutritionLogRollupValue.energyFromFat: object expected"); + message.energyFromFat = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup.fromObject(object.energyFromFat); + } + if (object.totalCarbohydrate != null) { + if (typeof object.totalCarbohydrate !== "object") + throw TypeError(".google.devicesandservices.health.v4.NutritionLogRollupValue.totalCarbohydrate: object expected"); + message.totalCarbohydrate = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.fromObject(object.totalCarbohydrate); + } + if (object.totalFat != null) { + if (typeof object.totalFat !== "object") + throw TypeError(".google.devicesandservices.health.v4.NutritionLogRollupValue.totalFat: object expected"); + message.totalFat = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.fromObject(object.totalFat); } - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a Steps message. Also converts values to other types if specified. + * Creates a plain object from a NutritionLogRollupValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.Steps + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue * @static - * @param {google.devicesandservices.health.v4.Steps} message Steps + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue} message NutritionLogRollupValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Steps.toObject = function toObject(message, options) { + NutritionLogRollupValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.nutrients = []; if (options.defaults) { - object.interval = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - } - if (message.interval != null && message.hasOwnProperty("interval")) - object.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.toObject(message.interval, options); - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + object.energy = null; + object.energyFromFat = null; + object.totalCarbohydrate = null; + object.totalFat = null; + } + if (message.nutrients && message.nutrients.length) { + object.nutrients = []; + for (var j = 0; j < message.nutrients.length; ++j) + object.nutrients[j] = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup.toObject(message.nutrients[j], options); + } + if (message.energy != null && message.hasOwnProperty("energy")) + object.energy = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup.toObject(message.energy, options); + if (message.energyFromFat != null && message.hasOwnProperty("energyFromFat")) + object.energyFromFat = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup.toObject(message.energyFromFat, options); + if (message.totalCarbohydrate != null && message.hasOwnProperty("totalCarbohydrate")) + object.totalCarbohydrate = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.toObject(message.totalCarbohydrate, options); + if (message.totalFat != null && message.hasOwnProperty("totalFat")) + object.totalFat = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.toObject(message.totalFat, options); return object; }; /** - * Converts this Steps to JSON. + * Converts this NutritionLogRollupValue to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.Steps + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue * @instance * @returns {Object.} JSON object */ - Steps.prototype.toJSON = function toJSON() { + NutritionLogRollupValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Steps + * Gets the default type url for NutritionLogRollupValue * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.Steps + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Steps.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + NutritionLogRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.Steps"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.NutritionLogRollupValue"; }; - return Steps; - })(); + NutritionLogRollupValue.WeightQuantityRollup = (function() { - v4.StepsRollupValue = (function() { + /** + * Properties of a WeightQuantityRollup. + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue + * @interface IWeightQuantityRollup + * @property {number|null} [gramsSum] WeightQuantityRollup gramsSum + * @property {google.devicesandservices.health.v4.WeightUnit|null} [userProvidedUnitLast] WeightQuantityRollup userProvidedUnitLast + */ - /** - * Properties of a StepsRollupValue. - * @memberof google.devicesandservices.health.v4 - * @interface IStepsRollupValue - * @property {number|Long|null} [countSum] StepsRollupValue countSum - */ + /** + * Constructs a new WeightQuantityRollup. + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue + * @classdesc Represents a WeightQuantityRollup. + * @implements IWeightQuantityRollup + * @constructor + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup=} [properties] Properties to set + */ + function WeightQuantityRollup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new StepsRollupValue. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a StepsRollupValue. - * @implements IStepsRollupValue - * @constructor - * @param {google.devicesandservices.health.v4.IStepsRollupValue=} [properties] Properties to set - */ - function StepsRollupValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * WeightQuantityRollup gramsSum. + * @member {number|null|undefined} gramsSum + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup + * @instance + */ + WeightQuantityRollup.prototype.gramsSum = null; - /** - * StepsRollupValue countSum. - * @member {number|Long} countSum - * @memberof google.devicesandservices.health.v4.StepsRollupValue - * @instance - */ - StepsRollupValue.prototype.countSum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * WeightQuantityRollup userProvidedUnitLast. + * @member {google.devicesandservices.health.v4.WeightUnit} userProvidedUnitLast + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup + * @instance + */ + WeightQuantityRollup.prototype.userProvidedUnitLast = 0; - /** - * Creates a new StepsRollupValue instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.StepsRollupValue - * @static - * @param {google.devicesandservices.health.v4.IStepsRollupValue=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.StepsRollupValue} StepsRollupValue instance - */ - StepsRollupValue.create = function create(properties) { - return new StepsRollupValue(properties); - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Encodes the specified StepsRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.StepsRollupValue.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.StepsRollupValue - * @static - * @param {google.devicesandservices.health.v4.IStepsRollupValue} message StepsRollupValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StepsRollupValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.countSum != null && Object.hasOwnProperty.call(message, "countSum")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.countSum); - return writer; - }; + // Virtual OneOf for proto3 optional field + Object.defineProperty(WeightQuantityRollup.prototype, "_gramsSum", { + get: $util.oneOfGetter($oneOfFields = ["gramsSum"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Encodes the specified StepsRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.StepsRollupValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.StepsRollupValue - * @static - * @param {google.devicesandservices.health.v4.IStepsRollupValue} message StepsRollupValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StepsRollupValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new WeightQuantityRollup instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup + * @static + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup} WeightQuantityRollup instance + */ + WeightQuantityRollup.create = function create(properties) { + return new WeightQuantityRollup(properties); + }; - /** - * Decodes a StepsRollupValue message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.StepsRollupValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.StepsRollupValue} StepsRollupValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StepsRollupValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.StepsRollupValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.countSum = reader.int64(); + /** + * Encodes the specified WeightQuantityRollup message. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup + * @static + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup} message WeightQuantityRollup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeightQuantityRollup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gramsSum != null && Object.hasOwnProperty.call(message, "gramsSum")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.gramsSum); + if (message.userProvidedUnitLast != null && Object.hasOwnProperty.call(message, "userProvidedUnitLast")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.userProvidedUnitLast); + return writer; + }; + + /** + * Encodes the specified WeightQuantityRollup message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup + * @static + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup} message WeightQuantityRollup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeightQuantityRollup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeightQuantityRollup message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup} WeightQuantityRollup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeightQuantityRollup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gramsSum = reader.double(); + break; + } + case 2: { + message.userProvidedUnitLast = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WeightQuantityRollup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup} WeightQuantityRollup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeightQuantityRollup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeightQuantityRollup message. + * @function verify + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeightQuantityRollup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gramsSum != null && message.hasOwnProperty("gramsSum")) { + properties._gramsSum = 1; + if (typeof message.gramsSum !== "number") + return "gramsSum: number expected"; + } + if (message.userProvidedUnitLast != null && message.hasOwnProperty("userProvidedUnitLast")) + switch (message.userProvidedUnitLast) { + default: + return "userProvidedUnitLast: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: break; } + return null; + }; + + /** + * Creates a WeightQuantityRollup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup} WeightQuantityRollup + */ + WeightQuantityRollup.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup) + return object; + var message = new $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup(); + if (object.gramsSum != null) + message.gramsSum = Number(object.gramsSum); + switch (object.userProvidedUnitLast) { default: - reader.skipType(tag & 7); + if (typeof object.userProvidedUnitLast === "number") { + message.userProvidedUnitLast = object.userProvidedUnitLast; + break; + } + break; + case "WEIGHT_UNIT_UNSPECIFIED": + case 0: + message.userProvidedUnitLast = 0; + break; + case "GRAM": + case 1: + message.userProvidedUnitLast = 1; + break; + case "KILOGRAM": + case 2: + message.userProvidedUnitLast = 2; + break; + case "OUNCE": + case 3: + message.userProvidedUnitLast = 3; + break; + case "POUND": + case 4: + message.userProvidedUnitLast = 4; + break; + case "STONE": + case 5: + message.userProvidedUnitLast = 5; + break; + case "MILLIGRAM": + case 6: + message.userProvidedUnitLast = 6; + break; + case "MICROGRAM": + case 7: + message.userProvidedUnitLast = 7; + break; + case "NANOGRAM": + case 8: + message.userProvidedUnitLast = 8; break; } - } - return message; - }; + return message; + }; - /** - * Decodes a StepsRollupValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.StepsRollupValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.StepsRollupValue} StepsRollupValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StepsRollupValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from a WeightQuantityRollup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup + * @static + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup} message WeightQuantityRollup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeightQuantityRollup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.userProvidedUnitLast = options.enums === String ? "WEIGHT_UNIT_UNSPECIFIED" : 0; + if (message.gramsSum != null && message.hasOwnProperty("gramsSum")) { + object.gramsSum = options.json && !isFinite(message.gramsSum) ? String(message.gramsSum) : message.gramsSum; + if (options.oneofs) + object._gramsSum = "gramsSum"; + } + if (message.userProvidedUnitLast != null && message.hasOwnProperty("userProvidedUnitLast")) + object.userProvidedUnitLast = options.enums === String ? $root.google.devicesandservices.health.v4.WeightUnit[message.userProvidedUnitLast] === undefined ? message.userProvidedUnitLast : $root.google.devicesandservices.health.v4.WeightUnit[message.userProvidedUnitLast] : message.userProvidedUnitLast; + return object; + }; - /** - * Verifies a StepsRollupValue message. - * @function verify - * @memberof google.devicesandservices.health.v4.StepsRollupValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StepsRollupValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.countSum != null && message.hasOwnProperty("countSum")) - if (!$util.isInteger(message.countSum) && !(message.countSum && $util.isInteger(message.countSum.low) && $util.isInteger(message.countSum.high))) - return "countSum: integer|Long expected"; - return null; - }; + /** + * Converts this WeightQuantityRollup to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup + * @instance + * @returns {Object.} JSON object + */ + WeightQuantityRollup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a StepsRollupValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.StepsRollupValue - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.StepsRollupValue} StepsRollupValue - */ - StepsRollupValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.StepsRollupValue) - return object; - var message = new $root.google.devicesandservices.health.v4.StepsRollupValue(); - if (object.countSum != null) - if ($util.Long) - (message.countSum = $util.Long.fromValue(object.countSum)).unsigned = false; - else if (typeof object.countSum === "string") - message.countSum = parseInt(object.countSum, 10); - else if (typeof object.countSum === "number") - message.countSum = object.countSum; - else if (typeof object.countSum === "object") - message.countSum = new $util.LongBits(object.countSum.low >>> 0, object.countSum.high >>> 0).toNumber(); - return message; - }; + /** + * Gets the default type url for WeightQuantityRollup + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeightQuantityRollup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup"; + }; - /** - * Creates a plain object from a StepsRollupValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.StepsRollupValue - * @static - * @param {google.devicesandservices.health.v4.StepsRollupValue} message StepsRollupValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StepsRollupValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.countSum = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.countSum = options.longs === String ? "0" : 0; - if (message.countSum != null && message.hasOwnProperty("countSum")) - if (typeof message.countSum === "number") - object.countSum = options.longs === String ? String(message.countSum) : message.countSum; - else - object.countSum = options.longs === String ? $util.Long.prototype.toString.call(message.countSum) : options.longs === Number ? new $util.LongBits(message.countSum.low >>> 0, message.countSum.high >>> 0).toNumber() : message.countSum; - return object; - }; + return WeightQuantityRollup; + })(); - /** - * Converts this StepsRollupValue to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.StepsRollupValue - * @instance - * @returns {Object.} JSON object - */ - StepsRollupValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + NutritionLogRollupValue.EnergyQuantityRollup = (function() { - /** - * Gets the default type url for StepsRollupValue - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.StepsRollupValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StepsRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Properties of an EnergyQuantityRollup. + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue + * @interface IEnergyQuantityRollup + * @property {number|null} [kcalSum] EnergyQuantityRollup kcalSum + * @property {google.devicesandservices.health.v4.EnergyUnit|null} [userProvidedUnitLast] EnergyQuantityRollup userProvidedUnitLast + */ + + /** + * Constructs a new EnergyQuantityRollup. + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue + * @classdesc Represents an EnergyQuantityRollup. + * @implements IEnergyQuantityRollup + * @constructor + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup=} [properties] Properties to set + */ + function EnergyQuantityRollup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.StepsRollupValue"; - }; - return StepsRollupValue; - })(); + /** + * EnergyQuantityRollup kcalSum. + * @member {number|null|undefined} kcalSum + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup + * @instance + */ + EnergyQuantityRollup.prototype.kcalSum = null; - v4.SwimLengthsData = (function() { + /** + * EnergyQuantityRollup userProvidedUnitLast. + * @member {google.devicesandservices.health.v4.EnergyUnit} userProvidedUnitLast + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup + * @instance + */ + EnergyQuantityRollup.prototype.userProvidedUnitLast = 0; - /** - * Properties of a SwimLengthsData. - * @memberof google.devicesandservices.health.v4 - * @interface ISwimLengthsData - * @property {google.devicesandservices.health.v4.IObservationTimeInterval|null} [interval] SwimLengthsData interval - * @property {google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType|null} [swimStrokeType] SwimLengthsData swimStrokeType - * @property {number|Long|null} [strokeCount] SwimLengthsData strokeCount - */ + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Constructs a new SwimLengthsData. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a SwimLengthsData. - * @implements ISwimLengthsData - * @constructor - * @param {google.devicesandservices.health.v4.ISwimLengthsData=} [properties] Properties to set - */ - function SwimLengthsData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + // Virtual OneOf for proto3 optional field + Object.defineProperty(EnergyQuantityRollup.prototype, "_kcalSum", { + get: $util.oneOfGetter($oneOfFields = ["kcalSum"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * SwimLengthsData interval. - * @member {google.devicesandservices.health.v4.IObservationTimeInterval|null|undefined} interval - * @memberof google.devicesandservices.health.v4.SwimLengthsData - * @instance - */ - SwimLengthsData.prototype.interval = null; + /** + * Creates a new EnergyQuantityRollup instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup + * @static + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup} EnergyQuantityRollup instance + */ + EnergyQuantityRollup.create = function create(properties) { + return new EnergyQuantityRollup(properties); + }; - /** - * SwimLengthsData swimStrokeType. - * @member {google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType} swimStrokeType - * @memberof google.devicesandservices.health.v4.SwimLengthsData - * @instance - */ - SwimLengthsData.prototype.swimStrokeType = 0; + /** + * Encodes the specified EnergyQuantityRollup message. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup + * @static + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup} message EnergyQuantityRollup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnergyQuantityRollup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kcalSum != null && Object.hasOwnProperty.call(message, "kcalSum")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.kcalSum); + if (message.userProvidedUnitLast != null && Object.hasOwnProperty.call(message, "userProvidedUnitLast")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.userProvidedUnitLast); + return writer; + }; - /** - * SwimLengthsData strokeCount. - * @member {number|Long} strokeCount - * @memberof google.devicesandservices.health.v4.SwimLengthsData - * @instance - */ - SwimLengthsData.prototype.strokeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Encodes the specified EnergyQuantityRollup message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup + * @static + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.IEnergyQuantityRollup} message EnergyQuantityRollup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnergyQuantityRollup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new SwimLengthsData instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.SwimLengthsData - * @static - * @param {google.devicesandservices.health.v4.ISwimLengthsData=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.SwimLengthsData} SwimLengthsData instance + /** + * Decodes an EnergyQuantityRollup message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup} EnergyQuantityRollup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnergyQuantityRollup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kcalSum = reader.double(); + break; + } + case 2: { + message.userProvidedUnitLast = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnergyQuantityRollup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup} EnergyQuantityRollup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnergyQuantityRollup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnergyQuantityRollup message. + * @function verify + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnergyQuantityRollup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.kcalSum != null && message.hasOwnProperty("kcalSum")) { + properties._kcalSum = 1; + if (typeof message.kcalSum !== "number") + return "kcalSum: number expected"; + } + if (message.userProvidedUnitLast != null && message.hasOwnProperty("userProvidedUnitLast")) + switch (message.userProvidedUnitLast) { + default: + return "userProvidedUnitLast: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates an EnergyQuantityRollup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup} EnergyQuantityRollup + */ + EnergyQuantityRollup.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup) + return object; + var message = new $root.google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup(); + if (object.kcalSum != null) + message.kcalSum = Number(object.kcalSum); + switch (object.userProvidedUnitLast) { + default: + if (typeof object.userProvidedUnitLast === "number") { + message.userProvidedUnitLast = object.userProvidedUnitLast; + break; + } + break; + case "ENERGY_UNIT_UNSPECIFIED": + case 0: + message.userProvidedUnitLast = 0; + break; + case "JOULE": + case 1: + message.userProvidedUnitLast = 1; + break; + case "KILOJOULE": + case 2: + message.userProvidedUnitLast = 2; + break; + case "KILOCALORIE": + case 3: + message.userProvidedUnitLast = 3; + break; + case "SMALL_CALORIE": + case 4: + message.userProvidedUnitLast = 4; + break; + case "CALORIE": + case 5: + message.userProvidedUnitLast = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from an EnergyQuantityRollup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup + * @static + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup} message EnergyQuantityRollup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnergyQuantityRollup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.userProvidedUnitLast = options.enums === String ? "ENERGY_UNIT_UNSPECIFIED" : 0; + if (message.kcalSum != null && message.hasOwnProperty("kcalSum")) { + object.kcalSum = options.json && !isFinite(message.kcalSum) ? String(message.kcalSum) : message.kcalSum; + if (options.oneofs) + object._kcalSum = "kcalSum"; + } + if (message.userProvidedUnitLast != null && message.hasOwnProperty("userProvidedUnitLast")) + object.userProvidedUnitLast = options.enums === String ? $root.google.devicesandservices.health.v4.EnergyUnit[message.userProvidedUnitLast] === undefined ? message.userProvidedUnitLast : $root.google.devicesandservices.health.v4.EnergyUnit[message.userProvidedUnitLast] : message.userProvidedUnitLast; + return object; + }; + + /** + * Converts this EnergyQuantityRollup to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup + * @instance + * @returns {Object.} JSON object + */ + EnergyQuantityRollup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnergyQuantityRollup + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnergyQuantityRollup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.NutritionLogRollupValue.EnergyQuantityRollup"; + }; + + return EnergyQuantityRollup; + })(); + + NutritionLogRollupValue.NutrientQuantityRollup = (function() { + + /** + * Properties of a NutrientQuantityRollup. + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue + * @interface INutrientQuantityRollup + * @property {google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup|null} [quantity] NutrientQuantityRollup quantity + * @property {google.devicesandservices.health.v4.Nutrient|null} [nutrient] NutrientQuantityRollup nutrient + */ + + /** + * Constructs a new NutrientQuantityRollup. + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue + * @classdesc Represents a NutrientQuantityRollup. + * @implements INutrientQuantityRollup + * @constructor + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.INutrientQuantityRollup=} [properties] Properties to set + */ + function NutrientQuantityRollup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NutrientQuantityRollup quantity. + * @member {google.devicesandservices.health.v4.NutritionLogRollupValue.IWeightQuantityRollup|null|undefined} quantity + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup + * @instance + */ + NutrientQuantityRollup.prototype.quantity = null; + + /** + * NutrientQuantityRollup nutrient. + * @member {google.devicesandservices.health.v4.Nutrient} nutrient + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup + * @instance + */ + NutrientQuantityRollup.prototype.nutrient = 0; + + /** + * Creates a new NutrientQuantityRollup instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup + * @static + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.INutrientQuantityRollup=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup} NutrientQuantityRollup instance + */ + NutrientQuantityRollup.create = function create(properties) { + return new NutrientQuantityRollup(properties); + }; + + /** + * Encodes the specified NutrientQuantityRollup message. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup + * @static + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.INutrientQuantityRollup} message NutrientQuantityRollup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NutrientQuantityRollup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.encode(message.quantity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nutrient != null && Object.hasOwnProperty.call(message, "nutrient")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nutrient); + return writer; + }; + + /** + * Encodes the specified NutrientQuantityRollup message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup + * @static + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.INutrientQuantityRollup} message NutrientQuantityRollup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NutrientQuantityRollup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NutrientQuantityRollup message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup} NutrientQuantityRollup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NutrientQuantityRollup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.quantity = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.decode(reader, reader.uint32()); + break; + } + case 2: { + message.nutrient = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NutrientQuantityRollup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup} NutrientQuantityRollup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NutrientQuantityRollup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NutrientQuantityRollup message. + * @function verify + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NutrientQuantityRollup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) { + var error = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.verify(message.quantity); + if (error) + return "quantity." + error; + } + if (message.nutrient != null && message.hasOwnProperty("nutrient")) + switch (message.nutrient) { + default: + return "nutrient: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + break; + } + return null; + }; + + /** + * Creates a NutrientQuantityRollup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup} NutrientQuantityRollup + */ + NutrientQuantityRollup.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup) + return object; + var message = new $root.google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup(); + if (object.quantity != null) { + if (typeof object.quantity !== "object") + throw TypeError(".google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup.quantity: object expected"); + message.quantity = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.fromObject(object.quantity); + } + switch (object.nutrient) { + default: + if (typeof object.nutrient === "number") { + message.nutrient = object.nutrient; + break; + } + break; + case "NUTRIENT_UNSPECIFIED": + case 0: + message.nutrient = 0; + break; + case "BIOTIN": + case 1: + message.nutrient = 1; + break; + case "CAFFEINE": + case 2: + message.nutrient = 2; + break; + case "CALCIUM": + case 3: + message.nutrient = 3; + break; + case "CHLORIDE": + case 4: + message.nutrient = 4; + break; + case "CARBOHYDRATES": + case 5: + message.nutrient = 5; + break; + case "CHOLESTEROL": + case 6: + message.nutrient = 6; + break; + case "CHROMIUM": + case 7: + message.nutrient = 7; + break; + case "COPPER": + case 8: + message.nutrient = 8; + break; + case "DIETARY_FIBER": + case 9: + message.nutrient = 9; + break; + case "FOLIC_ACID": + case 10: + message.nutrient = 10; + break; + case "IODINE": + case 11: + message.nutrient = 11; + break; + case "IRON": + case 12: + message.nutrient = 12; + break; + case "MAGNESIUM": + case 13: + message.nutrient = 13; + break; + case "MANGANESE": + case 14: + message.nutrient = 14; + break; + case "MOLYBDENUM": + case 15: + message.nutrient = 15; + break; + case "MONOUNSATURATED_FAT": + case 16: + message.nutrient = 16; + break; + case "NIACIN": + case 17: + message.nutrient = 17; + break; + case "PANTOTHENIC_ACID": + case 18: + message.nutrient = 18; + break; + case "PHOSPHORUS": + case 19: + message.nutrient = 19; + break; + case "POLYUNSATURATED_FAT": + case 20: + message.nutrient = 20; + break; + case "POTASSIUM": + case 21: + message.nutrient = 21; + break; + case "PROTEIN": + case 22: + message.nutrient = 22; + break; + case "RIBOFLAVIN": + case 23: + message.nutrient = 23; + break; + case "SATURATED_FAT": + case 24: + message.nutrient = 24; + break; + case "SELENIUM": + case 25: + message.nutrient = 25; + break; + case "SODIUM": + case 26: + message.nutrient = 26; + break; + case "SUGAR": + case 27: + message.nutrient = 27; + break; + case "THIAMIN": + case 28: + message.nutrient = 28; + break; + case "TRANS_FAT": + case 29: + message.nutrient = 29; + break; + case "UNSATURATED_FAT": + case 30: + message.nutrient = 30; + break; + case "VITAMIN_A": + case 31: + message.nutrient = 31; + break; + case "VITAMIN_B12": + case 32: + message.nutrient = 32; + break; + case "VITAMIN_B6": + case 33: + message.nutrient = 33; + break; + case "VITAMIN_C": + case 34: + message.nutrient = 34; + break; + case "VITAMIN_D": + case 35: + message.nutrient = 35; + break; + case "VITAMIN_E": + case 36: + message.nutrient = 36; + break; + case "VITAMIN_K": + case 37: + message.nutrient = 37; + break; + case "ZINC": + case 38: + message.nutrient = 38; + break; + case "FOLATE": + case 39: + message.nutrient = 39; + break; + } + return message; + }; + + /** + * Creates a plain object from a NutrientQuantityRollup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup + * @static + * @param {google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup} message NutrientQuantityRollup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NutrientQuantityRollup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.quantity = null; + object.nutrient = options.enums === String ? "NUTRIENT_UNSPECIFIED" : 0; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) + object.quantity = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.WeightQuantityRollup.toObject(message.quantity, options); + if (message.nutrient != null && message.hasOwnProperty("nutrient")) + object.nutrient = options.enums === String ? $root.google.devicesandservices.health.v4.Nutrient[message.nutrient] === undefined ? message.nutrient : $root.google.devicesandservices.health.v4.Nutrient[message.nutrient] : message.nutrient; + return object; + }; + + /** + * Converts this NutrientQuantityRollup to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup + * @instance + * @returns {Object.} JSON object + */ + NutrientQuantityRollup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NutrientQuantityRollup + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NutrientQuantityRollup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.NutritionLogRollupValue.NutrientQuantityRollup"; + }; + + return NutrientQuantityRollup; + })(); + + return NutritionLogRollupValue; + })(); + + v4.OxygenSaturation = (function() { + + /** + * Properties of an OxygenSaturation. + * @memberof google.devicesandservices.health.v4 + * @interface IOxygenSaturation + * @property {google.devicesandservices.health.v4.IObservationSampleTime|null} [sampleTime] OxygenSaturation sampleTime + * @property {number|null} [percentage] OxygenSaturation percentage */ - SwimLengthsData.create = function create(properties) { - return new SwimLengthsData(properties); + + /** + * Constructs a new OxygenSaturation. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents an OxygenSaturation. + * @implements IOxygenSaturation + * @constructor + * @param {google.devicesandservices.health.v4.IOxygenSaturation=} [properties] Properties to set + */ + function OxygenSaturation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OxygenSaturation sampleTime. + * @member {google.devicesandservices.health.v4.IObservationSampleTime|null|undefined} sampleTime + * @memberof google.devicesandservices.health.v4.OxygenSaturation + * @instance + */ + OxygenSaturation.prototype.sampleTime = null; + + /** + * OxygenSaturation percentage. + * @member {number|null|undefined} percentage + * @memberof google.devicesandservices.health.v4.OxygenSaturation + * @instance + */ + OxygenSaturation.prototype.percentage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OxygenSaturation.prototype, "_percentage", { + get: $util.oneOfGetter($oneOfFields = ["percentage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OxygenSaturation instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.OxygenSaturation + * @static + * @param {google.devicesandservices.health.v4.IOxygenSaturation=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.OxygenSaturation} OxygenSaturation instance + */ + OxygenSaturation.create = function create(properties) { + return new OxygenSaturation(properties); }; /** - * Encodes the specified SwimLengthsData message. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsData.verify|verify} messages. + * Encodes the specified OxygenSaturation message. Does not implicitly {@link google.devicesandservices.health.v4.OxygenSaturation.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.SwimLengthsData + * @memberof google.devicesandservices.health.v4.OxygenSaturation * @static - * @param {google.devicesandservices.health.v4.ISwimLengthsData} message SwimLengthsData message or plain object to encode + * @param {google.devicesandservices.health.v4.IOxygenSaturation} message OxygenSaturation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SwimLengthsData.encode = function encode(message, writer) { + OxygenSaturation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) - $root.google.devicesandservices.health.v4.ObservationTimeInterval.encode(message.interval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.swimStrokeType != null && Object.hasOwnProperty.call(message, "swimStrokeType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.swimStrokeType); - if (message.strokeCount != null && Object.hasOwnProperty.call(message, "strokeCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.strokeCount); + if (message.sampleTime != null && Object.hasOwnProperty.call(message, "sampleTime")) + $root.google.devicesandservices.health.v4.ObservationSampleTime.encode(message.sampleTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.percentage != null && Object.hasOwnProperty.call(message, "percentage")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.percentage); return writer; }; /** - * Encodes the specified SwimLengthsData message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsData.verify|verify} messages. + * Encodes the specified OxygenSaturation message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.OxygenSaturation.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.SwimLengthsData + * @memberof google.devicesandservices.health.v4.OxygenSaturation * @static - * @param {google.devicesandservices.health.v4.ISwimLengthsData} message SwimLengthsData message or plain object to encode + * @param {google.devicesandservices.health.v4.IOxygenSaturation} message OxygenSaturation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SwimLengthsData.encodeDelimited = function encodeDelimited(message, writer) { + OxygenSaturation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SwimLengthsData message from the specified reader or buffer. + * Decodes an OxygenSaturation message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.SwimLengthsData + * @memberof google.devicesandservices.health.v4.OxygenSaturation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.SwimLengthsData} SwimLengthsData + * @returns {google.devicesandservices.health.v4.OxygenSaturation} OxygenSaturation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SwimLengthsData.decode = function decode(reader, length, error) { + OxygenSaturation.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.SwimLengthsData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.OxygenSaturation(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.decode(reader, reader.uint32()); + message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.decode(reader, reader.uint32()); break; } case 2: { - message.swimStrokeType = reader.int32(); - break; - } - case 3: { - message.strokeCount = reader.int64(); + message.percentage = reader.double(); break; } default: @@ -19311,212 +22442,141 @@ }; /** - * Decodes a SwimLengthsData message from the specified reader or buffer, length delimited. + * Decodes an OxygenSaturation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.SwimLengthsData + * @memberof google.devicesandservices.health.v4.OxygenSaturation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.SwimLengthsData} SwimLengthsData + * @returns {google.devicesandservices.health.v4.OxygenSaturation} OxygenSaturation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SwimLengthsData.decodeDelimited = function decodeDelimited(reader) { + OxygenSaturation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SwimLengthsData message. + * Verifies an OxygenSaturation message. * @function verify - * @memberof google.devicesandservices.health.v4.SwimLengthsData + * @memberof google.devicesandservices.health.v4.OxygenSaturation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SwimLengthsData.verify = function verify(message) { + OxygenSaturation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.interval != null && message.hasOwnProperty("interval")) { - var error = $root.google.devicesandservices.health.v4.ObservationTimeInterval.verify(message.interval); + var properties = {}; + if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { + var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); if (error) - return "interval." + error; + return "sampleTime." + error; + } + if (message.percentage != null && message.hasOwnProperty("percentage")) { + properties._percentage = 1; + if (typeof message.percentage !== "number") + return "percentage: number expected"; } - if (message.swimStrokeType != null && message.hasOwnProperty("swimStrokeType")) - switch (message.swimStrokeType) { - default: - return "swimStrokeType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.strokeCount != null && message.hasOwnProperty("strokeCount")) - if (!$util.isInteger(message.strokeCount) && !(message.strokeCount && $util.isInteger(message.strokeCount.low) && $util.isInteger(message.strokeCount.high))) - return "strokeCount: integer|Long expected"; return null; }; /** - * Creates a SwimLengthsData message from a plain object. Also converts values to their respective internal types. + * Creates an OxygenSaturation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.SwimLengthsData + * @memberof google.devicesandservices.health.v4.OxygenSaturation * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.SwimLengthsData} SwimLengthsData + * @returns {google.devicesandservices.health.v4.OxygenSaturation} OxygenSaturation */ - SwimLengthsData.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.SwimLengthsData) + OxygenSaturation.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.OxygenSaturation) return object; - var message = new $root.google.devicesandservices.health.v4.SwimLengthsData(); - if (object.interval != null) { - if (typeof object.interval !== "object") - throw TypeError(".google.devicesandservices.health.v4.SwimLengthsData.interval: object expected"); - message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.fromObject(object.interval); - } - switch (object.swimStrokeType) { - default: - if (typeof object.swimStrokeType === "number") { - message.swimStrokeType = object.swimStrokeType; - break; - } - break; - case "SWIM_STROKE_TYPE_UNSPECIFIED": - case 0: - message.swimStrokeType = 0; - break; - case "FREESTYLE": - case 1: - message.swimStrokeType = 1; - break; - case "BACKSTROKE": - case 2: - message.swimStrokeType = 2; - break; - case "BREASTSTROKE": - case 3: - message.swimStrokeType = 3; - break; - case "BUTTERFLY": - case 4: - message.swimStrokeType = 4; - break; + var message = new $root.google.devicesandservices.health.v4.OxygenSaturation(); + if (object.sampleTime != null) { + if (typeof object.sampleTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.OxygenSaturation.sampleTime: object expected"); + message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.fromObject(object.sampleTime); } - if (object.strokeCount != null) - if ($util.Long) - (message.strokeCount = $util.Long.fromValue(object.strokeCount)).unsigned = false; - else if (typeof object.strokeCount === "string") - message.strokeCount = parseInt(object.strokeCount, 10); - else if (typeof object.strokeCount === "number") - message.strokeCount = object.strokeCount; - else if (typeof object.strokeCount === "object") - message.strokeCount = new $util.LongBits(object.strokeCount.low >>> 0, object.strokeCount.high >>> 0).toNumber(); + if (object.percentage != null) + message.percentage = Number(object.percentage); return message; }; /** - * Creates a plain object from a SwimLengthsData message. Also converts values to other types if specified. + * Creates a plain object from an OxygenSaturation message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.SwimLengthsData + * @memberof google.devicesandservices.health.v4.OxygenSaturation * @static - * @param {google.devicesandservices.health.v4.SwimLengthsData} message SwimLengthsData + * @param {google.devicesandservices.health.v4.OxygenSaturation} message OxygenSaturation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SwimLengthsData.toObject = function toObject(message, options) { + OxygenSaturation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.interval = null; - object.swimStrokeType = options.enums === String ? "SWIM_STROKE_TYPE_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.strokeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.strokeCount = options.longs === String ? "0" : 0; + if (options.defaults) + object.sampleTime = null; + if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) + object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); + if (message.percentage != null && message.hasOwnProperty("percentage")) { + object.percentage = options.json && !isFinite(message.percentage) ? String(message.percentage) : message.percentage; + if (options.oneofs) + object._percentage = "percentage"; } - if (message.interval != null && message.hasOwnProperty("interval")) - object.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.toObject(message.interval, options); - if (message.swimStrokeType != null && message.hasOwnProperty("swimStrokeType")) - object.swimStrokeType = options.enums === String ? $root.google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType[message.swimStrokeType] === undefined ? message.swimStrokeType : $root.google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType[message.swimStrokeType] : message.swimStrokeType; - if (message.strokeCount != null && message.hasOwnProperty("strokeCount")) - if (typeof message.strokeCount === "number") - object.strokeCount = options.longs === String ? String(message.strokeCount) : message.strokeCount; - else - object.strokeCount = options.longs === String ? $util.Long.prototype.toString.call(message.strokeCount) : options.longs === Number ? new $util.LongBits(message.strokeCount.low >>> 0, message.strokeCount.high >>> 0).toNumber() : message.strokeCount; return object; }; /** - * Converts this SwimLengthsData to JSON. + * Converts this OxygenSaturation to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.SwimLengthsData + * @memberof google.devicesandservices.health.v4.OxygenSaturation * @instance * @returns {Object.} JSON object */ - SwimLengthsData.prototype.toJSON = function toJSON() { + OxygenSaturation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SwimLengthsData + * Gets the default type url for OxygenSaturation * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.SwimLengthsData + * @memberof google.devicesandservices.health.v4.OxygenSaturation * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SwimLengthsData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OxygenSaturation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.SwimLengthsData"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.OxygenSaturation"; }; - /** - * SwimStrokeType enum. - * @name google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType - * @enum {number} - * @property {number} SWIM_STROKE_TYPE_UNSPECIFIED=0 SWIM_STROKE_TYPE_UNSPECIFIED value - * @property {number} FREESTYLE=1 FREESTYLE value - * @property {number} BACKSTROKE=2 BACKSTROKE value - * @property {number} BREASTSTROKE=3 BREASTSTROKE value - * @property {number} BUTTERFLY=4 BUTTERFLY value - */ - SwimLengthsData.SwimStrokeType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SWIM_STROKE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "FREESTYLE"] = 1; - values[valuesById[2] = "BACKSTROKE"] = 2; - values[valuesById[3] = "BREASTSTROKE"] = 3; - values[valuesById[4] = "BUTTERFLY"] = 4; - return values; - })(); - - return SwimLengthsData; + return OxygenSaturation; })(); - v4.SwimLengthsDataRollupValue = (function() { + v4.RestingHeartRatePersonalRangeRollupValue = (function() { /** - * Properties of a SwimLengthsDataRollupValue. + * Properties of a RestingHeartRatePersonalRangeRollupValue. * @memberof google.devicesandservices.health.v4 - * @interface ISwimLengthsDataRollupValue - * @property {number|Long|null} [strokeCountSum] SwimLengthsDataRollupValue strokeCountSum + * @interface IRestingHeartRatePersonalRangeRollupValue + * @property {number|null} [beatsPerMinuteMin] RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMin + * @property {number|null} [beatsPerMinuteMax] RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMax */ /** - * Constructs a new SwimLengthsDataRollupValue. + * Constructs a new RestingHeartRatePersonalRangeRollupValue. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a SwimLengthsDataRollupValue. - * @implements ISwimLengthsDataRollupValue + * @classdesc Represents a RestingHeartRatePersonalRangeRollupValue. + * @implements IRestingHeartRatePersonalRangeRollupValue * @constructor - * @param {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue=} [properties] Properties to set */ - function SwimLengthsDataRollupValue(properties) { + function RestingHeartRatePersonalRangeRollupValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19524,77 +22584,106 @@ } /** - * SwimLengthsDataRollupValue strokeCountSum. - * @member {number|Long} strokeCountSum - * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMin. + * @member {number|null|undefined} beatsPerMinuteMin + * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue * @instance */ - SwimLengthsDataRollupValue.prototype.strokeCountSum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + RestingHeartRatePersonalRangeRollupValue.prototype.beatsPerMinuteMin = null; /** - * Creates a new SwimLengthsDataRollupValue instance using the specified properties. + * RestingHeartRatePersonalRangeRollupValue beatsPerMinuteMax. + * @member {number|null|undefined} beatsPerMinuteMax + * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue + * @instance + */ + RestingHeartRatePersonalRangeRollupValue.prototype.beatsPerMinuteMax = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RestingHeartRatePersonalRangeRollupValue.prototype, "_beatsPerMinuteMin", { + get: $util.oneOfGetter($oneOfFields = ["beatsPerMinuteMin"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RestingHeartRatePersonalRangeRollupValue.prototype, "_beatsPerMinuteMax", { + get: $util.oneOfGetter($oneOfFields = ["beatsPerMinuteMax"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestingHeartRatePersonalRangeRollupValue instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue * @static - * @param {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.SwimLengthsDataRollupValue} SwimLengthsDataRollupValue instance + * @param {google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue} RestingHeartRatePersonalRangeRollupValue instance */ - SwimLengthsDataRollupValue.create = function create(properties) { - return new SwimLengthsDataRollupValue(properties); + RestingHeartRatePersonalRangeRollupValue.create = function create(properties) { + return new RestingHeartRatePersonalRangeRollupValue(properties); }; /** - * Encodes the specified SwimLengthsDataRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsDataRollupValue.verify|verify} messages. + * Encodes the specified RestingHeartRatePersonalRangeRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue * @static - * @param {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue} message SwimLengthsDataRollupValue message or plain object to encode + * @param {google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue} message RestingHeartRatePersonalRangeRollupValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SwimLengthsDataRollupValue.encode = function encode(message, writer) { + RestingHeartRatePersonalRangeRollupValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.strokeCountSum != null && Object.hasOwnProperty.call(message, "strokeCountSum")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.strokeCountSum); + if (message.beatsPerMinuteMin != null && Object.hasOwnProperty.call(message, "beatsPerMinuteMin")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.beatsPerMinuteMin); + if (message.beatsPerMinuteMax != null && Object.hasOwnProperty.call(message, "beatsPerMinuteMax")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.beatsPerMinuteMax); return writer; }; /** - * Encodes the specified SwimLengthsDataRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsDataRollupValue.verify|verify} messages. + * Encodes the specified RestingHeartRatePersonalRangeRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue * @static - * @param {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue} message SwimLengthsDataRollupValue message or plain object to encode + * @param {google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue} message RestingHeartRatePersonalRangeRollupValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SwimLengthsDataRollupValue.encodeDelimited = function encodeDelimited(message, writer) { + RestingHeartRatePersonalRangeRollupValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SwimLengthsDataRollupValue message from the specified reader or buffer. + * Decodes a RestingHeartRatePersonalRangeRollupValue message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.SwimLengthsDataRollupValue} SwimLengthsDataRollupValue + * @returns {google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue} RestingHeartRatePersonalRangeRollupValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SwimLengthsDataRollupValue.decode = function decode(reader, length, error) { + RestingHeartRatePersonalRangeRollupValue.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.strokeCountSum = reader.int64(); + message.beatsPerMinuteMin = reader.double(); + break; + } + case 2: { + message.beatsPerMinuteMax = reader.double(); break; } default: @@ -19606,137 +22695,139 @@ }; /** - * Decodes a SwimLengthsDataRollupValue message from the specified reader or buffer, length delimited. + * Decodes a RestingHeartRatePersonalRangeRollupValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.SwimLengthsDataRollupValue} SwimLengthsDataRollupValue + * @returns {google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue} RestingHeartRatePersonalRangeRollupValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SwimLengthsDataRollupValue.decodeDelimited = function decodeDelimited(reader) { + RestingHeartRatePersonalRangeRollupValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SwimLengthsDataRollupValue message. + * Verifies a RestingHeartRatePersonalRangeRollupValue message. * @function verify - * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SwimLengthsDataRollupValue.verify = function verify(message) { + RestingHeartRatePersonalRangeRollupValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.strokeCountSum != null && message.hasOwnProperty("strokeCountSum")) - if (!$util.isInteger(message.strokeCountSum) && !(message.strokeCountSum && $util.isInteger(message.strokeCountSum.low) && $util.isInteger(message.strokeCountSum.high))) - return "strokeCountSum: integer|Long expected"; + var properties = {}; + if (message.beatsPerMinuteMin != null && message.hasOwnProperty("beatsPerMinuteMin")) { + properties._beatsPerMinuteMin = 1; + if (typeof message.beatsPerMinuteMin !== "number") + return "beatsPerMinuteMin: number expected"; + } + if (message.beatsPerMinuteMax != null && message.hasOwnProperty("beatsPerMinuteMax")) { + properties._beatsPerMinuteMax = 1; + if (typeof message.beatsPerMinuteMax !== "number") + return "beatsPerMinuteMax: number expected"; + } return null; }; /** - * Creates a SwimLengthsDataRollupValue message from a plain object. Also converts values to their respective internal types. + * Creates a RestingHeartRatePersonalRangeRollupValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.SwimLengthsDataRollupValue} SwimLengthsDataRollupValue + * @returns {google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue} RestingHeartRatePersonalRangeRollupValue */ - SwimLengthsDataRollupValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue) + RestingHeartRatePersonalRangeRollupValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue) return object; - var message = new $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue(); - if (object.strokeCountSum != null) - if ($util.Long) - (message.strokeCountSum = $util.Long.fromValue(object.strokeCountSum)).unsigned = false; - else if (typeof object.strokeCountSum === "string") - message.strokeCountSum = parseInt(object.strokeCountSum, 10); - else if (typeof object.strokeCountSum === "number") - message.strokeCountSum = object.strokeCountSum; - else if (typeof object.strokeCountSum === "object") - message.strokeCountSum = new $util.LongBits(object.strokeCountSum.low >>> 0, object.strokeCountSum.high >>> 0).toNumber(); + var message = new $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue(); + if (object.beatsPerMinuteMin != null) + message.beatsPerMinuteMin = Number(object.beatsPerMinuteMin); + if (object.beatsPerMinuteMax != null) + message.beatsPerMinuteMax = Number(object.beatsPerMinuteMax); return message; }; /** - * Creates a plain object from a SwimLengthsDataRollupValue message. Also converts values to other types if specified. + * Creates a plain object from a RestingHeartRatePersonalRangeRollupValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue * @static - * @param {google.devicesandservices.health.v4.SwimLengthsDataRollupValue} message SwimLengthsDataRollupValue + * @param {google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue} message RestingHeartRatePersonalRangeRollupValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SwimLengthsDataRollupValue.toObject = function toObject(message, options) { + RestingHeartRatePersonalRangeRollupValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.strokeCountSum = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.strokeCountSum = options.longs === String ? "0" : 0; - if (message.strokeCountSum != null && message.hasOwnProperty("strokeCountSum")) - if (typeof message.strokeCountSum === "number") - object.strokeCountSum = options.longs === String ? String(message.strokeCountSum) : message.strokeCountSum; - else - object.strokeCountSum = options.longs === String ? $util.Long.prototype.toString.call(message.strokeCountSum) : options.longs === Number ? new $util.LongBits(message.strokeCountSum.low >>> 0, message.strokeCountSum.high >>> 0).toNumber() : message.strokeCountSum; + if (message.beatsPerMinuteMin != null && message.hasOwnProperty("beatsPerMinuteMin")) { + object.beatsPerMinuteMin = options.json && !isFinite(message.beatsPerMinuteMin) ? String(message.beatsPerMinuteMin) : message.beatsPerMinuteMin; + if (options.oneofs) + object._beatsPerMinuteMin = "beatsPerMinuteMin"; + } + if (message.beatsPerMinuteMax != null && message.hasOwnProperty("beatsPerMinuteMax")) { + object.beatsPerMinuteMax = options.json && !isFinite(message.beatsPerMinuteMax) ? String(message.beatsPerMinuteMax) : message.beatsPerMinuteMax; + if (options.oneofs) + object._beatsPerMinuteMax = "beatsPerMinuteMax"; + } return object; }; /** - * Converts this SwimLengthsDataRollupValue to JSON. + * Converts this RestingHeartRatePersonalRangeRollupValue to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue * @instance * @returns {Object.} JSON object */ - SwimLengthsDataRollupValue.prototype.toJSON = function toJSON() { + RestingHeartRatePersonalRangeRollupValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SwimLengthsDataRollupValue + * Gets the default type url for RestingHeartRatePersonalRangeRollupValue * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @memberof google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SwimLengthsDataRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RestingHeartRatePersonalRangeRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.SwimLengthsDataRollupValue"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue"; }; - return SwimLengthsDataRollupValue; + return RestingHeartRatePersonalRangeRollupValue; })(); - v4.TimeInHeartRateZone = (function() { + v4.FoodMeasurementUnit = (function() { /** - * Properties of a TimeInHeartRateZone. + * Properties of a FoodMeasurementUnit. * @memberof google.devicesandservices.health.v4 - * @interface ITimeInHeartRateZone - * @property {google.devicesandservices.health.v4.IObservationTimeInterval|null} [interval] TimeInHeartRateZone interval - * @property {google.devicesandservices.health.v4.HeartRateZoneType|null} [heartRateZoneType] TimeInHeartRateZone heartRateZoneType + * @interface IFoodMeasurementUnit + * @property {string|null} [displayName] FoodMeasurementUnit displayName + * @property {string|null} [pluralDisplayName] FoodMeasurementUnit pluralDisplayName */ /** - * Constructs a new TimeInHeartRateZone. + * Constructs a new FoodMeasurementUnit. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a TimeInHeartRateZone. - * @implements ITimeInHeartRateZone + * @classdesc Represents a FoodMeasurementUnit. + * @implements IFoodMeasurementUnit * @constructor - * @param {google.devicesandservices.health.v4.ITimeInHeartRateZone=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IFoodMeasurementUnit=} [properties] Properties to set */ - function TimeInHeartRateZone(properties) { + function FoodMeasurementUnit(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19744,91 +22835,91 @@ } /** - * TimeInHeartRateZone interval. - * @member {google.devicesandservices.health.v4.IObservationTimeInterval|null|undefined} interval - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * FoodMeasurementUnit displayName. + * @member {string} displayName + * @memberof google.devicesandservices.health.v4.FoodMeasurementUnit * @instance */ - TimeInHeartRateZone.prototype.interval = null; + FoodMeasurementUnit.prototype.displayName = ""; /** - * TimeInHeartRateZone heartRateZoneType. - * @member {google.devicesandservices.health.v4.HeartRateZoneType} heartRateZoneType - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * FoodMeasurementUnit pluralDisplayName. + * @member {string} pluralDisplayName + * @memberof google.devicesandservices.health.v4.FoodMeasurementUnit * @instance */ - TimeInHeartRateZone.prototype.heartRateZoneType = 0; + FoodMeasurementUnit.prototype.pluralDisplayName = ""; /** - * Creates a new TimeInHeartRateZone instance using the specified properties. + * Creates a new FoodMeasurementUnit instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @memberof google.devicesandservices.health.v4.FoodMeasurementUnit * @static - * @param {google.devicesandservices.health.v4.ITimeInHeartRateZone=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.TimeInHeartRateZone} TimeInHeartRateZone instance + * @param {google.devicesandservices.health.v4.IFoodMeasurementUnit=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.FoodMeasurementUnit} FoodMeasurementUnit instance */ - TimeInHeartRateZone.create = function create(properties) { - return new TimeInHeartRateZone(properties); + FoodMeasurementUnit.create = function create(properties) { + return new FoodMeasurementUnit(properties); }; /** - * Encodes the specified TimeInHeartRateZone message. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZone.verify|verify} messages. + * Encodes the specified FoodMeasurementUnit message. Does not implicitly {@link google.devicesandservices.health.v4.FoodMeasurementUnit.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @memberof google.devicesandservices.health.v4.FoodMeasurementUnit * @static - * @param {google.devicesandservices.health.v4.ITimeInHeartRateZone} message TimeInHeartRateZone message or plain object to encode + * @param {google.devicesandservices.health.v4.IFoodMeasurementUnit} message FoodMeasurementUnit message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeInHeartRateZone.encode = function encode(message, writer) { + FoodMeasurementUnit.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) - $root.google.devicesandservices.health.v4.ObservationTimeInterval.encode(message.interval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.heartRateZoneType != null && Object.hasOwnProperty.call(message, "heartRateZoneType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.heartRateZoneType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.pluralDisplayName != null && Object.hasOwnProperty.call(message, "pluralDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pluralDisplayName); return writer; }; /** - * Encodes the specified TimeInHeartRateZone message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZone.verify|verify} messages. + * Encodes the specified FoodMeasurementUnit message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.FoodMeasurementUnit.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @memberof google.devicesandservices.health.v4.FoodMeasurementUnit * @static - * @param {google.devicesandservices.health.v4.ITimeInHeartRateZone} message TimeInHeartRateZone message or plain object to encode + * @param {google.devicesandservices.health.v4.IFoodMeasurementUnit} message FoodMeasurementUnit message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeInHeartRateZone.encodeDelimited = function encodeDelimited(message, writer) { + FoodMeasurementUnit.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeInHeartRateZone message from the specified reader or buffer. + * Decodes a FoodMeasurementUnit message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @memberof google.devicesandservices.health.v4.FoodMeasurementUnit * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.TimeInHeartRateZone} TimeInHeartRateZone + * @returns {google.devicesandservices.health.v4.FoodMeasurementUnit} FoodMeasurementUnit * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeInHeartRateZone.decode = function decode(reader, length, error) { + FoodMeasurementUnit.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.TimeInHeartRateZone(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.FoodMeasurementUnit(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.decode(reader, reader.uint32()); + message.displayName = reader.string(); break; } case 2: { - message.heartRateZoneType = reader.int32(); + message.pluralDisplayName = reader.string(); break; } default: @@ -19840,171 +22931,135 @@ }; /** - * Decodes a TimeInHeartRateZone message from the specified reader or buffer, length delimited. + * Decodes a FoodMeasurementUnit message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @memberof google.devicesandservices.health.v4.FoodMeasurementUnit * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.TimeInHeartRateZone} TimeInHeartRateZone + * @returns {google.devicesandservices.health.v4.FoodMeasurementUnit} FoodMeasurementUnit * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeInHeartRateZone.decodeDelimited = function decodeDelimited(reader) { + FoodMeasurementUnit.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeInHeartRateZone message. + * Verifies a FoodMeasurementUnit message. * @function verify - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @memberof google.devicesandservices.health.v4.FoodMeasurementUnit * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TimeInHeartRateZone.verify = function verify(message) { + FoodMeasurementUnit.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.interval != null && message.hasOwnProperty("interval")) { - var error = $root.google.devicesandservices.health.v4.ObservationTimeInterval.verify(message.interval); - if (error) - return "interval." + error; - } - if (message.heartRateZoneType != null && message.hasOwnProperty("heartRateZoneType")) - switch (message.heartRateZoneType) { - default: - return "heartRateZoneType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.pluralDisplayName != null && message.hasOwnProperty("pluralDisplayName")) + if (!$util.isString(message.pluralDisplayName)) + return "pluralDisplayName: string expected"; return null; }; /** - * Creates a TimeInHeartRateZone message from a plain object. Also converts values to their respective internal types. + * Creates a FoodMeasurementUnit message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @memberof google.devicesandservices.health.v4.FoodMeasurementUnit * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.TimeInHeartRateZone} TimeInHeartRateZone + * @returns {google.devicesandservices.health.v4.FoodMeasurementUnit} FoodMeasurementUnit */ - TimeInHeartRateZone.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.TimeInHeartRateZone) + FoodMeasurementUnit.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.FoodMeasurementUnit) return object; - var message = new $root.google.devicesandservices.health.v4.TimeInHeartRateZone(); - if (object.interval != null) { - if (typeof object.interval !== "object") - throw TypeError(".google.devicesandservices.health.v4.TimeInHeartRateZone.interval: object expected"); - message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.fromObject(object.interval); - } - switch (object.heartRateZoneType) { - default: - if (typeof object.heartRateZoneType === "number") { - message.heartRateZoneType = object.heartRateZoneType; - break; - } - break; - case "HEART_RATE_ZONE_TYPE_UNSPECIFIED": - case 0: - message.heartRateZoneType = 0; - break; - case "LIGHT": - case 1: - message.heartRateZoneType = 1; - break; - case "MODERATE": - case 2: - message.heartRateZoneType = 2; - break; - case "VIGOROUS": - case 3: - message.heartRateZoneType = 3; - break; - case "PEAK": - case 4: - message.heartRateZoneType = 4; - break; - } + var message = new $root.google.devicesandservices.health.v4.FoodMeasurementUnit(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.pluralDisplayName != null) + message.pluralDisplayName = String(object.pluralDisplayName); return message; }; /** - * Creates a plain object from a TimeInHeartRateZone message. Also converts values to other types if specified. + * Creates a plain object from a FoodMeasurementUnit message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @memberof google.devicesandservices.health.v4.FoodMeasurementUnit * @static - * @param {google.devicesandservices.health.v4.TimeInHeartRateZone} message TimeInHeartRateZone + * @param {google.devicesandservices.health.v4.FoodMeasurementUnit} message FoodMeasurementUnit * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeInHeartRateZone.toObject = function toObject(message, options) { + FoodMeasurementUnit.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.interval = null; - object.heartRateZoneType = options.enums === String ? "HEART_RATE_ZONE_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + object.pluralDisplayName = ""; } - if (message.interval != null && message.hasOwnProperty("interval")) - object.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.toObject(message.interval, options); - if (message.heartRateZoneType != null && message.hasOwnProperty("heartRateZoneType")) - object.heartRateZoneType = options.enums === String ? $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZoneType] === undefined ? message.heartRateZoneType : $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZoneType] : message.heartRateZoneType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.pluralDisplayName != null && message.hasOwnProperty("pluralDisplayName")) + object.pluralDisplayName = message.pluralDisplayName; return object; }; /** - * Converts this TimeInHeartRateZone to JSON. + * Converts this FoodMeasurementUnit to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @memberof google.devicesandservices.health.v4.FoodMeasurementUnit * @instance * @returns {Object.} JSON object */ - TimeInHeartRateZone.prototype.toJSON = function toJSON() { + FoodMeasurementUnit.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TimeInHeartRateZone + * Gets the default type url for FoodMeasurementUnit * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @memberof google.devicesandservices.health.v4.FoodMeasurementUnit * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TimeInHeartRateZone.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FoodMeasurementUnit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.TimeInHeartRateZone"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.FoodMeasurementUnit"; }; - return TimeInHeartRateZone; + return FoodMeasurementUnit; })(); - v4.TimeInHeartRateZoneRollupValue = (function() { + v4.RespiratoryRateSleepSummary = (function() { /** - * Properties of a TimeInHeartRateZoneRollupValue. + * Properties of a RespiratoryRateSleepSummary. * @memberof google.devicesandservices.health.v4 - * @interface ITimeInHeartRateZoneRollupValue - * @property {Array.|null} [timeInHeartRateZones] TimeInHeartRateZoneRollupValue timeInHeartRateZones + * @interface IRespiratoryRateSleepSummary + * @property {google.devicesandservices.health.v4.IObservationSampleTime|null} [sampleTime] RespiratoryRateSleepSummary sampleTime + * @property {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null} [deepSleepStats] RespiratoryRateSleepSummary deepSleepStats + * @property {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null} [lightSleepStats] RespiratoryRateSleepSummary lightSleepStats + * @property {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null} [remSleepStats] RespiratoryRateSleepSummary remSleepStats + * @property {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null} [fullSleepStats] RespiratoryRateSleepSummary fullSleepStats */ /** - * Constructs a new TimeInHeartRateZoneRollupValue. + * Constructs a new RespiratoryRateSleepSummary. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a TimeInHeartRateZoneRollupValue. - * @implements ITimeInHeartRateZoneRollupValue + * @classdesc Represents a RespiratoryRateSleepSummary. + * @implements IRespiratoryRateSleepSummary * @constructor - * @param {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary=} [properties] Properties to set */ - function TimeInHeartRateZoneRollupValue(properties) { - this.timeInHeartRateZones = []; + function RespiratoryRateSleepSummary(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20012,80 +23067,133 @@ } /** - * TimeInHeartRateZoneRollupValue timeInHeartRateZones. - * @member {Array.} timeInHeartRateZones - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * RespiratoryRateSleepSummary sampleTime. + * @member {google.devicesandservices.health.v4.IObservationSampleTime|null|undefined} sampleTime + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary * @instance */ - TimeInHeartRateZoneRollupValue.prototype.timeInHeartRateZones = $util.emptyArray; + RespiratoryRateSleepSummary.prototype.sampleTime = null; /** - * Creates a new TimeInHeartRateZoneRollupValue instance using the specified properties. + * RespiratoryRateSleepSummary deepSleepStats. + * @member {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null|undefined} deepSleepStats + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary + * @instance + */ + RespiratoryRateSleepSummary.prototype.deepSleepStats = null; + + /** + * RespiratoryRateSleepSummary lightSleepStats. + * @member {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null|undefined} lightSleepStats + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary + * @instance + */ + RespiratoryRateSleepSummary.prototype.lightSleepStats = null; + + /** + * RespiratoryRateSleepSummary remSleepStats. + * @member {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null|undefined} remSleepStats + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary + * @instance + */ + RespiratoryRateSleepSummary.prototype.remSleepStats = null; + + /** + * RespiratoryRateSleepSummary fullSleepStats. + * @member {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics|null|undefined} fullSleepStats + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary + * @instance + */ + RespiratoryRateSleepSummary.prototype.fullSleepStats = null; + + /** + * Creates a new RespiratoryRateSleepSummary instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary * @static - * @param {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue} TimeInHeartRateZoneRollupValue instance + * @param {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary} RespiratoryRateSleepSummary instance */ - TimeInHeartRateZoneRollupValue.create = function create(properties) { - return new TimeInHeartRateZoneRollupValue(properties); + RespiratoryRateSleepSummary.create = function create(properties) { + return new RespiratoryRateSleepSummary(properties); }; /** - * Encodes the specified TimeInHeartRateZoneRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.verify|verify} messages. + * Encodes the specified RespiratoryRateSleepSummary message. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary * @static - * @param {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue} message TimeInHeartRateZoneRollupValue message or plain object to encode + * @param {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary} message RespiratoryRateSleepSummary message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeInHeartRateZoneRollupValue.encode = function encode(message, writer) { + RespiratoryRateSleepSummary.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.timeInHeartRateZones != null && message.timeInHeartRateZones.length) - for (var i = 0; i < message.timeInHeartRateZones.length; ++i) - $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.encode(message.timeInHeartRateZones[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sampleTime != null && Object.hasOwnProperty.call(message, "sampleTime")) + $root.google.devicesandservices.health.v4.ObservationSampleTime.encode(message.sampleTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deepSleepStats != null && Object.hasOwnProperty.call(message, "deepSleepStats")) + $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.encode(message.deepSleepStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.lightSleepStats != null && Object.hasOwnProperty.call(message, "lightSleepStats")) + $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.encode(message.lightSleepStats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.remSleepStats != null && Object.hasOwnProperty.call(message, "remSleepStats")) + $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.encode(message.remSleepStats, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fullSleepStats != null && Object.hasOwnProperty.call(message, "fullSleepStats")) + $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.encode(message.fullSleepStats, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified TimeInHeartRateZoneRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.verify|verify} messages. + * Encodes the specified RespiratoryRateSleepSummary message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary * @static - * @param {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue} message TimeInHeartRateZoneRollupValue message or plain object to encode + * @param {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary} message RespiratoryRateSleepSummary message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeInHeartRateZoneRollupValue.encodeDelimited = function encodeDelimited(message, writer) { + RespiratoryRateSleepSummary.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeInHeartRateZoneRollupValue message from the specified reader or buffer. + * Decodes a RespiratoryRateSleepSummary message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue} TimeInHeartRateZoneRollupValue + * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary} RespiratoryRateSleepSummary * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeInHeartRateZoneRollupValue.decode = function decode(reader, length, error) { + RespiratoryRateSleepSummary.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - if (!(message.timeInHeartRateZones && message.timeInHeartRateZones.length)) - message.timeInHeartRateZones = []; - message.timeInHeartRateZones.push($root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.decode(reader, reader.uint32())); + message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.decode(reader, reader.uint32()); + break; + } + case 2: { + message.deepSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.decode(reader, reader.uint32()); + break; + } + case 3: { + message.lightSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.decode(reader, reader.uint32()); + break; + } + case 4: { + message.remSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fullSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.decode(reader, reader.uint32()); break; } default: @@ -20097,137 +23205,179 @@ }; /** - * Decodes a TimeInHeartRateZoneRollupValue message from the specified reader or buffer, length delimited. + * Decodes a RespiratoryRateSleepSummary message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue} TimeInHeartRateZoneRollupValue + * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary} RespiratoryRateSleepSummary * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeInHeartRateZoneRollupValue.decodeDelimited = function decodeDelimited(reader) { + RespiratoryRateSleepSummary.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeInHeartRateZoneRollupValue message. + * Verifies a RespiratoryRateSleepSummary message. * @function verify - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TimeInHeartRateZoneRollupValue.verify = function verify(message) { + RespiratoryRateSleepSummary.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.timeInHeartRateZones != null && message.hasOwnProperty("timeInHeartRateZones")) { - if (!Array.isArray(message.timeInHeartRateZones)) - return "timeInHeartRateZones: array expected"; - for (var i = 0; i < message.timeInHeartRateZones.length; ++i) { - var error = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.verify(message.timeInHeartRateZones[i]); - if (error) - return "timeInHeartRateZones." + error; - } + if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { + var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); + if (error) + return "sampleTime." + error; + } + if (message.deepSleepStats != null && message.hasOwnProperty("deepSleepStats")) { + var error = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify(message.deepSleepStats); + if (error) + return "deepSleepStats." + error; + } + if (message.lightSleepStats != null && message.hasOwnProperty("lightSleepStats")) { + var error = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify(message.lightSleepStats); + if (error) + return "lightSleepStats." + error; + } + if (message.remSleepStats != null && message.hasOwnProperty("remSleepStats")) { + var error = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify(message.remSleepStats); + if (error) + return "remSleepStats." + error; + } + if (message.fullSleepStats != null && message.hasOwnProperty("fullSleepStats")) { + var error = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify(message.fullSleepStats); + if (error) + return "fullSleepStats." + error; } return null; }; /** - * Creates a TimeInHeartRateZoneRollupValue message from a plain object. Also converts values to their respective internal types. + * Creates a RespiratoryRateSleepSummary message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue} TimeInHeartRateZoneRollupValue + * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary} RespiratoryRateSleepSummary */ - TimeInHeartRateZoneRollupValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue) + RespiratoryRateSleepSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary) return object; - var message = new $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue(); - if (object.timeInHeartRateZones) { - if (!Array.isArray(object.timeInHeartRateZones)) - throw TypeError(".google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.timeInHeartRateZones: array expected"); - message.timeInHeartRateZones = []; - for (var i = 0; i < object.timeInHeartRateZones.length; ++i) { - if (typeof object.timeInHeartRateZones[i] !== "object") - throw TypeError(".google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.timeInHeartRateZones: object expected"); - message.timeInHeartRateZones[i] = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.fromObject(object.timeInHeartRateZones[i]); - } + var message = new $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary(); + if (object.sampleTime != null) { + if (typeof object.sampleTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.RespiratoryRateSleepSummary.sampleTime: object expected"); + message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.fromObject(object.sampleTime); + } + if (object.deepSleepStats != null) { + if (typeof object.deepSleepStats !== "object") + throw TypeError(".google.devicesandservices.health.v4.RespiratoryRateSleepSummary.deepSleepStats: object expected"); + message.deepSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.fromObject(object.deepSleepStats); + } + if (object.lightSleepStats != null) { + if (typeof object.lightSleepStats !== "object") + throw TypeError(".google.devicesandservices.health.v4.RespiratoryRateSleepSummary.lightSleepStats: object expected"); + message.lightSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.fromObject(object.lightSleepStats); + } + if (object.remSleepStats != null) { + if (typeof object.remSleepStats !== "object") + throw TypeError(".google.devicesandservices.health.v4.RespiratoryRateSleepSummary.remSleepStats: object expected"); + message.remSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.fromObject(object.remSleepStats); + } + if (object.fullSleepStats != null) { + if (typeof object.fullSleepStats !== "object") + throw TypeError(".google.devicesandservices.health.v4.RespiratoryRateSleepSummary.fullSleepStats: object expected"); + message.fullSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.fromObject(object.fullSleepStats); } return message; }; /** - * Creates a plain object from a TimeInHeartRateZoneRollupValue message. Also converts values to other types if specified. + * Creates a plain object from a RespiratoryRateSleepSummary message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary * @static - * @param {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue} message TimeInHeartRateZoneRollupValue + * @param {google.devicesandservices.health.v4.RespiratoryRateSleepSummary} message RespiratoryRateSleepSummary * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeInHeartRateZoneRollupValue.toObject = function toObject(message, options) { + RespiratoryRateSleepSummary.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.timeInHeartRateZones = []; - if (message.timeInHeartRateZones && message.timeInHeartRateZones.length) { - object.timeInHeartRateZones = []; - for (var j = 0; j < message.timeInHeartRateZones.length; ++j) - object.timeInHeartRateZones[j] = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.toObject(message.timeInHeartRateZones[j], options); + if (options.defaults) { + object.sampleTime = null; + object.deepSleepStats = null; + object.lightSleepStats = null; + object.remSleepStats = null; + object.fullSleepStats = null; } + if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) + object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); + if (message.deepSleepStats != null && message.hasOwnProperty("deepSleepStats")) + object.deepSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.toObject(message.deepSleepStats, options); + if (message.lightSleepStats != null && message.hasOwnProperty("lightSleepStats")) + object.lightSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.toObject(message.lightSleepStats, options); + if (message.remSleepStats != null && message.hasOwnProperty("remSleepStats")) + object.remSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.toObject(message.remSleepStats, options); + if (message.fullSleepStats != null && message.hasOwnProperty("fullSleepStats")) + object.fullSleepStats = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.toObject(message.fullSleepStats, options); return object; }; /** - * Converts this TimeInHeartRateZoneRollupValue to JSON. + * Converts this RespiratoryRateSleepSummary to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary * @instance * @returns {Object.} JSON object */ - TimeInHeartRateZoneRollupValue.prototype.toJSON = function toJSON() { + RespiratoryRateSleepSummary.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TimeInHeartRateZoneRollupValue + * Gets the default type url for RespiratoryRateSleepSummary * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TimeInHeartRateZoneRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RespiratoryRateSleepSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.RespiratoryRateSleepSummary"; }; - TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue = (function() { + RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics = (function() { /** - * Properties of a TimeInHeartRateZoneValue. - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue - * @interface ITimeInHeartRateZoneValue - * @property {google.devicesandservices.health.v4.HeartRateZoneType|null} [heartRateZone] TimeInHeartRateZoneValue heartRateZone - * @property {google.protobuf.IDuration|null} [duration] TimeInHeartRateZoneValue duration + * Properties of a RespiratoryRateSleepSummaryStatistics. + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary + * @interface IRespiratoryRateSleepSummaryStatistics + * @property {number|null} [breathsPerMinute] RespiratoryRateSleepSummaryStatistics breathsPerMinute + * @property {number|null} [standardDeviation] RespiratoryRateSleepSummaryStatistics standardDeviation + * @property {number|null} [signalToNoise] RespiratoryRateSleepSummaryStatistics signalToNoise */ /** - * Constructs a new TimeInHeartRateZoneValue. - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue - * @classdesc Represents a TimeInHeartRateZoneValue. - * @implements ITimeInHeartRateZoneValue + * Constructs a new RespiratoryRateSleepSummaryStatistics. + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary + * @classdesc Represents a RespiratoryRateSleepSummaryStatistics. + * @implements IRespiratoryRateSleepSummaryStatistics * @constructor - * @param {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics=} [properties] Properties to set */ - function TimeInHeartRateZoneValue(properties) { + function RespiratoryRateSleepSummaryStatistics(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20235,91 +23385,126 @@ } /** - * TimeInHeartRateZoneValue heartRateZone. - * @member {google.devicesandservices.health.v4.HeartRateZoneType} heartRateZone - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * RespiratoryRateSleepSummaryStatistics breathsPerMinute. + * @member {number|null|undefined} breathsPerMinute + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics * @instance */ - TimeInHeartRateZoneValue.prototype.heartRateZone = 0; + RespiratoryRateSleepSummaryStatistics.prototype.breathsPerMinute = null; /** - * TimeInHeartRateZoneValue duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * RespiratoryRateSleepSummaryStatistics standardDeviation. + * @member {number|null|undefined} standardDeviation + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics * @instance */ - TimeInHeartRateZoneValue.prototype.duration = null; + RespiratoryRateSleepSummaryStatistics.prototype.standardDeviation = null; /** - * Creates a new TimeInHeartRateZoneValue instance using the specified properties. + * RespiratoryRateSleepSummaryStatistics signalToNoise. + * @member {number|null|undefined} signalToNoise + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics + * @instance + */ + RespiratoryRateSleepSummaryStatistics.prototype.signalToNoise = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RespiratoryRateSleepSummaryStatistics.prototype, "_breathsPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["breathsPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RespiratoryRateSleepSummaryStatistics.prototype, "_standardDeviation", { + get: $util.oneOfGetter($oneOfFields = ["standardDeviation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RespiratoryRateSleepSummaryStatistics.prototype, "_signalToNoise", { + get: $util.oneOfGetter($oneOfFields = ["signalToNoise"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RespiratoryRateSleepSummaryStatistics instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics * @static - * @param {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue} TimeInHeartRateZoneValue instance + * @param {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics} RespiratoryRateSleepSummaryStatistics instance */ - TimeInHeartRateZoneValue.create = function create(properties) { - return new TimeInHeartRateZoneValue(properties); + RespiratoryRateSleepSummaryStatistics.create = function create(properties) { + return new RespiratoryRateSleepSummaryStatistics(properties); }; /** - * Encodes the specified TimeInHeartRateZoneValue message. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.verify|verify} messages. + * Encodes the specified RespiratoryRateSleepSummaryStatistics message. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics * @static - * @param {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue} message TimeInHeartRateZoneValue message or plain object to encode + * @param {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics} message RespiratoryRateSleepSummaryStatistics message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeInHeartRateZoneValue.encode = function encode(message, writer) { + RespiratoryRateSleepSummaryStatistics.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.heartRateZone != null && Object.hasOwnProperty.call(message, "heartRateZone")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.heartRateZone); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.breathsPerMinute != null && Object.hasOwnProperty.call(message, "breathsPerMinute")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.breathsPerMinute); + if (message.standardDeviation != null && Object.hasOwnProperty.call(message, "standardDeviation")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.standardDeviation); + if (message.signalToNoise != null && Object.hasOwnProperty.call(message, "signalToNoise")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.signalToNoise); return writer; }; /** - * Encodes the specified TimeInHeartRateZoneValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.verify|verify} messages. + * Encodes the specified RespiratoryRateSleepSummaryStatistics message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics * @static - * @param {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue} message TimeInHeartRateZoneValue message or plain object to encode + * @param {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.IRespiratoryRateSleepSummaryStatistics} message RespiratoryRateSleepSummaryStatistics message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeInHeartRateZoneValue.encodeDelimited = function encodeDelimited(message, writer) { + RespiratoryRateSleepSummaryStatistics.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeInHeartRateZoneValue message from the specified reader or buffer. + * Decodes a RespiratoryRateSleepSummaryStatistics message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue} TimeInHeartRateZoneValue + * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics} RespiratoryRateSleepSummaryStatistics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeInHeartRateZoneValue.decode = function decode(reader, length, error) { + RespiratoryRateSleepSummaryStatistics.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.heartRateZone = reader.int32(); + message.breathsPerMinute = reader.double(); break; } case 2: { - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.standardDeviation = reader.double(); + break; + } + case 3: { + message.signalToNoise = reader.double(); break; } default: @@ -20331,173 +23516,162 @@ }; /** - * Decodes a TimeInHeartRateZoneValue message from the specified reader or buffer, length delimited. + * Decodes a RespiratoryRateSleepSummaryStatistics message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue} TimeInHeartRateZoneValue + * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics} RespiratoryRateSleepSummaryStatistics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeInHeartRateZoneValue.decodeDelimited = function decodeDelimited(reader) { + RespiratoryRateSleepSummaryStatistics.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeInHeartRateZoneValue message. + * Verifies a RespiratoryRateSleepSummaryStatistics message. * @function verify - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TimeInHeartRateZoneValue.verify = function verify(message) { + RespiratoryRateSleepSummaryStatistics.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.heartRateZone != null && message.hasOwnProperty("heartRateZone")) - switch (message.heartRateZone) { - default: - return "heartRateZone: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); - if (error) - return "duration." + error; + var properties = {}; + if (message.breathsPerMinute != null && message.hasOwnProperty("breathsPerMinute")) { + properties._breathsPerMinute = 1; + if (typeof message.breathsPerMinute !== "number") + return "breathsPerMinute: number expected"; + } + if (message.standardDeviation != null && message.hasOwnProperty("standardDeviation")) { + properties._standardDeviation = 1; + if (typeof message.standardDeviation !== "number") + return "standardDeviation: number expected"; + } + if (message.signalToNoise != null && message.hasOwnProperty("signalToNoise")) { + properties._signalToNoise = 1; + if (typeof message.signalToNoise !== "number") + return "signalToNoise: number expected"; } return null; }; /** - * Creates a TimeInHeartRateZoneValue message from a plain object. Also converts values to their respective internal types. + * Creates a RespiratoryRateSleepSummaryStatistics message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue} TimeInHeartRateZoneValue + * @returns {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics} RespiratoryRateSleepSummaryStatistics */ - TimeInHeartRateZoneValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue) + RespiratoryRateSleepSummaryStatistics.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics) return object; - var message = new $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue(); - switch (object.heartRateZone) { - default: - if (typeof object.heartRateZone === "number") { - message.heartRateZone = object.heartRateZone; - break; - } - break; - case "HEART_RATE_ZONE_TYPE_UNSPECIFIED": - case 0: - message.heartRateZone = 0; - break; - case "LIGHT": - case 1: - message.heartRateZone = 1; - break; - case "MODERATE": - case 2: - message.heartRateZone = 2; - break; - case "VIGOROUS": - case 3: - message.heartRateZone = 3; - break; - case "PEAK": - case 4: - message.heartRateZone = 4; - break; - } - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } + var message = new $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics(); + if (object.breathsPerMinute != null) + message.breathsPerMinute = Number(object.breathsPerMinute); + if (object.standardDeviation != null) + message.standardDeviation = Number(object.standardDeviation); + if (object.signalToNoise != null) + message.signalToNoise = Number(object.signalToNoise); return message; }; /** - * Creates a plain object from a TimeInHeartRateZoneValue message. Also converts values to other types if specified. + * Creates a plain object from a RespiratoryRateSleepSummaryStatistics message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics * @static - * @param {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue} message TimeInHeartRateZoneValue + * @param {google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics} message RespiratoryRateSleepSummaryStatistics * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeInHeartRateZoneValue.toObject = function toObject(message, options) { + RespiratoryRateSleepSummaryStatistics.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.heartRateZone = options.enums === String ? "HEART_RATE_ZONE_TYPE_UNSPECIFIED" : 0; - object.duration = null; + if (message.breathsPerMinute != null && message.hasOwnProperty("breathsPerMinute")) { + object.breathsPerMinute = options.json && !isFinite(message.breathsPerMinute) ? String(message.breathsPerMinute) : message.breathsPerMinute; + if (options.oneofs) + object._breathsPerMinute = "breathsPerMinute"; + } + if (message.standardDeviation != null && message.hasOwnProperty("standardDeviation")) { + object.standardDeviation = options.json && !isFinite(message.standardDeviation) ? String(message.standardDeviation) : message.standardDeviation; + if (options.oneofs) + object._standardDeviation = "standardDeviation"; + } + if (message.signalToNoise != null && message.hasOwnProperty("signalToNoise")) { + object.signalToNoise = options.json && !isFinite(message.signalToNoise) ? String(message.signalToNoise) : message.signalToNoise; + if (options.oneofs) + object._signalToNoise = "signalToNoise"; } - if (message.heartRateZone != null && message.hasOwnProperty("heartRateZone")) - object.heartRateZone = options.enums === String ? $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZone] === undefined ? message.heartRateZone : $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZone] : message.heartRateZone; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); return object; }; /** - * Converts this TimeInHeartRateZoneValue to JSON. + * Converts this RespiratoryRateSleepSummaryStatistics to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics * @instance * @returns {Object.} JSON object */ - TimeInHeartRateZoneValue.prototype.toJSON = function toJSON() { + RespiratoryRateSleepSummaryStatistics.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TimeInHeartRateZoneValue + * Gets the default type url for RespiratoryRateSleepSummaryStatistics * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @memberof google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TimeInHeartRateZoneValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RespiratoryRateSleepSummaryStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.RespiratoryRateSleepSummary.RespiratoryRateSleepSummaryStatistics"; }; - return TimeInHeartRateZoneValue; + return RespiratoryRateSleepSummaryStatistics; })(); - return TimeInHeartRateZoneRollupValue; + return RespiratoryRateSleepSummary; })(); - v4.TotalCaloriesRollupValue = (function() { + v4.Sleep = (function() { /** - * Properties of a TotalCaloriesRollupValue. + * Properties of a Sleep. * @memberof google.devicesandservices.health.v4 - * @interface ITotalCaloriesRollupValue - * @property {number|null} [kcalSum] TotalCaloriesRollupValue kcalSum + * @interface ISleep + * @property {google.devicesandservices.health.v4.ISessionTimeInterval|null} [interval] Sleep interval + * @property {google.devicesandservices.health.v4.Sleep.SleepType|null} [type] Sleep type + * @property {Array.|null} [stages] Sleep stages + * @property {Array.|null} [outOfBedSegments] Sleep outOfBedSegments + * @property {google.devicesandservices.health.v4.Sleep.ISleepMetadata|null} [metadata] Sleep metadata + * @property {google.devicesandservices.health.v4.Sleep.ISleepSummary|null} [summary] Sleep summary + * @property {google.protobuf.ITimestamp|null} [createTime] Sleep createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Sleep updateTime */ /** - * Constructs a new TotalCaloriesRollupValue. + * Constructs a new Sleep. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a TotalCaloriesRollupValue. - * @implements ITotalCaloriesRollupValue + * @classdesc Represents a Sleep. + * @implements ISleep * @constructor - * @param {google.devicesandservices.health.v4.ITotalCaloriesRollupValue=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.ISleep=} [properties] Properties to set */ - function TotalCaloriesRollupValue(properties) { + function Sleep(properties) { + this.stages = []; + this.outOfBedSegments = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20505,312 +23679,181 @@ } /** - * TotalCaloriesRollupValue kcalSum. - * @member {number} kcalSum - * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue + * Sleep interval. + * @member {google.devicesandservices.health.v4.ISessionTimeInterval|null|undefined} interval + * @memberof google.devicesandservices.health.v4.Sleep * @instance */ - TotalCaloriesRollupValue.prototype.kcalSum = 0; + Sleep.prototype.interval = null; /** - * Creates a new TotalCaloriesRollupValue instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue - * @static - * @param {google.devicesandservices.health.v4.ITotalCaloriesRollupValue=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.TotalCaloriesRollupValue} TotalCaloriesRollupValue instance + * Sleep type. + * @member {google.devicesandservices.health.v4.Sleep.SleepType} type + * @memberof google.devicesandservices.health.v4.Sleep + * @instance */ - TotalCaloriesRollupValue.create = function create(properties) { - return new TotalCaloriesRollupValue(properties); - }; + Sleep.prototype.type = 0; /** - * Encodes the specified TotalCaloriesRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.TotalCaloriesRollupValue.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue - * @static - * @param {google.devicesandservices.health.v4.ITotalCaloriesRollupValue} message TotalCaloriesRollupValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Sleep stages. + * @member {Array.} stages + * @memberof google.devicesandservices.health.v4.Sleep + * @instance */ - TotalCaloriesRollupValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kcalSum != null && Object.hasOwnProperty.call(message, "kcalSum")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.kcalSum); - return writer; - }; + Sleep.prototype.stages = $util.emptyArray; /** - * Encodes the specified TotalCaloriesRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TotalCaloriesRollupValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue - * @static - * @param {google.devicesandservices.health.v4.ITotalCaloriesRollupValue} message TotalCaloriesRollupValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Sleep outOfBedSegments. + * @member {Array.} outOfBedSegments + * @memberof google.devicesandservices.health.v4.Sleep + * @instance */ - TotalCaloriesRollupValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TotalCaloriesRollupValue message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.TotalCaloriesRollupValue} TotalCaloriesRollupValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TotalCaloriesRollupValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kcalSum = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TotalCaloriesRollupValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.TotalCaloriesRollupValue} TotalCaloriesRollupValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TotalCaloriesRollupValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TotalCaloriesRollupValue message. - * @function verify - * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TotalCaloriesRollupValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kcalSum != null && message.hasOwnProperty("kcalSum")) - if (typeof message.kcalSum !== "number") - return "kcalSum: number expected"; - return null; - }; - - /** - * Creates a TotalCaloriesRollupValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.TotalCaloriesRollupValue} TotalCaloriesRollupValue - */ - TotalCaloriesRollupValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue) - return object; - var message = new $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue(); - if (object.kcalSum != null) - message.kcalSum = Number(object.kcalSum); - return message; - }; - - /** - * Creates a plain object from a TotalCaloriesRollupValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue - * @static - * @param {google.devicesandservices.health.v4.TotalCaloriesRollupValue} message TotalCaloriesRollupValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TotalCaloriesRollupValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.kcalSum = 0; - if (message.kcalSum != null && message.hasOwnProperty("kcalSum")) - object.kcalSum = options.json && !isFinite(message.kcalSum) ? String(message.kcalSum) : message.kcalSum; - return object; - }; + Sleep.prototype.outOfBedSegments = $util.emptyArray; /** - * Converts this TotalCaloriesRollupValue to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue + * Sleep metadata. + * @member {google.devicesandservices.health.v4.Sleep.ISleepMetadata|null|undefined} metadata + * @memberof google.devicesandservices.health.v4.Sleep * @instance - * @returns {Object.} JSON object - */ - TotalCaloriesRollupValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TotalCaloriesRollupValue - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TotalCaloriesRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.TotalCaloriesRollupValue"; - }; - - return TotalCaloriesRollupValue; - })(); - - v4.VO2Max = (function() { - - /** - * Properties of a VO2Max. - * @memberof google.devicesandservices.health.v4 - * @interface IVO2Max - * @property {google.devicesandservices.health.v4.IObservationSampleTime|null} [sampleTime] VO2Max sampleTime - * @property {number|null} [vo2Max] VO2Max vo2Max - * @property {google.devicesandservices.health.v4.VO2Max.MeasurementMethod|null} [measurementMethod] VO2Max measurementMethod - */ - - /** - * Constructs a new VO2Max. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a VO2Max. - * @implements IVO2Max - * @constructor - * @param {google.devicesandservices.health.v4.IVO2Max=} [properties] Properties to set */ - function VO2Max(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Sleep.prototype.metadata = null; /** - * VO2Max sampleTime. - * @member {google.devicesandservices.health.v4.IObservationSampleTime|null|undefined} sampleTime - * @memberof google.devicesandservices.health.v4.VO2Max + * Sleep summary. + * @member {google.devicesandservices.health.v4.Sleep.ISleepSummary|null|undefined} summary + * @memberof google.devicesandservices.health.v4.Sleep * @instance */ - VO2Max.prototype.sampleTime = null; + Sleep.prototype.summary = null; /** - * VO2Max vo2Max. - * @member {number} vo2Max - * @memberof google.devicesandservices.health.v4.VO2Max + * Sleep createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.devicesandservices.health.v4.Sleep * @instance */ - VO2Max.prototype.vo2Max = 0; + Sleep.prototype.createTime = null; /** - * VO2Max measurementMethod. - * @member {google.devicesandservices.health.v4.VO2Max.MeasurementMethod} measurementMethod - * @memberof google.devicesandservices.health.v4.VO2Max + * Sleep updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.devicesandservices.health.v4.Sleep * @instance */ - VO2Max.prototype.measurementMethod = 0; + Sleep.prototype.updateTime = null; /** - * Creates a new VO2Max instance using the specified properties. + * Creates a new Sleep instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.VO2Max + * @memberof google.devicesandservices.health.v4.Sleep * @static - * @param {google.devicesandservices.health.v4.IVO2Max=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.VO2Max} VO2Max instance + * @param {google.devicesandservices.health.v4.ISleep=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Sleep} Sleep instance */ - VO2Max.create = function create(properties) { - return new VO2Max(properties); + Sleep.create = function create(properties) { + return new Sleep(properties); }; /** - * Encodes the specified VO2Max message. Does not implicitly {@link google.devicesandservices.health.v4.VO2Max.verify|verify} messages. + * Encodes the specified Sleep message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.VO2Max + * @memberof google.devicesandservices.health.v4.Sleep * @static - * @param {google.devicesandservices.health.v4.IVO2Max} message VO2Max message or plain object to encode + * @param {google.devicesandservices.health.v4.ISleep} message Sleep message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VO2Max.encode = function encode(message, writer) { + Sleep.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sampleTime != null && Object.hasOwnProperty.call(message, "sampleTime")) - $root.google.devicesandservices.health.v4.ObservationSampleTime.encode(message.sampleTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.vo2Max != null && Object.hasOwnProperty.call(message, "vo2Max")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.vo2Max); - if (message.measurementMethod != null && Object.hasOwnProperty.call(message, "measurementMethod")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.measurementMethod); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.devicesandservices.health.v4.SessionTimeInterval.encode(message.interval, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); + if (message.stages != null && message.stages.length) + for (var i = 0; i < message.stages.length; ++i) + $root.google.devicesandservices.health.v4.Sleep.SleepStage.encode(message.stages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outOfBedSegments != null && message.outOfBedSegments.length) + for (var i = 0; i < message.outOfBedSegments.length; ++i) + $root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment.encode(message.outOfBedSegments[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.devicesandservices.health.v4.Sleep.SleepMetadata.encode(message.metadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + $root.google.devicesandservices.health.v4.Sleep.SleepSummary.encode(message.summary, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; /** - * Encodes the specified VO2Max message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.VO2Max.verify|verify} messages. + * Encodes the specified Sleep message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.VO2Max + * @memberof google.devicesandservices.health.v4.Sleep * @static - * @param {google.devicesandservices.health.v4.IVO2Max} message VO2Max message or plain object to encode + * @param {google.devicesandservices.health.v4.ISleep} message Sleep message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VO2Max.encodeDelimited = function encodeDelimited(message, writer) { + Sleep.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VO2Max message from the specified reader or buffer. + * Decodes a Sleep message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.VO2Max + * @memberof google.devicesandservices.health.v4.Sleep * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.VO2Max} VO2Max + * @returns {google.devicesandservices.health.v4.Sleep} Sleep * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VO2Max.decode = function decode(reader, length, error) { + Sleep.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.VO2Max(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Sleep(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 1: { - message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.decode(reader, reader.uint32()); + case 3: { + message.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.decode(reader, reader.uint32()); break; } - case 2: { - message.vo2Max = reader.double(); + case 4: { + message.type = reader.int32(); break; } - case 4: { - message.measurementMethod = reader.int32(); + case 5: { + if (!(message.stages && message.stages.length)) + message.stages = []; + message.stages.push($root.google.devicesandservices.health.v4.Sleep.SleepStage.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.outOfBedSegments && message.outOfBedSegments.length)) + message.outOfBedSegments = []; + message.outOfBedSegments.push($root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment.decode(reader, reader.uint32())); + break; + } + case 8: { + message.metadata = $root.google.devicesandservices.health.v4.Sleep.SleepMetadata.decode(reader, reader.uint32()); + break; + } + case 9: { + message.summary = $root.google.devicesandservices.health.v4.Sleep.SleepSummary.decode(reader, reader.uint32()); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -20822,2018 +23865,2290 @@ }; /** - * Decodes a VO2Max message from the specified reader or buffer, length delimited. + * Decodes a Sleep message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.VO2Max + * @memberof google.devicesandservices.health.v4.Sleep * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.VO2Max} VO2Max + * @returns {google.devicesandservices.health.v4.Sleep} Sleep * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VO2Max.decodeDelimited = function decodeDelimited(reader) { + Sleep.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VO2Max message. + * Verifies a Sleep message. * @function verify - * @memberof google.devicesandservices.health.v4.VO2Max + * @memberof google.devicesandservices.health.v4.Sleep * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VO2Max.verify = function verify(message) { + Sleep.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { - var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); + if (message.interval != null && message.hasOwnProperty("interval")) { + var error = $root.google.devicesandservices.health.v4.SessionTimeInterval.verify(message.interval); if (error) - return "sampleTime." + error; + return "interval." + error; } - if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) - if (typeof message.vo2Max !== "number") - return "vo2Max: number expected"; - if (message.measurementMethod != null && message.hasOwnProperty("measurementMethod")) - switch (message.measurementMethod) { + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { default: - return "measurementMethod: enum value expected"; + return "type: enum value expected"; case 0: case 1: case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: break; } + if (message.stages != null && message.hasOwnProperty("stages")) { + if (!Array.isArray(message.stages)) + return "stages: array expected"; + for (var i = 0; i < message.stages.length; ++i) { + var error = $root.google.devicesandservices.health.v4.Sleep.SleepStage.verify(message.stages[i]); + if (error) + return "stages." + error; + } + } + if (message.outOfBedSegments != null && message.hasOwnProperty("outOfBedSegments")) { + if (!Array.isArray(message.outOfBedSegments)) + return "outOfBedSegments: array expected"; + for (var i = 0; i < message.outOfBedSegments.length; ++i) { + var error = $root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment.verify(message.outOfBedSegments[i]); + if (error) + return "outOfBedSegments." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.devicesandservices.health.v4.Sleep.SleepMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.summary != null && message.hasOwnProperty("summary")) { + var error = $root.google.devicesandservices.health.v4.Sleep.SleepSummary.verify(message.summary); + if (error) + return "summary." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } return null; }; /** - * Creates a VO2Max message from a plain object. Also converts values to their respective internal types. + * Creates a Sleep message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.VO2Max + * @memberof google.devicesandservices.health.v4.Sleep * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.VO2Max} VO2Max + * @returns {google.devicesandservices.health.v4.Sleep} Sleep */ - VO2Max.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.VO2Max) + Sleep.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Sleep) return object; - var message = new $root.google.devicesandservices.health.v4.VO2Max(); - if (object.sampleTime != null) { - if (typeof object.sampleTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.VO2Max.sampleTime: object expected"); - message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.fromObject(object.sampleTime); + var message = new $root.google.devicesandservices.health.v4.Sleep(); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.interval: object expected"); + message.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.fromObject(object.interval); } - if (object.vo2Max != null) - message.vo2Max = Number(object.vo2Max); - switch (object.measurementMethod) { + switch (object.type) { default: - if (typeof object.measurementMethod === "number") { - message.measurementMethod = object.measurementMethod; + if (typeof object.type === "number") { + message.type = object.type; break; } break; - case "MEASUREMENT_METHOD_UNSPECIFIED": + case "SLEEP_TYPE_UNSPECIFIED": case 0: - message.measurementMethod = 0; + message.type = 0; break; - case "FITBIT_RUN": + case "CLASSIC": case 1: - message.measurementMethod = 1; + message.type = 1; break; - case "GOOGLE_DEMOGRAPHIC": + case "STAGES": case 2: - message.measurementMethod = 2; - break; - case "COOPER_TEST": - case 3: - message.measurementMethod = 3; - break; - case "HEART_RATE_RATIO": - case 4: - message.measurementMethod = 4; - break; - case "METABOLIC_CART": - case 5: - message.measurementMethod = 5; - break; - case "MULTISTAGE_FITNESS_TEST": - case 6: - message.measurementMethod = 6; - break; - case "ROCKPORT_FITNESS_TEST": - case 7: - message.measurementMethod = 7; - break; - case "MAX_EXERCISE": - case 8: - message.measurementMethod = 8; - break; - case "PREDICTION_SUB_MAX_EXERCISE": - case 9: - message.measurementMethod = 9; - break; - case "PREDICTION_NON_EXERCISE": - case 10: - message.measurementMethod = 10; - break; - case "OTHER": - case 11: - message.measurementMethod = 11; + message.type = 2; break; } + if (object.stages) { + if (!Array.isArray(object.stages)) + throw TypeError(".google.devicesandservices.health.v4.Sleep.stages: array expected"); + message.stages = []; + for (var i = 0; i < object.stages.length; ++i) { + if (typeof object.stages[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.stages: object expected"); + message.stages[i] = $root.google.devicesandservices.health.v4.Sleep.SleepStage.fromObject(object.stages[i]); + } + } + if (object.outOfBedSegments) { + if (!Array.isArray(object.outOfBedSegments)) + throw TypeError(".google.devicesandservices.health.v4.Sleep.outOfBedSegments: array expected"); + message.outOfBedSegments = []; + for (var i = 0; i < object.outOfBedSegments.length; ++i) { + if (typeof object.outOfBedSegments[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.outOfBedSegments: object expected"); + message.outOfBedSegments[i] = $root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment.fromObject(object.outOfBedSegments[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.metadata: object expected"); + message.metadata = $root.google.devicesandservices.health.v4.Sleep.SleepMetadata.fromObject(object.metadata); + } + if (object.summary != null) { + if (typeof object.summary !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.summary: object expected"); + message.summary = $root.google.devicesandservices.health.v4.Sleep.SleepSummary.fromObject(object.summary); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } return message; }; /** - * Creates a plain object from a VO2Max message. Also converts values to other types if specified. + * Creates a plain object from a Sleep message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.VO2Max + * @memberof google.devicesandservices.health.v4.Sleep * @static - * @param {google.devicesandservices.health.v4.VO2Max} message VO2Max + * @param {google.devicesandservices.health.v4.Sleep} message Sleep * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VO2Max.toObject = function toObject(message, options) { + Sleep.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.stages = []; + object.outOfBedSegments = []; + } if (options.defaults) { - object.sampleTime = null; - object.vo2Max = 0; - object.measurementMethod = options.enums === String ? "MEASUREMENT_METHOD_UNSPECIFIED" : 0; + object.interval = null; + object.type = options.enums === String ? "SLEEP_TYPE_UNSPECIFIED" : 0; + object.metadata = null; + object.summary = null; + object.createTime = null; + object.updateTime = null; } - if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) - object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); - if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) - object.vo2Max = options.json && !isFinite(message.vo2Max) ? String(message.vo2Max) : message.vo2Max; - if (message.measurementMethod != null && message.hasOwnProperty("measurementMethod")) - object.measurementMethod = options.enums === String ? $root.google.devicesandservices.health.v4.VO2Max.MeasurementMethod[message.measurementMethod] === undefined ? message.measurementMethod : $root.google.devicesandservices.health.v4.VO2Max.MeasurementMethod[message.measurementMethod] : message.measurementMethod; - return object; - }; - - /** - * Converts this VO2Max to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.VO2Max - * @instance - * @returns {Object.} JSON object - */ - VO2Max.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VO2Max - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.VO2Max - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VO2Max.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.VO2Max"; - }; - - /** - * MeasurementMethod enum. - * @name google.devicesandservices.health.v4.VO2Max.MeasurementMethod - * @enum {number} - * @property {number} MEASUREMENT_METHOD_UNSPECIFIED=0 MEASUREMENT_METHOD_UNSPECIFIED value - * @property {number} FITBIT_RUN=1 FITBIT_RUN value - * @property {number} GOOGLE_DEMOGRAPHIC=2 GOOGLE_DEMOGRAPHIC value - * @property {number} COOPER_TEST=3 COOPER_TEST value - * @property {number} HEART_RATE_RATIO=4 HEART_RATE_RATIO value - * @property {number} METABOLIC_CART=5 METABOLIC_CART value - * @property {number} MULTISTAGE_FITNESS_TEST=6 MULTISTAGE_FITNESS_TEST value - * @property {number} ROCKPORT_FITNESS_TEST=7 ROCKPORT_FITNESS_TEST value - * @property {number} MAX_EXERCISE=8 MAX_EXERCISE value - * @property {number} PREDICTION_SUB_MAX_EXERCISE=9 PREDICTION_SUB_MAX_EXERCISE value - * @property {number} PREDICTION_NON_EXERCISE=10 PREDICTION_NON_EXERCISE value - * @property {number} OTHER=11 OTHER value - */ - VO2Max.MeasurementMethod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MEASUREMENT_METHOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "FITBIT_RUN"] = 1; - values[valuesById[2] = "GOOGLE_DEMOGRAPHIC"] = 2; - values[valuesById[3] = "COOPER_TEST"] = 3; - values[valuesById[4] = "HEART_RATE_RATIO"] = 4; - values[valuesById[5] = "METABOLIC_CART"] = 5; - values[valuesById[6] = "MULTISTAGE_FITNESS_TEST"] = 6; - values[valuesById[7] = "ROCKPORT_FITNESS_TEST"] = 7; - values[valuesById[8] = "MAX_EXERCISE"] = 8; - values[valuesById[9] = "PREDICTION_SUB_MAX_EXERCISE"] = 9; - values[valuesById[10] = "PREDICTION_NON_EXERCISE"] = 10; - values[valuesById[11] = "OTHER"] = 11; - return values; - })(); - - return VO2Max; - })(); - - v4.Weight = (function() { - - /** - * Properties of a Weight. - * @memberof google.devicesandservices.health.v4 - * @interface IWeight - * @property {google.devicesandservices.health.v4.IObservationSampleTime|null} [sampleTime] Weight sampleTime - * @property {number|null} [weightGrams] Weight weightGrams - * @property {string|null} [notes] Weight notes - */ - - /** - * Constructs a new Weight. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a Weight. - * @implements IWeight - * @constructor - * @param {google.devicesandservices.health.v4.IWeight=} [properties] Properties to set - */ - function Weight(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Weight sampleTime. - * @member {google.devicesandservices.health.v4.IObservationSampleTime|null|undefined} sampleTime - * @memberof google.devicesandservices.health.v4.Weight - * @instance - */ - Weight.prototype.sampleTime = null; - - /** - * Weight weightGrams. - * @member {number} weightGrams - * @memberof google.devicesandservices.health.v4.Weight - * @instance - */ - Weight.prototype.weightGrams = 0; - - /** - * Weight notes. - * @member {string} notes - * @memberof google.devicesandservices.health.v4.Weight - * @instance - */ - Weight.prototype.notes = ""; - - /** - * Creates a new Weight instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.Weight - * @static - * @param {google.devicesandservices.health.v4.IWeight=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.Weight} Weight instance - */ - Weight.create = function create(properties) { - return new Weight(properties); - }; - - /** - * Encodes the specified Weight message. Does not implicitly {@link google.devicesandservices.health.v4.Weight.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.Weight - * @static - * @param {google.devicesandservices.health.v4.IWeight} message Weight message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Weight.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sampleTime != null && Object.hasOwnProperty.call(message, "sampleTime")) - $root.google.devicesandservices.health.v4.ObservationSampleTime.encode(message.sampleTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.weightGrams != null && Object.hasOwnProperty.call(message, "weightGrams")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.weightGrams); - if (message.notes != null && Object.hasOwnProperty.call(message, "notes")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.notes); - return writer; - }; - - /** - * Encodes the specified Weight message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Weight.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.Weight - * @static - * @param {google.devicesandservices.health.v4.IWeight} message Weight message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Weight.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Weight message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.Weight - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.Weight} Weight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Weight.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Weight(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.decode(reader, reader.uint32()); - break; - } - case 3: { - message.weightGrams = reader.double(); - break; - } - case 4: { - message.notes = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Weight message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.Weight - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.Weight} Weight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Weight.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Weight message. - * @function verify - * @memberof google.devicesandservices.health.v4.Weight - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Weight.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { - var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); - if (error) - return "sampleTime." + error; - } - if (message.weightGrams != null && message.hasOwnProperty("weightGrams")) - if (typeof message.weightGrams !== "number") - return "weightGrams: number expected"; - if (message.notes != null && message.hasOwnProperty("notes")) - if (!$util.isString(message.notes)) - return "notes: string expected"; - return null; - }; - - /** - * Creates a Weight message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.Weight - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.Weight} Weight - */ - Weight.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.Weight) - return object; - var message = new $root.google.devicesandservices.health.v4.Weight(); - if (object.sampleTime != null) { - if (typeof object.sampleTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.Weight.sampleTime: object expected"); - message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.fromObject(object.sampleTime); + if (message.interval != null && message.hasOwnProperty("interval")) + object.interval = $root.google.devicesandservices.health.v4.SessionTimeInterval.toObject(message.interval, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.devicesandservices.health.v4.Sleep.SleepType[message.type] === undefined ? message.type : $root.google.devicesandservices.health.v4.Sleep.SleepType[message.type] : message.type; + if (message.stages && message.stages.length) { + object.stages = []; + for (var j = 0; j < message.stages.length; ++j) + object.stages[j] = $root.google.devicesandservices.health.v4.Sleep.SleepStage.toObject(message.stages[j], options); } - if (object.weightGrams != null) - message.weightGrams = Number(object.weightGrams); - if (object.notes != null) - message.notes = String(object.notes); - return message; - }; - - /** - * Creates a plain object from a Weight message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.Weight - * @static - * @param {google.devicesandservices.health.v4.Weight} message Weight - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Weight.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sampleTime = null; - object.weightGrams = 0; - object.notes = ""; + if (message.outOfBedSegments && message.outOfBedSegments.length) { + object.outOfBedSegments = []; + for (var j = 0; j < message.outOfBedSegments.length; ++j) + object.outOfBedSegments[j] = $root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment.toObject(message.outOfBedSegments[j], options); } - if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) - object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); - if (message.weightGrams != null && message.hasOwnProperty("weightGrams")) - object.weightGrams = options.json && !isFinite(message.weightGrams) ? String(message.weightGrams) : message.weightGrams; - if (message.notes != null && message.hasOwnProperty("notes")) - object.notes = message.notes; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.devicesandservices.health.v4.Sleep.SleepMetadata.toObject(message.metadata, options); + if (message.summary != null && message.hasOwnProperty("summary")) + object.summary = $root.google.devicesandservices.health.v4.Sleep.SleepSummary.toObject(message.summary, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** - * Converts this Weight to JSON. + * Converts this Sleep to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.Weight + * @memberof google.devicesandservices.health.v4.Sleep * @instance * @returns {Object.} JSON object */ - Weight.prototype.toJSON = function toJSON() { + Sleep.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Weight + * Gets the default type url for Sleep * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.Weight + * @memberof google.devicesandservices.health.v4.Sleep * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Weight.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Sleep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.Weight"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.Sleep"; }; - return Weight; - })(); + Sleep.SleepStage = (function() { - v4.WeightRollupValue = (function() { + /** + * Properties of a SleepStage. + * @memberof google.devicesandservices.health.v4.Sleep + * @interface ISleepStage + * @property {google.protobuf.ITimestamp|null} [startTime] SleepStage startTime + * @property {google.protobuf.IDuration|null} [startUtcOffset] SleepStage startUtcOffset + * @property {google.protobuf.ITimestamp|null} [endTime] SleepStage endTime + * @property {google.protobuf.IDuration|null} [endUtcOffset] SleepStage endUtcOffset + * @property {google.devicesandservices.health.v4.Sleep.SleepStageType|null} [type] SleepStage type + * @property {google.protobuf.ITimestamp|null} [createTime] SleepStage createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] SleepStage updateTime + */ - /** - * Properties of a WeightRollupValue. - * @memberof google.devicesandservices.health.v4 - * @interface IWeightRollupValue - * @property {number|null} [weightGramsAvg] WeightRollupValue weightGramsAvg - */ + /** + * Constructs a new SleepStage. + * @memberof google.devicesandservices.health.v4.Sleep + * @classdesc Represents a SleepStage. + * @implements ISleepStage + * @constructor + * @param {google.devicesandservices.health.v4.Sleep.ISleepStage=} [properties] Properties to set + */ + function SleepStage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new WeightRollupValue. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a WeightRollupValue. - * @implements IWeightRollupValue - * @constructor - * @param {google.devicesandservices.health.v4.IWeightRollupValue=} [properties] Properties to set - */ - function WeightRollupValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * SleepStage startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @instance + */ + SleepStage.prototype.startTime = null; - /** - * WeightRollupValue weightGramsAvg. - * @member {number} weightGramsAvg - * @memberof google.devicesandservices.health.v4.WeightRollupValue - * @instance - */ - WeightRollupValue.prototype.weightGramsAvg = 0; + /** + * SleepStage startUtcOffset. + * @member {google.protobuf.IDuration|null|undefined} startUtcOffset + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @instance + */ + SleepStage.prototype.startUtcOffset = null; - /** - * Creates a new WeightRollupValue instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.WeightRollupValue - * @static - * @param {google.devicesandservices.health.v4.IWeightRollupValue=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.WeightRollupValue} WeightRollupValue instance - */ - WeightRollupValue.create = function create(properties) { - return new WeightRollupValue(properties); - }; + /** + * SleepStage endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @instance + */ + SleepStage.prototype.endTime = null; - /** - * Encodes the specified WeightRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.WeightRollupValue.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.WeightRollupValue - * @static - * @param {google.devicesandservices.health.v4.IWeightRollupValue} message WeightRollupValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeightRollupValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.weightGramsAvg != null && Object.hasOwnProperty.call(message, "weightGramsAvg")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.weightGramsAvg); - return writer; - }; + /** + * SleepStage endUtcOffset. + * @member {google.protobuf.IDuration|null|undefined} endUtcOffset + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @instance + */ + SleepStage.prototype.endUtcOffset = null; - /** - * Encodes the specified WeightRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.WeightRollupValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.WeightRollupValue - * @static - * @param {google.devicesandservices.health.v4.IWeightRollupValue} message WeightRollupValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeightRollupValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * SleepStage type. + * @member {google.devicesandservices.health.v4.Sleep.SleepStageType} type + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @instance + */ + SleepStage.prototype.type = 0; - /** - * Decodes a WeightRollupValue message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.WeightRollupValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.WeightRollupValue} WeightRollupValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeightRollupValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.WeightRollupValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.weightGramsAvg = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * SleepStage createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @instance + */ + SleepStage.prototype.createTime = null; - /** - * Decodes a WeightRollupValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.WeightRollupValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.WeightRollupValue} WeightRollupValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeightRollupValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * SleepStage updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @instance + */ + SleepStage.prototype.updateTime = null; - /** - * Verifies a WeightRollupValue message. - * @function verify - * @memberof google.devicesandservices.health.v4.WeightRollupValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WeightRollupValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.weightGramsAvg != null && message.hasOwnProperty("weightGramsAvg")) - if (typeof message.weightGramsAvg !== "number") - return "weightGramsAvg: number expected"; - return null; - }; + /** + * Creates a new SleepStage instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @static + * @param {google.devicesandservices.health.v4.Sleep.ISleepStage=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Sleep.SleepStage} SleepStage instance + */ + SleepStage.create = function create(properties) { + return new SleepStage(properties); + }; - /** - * Creates a WeightRollupValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.WeightRollupValue - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.WeightRollupValue} WeightRollupValue - */ - WeightRollupValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.WeightRollupValue) - return object; - var message = new $root.google.devicesandservices.health.v4.WeightRollupValue(); - if (object.weightGramsAvg != null) - message.weightGramsAvg = Number(object.weightGramsAvg); - return message; - }; + /** + * Encodes the specified SleepStage message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepStage.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @static + * @param {google.devicesandservices.health.v4.Sleep.ISleepStage} message SleepStage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SleepStage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startUtcOffset != null && Object.hasOwnProperty.call(message, "startUtcOffset")) + $root.google.protobuf.Duration.encode(message.startUtcOffset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.endUtcOffset != null && Object.hasOwnProperty.call(message, "endUtcOffset")) + $root.google.protobuf.Duration.encode(message.endUtcOffset, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.type); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; - /** - * Creates a plain object from a WeightRollupValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.WeightRollupValue - * @static - * @param {google.devicesandservices.health.v4.WeightRollupValue} message WeightRollupValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WeightRollupValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.weightGramsAvg = 0; - if (message.weightGramsAvg != null && message.hasOwnProperty("weightGramsAvg")) - object.weightGramsAvg = options.json && !isFinite(message.weightGramsAvg) ? String(message.weightGramsAvg) : message.weightGramsAvg; - return object; - }; + /** + * Encodes the specified SleepStage message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepStage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @static + * @param {google.devicesandservices.health.v4.Sleep.ISleepStage} message SleepStage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SleepStage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Converts this WeightRollupValue to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.WeightRollupValue - * @instance - * @returns {Object.} JSON object - */ - WeightRollupValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a SleepStage message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.Sleep.SleepStage} SleepStage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SleepStage.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Sleep.SleepStage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.startUtcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.endUtcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.type = reader.int32(); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Gets the default type url for WeightRollupValue - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.WeightRollupValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WeightRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.WeightRollupValue"; - }; + /** + * Decodes a SleepStage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.Sleep.SleepStage} SleepStage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SleepStage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return WeightRollupValue; - })(); + /** + * Verifies a SleepStage message. + * @function verify + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SleepStage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.startUtcOffset != null && message.hasOwnProperty("startUtcOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startUtcOffset); + if (error) + return "startUtcOffset." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.endUtcOffset != null && message.hasOwnProperty("endUtcOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endUtcOffset); + if (error) + return "endUtcOffset." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; - v4.SedentaryPeriod = (function() { + /** + * Creates a SleepStage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.Sleep.SleepStage} SleepStage + */ + SleepStage.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Sleep.SleepStage) + return object; + var message = new $root.google.devicesandservices.health.v4.Sleep.SleepStage(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepStage.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.startUtcOffset != null) { + if (typeof object.startUtcOffset !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepStage.startUtcOffset: object expected"); + message.startUtcOffset = $root.google.protobuf.Duration.fromObject(object.startUtcOffset); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepStage.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.endUtcOffset != null) { + if (typeof object.endUtcOffset !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepStage.endUtcOffset: object expected"); + message.endUtcOffset = $root.google.protobuf.Duration.fromObject(object.endUtcOffset); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "SLEEP_STAGE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "AWAKE": + case 1: + message.type = 1; + break; + case "LIGHT": + case 2: + message.type = 2; + break; + case "DEEP": + case 3: + message.type = 3; + break; + case "REM": + case 4: + message.type = 4; + break; + case "ASLEEP": + case 5: + message.type = 5; + break; + case "RESTLESS": + case 6: + message.type = 6; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepStage.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepStage.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; - /** - * Properties of a SedentaryPeriod. - * @memberof google.devicesandservices.health.v4 - * @interface ISedentaryPeriod - * @property {google.devicesandservices.health.v4.IObservationTimeInterval|null} [interval] SedentaryPeriod interval - */ + /** + * Creates a plain object from a SleepStage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @static + * @param {google.devicesandservices.health.v4.Sleep.SleepStage} message SleepStage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SleepStage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.startUtcOffset = null; + object.endTime = null; + object.endUtcOffset = null; + object.type = options.enums === String ? "SLEEP_STAGE_TYPE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.startUtcOffset != null && message.hasOwnProperty("startUtcOffset")) + object.startUtcOffset = $root.google.protobuf.Duration.toObject(message.startUtcOffset, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.endUtcOffset != null && message.hasOwnProperty("endUtcOffset")) + object.endUtcOffset = $root.google.protobuf.Duration.toObject(message.endUtcOffset, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.devicesandservices.health.v4.Sleep.SleepStageType[message.type] === undefined ? message.type : $root.google.devicesandservices.health.v4.Sleep.SleepStageType[message.type] : message.type; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; - /** - * Constructs a new SedentaryPeriod. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a SedentaryPeriod. - * @implements ISedentaryPeriod - * @constructor - * @param {google.devicesandservices.health.v4.ISedentaryPeriod=} [properties] Properties to set - */ - function SedentaryPeriod(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Converts this SleepStage to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @instance + * @returns {Object.} JSON object + */ + SleepStage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * SedentaryPeriod interval. - * @member {google.devicesandservices.health.v4.IObservationTimeInterval|null|undefined} interval - * @memberof google.devicesandservices.health.v4.SedentaryPeriod - * @instance - */ - SedentaryPeriod.prototype.interval = null; + /** + * Gets the default type url for SleepStage + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.Sleep.SleepStage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SleepStage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.Sleep.SleepStage"; + }; - /** - * Creates a new SedentaryPeriod instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.SedentaryPeriod - * @static - * @param {google.devicesandservices.health.v4.ISedentaryPeriod=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.SedentaryPeriod} SedentaryPeriod instance - */ - SedentaryPeriod.create = function create(properties) { - return new SedentaryPeriod(properties); - }; + return SleepStage; + })(); - /** - * Encodes the specified SedentaryPeriod message. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriod.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.SedentaryPeriod - * @static - * @param {google.devicesandservices.health.v4.ISedentaryPeriod} message SedentaryPeriod message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SedentaryPeriod.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) - $root.google.devicesandservices.health.v4.ObservationTimeInterval.encode(message.interval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + Sleep.OutOfBedSegment = (function() { - /** - * Encodes the specified SedentaryPeriod message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriod.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.SedentaryPeriod - * @static - * @param {google.devicesandservices.health.v4.ISedentaryPeriod} message SedentaryPeriod message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SedentaryPeriod.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of an OutOfBedSegment. + * @memberof google.devicesandservices.health.v4.Sleep + * @interface IOutOfBedSegment + * @property {google.protobuf.ITimestamp|null} [startTime] OutOfBedSegment startTime + * @property {google.protobuf.IDuration|null} [startUtcOffset] OutOfBedSegment startUtcOffset + * @property {google.protobuf.ITimestamp|null} [endTime] OutOfBedSegment endTime + * @property {google.protobuf.IDuration|null} [endUtcOffset] OutOfBedSegment endUtcOffset + */ - /** - * Decodes a SedentaryPeriod message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.SedentaryPeriod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.SedentaryPeriod} SedentaryPeriod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SedentaryPeriod.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.SedentaryPeriod(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } + /** + * Constructs a new OutOfBedSegment. + * @memberof google.devicesandservices.health.v4.Sleep + * @classdesc Represents an OutOfBedSegment. + * @implements IOutOfBedSegment + * @constructor + * @param {google.devicesandservices.health.v4.Sleep.IOutOfBedSegment=} [properties] Properties to set + */ + function OutOfBedSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Decodes a SedentaryPeriod message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.SedentaryPeriod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.SedentaryPeriod} SedentaryPeriod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SedentaryPeriod.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * OutOfBedSegment startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment + * @instance + */ + OutOfBedSegment.prototype.startTime = null; - /** - * Verifies a SedentaryPeriod message. - * @function verify - * @memberof google.devicesandservices.health.v4.SedentaryPeriod - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SedentaryPeriod.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.interval != null && message.hasOwnProperty("interval")) { - var error = $root.google.devicesandservices.health.v4.ObservationTimeInterval.verify(message.interval); - if (error) - return "interval." + error; - } - return null; - }; - - /** - * Creates a SedentaryPeriod message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.SedentaryPeriod - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.SedentaryPeriod} SedentaryPeriod - */ - SedentaryPeriod.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.SedentaryPeriod) - return object; - var message = new $root.google.devicesandservices.health.v4.SedentaryPeriod(); - if (object.interval != null) { - if (typeof object.interval !== "object") - throw TypeError(".google.devicesandservices.health.v4.SedentaryPeriod.interval: object expected"); - message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.fromObject(object.interval); - } - return message; - }; + /** + * OutOfBedSegment startUtcOffset. + * @member {google.protobuf.IDuration|null|undefined} startUtcOffset + * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment + * @instance + */ + OutOfBedSegment.prototype.startUtcOffset = null; - /** - * Creates a plain object from a SedentaryPeriod message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.SedentaryPeriod - * @static - * @param {google.devicesandservices.health.v4.SedentaryPeriod} message SedentaryPeriod - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SedentaryPeriod.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.interval = null; - if (message.interval != null && message.hasOwnProperty("interval")) - object.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.toObject(message.interval, options); - return object; - }; + /** + * OutOfBedSegment endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment + * @instance + */ + OutOfBedSegment.prototype.endTime = null; - /** - * Converts this SedentaryPeriod to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.SedentaryPeriod - * @instance - * @returns {Object.} JSON object - */ - SedentaryPeriod.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * OutOfBedSegment endUtcOffset. + * @member {google.protobuf.IDuration|null|undefined} endUtcOffset + * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment + * @instance + */ + OutOfBedSegment.prototype.endUtcOffset = null; - /** - * Gets the default type url for SedentaryPeriod - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.SedentaryPeriod - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SedentaryPeriod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.SedentaryPeriod"; - }; + /** + * Creates a new OutOfBedSegment instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment + * @static + * @param {google.devicesandservices.health.v4.Sleep.IOutOfBedSegment=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Sleep.OutOfBedSegment} OutOfBedSegment instance + */ + OutOfBedSegment.create = function create(properties) { + return new OutOfBedSegment(properties); + }; - return SedentaryPeriod; - })(); + /** + * Encodes the specified OutOfBedSegment message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.OutOfBedSegment.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment + * @static + * @param {google.devicesandservices.health.v4.Sleep.IOutOfBedSegment} message OutOfBedSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutOfBedSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startUtcOffset != null && Object.hasOwnProperty.call(message, "startUtcOffset")) + $root.google.protobuf.Duration.encode(message.startUtcOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endUtcOffset != null && Object.hasOwnProperty.call(message, "endUtcOffset")) + $root.google.protobuf.Duration.encode(message.endUtcOffset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - v4.SedentaryPeriodRollupValue = (function() { + /** + * Encodes the specified OutOfBedSegment message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.OutOfBedSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment + * @static + * @param {google.devicesandservices.health.v4.Sleep.IOutOfBedSegment} message OutOfBedSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutOfBedSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Properties of a SedentaryPeriodRollupValue. - * @memberof google.devicesandservices.health.v4 - * @interface ISedentaryPeriodRollupValue - * @property {google.protobuf.IDuration|null} [durationSum] SedentaryPeriodRollupValue durationSum - */ + /** + * Decodes an OutOfBedSegment message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.Sleep.OutOfBedSegment} OutOfBedSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutOfBedSegment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startUtcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endUtcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Constructs a new SedentaryPeriodRollupValue. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a SedentaryPeriodRollupValue. - * @implements ISedentaryPeriodRollupValue - * @constructor - * @param {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue=} [properties] Properties to set - */ - function SedentaryPeriodRollupValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes an OutOfBedSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.Sleep.OutOfBedSegment} OutOfBedSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutOfBedSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * SedentaryPeriodRollupValue durationSum. - * @member {google.protobuf.IDuration|null|undefined} durationSum - * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue - * @instance - */ - SedentaryPeriodRollupValue.prototype.durationSum = null; + /** + * Verifies an OutOfBedSegment message. + * @function verify + * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutOfBedSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.startUtcOffset != null && message.hasOwnProperty("startUtcOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startUtcOffset); + if (error) + return "startUtcOffset." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.endUtcOffset != null && message.hasOwnProperty("endUtcOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endUtcOffset); + if (error) + return "endUtcOffset." + error; + } + return null; + }; - /** - * Creates a new SedentaryPeriodRollupValue instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue - * @static - * @param {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.SedentaryPeriodRollupValue} SedentaryPeriodRollupValue instance - */ - SedentaryPeriodRollupValue.create = function create(properties) { - return new SedentaryPeriodRollupValue(properties); - }; + /** + * Creates an OutOfBedSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.Sleep.OutOfBedSegment} OutOfBedSegment + */ + OutOfBedSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment) + return object; + var message = new $root.google.devicesandservices.health.v4.Sleep.OutOfBedSegment(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.OutOfBedSegment.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.startUtcOffset != null) { + if (typeof object.startUtcOffset !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.OutOfBedSegment.startUtcOffset: object expected"); + message.startUtcOffset = $root.google.protobuf.Duration.fromObject(object.startUtcOffset); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.OutOfBedSegment.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.endUtcOffset != null) { + if (typeof object.endUtcOffset !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.OutOfBedSegment.endUtcOffset: object expected"); + message.endUtcOffset = $root.google.protobuf.Duration.fromObject(object.endUtcOffset); + } + return message; + }; - /** - * Encodes the specified SedentaryPeriodRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriodRollupValue.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue - * @static - * @param {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue} message SedentaryPeriodRollupValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SedentaryPeriodRollupValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.durationSum != null && Object.hasOwnProperty.call(message, "durationSum")) - $root.google.protobuf.Duration.encode(message.durationSum, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Creates a plain object from an OutOfBedSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment + * @static + * @param {google.devicesandservices.health.v4.Sleep.OutOfBedSegment} message OutOfBedSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutOfBedSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.startUtcOffset = null; + object.endTime = null; + object.endUtcOffset = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.startUtcOffset != null && message.hasOwnProperty("startUtcOffset")) + object.startUtcOffset = $root.google.protobuf.Duration.toObject(message.startUtcOffset, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.endUtcOffset != null && message.hasOwnProperty("endUtcOffset")) + object.endUtcOffset = $root.google.protobuf.Duration.toObject(message.endUtcOffset, options); + return object; + }; - /** - * Encodes the specified SedentaryPeriodRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriodRollupValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue - * @static - * @param {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue} message SedentaryPeriodRollupValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SedentaryPeriodRollupValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this OutOfBedSegment to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment + * @instance + * @returns {Object.} JSON object + */ + OutOfBedSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a SedentaryPeriodRollupValue message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.SedentaryPeriodRollupValue} SedentaryPeriodRollupValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SedentaryPeriodRollupValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.durationSum = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; + /** + * Gets the default type url for OutOfBedSegment + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.Sleep.OutOfBedSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutOfBedSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - } - return message; - }; + return typeUrlPrefix + "/google.devicesandservices.health.v4.Sleep.OutOfBedSegment"; + }; - /** - * Decodes a SedentaryPeriodRollupValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.SedentaryPeriodRollupValue} SedentaryPeriodRollupValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SedentaryPeriodRollupValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return OutOfBedSegment; + })(); - /** - * Verifies a SedentaryPeriodRollupValue message. - * @function verify - * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SedentaryPeriodRollupValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.durationSum != null && message.hasOwnProperty("durationSum")) { - var error = $root.google.protobuf.Duration.verify(message.durationSum); - if (error) - return "durationSum." + error; - } - return null; - }; + Sleep.SleepMetadata = (function() { - /** - * Creates a SedentaryPeriodRollupValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.SedentaryPeriodRollupValue} SedentaryPeriodRollupValue - */ - SedentaryPeriodRollupValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue) - return object; - var message = new $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue(); - if (object.durationSum != null) { - if (typeof object.durationSum !== "object") - throw TypeError(".google.devicesandservices.health.v4.SedentaryPeriodRollupValue.durationSum: object expected"); - message.durationSum = $root.google.protobuf.Duration.fromObject(object.durationSum); + /** + * Properties of a SleepMetadata. + * @memberof google.devicesandservices.health.v4.Sleep + * @interface ISleepMetadata + * @property {google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState|null} [stagesStatus] SleepMetadata stagesStatus + * @property {boolean|null} [processed] SleepMetadata processed + * @property {boolean|null} [nap] SleepMetadata nap + * @property {boolean|null} [manuallyEdited] SleepMetadata manuallyEdited + * @property {string|null} [externalId] SleepMetadata externalId + */ + + /** + * Constructs a new SleepMetadata. + * @memberof google.devicesandservices.health.v4.Sleep + * @classdesc Represents a SleepMetadata. + * @implements ISleepMetadata + * @constructor + * @param {google.devicesandservices.health.v4.Sleep.ISleepMetadata=} [properties] Properties to set + */ + function SleepMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Creates a plain object from a SedentaryPeriodRollupValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue - * @static - * @param {google.devicesandservices.health.v4.SedentaryPeriodRollupValue} message SedentaryPeriodRollupValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SedentaryPeriodRollupValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.durationSum = null; - if (message.durationSum != null && message.hasOwnProperty("durationSum")) - object.durationSum = $root.google.protobuf.Duration.toObject(message.durationSum, options); - return object; - }; + /** + * SleepMetadata stagesStatus. + * @member {google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState} stagesStatus + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @instance + */ + SleepMetadata.prototype.stagesStatus = 0; - /** - * Converts this SedentaryPeriodRollupValue to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue - * @instance - * @returns {Object.} JSON object - */ - SedentaryPeriodRollupValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * SleepMetadata processed. + * @member {boolean} processed + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @instance + */ + SleepMetadata.prototype.processed = false; - /** - * Gets the default type url for SedentaryPeriodRollupValue - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SedentaryPeriodRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.SedentaryPeriodRollupValue"; - }; + /** + * SleepMetadata nap. + * @member {boolean} nap + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @instance + */ + SleepMetadata.prototype.nap = false; - return SedentaryPeriodRollupValue; - })(); + /** + * SleepMetadata manuallyEdited. + * @member {boolean} manuallyEdited + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @instance + */ + SleepMetadata.prototype.manuallyEdited = false; - v4.DataPointsService = (function() { + /** + * SleepMetadata externalId. + * @member {string} externalId + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @instance + */ + SleepMetadata.prototype.externalId = ""; - /** - * Constructs a new DataPointsService service. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a DataPointsService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function DataPointsService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + /** + * Creates a new SleepMetadata instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @static + * @param {google.devicesandservices.health.v4.Sleep.ISleepMetadata=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Sleep.SleepMetadata} SleepMetadata instance + */ + SleepMetadata.create = function create(properties) { + return new SleepMetadata(properties); + }; - (DataPointsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DataPointsService; + /** + * Encodes the specified SleepMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepMetadata.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @static + * @param {google.devicesandservices.health.v4.Sleep.ISleepMetadata} message SleepMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SleepMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stagesStatus != null && Object.hasOwnProperty.call(message, "stagesStatus")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stagesStatus); + if (message.processed != null && Object.hasOwnProperty.call(message, "processed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.processed); + if (message.nap != null && Object.hasOwnProperty.call(message, "nap")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.nap); + if (message.manuallyEdited != null && Object.hasOwnProperty.call(message, "manuallyEdited")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.manuallyEdited); + if (message.externalId != null && Object.hasOwnProperty.call(message, "externalId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.externalId); + return writer; + }; - /** - * Creates new DataPointsService service using the specified rpc implementation. - * @function create - * @memberof google.devicesandservices.health.v4.DataPointsService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {DataPointsService} RPC service. Useful where requests and/or responses are streamed. - */ - DataPointsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + /** + * Encodes the specified SleepMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @static + * @param {google.devicesandservices.health.v4.Sleep.ISleepMetadata} message SleepMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SleepMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|getDataPoint}. - * @memberof google.devicesandservices.health.v4.DataPointsService - * @typedef GetDataPointCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.devicesandservices.health.v4.DataPoint} [response] DataPoint - */ + /** + * Decodes a SleepMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.Sleep.SleepMetadata} SleepMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SleepMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Sleep.SleepMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stagesStatus = reader.int32(); + break; + } + case 2: { + message.processed = reader.bool(); + break; + } + case 5: { + message.nap = reader.bool(); + break; + } + case 6: { + message.manuallyEdited = reader.bool(); + break; + } + case 7: { + message.externalId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Calls GetDataPoint. - * @function getDataPoint - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IGetDataPointRequest} request GetDataPointRequest message or plain object - * @param {google.devicesandservices.health.v4.DataPointsService.GetDataPointCallback} callback Node-style callback called with the error, if any, and DataPoint - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DataPointsService.prototype.getDataPoint = function getDataPoint(request, callback) { - return this.rpcCall(getDataPoint, $root.google.devicesandservices.health.v4.GetDataPointRequest, $root.google.devicesandservices.health.v4.DataPoint, request, callback); - }, "name", { value: "GetDataPoint" }); + /** + * Decodes a SleepMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.Sleep.SleepMetadata} SleepMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SleepMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls GetDataPoint. - * @function getDataPoint - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IGetDataPointRequest} request GetDataPointRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Verifies a SleepMetadata message. + * @function verify + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SleepMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stagesStatus != null && message.hasOwnProperty("stagesStatus")) + switch (message.stagesStatus) { + default: + return "stagesStatus: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.processed != null && message.hasOwnProperty("processed")) + if (typeof message.processed !== "boolean") + return "processed: boolean expected"; + if (message.nap != null && message.hasOwnProperty("nap")) + if (typeof message.nap !== "boolean") + return "nap: boolean expected"; + if (message.manuallyEdited != null && message.hasOwnProperty("manuallyEdited")) + if (typeof message.manuallyEdited !== "boolean") + return "manuallyEdited: boolean expected"; + if (message.externalId != null && message.hasOwnProperty("externalId")) + if (!$util.isString(message.externalId)) + return "externalId: string expected"; + return null; + }; - /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|listDataPoints}. - * @memberof google.devicesandservices.health.v4.DataPointsService - * @typedef ListDataPointsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.devicesandservices.health.v4.ListDataPointsResponse} [response] ListDataPointsResponse - */ + /** + * Creates a SleepMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.Sleep.SleepMetadata} SleepMetadata + */ + SleepMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Sleep.SleepMetadata) + return object; + var message = new $root.google.devicesandservices.health.v4.Sleep.SleepMetadata(); + switch (object.stagesStatus) { + default: + if (typeof object.stagesStatus === "number") { + message.stagesStatus = object.stagesStatus; + break; + } + break; + case "STAGES_STATE_UNSPECIFIED": + case 0: + message.stagesStatus = 0; + break; + case "REJECTED_COVERAGE": + case 1: + message.stagesStatus = 1; + break; + case "REJECTED_MAX_GAP": + case 2: + message.stagesStatus = 2; + break; + case "REJECTED_START_GAP": + case 3: + message.stagesStatus = 3; + break; + case "REJECTED_END_GAP": + case 4: + message.stagesStatus = 4; + break; + case "REJECTED_NAP": + case 5: + message.stagesStatus = 5; + break; + case "REJECTED_SERVER": + case 6: + message.stagesStatus = 6; + break; + case "TIMEOUT": + case 7: + message.stagesStatus = 7; + break; + case "SUCCEEDED": + case 8: + message.stagesStatus = 8; + break; + case "PROCESSING_INTERNAL_ERROR": + case 9: + message.stagesStatus = 9; + break; + } + if (object.processed != null) + message.processed = Boolean(object.processed); + if (object.nap != null) + message.nap = Boolean(object.nap); + if (object.manuallyEdited != null) + message.manuallyEdited = Boolean(object.manuallyEdited); + if (object.externalId != null) + message.externalId = String(object.externalId); + return message; + }; - /** - * Calls ListDataPoints. - * @function listDataPoints - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IListDataPointsRequest} request ListDataPointsRequest message or plain object - * @param {google.devicesandservices.health.v4.DataPointsService.ListDataPointsCallback} callback Node-style callback called with the error, if any, and ListDataPointsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DataPointsService.prototype.listDataPoints = function listDataPoints(request, callback) { - return this.rpcCall(listDataPoints, $root.google.devicesandservices.health.v4.ListDataPointsRequest, $root.google.devicesandservices.health.v4.ListDataPointsResponse, request, callback); - }, "name", { value: "ListDataPoints" }); + /** + * Creates a plain object from a SleepMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @static + * @param {google.devicesandservices.health.v4.Sleep.SleepMetadata} message SleepMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SleepMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stagesStatus = options.enums === String ? "STAGES_STATE_UNSPECIFIED" : 0; + object.processed = false; + object.nap = false; + object.manuallyEdited = false; + object.externalId = ""; + } + if (message.stagesStatus != null && message.hasOwnProperty("stagesStatus")) + object.stagesStatus = options.enums === String ? $root.google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState[message.stagesStatus] === undefined ? message.stagesStatus : $root.google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState[message.stagesStatus] : message.stagesStatus; + if (message.processed != null && message.hasOwnProperty("processed")) + object.processed = message.processed; + if (message.nap != null && message.hasOwnProperty("nap")) + object.nap = message.nap; + if (message.manuallyEdited != null && message.hasOwnProperty("manuallyEdited")) + object.manuallyEdited = message.manuallyEdited; + if (message.externalId != null && message.hasOwnProperty("externalId")) + object.externalId = message.externalId; + return object; + }; - /** - * Calls ListDataPoints. - * @function listDataPoints - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IListDataPointsRequest} request ListDataPointsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Converts this SleepMetadata to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @instance + * @returns {Object.} JSON object + */ + SleepMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|createDataPoint}. - * @memberof google.devicesandservices.health.v4.DataPointsService - * @typedef CreateDataPointCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Gets the default type url for SleepMetadata + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.Sleep.SleepMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SleepMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.Sleep.SleepMetadata"; + }; - /** - * Calls CreateDataPoint. - * @function createDataPoint - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.ICreateDataPointRequest} request CreateDataPointRequest message or plain object - * @param {google.devicesandservices.health.v4.DataPointsService.CreateDataPointCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DataPointsService.prototype.createDataPoint = function createDataPoint(request, callback) { - return this.rpcCall(createDataPoint, $root.google.devicesandservices.health.v4.CreateDataPointRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateDataPoint" }); + /** + * StagesState enum. + * @name google.devicesandservices.health.v4.Sleep.SleepMetadata.StagesState + * @enum {number} + * @property {number} STAGES_STATE_UNSPECIFIED=0 STAGES_STATE_UNSPECIFIED value + * @property {number} REJECTED_COVERAGE=1 REJECTED_COVERAGE value + * @property {number} REJECTED_MAX_GAP=2 REJECTED_MAX_GAP value + * @property {number} REJECTED_START_GAP=3 REJECTED_START_GAP value + * @property {number} REJECTED_END_GAP=4 REJECTED_END_GAP value + * @property {number} REJECTED_NAP=5 REJECTED_NAP value + * @property {number} REJECTED_SERVER=6 REJECTED_SERVER value + * @property {number} TIMEOUT=7 TIMEOUT value + * @property {number} SUCCEEDED=8 SUCCEEDED value + * @property {number} PROCESSING_INTERNAL_ERROR=9 PROCESSING_INTERNAL_ERROR value + */ + SleepMetadata.StagesState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STAGES_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REJECTED_COVERAGE"] = 1; + values[valuesById[2] = "REJECTED_MAX_GAP"] = 2; + values[valuesById[3] = "REJECTED_START_GAP"] = 3; + values[valuesById[4] = "REJECTED_END_GAP"] = 4; + values[valuesById[5] = "REJECTED_NAP"] = 5; + values[valuesById[6] = "REJECTED_SERVER"] = 6; + values[valuesById[7] = "TIMEOUT"] = 7; + values[valuesById[8] = "SUCCEEDED"] = 8; + values[valuesById[9] = "PROCESSING_INTERNAL_ERROR"] = 9; + return values; + })(); - /** - * Calls CreateDataPoint. - * @function createDataPoint - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.ICreateDataPointRequest} request CreateDataPointRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return SleepMetadata; + })(); - /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|updateDataPoint}. - * @memberof google.devicesandservices.health.v4.DataPointsService - * @typedef UpdateDataPointCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + Sleep.SleepSummary = (function() { - /** - * Calls UpdateDataPoint. - * @function updateDataPoint - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IUpdateDataPointRequest} request UpdateDataPointRequest message or plain object - * @param {google.devicesandservices.health.v4.DataPointsService.UpdateDataPointCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DataPointsService.prototype.updateDataPoint = function updateDataPoint(request, callback) { - return this.rpcCall(updateDataPoint, $root.google.devicesandservices.health.v4.UpdateDataPointRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateDataPoint" }); - - /** - * Calls UpdateDataPoint. - * @function updateDataPoint - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IUpdateDataPointRequest} request UpdateDataPointRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|batchDeleteDataPoints}. - * @memberof google.devicesandservices.health.v4.DataPointsService - * @typedef BatchDeleteDataPointsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchDeleteDataPoints. - * @function batchDeleteDataPoints - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest} request BatchDeleteDataPointsRequest message or plain object - * @param {google.devicesandservices.health.v4.DataPointsService.BatchDeleteDataPointsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DataPointsService.prototype.batchDeleteDataPoints = function batchDeleteDataPoints(request, callback) { - return this.rpcCall(batchDeleteDataPoints, $root.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchDeleteDataPoints" }); - - /** - * Calls BatchDeleteDataPoints. - * @function batchDeleteDataPoints - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest} request BatchDeleteDataPointsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|reconcileDataPoints}. - * @memberof google.devicesandservices.health.v4.DataPointsService - * @typedef ReconcileDataPointsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.devicesandservices.health.v4.ReconcileDataPointsResponse} [response] ReconcileDataPointsResponse - */ + /** + * Properties of a SleepSummary. + * @memberof google.devicesandservices.health.v4.Sleep + * @interface ISleepSummary + * @property {number|Long|null} [minutesInSleepPeriod] SleepSummary minutesInSleepPeriod + * @property {number|Long|null} [minutesAfterWakeUp] SleepSummary minutesAfterWakeUp + * @property {number|Long|null} [minutesToFallAsleep] SleepSummary minutesToFallAsleep + * @property {number|Long|null} [minutesAsleep] SleepSummary minutesAsleep + * @property {number|Long|null} [minutesAwake] SleepSummary minutesAwake + * @property {Array.|null} [stagesSummary] SleepSummary stagesSummary + */ - /** - * Calls ReconcileDataPoints. - * @function reconcileDataPoints - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IReconcileDataPointsRequest} request ReconcileDataPointsRequest message or plain object - * @param {google.devicesandservices.health.v4.DataPointsService.ReconcileDataPointsCallback} callback Node-style callback called with the error, if any, and ReconcileDataPointsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DataPointsService.prototype.reconcileDataPoints = function reconcileDataPoints(request, callback) { - return this.rpcCall(reconcileDataPoints, $root.google.devicesandservices.health.v4.ReconcileDataPointsRequest, $root.google.devicesandservices.health.v4.ReconcileDataPointsResponse, request, callback); - }, "name", { value: "ReconcileDataPoints" }); + /** + * Constructs a new SleepSummary. + * @memberof google.devicesandservices.health.v4.Sleep + * @classdesc Represents a SleepSummary. + * @implements ISleepSummary + * @constructor + * @param {google.devicesandservices.health.v4.Sleep.ISleepSummary=} [properties] Properties to set + */ + function SleepSummary(properties) { + this.stagesSummary = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Calls ReconcileDataPoints. - * @function reconcileDataPoints - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IReconcileDataPointsRequest} request ReconcileDataPointsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * SleepSummary minutesInSleepPeriod. + * @member {number|Long|null|undefined} minutesInSleepPeriod + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @instance + */ + SleepSummary.prototype.minutesInSleepPeriod = null; - /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|rollUpDataPoints}. - * @memberof google.devicesandservices.health.v4.DataPointsService - * @typedef RollUpDataPointsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.devicesandservices.health.v4.RollUpDataPointsResponse} [response] RollUpDataPointsResponse - */ + /** + * SleepSummary minutesAfterWakeUp. + * @member {number|Long|null|undefined} minutesAfterWakeUp + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @instance + */ + SleepSummary.prototype.minutesAfterWakeUp = null; - /** - * Calls RollUpDataPoints. - * @function rollUpDataPoints - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IRollUpDataPointsRequest} request RollUpDataPointsRequest message or plain object - * @param {google.devicesandservices.health.v4.DataPointsService.RollUpDataPointsCallback} callback Node-style callback called with the error, if any, and RollUpDataPointsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DataPointsService.prototype.rollUpDataPoints = function rollUpDataPoints(request, callback) { - return this.rpcCall(rollUpDataPoints, $root.google.devicesandservices.health.v4.RollUpDataPointsRequest, $root.google.devicesandservices.health.v4.RollUpDataPointsResponse, request, callback); - }, "name", { value: "RollUpDataPoints" }); + /** + * SleepSummary minutesToFallAsleep. + * @member {number|Long|null|undefined} minutesToFallAsleep + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @instance + */ + SleepSummary.prototype.minutesToFallAsleep = null; - /** - * Calls RollUpDataPoints. - * @function rollUpDataPoints - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IRollUpDataPointsRequest} request RollUpDataPointsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * SleepSummary minutesAsleep. + * @member {number|Long|null|undefined} minutesAsleep + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @instance + */ + SleepSummary.prototype.minutesAsleep = null; - /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|dailyRollUpDataPoints}. - * @memberof google.devicesandservices.health.v4.DataPointsService - * @typedef DailyRollUpDataPointsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.devicesandservices.health.v4.DailyRollUpDataPointsResponse} [response] DailyRollUpDataPointsResponse - */ + /** + * SleepSummary minutesAwake. + * @member {number|Long|null|undefined} minutesAwake + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @instance + */ + SleepSummary.prototype.minutesAwake = null; - /** - * Calls DailyRollUpDataPoints. - * @function dailyRollUpDataPoints - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest} request DailyRollUpDataPointsRequest message or plain object - * @param {google.devicesandservices.health.v4.DataPointsService.DailyRollUpDataPointsCallback} callback Node-style callback called with the error, if any, and DailyRollUpDataPointsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DataPointsService.prototype.dailyRollUpDataPoints = function dailyRollUpDataPoints(request, callback) { - return this.rpcCall(dailyRollUpDataPoints, $root.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest, $root.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse, request, callback); - }, "name", { value: "DailyRollUpDataPoints" }); + /** + * SleepSummary stagesSummary. + * @member {Array.} stagesSummary + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @instance + */ + SleepSummary.prototype.stagesSummary = $util.emptyArray; - /** - * Calls DailyRollUpDataPoints. - * @function dailyRollUpDataPoints - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest} request DailyRollUpDataPointsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|exportExerciseTcx}. - * @memberof google.devicesandservices.health.v4.DataPointsService - * @typedef ExportExerciseTcxCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.devicesandservices.health.v4.ExportExerciseTcxResponse} [response] ExportExerciseTcxResponse - */ + // Virtual OneOf for proto3 optional field + Object.defineProperty(SleepSummary.prototype, "_minutesInSleepPeriod", { + get: $util.oneOfGetter($oneOfFields = ["minutesInSleepPeriod"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Calls ExportExerciseTcx. - * @function exportExerciseTcx - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IExportExerciseTcxRequest} request ExportExerciseTcxRequest message or plain object - * @param {google.devicesandservices.health.v4.DataPointsService.ExportExerciseTcxCallback} callback Node-style callback called with the error, if any, and ExportExerciseTcxResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DataPointsService.prototype.exportExerciseTcx = function exportExerciseTcx(request, callback) { - return this.rpcCall(exportExerciseTcx, $root.google.devicesandservices.health.v4.ExportExerciseTcxRequest, $root.google.devicesandservices.health.v4.ExportExerciseTcxResponse, request, callback); - }, "name", { value: "ExportExerciseTcx" }); + // Virtual OneOf for proto3 optional field + Object.defineProperty(SleepSummary.prototype, "_minutesAfterWakeUp", { + get: $util.oneOfGetter($oneOfFields = ["minutesAfterWakeUp"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Calls ExportExerciseTcx. - * @function exportExerciseTcx - * @memberof google.devicesandservices.health.v4.DataPointsService - * @instance - * @param {google.devicesandservices.health.v4.IExportExerciseTcxRequest} request ExportExerciseTcxRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + // Virtual OneOf for proto3 optional field + Object.defineProperty(SleepSummary.prototype, "_minutesToFallAsleep", { + get: $util.oneOfGetter($oneOfFields = ["minutesToFallAsleep"]), + set: $util.oneOfSetter($oneOfFields) + }); - return DataPointsService; - })(); + // Virtual OneOf for proto3 optional field + Object.defineProperty(SleepSummary.prototype, "_minutesAsleep", { + get: $util.oneOfGetter($oneOfFields = ["minutesAsleep"]), + set: $util.oneOfSetter($oneOfFields) + }); - v4.DataPoint = (function() { + // Virtual OneOf for proto3 optional field + Object.defineProperty(SleepSummary.prototype, "_minutesAwake", { + get: $util.oneOfGetter($oneOfFields = ["minutesAwake"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Properties of a DataPoint. - * @memberof google.devicesandservices.health.v4 - * @interface IDataPoint - * @property {google.devicesandservices.health.v4.ISteps|null} [steps] DataPoint steps - * @property {google.devicesandservices.health.v4.IFloors|null} [floors] DataPoint floors - * @property {google.devicesandservices.health.v4.IHeartRate|null} [heartRate] DataPoint heartRate - * @property {google.devicesandservices.health.v4.ISleep|null} [sleep] DataPoint sleep - * @property {google.devicesandservices.health.v4.IDailyRestingHeartRate|null} [dailyRestingHeartRate] DataPoint dailyRestingHeartRate - * @property {google.devicesandservices.health.v4.IDailyHeartRateVariability|null} [dailyHeartRateVariability] DataPoint dailyHeartRateVariability - * @property {google.devicesandservices.health.v4.IExercise|null} [exercise] DataPoint exercise - * @property {google.devicesandservices.health.v4.IWeight|null} [weight] DataPoint weight - * @property {google.devicesandservices.health.v4.IAltitude|null} [altitude] DataPoint altitude - * @property {google.devicesandservices.health.v4.IDistance|null} [distance] DataPoint distance - * @property {google.devicesandservices.health.v4.IBodyFat|null} [bodyFat] DataPoint bodyFat - * @property {google.devicesandservices.health.v4.IActiveZoneMinutes|null} [activeZoneMinutes] DataPoint activeZoneMinutes - * @property {google.devicesandservices.health.v4.IHeartRateVariability|null} [heartRateVariability] DataPoint heartRateVariability - * @property {google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null} [dailySleepTemperatureDerivations] DataPoint dailySleepTemperatureDerivations - * @property {google.devicesandservices.health.v4.ISedentaryPeriod|null} [sedentaryPeriod] DataPoint sedentaryPeriod - * @property {google.devicesandservices.health.v4.IRunVO2Max|null} [runVo2Max] DataPoint runVo2Max - * @property {google.devicesandservices.health.v4.IOxygenSaturation|null} [oxygenSaturation] DataPoint oxygenSaturation - * @property {google.devicesandservices.health.v4.IDailyOxygenSaturation|null} [dailyOxygenSaturation] DataPoint dailyOxygenSaturation - * @property {google.devicesandservices.health.v4.IActivityLevel|null} [activityLevel] DataPoint activityLevel - * @property {google.devicesandservices.health.v4.IVO2Max|null} [vo2Max] DataPoint vo2Max - * @property {google.devicesandservices.health.v4.IDailyVO2Max|null} [dailyVo2Max] DataPoint dailyVo2Max - * @property {google.devicesandservices.health.v4.IDailyHeartRateZones|null} [dailyHeartRateZones] DataPoint dailyHeartRateZones - * @property {google.devicesandservices.health.v4.IHydrationLog|null} [hydrationLog] DataPoint hydrationLog - * @property {google.devicesandservices.health.v4.ITimeInHeartRateZone|null} [timeInHeartRateZone] DataPoint timeInHeartRateZone - * @property {google.devicesandservices.health.v4.IActiveMinutes|null} [activeMinutes] DataPoint activeMinutes - * @property {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null} [respiratoryRateSleepSummary] DataPoint respiratoryRateSleepSummary - * @property {google.devicesandservices.health.v4.IDailyRespiratoryRate|null} [dailyRespiratoryRate] DataPoint dailyRespiratoryRate - * @property {google.devicesandservices.health.v4.ISwimLengthsData|null} [swimLengthsData] DataPoint swimLengthsData - * @property {google.devicesandservices.health.v4.IHeight|null} [height] DataPoint height - * @property {google.devicesandservices.health.v4.IBasalEnergyBurned|null} [basalEnergyBurned] DataPoint basalEnergyBurned - * @property {string|null} [name] DataPoint name - * @property {google.devicesandservices.health.v4.IDataSource|null} [dataSource] DataPoint dataSource - */ + /** + * Creates a new SleepSummary instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @static + * @param {google.devicesandservices.health.v4.Sleep.ISleepSummary=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary} SleepSummary instance + */ + SleepSummary.create = function create(properties) { + return new SleepSummary(properties); + }; - /** - * Constructs a new DataPoint. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a DataPoint. - * @implements IDataPoint - * @constructor - * @param {google.devicesandservices.health.v4.IDataPoint=} [properties] Properties to set - */ - function DataPoint(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Encodes the specified SleepSummary message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @static + * @param {google.devicesandservices.health.v4.Sleep.ISleepSummary} message SleepSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SleepSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minutesInSleepPeriod != null && Object.hasOwnProperty.call(message, "minutesInSleepPeriod")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.minutesInSleepPeriod); + if (message.minutesAfterWakeUp != null && Object.hasOwnProperty.call(message, "minutesAfterWakeUp")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.minutesAfterWakeUp); + if (message.minutesToFallAsleep != null && Object.hasOwnProperty.call(message, "minutesToFallAsleep")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.minutesToFallAsleep); + if (message.minutesAsleep != null && Object.hasOwnProperty.call(message, "minutesAsleep")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.minutesAsleep); + if (message.minutesAwake != null && Object.hasOwnProperty.call(message, "minutesAwake")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.minutesAwake); + if (message.stagesSummary != null && message.stagesSummary.length) + for (var i = 0; i < message.stagesSummary.length; ++i) + $root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.encode(message.stagesSummary[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; - /** - * DataPoint steps. - * @member {google.devicesandservices.health.v4.ISteps|null|undefined} steps - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.steps = null; + /** + * Encodes the specified SleepSummary message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @static + * @param {google.devicesandservices.health.v4.Sleep.ISleepSummary} message SleepSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SleepSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * DataPoint floors. - * @member {google.devicesandservices.health.v4.IFloors|null|undefined} floors - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.floors = null; + /** + * Decodes a SleepSummary message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary} SleepSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SleepSummary.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Sleep.SleepSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.minutesInSleepPeriod = reader.int64(); + break; + } + case 2: { + message.minutesAfterWakeUp = reader.int64(); + break; + } + case 3: { + message.minutesToFallAsleep = reader.int64(); + break; + } + case 4: { + message.minutesAsleep = reader.int64(); + break; + } + case 5: { + message.minutesAwake = reader.int64(); + break; + } + case 6: { + if (!(message.stagesSummary && message.stagesSummary.length)) + message.stagesSummary = []; + message.stagesSummary.push($root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * DataPoint heartRate. - * @member {google.devicesandservices.health.v4.IHeartRate|null|undefined} heartRate - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.heartRate = null; + /** + * Decodes a SleepSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary} SleepSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SleepSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * DataPoint sleep. - * @member {google.devicesandservices.health.v4.ISleep|null|undefined} sleep - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.sleep = null; + /** + * Verifies a SleepSummary message. + * @function verify + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SleepSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.minutesInSleepPeriod != null && message.hasOwnProperty("minutesInSleepPeriod")) { + properties._minutesInSleepPeriod = 1; + if (!$util.isInteger(message.minutesInSleepPeriod) && !(message.minutesInSleepPeriod && $util.isInteger(message.minutesInSleepPeriod.low) && $util.isInteger(message.minutesInSleepPeriod.high))) + return "minutesInSleepPeriod: integer|Long expected"; + } + if (message.minutesAfterWakeUp != null && message.hasOwnProperty("minutesAfterWakeUp")) { + properties._minutesAfterWakeUp = 1; + if (!$util.isInteger(message.minutesAfterWakeUp) && !(message.minutesAfterWakeUp && $util.isInteger(message.minutesAfterWakeUp.low) && $util.isInteger(message.minutesAfterWakeUp.high))) + return "minutesAfterWakeUp: integer|Long expected"; + } + if (message.minutesToFallAsleep != null && message.hasOwnProperty("minutesToFallAsleep")) { + properties._minutesToFallAsleep = 1; + if (!$util.isInteger(message.minutesToFallAsleep) && !(message.minutesToFallAsleep && $util.isInteger(message.minutesToFallAsleep.low) && $util.isInteger(message.minutesToFallAsleep.high))) + return "minutesToFallAsleep: integer|Long expected"; + } + if (message.minutesAsleep != null && message.hasOwnProperty("minutesAsleep")) { + properties._minutesAsleep = 1; + if (!$util.isInteger(message.minutesAsleep) && !(message.minutesAsleep && $util.isInteger(message.minutesAsleep.low) && $util.isInteger(message.minutesAsleep.high))) + return "minutesAsleep: integer|Long expected"; + } + if (message.minutesAwake != null && message.hasOwnProperty("minutesAwake")) { + properties._minutesAwake = 1; + if (!$util.isInteger(message.minutesAwake) && !(message.minutesAwake && $util.isInteger(message.minutesAwake.low) && $util.isInteger(message.minutesAwake.high))) + return "minutesAwake: integer|Long expected"; + } + if (message.stagesSummary != null && message.hasOwnProperty("stagesSummary")) { + if (!Array.isArray(message.stagesSummary)) + return "stagesSummary: array expected"; + for (var i = 0; i < message.stagesSummary.length; ++i) { + var error = $root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.verify(message.stagesSummary[i]); + if (error) + return "stagesSummary." + error; + } + } + return null; + }; - /** - * DataPoint dailyRestingHeartRate. - * @member {google.devicesandservices.health.v4.IDailyRestingHeartRate|null|undefined} dailyRestingHeartRate - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.dailyRestingHeartRate = null; - - /** - * DataPoint dailyHeartRateVariability. - * @member {google.devicesandservices.health.v4.IDailyHeartRateVariability|null|undefined} dailyHeartRateVariability - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.dailyHeartRateVariability = null; - - /** - * DataPoint exercise. - * @member {google.devicesandservices.health.v4.IExercise|null|undefined} exercise - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.exercise = null; - - /** - * DataPoint weight. - * @member {google.devicesandservices.health.v4.IWeight|null|undefined} weight - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.weight = null; - - /** - * DataPoint altitude. - * @member {google.devicesandservices.health.v4.IAltitude|null|undefined} altitude - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.altitude = null; - - /** - * DataPoint distance. - * @member {google.devicesandservices.health.v4.IDistance|null|undefined} distance - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.distance = null; - - /** - * DataPoint bodyFat. - * @member {google.devicesandservices.health.v4.IBodyFat|null|undefined} bodyFat - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.bodyFat = null; - - /** - * DataPoint activeZoneMinutes. - * @member {google.devicesandservices.health.v4.IActiveZoneMinutes|null|undefined} activeZoneMinutes - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.activeZoneMinutes = null; + /** + * Creates a SleepSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary} SleepSummary + */ + SleepSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Sleep.SleepSummary) + return object; + var message = new $root.google.devicesandservices.health.v4.Sleep.SleepSummary(); + if (object.minutesInSleepPeriod != null) + if ($util.Long) + (message.minutesInSleepPeriod = $util.Long.fromValue(object.minutesInSleepPeriod)).unsigned = false; + else if (typeof object.minutesInSleepPeriod === "string") + message.minutesInSleepPeriod = parseInt(object.minutesInSleepPeriod, 10); + else if (typeof object.minutesInSleepPeriod === "number") + message.minutesInSleepPeriod = object.minutesInSleepPeriod; + else if (typeof object.minutesInSleepPeriod === "object") + message.minutesInSleepPeriod = new $util.LongBits(object.minutesInSleepPeriod.low >>> 0, object.minutesInSleepPeriod.high >>> 0).toNumber(); + if (object.minutesAfterWakeUp != null) + if ($util.Long) + (message.minutesAfterWakeUp = $util.Long.fromValue(object.minutesAfterWakeUp)).unsigned = false; + else if (typeof object.minutesAfterWakeUp === "string") + message.minutesAfterWakeUp = parseInt(object.minutesAfterWakeUp, 10); + else if (typeof object.minutesAfterWakeUp === "number") + message.minutesAfterWakeUp = object.minutesAfterWakeUp; + else if (typeof object.minutesAfterWakeUp === "object") + message.minutesAfterWakeUp = new $util.LongBits(object.minutesAfterWakeUp.low >>> 0, object.minutesAfterWakeUp.high >>> 0).toNumber(); + if (object.minutesToFallAsleep != null) + if ($util.Long) + (message.minutesToFallAsleep = $util.Long.fromValue(object.minutesToFallAsleep)).unsigned = false; + else if (typeof object.minutesToFallAsleep === "string") + message.minutesToFallAsleep = parseInt(object.minutesToFallAsleep, 10); + else if (typeof object.minutesToFallAsleep === "number") + message.minutesToFallAsleep = object.minutesToFallAsleep; + else if (typeof object.minutesToFallAsleep === "object") + message.minutesToFallAsleep = new $util.LongBits(object.minutesToFallAsleep.low >>> 0, object.minutesToFallAsleep.high >>> 0).toNumber(); + if (object.minutesAsleep != null) + if ($util.Long) + (message.minutesAsleep = $util.Long.fromValue(object.minutesAsleep)).unsigned = false; + else if (typeof object.minutesAsleep === "string") + message.minutesAsleep = parseInt(object.minutesAsleep, 10); + else if (typeof object.minutesAsleep === "number") + message.minutesAsleep = object.minutesAsleep; + else if (typeof object.minutesAsleep === "object") + message.minutesAsleep = new $util.LongBits(object.minutesAsleep.low >>> 0, object.minutesAsleep.high >>> 0).toNumber(); + if (object.minutesAwake != null) + if ($util.Long) + (message.minutesAwake = $util.Long.fromValue(object.minutesAwake)).unsigned = false; + else if (typeof object.minutesAwake === "string") + message.minutesAwake = parseInt(object.minutesAwake, 10); + else if (typeof object.minutesAwake === "number") + message.minutesAwake = object.minutesAwake; + else if (typeof object.minutesAwake === "object") + message.minutesAwake = new $util.LongBits(object.minutesAwake.low >>> 0, object.minutesAwake.high >>> 0).toNumber(); + if (object.stagesSummary) { + if (!Array.isArray(object.stagesSummary)) + throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepSummary.stagesSummary: array expected"); + message.stagesSummary = []; + for (var i = 0; i < object.stagesSummary.length; ++i) { + if (typeof object.stagesSummary[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.Sleep.SleepSummary.stagesSummary: object expected"); + message.stagesSummary[i] = $root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.fromObject(object.stagesSummary[i]); + } + } + return message; + }; - /** - * DataPoint heartRateVariability. - * @member {google.devicesandservices.health.v4.IHeartRateVariability|null|undefined} heartRateVariability - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.heartRateVariability = null; + /** + * Creates a plain object from a SleepSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @static + * @param {google.devicesandservices.health.v4.Sleep.SleepSummary} message SleepSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SleepSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stagesSummary = []; + if (message.minutesInSleepPeriod != null && message.hasOwnProperty("minutesInSleepPeriod")) { + if (typeof message.minutesInSleepPeriod === "number") + object.minutesInSleepPeriod = options.longs === String ? String(message.minutesInSleepPeriod) : message.minutesInSleepPeriod; + else + object.minutesInSleepPeriod = options.longs === String ? $util.Long.prototype.toString.call(message.minutesInSleepPeriod) : options.longs === Number ? new $util.LongBits(message.minutesInSleepPeriod.low >>> 0, message.minutesInSleepPeriod.high >>> 0).toNumber() : message.minutesInSleepPeriod; + if (options.oneofs) + object._minutesInSleepPeriod = "minutesInSleepPeriod"; + } + if (message.minutesAfterWakeUp != null && message.hasOwnProperty("minutesAfterWakeUp")) { + if (typeof message.minutesAfterWakeUp === "number") + object.minutesAfterWakeUp = options.longs === String ? String(message.minutesAfterWakeUp) : message.minutesAfterWakeUp; + else + object.minutesAfterWakeUp = options.longs === String ? $util.Long.prototype.toString.call(message.minutesAfterWakeUp) : options.longs === Number ? new $util.LongBits(message.minutesAfterWakeUp.low >>> 0, message.minutesAfterWakeUp.high >>> 0).toNumber() : message.minutesAfterWakeUp; + if (options.oneofs) + object._minutesAfterWakeUp = "minutesAfterWakeUp"; + } + if (message.minutesToFallAsleep != null && message.hasOwnProperty("minutesToFallAsleep")) { + if (typeof message.minutesToFallAsleep === "number") + object.minutesToFallAsleep = options.longs === String ? String(message.minutesToFallAsleep) : message.minutesToFallAsleep; + else + object.minutesToFallAsleep = options.longs === String ? $util.Long.prototype.toString.call(message.minutesToFallAsleep) : options.longs === Number ? new $util.LongBits(message.minutesToFallAsleep.low >>> 0, message.minutesToFallAsleep.high >>> 0).toNumber() : message.minutesToFallAsleep; + if (options.oneofs) + object._minutesToFallAsleep = "minutesToFallAsleep"; + } + if (message.minutesAsleep != null && message.hasOwnProperty("minutesAsleep")) { + if (typeof message.minutesAsleep === "number") + object.minutesAsleep = options.longs === String ? String(message.minutesAsleep) : message.minutesAsleep; + else + object.minutesAsleep = options.longs === String ? $util.Long.prototype.toString.call(message.minutesAsleep) : options.longs === Number ? new $util.LongBits(message.minutesAsleep.low >>> 0, message.minutesAsleep.high >>> 0).toNumber() : message.minutesAsleep; + if (options.oneofs) + object._minutesAsleep = "minutesAsleep"; + } + if (message.minutesAwake != null && message.hasOwnProperty("minutesAwake")) { + if (typeof message.minutesAwake === "number") + object.minutesAwake = options.longs === String ? String(message.minutesAwake) : message.minutesAwake; + else + object.minutesAwake = options.longs === String ? $util.Long.prototype.toString.call(message.minutesAwake) : options.longs === Number ? new $util.LongBits(message.minutesAwake.low >>> 0, message.minutesAwake.high >>> 0).toNumber() : message.minutesAwake; + if (options.oneofs) + object._minutesAwake = "minutesAwake"; + } + if (message.stagesSummary && message.stagesSummary.length) { + object.stagesSummary = []; + for (var j = 0; j < message.stagesSummary.length; ++j) + object.stagesSummary[j] = $root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.toObject(message.stagesSummary[j], options); + } + return object; + }; - /** - * DataPoint dailySleepTemperatureDerivations. - * @member {google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null|undefined} dailySleepTemperatureDerivations - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.dailySleepTemperatureDerivations = null; + /** + * Converts this SleepSummary to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @instance + * @returns {Object.} JSON object + */ + SleepSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * DataPoint sedentaryPeriod. - * @member {google.devicesandservices.health.v4.ISedentaryPeriod|null|undefined} sedentaryPeriod - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.sedentaryPeriod = null; + /** + * Gets the default type url for SleepSummary + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SleepSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.Sleep.SleepSummary"; + }; - /** - * DataPoint runVo2Max. - * @member {google.devicesandservices.health.v4.IRunVO2Max|null|undefined} runVo2Max - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.runVo2Max = null; + SleepSummary.StageSummary = (function() { - /** - * DataPoint oxygenSaturation. - * @member {google.devicesandservices.health.v4.IOxygenSaturation|null|undefined} oxygenSaturation - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.oxygenSaturation = null; + /** + * Properties of a StageSummary. + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @interface IStageSummary + * @property {google.devicesandservices.health.v4.Sleep.SleepStageType|null} [type] StageSummary type + * @property {number|Long|null} [minutes] StageSummary minutes + * @property {number|Long|null} [count] StageSummary count + */ - /** - * DataPoint dailyOxygenSaturation. - * @member {google.devicesandservices.health.v4.IDailyOxygenSaturation|null|undefined} dailyOxygenSaturation - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.dailyOxygenSaturation = null; + /** + * Constructs a new StageSummary. + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary + * @classdesc Represents a StageSummary. + * @implements IStageSummary + * @constructor + * @param {google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary=} [properties] Properties to set + */ + function StageSummary(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * DataPoint activityLevel. - * @member {google.devicesandservices.health.v4.IActivityLevel|null|undefined} activityLevel - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.activityLevel = null; + /** + * StageSummary type. + * @member {google.devicesandservices.health.v4.Sleep.SleepStageType} type + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary + * @instance + */ + StageSummary.prototype.type = 0; - /** - * DataPoint vo2Max. - * @member {google.devicesandservices.health.v4.IVO2Max|null|undefined} vo2Max - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.vo2Max = null; + /** + * StageSummary minutes. + * @member {number|Long|null|undefined} minutes + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary + * @instance + */ + StageSummary.prototype.minutes = null; - /** - * DataPoint dailyVo2Max. - * @member {google.devicesandservices.health.v4.IDailyVO2Max|null|undefined} dailyVo2Max - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.dailyVo2Max = null; + /** + * StageSummary count. + * @member {number|Long|null|undefined} count + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary + * @instance + */ + StageSummary.prototype.count = null; - /** - * DataPoint dailyHeartRateZones. - * @member {google.devicesandservices.health.v4.IDailyHeartRateZones|null|undefined} dailyHeartRateZones - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.dailyHeartRateZones = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * DataPoint hydrationLog. - * @member {google.devicesandservices.health.v4.IHydrationLog|null|undefined} hydrationLog - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.hydrationLog = null; + // Virtual OneOf for proto3 optional field + Object.defineProperty(StageSummary.prototype, "_minutes", { + get: $util.oneOfGetter($oneOfFields = ["minutes"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * DataPoint timeInHeartRateZone. - * @member {google.devicesandservices.health.v4.ITimeInHeartRateZone|null|undefined} timeInHeartRateZone - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.timeInHeartRateZone = null; + // Virtual OneOf for proto3 optional field + Object.defineProperty(StageSummary.prototype, "_count", { + get: $util.oneOfGetter($oneOfFields = ["count"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * DataPoint activeMinutes. - * @member {google.devicesandservices.health.v4.IActiveMinutes|null|undefined} activeMinutes - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.activeMinutes = null; + /** + * Creates a new StageSummary instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary + * @static + * @param {google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary} StageSummary instance + */ + StageSummary.create = function create(properties) { + return new StageSummary(properties); + }; - /** - * DataPoint respiratoryRateSleepSummary. - * @member {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null|undefined} respiratoryRateSleepSummary - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.respiratoryRateSleepSummary = null; + /** + * Encodes the specified StageSummary message. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary + * @static + * @param {google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary} message StageSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.minutes); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); + return writer; + }; - /** - * DataPoint dailyRespiratoryRate. - * @member {google.devicesandservices.health.v4.IDailyRespiratoryRate|null|undefined} dailyRespiratoryRate - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.dailyRespiratoryRate = null; + /** + * Encodes the specified StageSummary message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary + * @static + * @param {google.devicesandservices.health.v4.Sleep.SleepSummary.IStageSummary} message StageSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * DataPoint swimLengthsData. - * @member {google.devicesandservices.health.v4.ISwimLengthsData|null|undefined} swimLengthsData - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.swimLengthsData = null; + /** + * Decodes a StageSummary message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary} StageSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageSummary.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.minutes = reader.int64(); + break; + } + case 3: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * DataPoint height. - * @member {google.devicesandservices.health.v4.IHeight|null|undefined} height - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.height = null; + /** + * Decodes a StageSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary} StageSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * DataPoint basalEnergyBurned. - * @member {google.devicesandservices.health.v4.IBasalEnergyBurned|null|undefined} basalEnergyBurned - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - DataPoint.prototype.basalEnergyBurned = null; + /** + * Verifies a StageSummary message. + * @function verify + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StageSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.minutes != null && message.hasOwnProperty("minutes")) { + properties._minutes = 1; + if (!$util.isInteger(message.minutes) && !(message.minutes && $util.isInteger(message.minutes.low) && $util.isInteger(message.minutes.high))) + return "minutes: integer|Long expected"; + } + if (message.count != null && message.hasOwnProperty("count")) { + properties._count = 1; + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + } + return null; + }; - /** - * DataPoint name. - * @member {string} name - * @memberof google.devicesandservices.health.v4.DataPoint + /** + * Creates a StageSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary} StageSummary + */ + StageSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary) + return object; + var message = new $root.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "SLEEP_STAGE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "AWAKE": + case 1: + message.type = 1; + break; + case "LIGHT": + case 2: + message.type = 2; + break; + case "DEEP": + case 3: + message.type = 3; + break; + case "REM": + case 4: + message.type = 4; + break; + case "ASLEEP": + case 5: + message.type = 5; + break; + case "RESTLESS": + case 6: + message.type = 6; + break; + } + if (object.minutes != null) + if ($util.Long) + (message.minutes = $util.Long.fromValue(object.minutes)).unsigned = false; + else if (typeof object.minutes === "string") + message.minutes = parseInt(object.minutes, 10); + else if (typeof object.minutes === "number") + message.minutes = object.minutes; + else if (typeof object.minutes === "object") + message.minutes = new $util.LongBits(object.minutes.low >>> 0, object.minutes.high >>> 0).toNumber(); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a StageSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary + * @static + * @param {google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary} message StageSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StageSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.type = options.enums === String ? "SLEEP_STAGE_TYPE_UNSPECIFIED" : 0; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.devicesandservices.health.v4.Sleep.SleepStageType[message.type] === undefined ? message.type : $root.google.devicesandservices.health.v4.Sleep.SleepStageType[message.type] : message.type; + if (message.minutes != null && message.hasOwnProperty("minutes")) { + if (typeof message.minutes === "number") + object.minutes = options.longs === String ? String(message.minutes) : message.minutes; + else + object.minutes = options.longs === String ? $util.Long.prototype.toString.call(message.minutes) : options.longs === Number ? new $util.LongBits(message.minutes.low >>> 0, message.minutes.high >>> 0).toNumber() : message.minutes; + if (options.oneofs) + object._minutes = "minutes"; + } + if (message.count != null && message.hasOwnProperty("count")) { + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (options.oneofs) + object._count = "count"; + } + return object; + }; + + /** + * Converts this StageSummary to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary + * @instance + * @returns {Object.} JSON object + */ + StageSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StageSummary + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StageSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary"; + }; + + return StageSummary; + })(); + + return SleepSummary; + })(); + + /** + * SleepType enum. + * @name google.devicesandservices.health.v4.Sleep.SleepType + * @enum {number} + * @property {number} SLEEP_TYPE_UNSPECIFIED=0 SLEEP_TYPE_UNSPECIFIED value + * @property {number} CLASSIC=1 CLASSIC value + * @property {number} STAGES=2 STAGES value + */ + Sleep.SleepType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SLEEP_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLASSIC"] = 1; + values[valuesById[2] = "STAGES"] = 2; + return values; + })(); + + /** + * SleepStageType enum. + * @name google.devicesandservices.health.v4.Sleep.SleepStageType + * @enum {number} + * @property {number} SLEEP_STAGE_TYPE_UNSPECIFIED=0 SLEEP_STAGE_TYPE_UNSPECIFIED value + * @property {number} AWAKE=1 AWAKE value + * @property {number} LIGHT=2 LIGHT value + * @property {number} DEEP=3 DEEP value + * @property {number} REM=4 REM value + * @property {number} ASLEEP=5 ASLEEP value + * @property {number} RESTLESS=6 RESTLESS value + */ + Sleep.SleepStageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SLEEP_STAGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AWAKE"] = 1; + values[valuesById[2] = "LIGHT"] = 2; + values[valuesById[3] = "DEEP"] = 3; + values[valuesById[4] = "REM"] = 4; + values[valuesById[5] = "ASLEEP"] = 5; + values[valuesById[6] = "RESTLESS"] = 6; + return values; + })(); + + return Sleep; + })(); + + v4.Steps = (function() { + + /** + * Properties of a Steps. + * @memberof google.devicesandservices.health.v4 + * @interface ISteps + * @property {google.devicesandservices.health.v4.IObservationTimeInterval|null} [interval] Steps interval + * @property {number|Long|null} [count] Steps count + */ + + /** + * Constructs a new Steps. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a Steps. + * @implements ISteps + * @constructor + * @param {google.devicesandservices.health.v4.ISteps=} [properties] Properties to set + */ + function Steps(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Steps interval. + * @member {google.devicesandservices.health.v4.IObservationTimeInterval|null|undefined} interval + * @memberof google.devicesandservices.health.v4.Steps * @instance */ - DataPoint.prototype.name = ""; + Steps.prototype.interval = null; /** - * DataPoint dataSource. - * @member {google.devicesandservices.health.v4.IDataSource|null|undefined} dataSource - * @memberof google.devicesandservices.health.v4.DataPoint + * Steps count. + * @member {number|Long|null|undefined} count + * @memberof google.devicesandservices.health.v4.Steps * @instance */ - DataPoint.prototype.dataSource = null; + Steps.prototype.count = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; - /** - * DataPoint data. - * @member {"steps"|"floors"|"heartRate"|"sleep"|"dailyRestingHeartRate"|"dailyHeartRateVariability"|"exercise"|"weight"|"altitude"|"distance"|"bodyFat"|"activeZoneMinutes"|"heartRateVariability"|"dailySleepTemperatureDerivations"|"sedentaryPeriod"|"runVo2Max"|"oxygenSaturation"|"dailyOxygenSaturation"|"activityLevel"|"vo2Max"|"dailyVo2Max"|"dailyHeartRateZones"|"hydrationLog"|"timeInHeartRateZone"|"activeMinutes"|"respiratoryRateSleepSummary"|"dailyRespiratoryRate"|"swimLengthsData"|"height"|"basalEnergyBurned"|undefined} data - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - */ - Object.defineProperty(DataPoint.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = ["steps", "floors", "heartRate", "sleep", "dailyRestingHeartRate", "dailyHeartRateVariability", "exercise", "weight", "altitude", "distance", "bodyFat", "activeZoneMinutes", "heartRateVariability", "dailySleepTemperatureDerivations", "sedentaryPeriod", "runVo2Max", "oxygenSaturation", "dailyOxygenSaturation", "activityLevel", "vo2Max", "dailyVo2Max", "dailyHeartRateZones", "hydrationLog", "timeInHeartRateZone", "activeMinutes", "respiratoryRateSleepSummary", "dailyRespiratoryRate", "swimLengthsData", "height", "basalEnergyBurned"]), + // Virtual OneOf for proto3 optional field + Object.defineProperty(Steps.prototype, "_count", { + get: $util.oneOfGetter($oneOfFields = ["count"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new DataPoint instance using the specified properties. + * Creates a new Steps instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.DataPoint + * @memberof google.devicesandservices.health.v4.Steps * @static - * @param {google.devicesandservices.health.v4.IDataPoint=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.DataPoint} DataPoint instance + * @param {google.devicesandservices.health.v4.ISteps=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Steps} Steps instance */ - DataPoint.create = function create(properties) { - return new DataPoint(properties); + Steps.create = function create(properties) { + return new Steps(properties); }; /** - * Encodes the specified DataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.DataPoint.verify|verify} messages. + * Encodes the specified Steps message. Does not implicitly {@link google.devicesandservices.health.v4.Steps.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.DataPoint + * @memberof google.devicesandservices.health.v4.Steps * @static - * @param {google.devicesandservices.health.v4.IDataPoint} message DataPoint message or plain object to encode + * @param {google.devicesandservices.health.v4.ISteps} message Steps message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataPoint.encode = function encode(message, writer) { + Steps.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) - $root.google.devicesandservices.health.v4.DataSource.encode(message.dataSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.steps != null && Object.hasOwnProperty.call(message, "steps")) - $root.google.devicesandservices.health.v4.Steps.encode(message.steps, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.floors != null && Object.hasOwnProperty.call(message, "floors")) - $root.google.devicesandservices.health.v4.Floors.encode(message.floors, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.heartRate != null && Object.hasOwnProperty.call(message, "heartRate")) - $root.google.devicesandservices.health.v4.HeartRate.encode(message.heartRate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.sleep != null && Object.hasOwnProperty.call(message, "sleep")) - $root.google.devicesandservices.health.v4.Sleep.encode(message.sleep, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.dailyRestingHeartRate != null && Object.hasOwnProperty.call(message, "dailyRestingHeartRate")) - $root.google.devicesandservices.health.v4.DailyRestingHeartRate.encode(message.dailyRestingHeartRate, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.dailyHeartRateVariability != null && Object.hasOwnProperty.call(message, "dailyHeartRateVariability")) - $root.google.devicesandservices.health.v4.DailyHeartRateVariability.encode(message.dailyHeartRateVariability, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.exercise != null && Object.hasOwnProperty.call(message, "exercise")) - $root.google.devicesandservices.health.v4.Exercise.encode(message.exercise, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - $root.google.devicesandservices.health.v4.Weight.encode(message.weight, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.altitude != null && Object.hasOwnProperty.call(message, "altitude")) - $root.google.devicesandservices.health.v4.Altitude.encode(message.altitude, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) - $root.google.devicesandservices.health.v4.Distance.encode(message.distance, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.bodyFat != null && Object.hasOwnProperty.call(message, "bodyFat")) - $root.google.devicesandservices.health.v4.BodyFat.encode(message.bodyFat, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.activeZoneMinutes != null && Object.hasOwnProperty.call(message, "activeZoneMinutes")) - $root.google.devicesandservices.health.v4.ActiveZoneMinutes.encode(message.activeZoneMinutes, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.heartRateVariability != null && Object.hasOwnProperty.call(message, "heartRateVariability")) - $root.google.devicesandservices.health.v4.HeartRateVariability.encode(message.heartRateVariability, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.dailySleepTemperatureDerivations != null && Object.hasOwnProperty.call(message, "dailySleepTemperatureDerivations")) - $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.encode(message.dailySleepTemperatureDerivations, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.sedentaryPeriod != null && Object.hasOwnProperty.call(message, "sedentaryPeriod")) - $root.google.devicesandservices.health.v4.SedentaryPeriod.encode(message.sedentaryPeriod, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.runVo2Max != null && Object.hasOwnProperty.call(message, "runVo2Max")) - $root.google.devicesandservices.health.v4.RunVO2Max.encode(message.runVo2Max, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.oxygenSaturation != null && Object.hasOwnProperty.call(message, "oxygenSaturation")) - $root.google.devicesandservices.health.v4.OxygenSaturation.encode(message.oxygenSaturation, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.dailyOxygenSaturation != null && Object.hasOwnProperty.call(message, "dailyOxygenSaturation")) - $root.google.devicesandservices.health.v4.DailyOxygenSaturation.encode(message.dailyOxygenSaturation, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.activityLevel != null && Object.hasOwnProperty.call(message, "activityLevel")) - $root.google.devicesandservices.health.v4.ActivityLevel.encode(message.activityLevel, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.vo2Max != null && Object.hasOwnProperty.call(message, "vo2Max")) - $root.google.devicesandservices.health.v4.VO2Max.encode(message.vo2Max, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.dailyVo2Max != null && Object.hasOwnProperty.call(message, "dailyVo2Max")) - $root.google.devicesandservices.health.v4.DailyVO2Max.encode(message.dailyVo2Max, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.dailyHeartRateZones != null && Object.hasOwnProperty.call(message, "dailyHeartRateZones")) - $root.google.devicesandservices.health.v4.DailyHeartRateZones.encode(message.dailyHeartRateZones, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); - if (message.hydrationLog != null && Object.hasOwnProperty.call(message, "hydrationLog")) - $root.google.devicesandservices.health.v4.HydrationLog.encode(message.hydrationLog, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); - if (message.timeInHeartRateZone != null && Object.hasOwnProperty.call(message, "timeInHeartRateZone")) - $root.google.devicesandservices.health.v4.TimeInHeartRateZone.encode(message.timeInHeartRateZone, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.activeMinutes != null && Object.hasOwnProperty.call(message, "activeMinutes")) - $root.google.devicesandservices.health.v4.ActiveMinutes.encode(message.activeMinutes, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); - if (message.respiratoryRateSleepSummary != null && Object.hasOwnProperty.call(message, "respiratoryRateSleepSummary")) - $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.encode(message.respiratoryRateSleepSummary, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); - if (message.dailyRespiratoryRate != null && Object.hasOwnProperty.call(message, "dailyRespiratoryRate")) - $root.google.devicesandservices.health.v4.DailyRespiratoryRate.encode(message.dailyRespiratoryRate, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); - if (message.swimLengthsData != null && Object.hasOwnProperty.call(message, "swimLengthsData")) - $root.google.devicesandservices.health.v4.SwimLengthsData.encode(message.swimLengthsData, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.google.devicesandservices.health.v4.Height.encode(message.height, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); - if (message.basalEnergyBurned != null && Object.hasOwnProperty.call(message, "basalEnergyBurned")) - $root.google.devicesandservices.health.v4.BasalEnergyBurned.encode(message.basalEnergyBurned, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.devicesandservices.health.v4.ObservationTimeInterval.encode(message.interval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.count); return writer; }; /** - * Encodes the specified DataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataPoint.verify|verify} messages. + * Encodes the specified Steps message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Steps.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.DataPoint + * @memberof google.devicesandservices.health.v4.Steps * @static - * @param {google.devicesandservices.health.v4.IDataPoint} message DataPoint message or plain object to encode + * @param {google.devicesandservices.health.v4.ISteps} message Steps message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataPoint.encodeDelimited = function encodeDelimited(message, writer) { + Steps.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DataPoint message from the specified reader or buffer. + * Decodes a Steps message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.DataPoint + * @memberof google.devicesandservices.health.v4.Steps * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.DataPoint} DataPoint + * @returns {google.devicesandservices.health.v4.Steps} Steps * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DataPoint.decode = function decode(reader, length, error) { + Steps.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DataPoint(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Steps(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 4: { - message.steps = $root.google.devicesandservices.health.v4.Steps.decode(reader, reader.uint32()); - break; - } - case 5: { - message.floors = $root.google.devicesandservices.health.v4.Floors.decode(reader, reader.uint32()); - break; - } - case 6: { - message.heartRate = $root.google.devicesandservices.health.v4.HeartRate.decode(reader, reader.uint32()); - break; - } - case 8: { - message.sleep = $root.google.devicesandservices.health.v4.Sleep.decode(reader, reader.uint32()); - break; - } - case 9: { - message.dailyRestingHeartRate = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.decode(reader, reader.uint32()); - break; - } - case 10: { - message.dailyHeartRateVariability = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.decode(reader, reader.uint32()); - break; - } - case 11: { - message.exercise = $root.google.devicesandservices.health.v4.Exercise.decode(reader, reader.uint32()); - break; - } - case 12: { - message.weight = $root.google.devicesandservices.health.v4.Weight.decode(reader, reader.uint32()); - break; - } - case 13: { - message.altitude = $root.google.devicesandservices.health.v4.Altitude.decode(reader, reader.uint32()); - break; - } - case 14: { - message.distance = $root.google.devicesandservices.health.v4.Distance.decode(reader, reader.uint32()); - break; - } - case 15: { - message.bodyFat = $root.google.devicesandservices.health.v4.BodyFat.decode(reader, reader.uint32()); - break; - } - case 17: { - message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.decode(reader, reader.uint32()); - break; - } - case 19: { - message.heartRateVariability = $root.google.devicesandservices.health.v4.HeartRateVariability.decode(reader, reader.uint32()); - break; - } - case 20: { - message.dailySleepTemperatureDerivations = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.decode(reader, reader.uint32()); - break; - } - case 21: { - message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriod.decode(reader, reader.uint32()); - break; - } - case 22: { - message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2Max.decode(reader, reader.uint32()); - break; - } - case 24: { - message.oxygenSaturation = $root.google.devicesandservices.health.v4.OxygenSaturation.decode(reader, reader.uint32()); - break; - } - case 25: { - message.dailyOxygenSaturation = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.decode(reader, reader.uint32()); - break; - } - case 26: { - message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevel.decode(reader, reader.uint32()); - break; - } - case 27: { - message.vo2Max = $root.google.devicesandservices.health.v4.VO2Max.decode(reader, reader.uint32()); - break; - } - case 28: { - message.dailyVo2Max = $root.google.devicesandservices.health.v4.DailyVO2Max.decode(reader, reader.uint32()); - break; - } - case 32: { - message.dailyHeartRateZones = $root.google.devicesandservices.health.v4.DailyHeartRateZones.decode(reader, reader.uint32()); - break; - } - case 33: { - message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLog.decode(reader, reader.uint32()); - break; - } - case 35: { - message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.decode(reader, reader.uint32()); - break; - } - case 36: { - message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutes.decode(reader, reader.uint32()); - break; - } - case 37: { - message.respiratoryRateSleepSummary = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.decode(reader, reader.uint32()); - break; - } - case 38: { - message.dailyRespiratoryRate = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.decode(reader, reader.uint32()); - break; - } - case 39: { - message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsData.decode(reader, reader.uint32()); - break; - } - case 40: { - message.height = $root.google.devicesandservices.health.v4.Height.decode(reader, reader.uint32()); - break; - } - case 41: { - message.basalEnergyBurned = $root.google.devicesandservices.health.v4.BasalEnergyBurned.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); + case 2: { + message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.decode(reader, reader.uint32()); break; } - case 3: { - message.dataSource = $root.google.devicesandservices.health.v4.DataSource.decode(reader, reader.uint32()); + case 4: { + message.count = reader.int64(); break; } default: @@ -22845,765 +26160,150 @@ }; /** - * Decodes a DataPoint message from the specified reader or buffer, length delimited. + * Decodes a Steps message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.DataPoint + * @memberof google.devicesandservices.health.v4.Steps * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.DataPoint} DataPoint + * @returns {google.devicesandservices.health.v4.Steps} Steps * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DataPoint.decodeDelimited = function decodeDelimited(reader) { + Steps.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DataPoint message. + * Verifies a Steps message. * @function verify - * @memberof google.devicesandservices.health.v4.DataPoint + * @memberof google.devicesandservices.health.v4.Steps * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DataPoint.verify = function verify(message) { + Steps.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.steps != null && message.hasOwnProperty("steps")) { - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Steps.verify(message.steps); - if (error) - return "steps." + error; - } - } - if (message.floors != null && message.hasOwnProperty("floors")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Floors.verify(message.floors); - if (error) - return "floors." + error; - } - } - if (message.heartRate != null && message.hasOwnProperty("heartRate")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.HeartRate.verify(message.heartRate); - if (error) - return "heartRate." + error; - } + if (message.interval != null && message.hasOwnProperty("interval")) { + var error = $root.google.devicesandservices.health.v4.ObservationTimeInterval.verify(message.interval); + if (error) + return "interval." + error; } - if (message.sleep != null && message.hasOwnProperty("sleep")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Sleep.verify(message.sleep); - if (error) - return "sleep." + error; - } - } - if (message.dailyRestingHeartRate != null && message.hasOwnProperty("dailyRestingHeartRate")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.verify(message.dailyRestingHeartRate); - if (error) - return "dailyRestingHeartRate." + error; - } - } - if (message.dailyHeartRateVariability != null && message.hasOwnProperty("dailyHeartRateVariability")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.verify(message.dailyHeartRateVariability); - if (error) - return "dailyHeartRateVariability." + error; - } - } - if (message.exercise != null && message.hasOwnProperty("exercise")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Exercise.verify(message.exercise); - if (error) - return "exercise." + error; - } - } - if (message.weight != null && message.hasOwnProperty("weight")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Weight.verify(message.weight); - if (error) - return "weight." + error; - } - } - if (message.altitude != null && message.hasOwnProperty("altitude")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Altitude.verify(message.altitude); - if (error) - return "altitude." + error; - } - } - if (message.distance != null && message.hasOwnProperty("distance")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Distance.verify(message.distance); - if (error) - return "distance." + error; - } - } - if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.BodyFat.verify(message.bodyFat); - if (error) - return "bodyFat." + error; - } - } - if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.verify(message.activeZoneMinutes); - if (error) - return "activeZoneMinutes." + error; - } - } - if (message.heartRateVariability != null && message.hasOwnProperty("heartRateVariability")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.HeartRateVariability.verify(message.heartRateVariability); - if (error) - return "heartRateVariability." + error; - } - } - if (message.dailySleepTemperatureDerivations != null && message.hasOwnProperty("dailySleepTemperatureDerivations")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.verify(message.dailySleepTemperatureDerivations); - if (error) - return "dailySleepTemperatureDerivations." + error; - } - } - if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.SedentaryPeriod.verify(message.sedentaryPeriod); - if (error) - return "sedentaryPeriod." + error; - } - } - if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.RunVO2Max.verify(message.runVo2Max); - if (error) - return "runVo2Max." + error; - } - } - if (message.oxygenSaturation != null && message.hasOwnProperty("oxygenSaturation")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.OxygenSaturation.verify(message.oxygenSaturation); - if (error) - return "oxygenSaturation." + error; - } - } - if (message.dailyOxygenSaturation != null && message.hasOwnProperty("dailyOxygenSaturation")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.verify(message.dailyOxygenSaturation); - if (error) - return "dailyOxygenSaturation." + error; - } - } - if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.ActivityLevel.verify(message.activityLevel); - if (error) - return "activityLevel." + error; - } - } - if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.VO2Max.verify(message.vo2Max); - if (error) - return "vo2Max." + error; - } - } - if (message.dailyVo2Max != null && message.hasOwnProperty("dailyVo2Max")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.DailyVO2Max.verify(message.dailyVo2Max); - if (error) - return "dailyVo2Max." + error; - } - } - if (message.dailyHeartRateZones != null && message.hasOwnProperty("dailyHeartRateZones")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.DailyHeartRateZones.verify(message.dailyHeartRateZones); - if (error) - return "dailyHeartRateZones." + error; - } - } - if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.HydrationLog.verify(message.hydrationLog); - if (error) - return "hydrationLog." + error; - } - } - if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.verify(message.timeInHeartRateZone); - if (error) - return "timeInHeartRateZone." + error; - } - } - if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.ActiveMinutes.verify(message.activeMinutes); - if (error) - return "activeMinutes." + error; - } - } - if (message.respiratoryRateSleepSummary != null && message.hasOwnProperty("respiratoryRateSleepSummary")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.verify(message.respiratoryRateSleepSummary); - if (error) - return "respiratoryRateSleepSummary." + error; - } - } - if (message.dailyRespiratoryRate != null && message.hasOwnProperty("dailyRespiratoryRate")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.verify(message.dailyRespiratoryRate); - if (error) - return "dailyRespiratoryRate." + error; - } - } - if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.SwimLengthsData.verify(message.swimLengthsData); - if (error) - return "swimLengthsData." + error; - } - } - if (message.height != null && message.hasOwnProperty("height")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Height.verify(message.height); - if (error) - return "height." + error; - } - } - if (message.basalEnergyBurned != null && message.hasOwnProperty("basalEnergyBurned")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.BasalEnergyBurned.verify(message.basalEnergyBurned); - if (error) - return "basalEnergyBurned." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.dataSource != null && message.hasOwnProperty("dataSource")) { - var error = $root.google.devicesandservices.health.v4.DataSource.verify(message.dataSource); - if (error) - return "dataSource." + error; + if (message.count != null && message.hasOwnProperty("count")) { + properties._count = 1; + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; } return null; }; /** - * Creates a DataPoint message from a plain object. Also converts values to their respective internal types. + * Creates a Steps message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.DataPoint + * @memberof google.devicesandservices.health.v4.Steps * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.DataPoint} DataPoint + * @returns {google.devicesandservices.health.v4.Steps} Steps */ - DataPoint.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.DataPoint) + Steps.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Steps) return object; - var message = new $root.google.devicesandservices.health.v4.DataPoint(); - if (object.steps != null) { - if (typeof object.steps !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.steps: object expected"); - message.steps = $root.google.devicesandservices.health.v4.Steps.fromObject(object.steps); - } - if (object.floors != null) { - if (typeof object.floors !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.floors: object expected"); - message.floors = $root.google.devicesandservices.health.v4.Floors.fromObject(object.floors); - } - if (object.heartRate != null) { - if (typeof object.heartRate !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.heartRate: object expected"); - message.heartRate = $root.google.devicesandservices.health.v4.HeartRate.fromObject(object.heartRate); - } - if (object.sleep != null) { - if (typeof object.sleep !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.sleep: object expected"); - message.sleep = $root.google.devicesandservices.health.v4.Sleep.fromObject(object.sleep); - } - if (object.dailyRestingHeartRate != null) { - if (typeof object.dailyRestingHeartRate !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.dailyRestingHeartRate: object expected"); - message.dailyRestingHeartRate = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.fromObject(object.dailyRestingHeartRate); - } - if (object.dailyHeartRateVariability != null) { - if (typeof object.dailyHeartRateVariability !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.dailyHeartRateVariability: object expected"); - message.dailyHeartRateVariability = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.fromObject(object.dailyHeartRateVariability); - } - if (object.exercise != null) { - if (typeof object.exercise !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.exercise: object expected"); - message.exercise = $root.google.devicesandservices.health.v4.Exercise.fromObject(object.exercise); - } - if (object.weight != null) { - if (typeof object.weight !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.weight: object expected"); - message.weight = $root.google.devicesandservices.health.v4.Weight.fromObject(object.weight); - } - if (object.altitude != null) { - if (typeof object.altitude !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.altitude: object expected"); - message.altitude = $root.google.devicesandservices.health.v4.Altitude.fromObject(object.altitude); - } - if (object.distance != null) { - if (typeof object.distance !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.distance: object expected"); - message.distance = $root.google.devicesandservices.health.v4.Distance.fromObject(object.distance); - } - if (object.bodyFat != null) { - if (typeof object.bodyFat !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.bodyFat: object expected"); - message.bodyFat = $root.google.devicesandservices.health.v4.BodyFat.fromObject(object.bodyFat); - } - if (object.activeZoneMinutes != null) { - if (typeof object.activeZoneMinutes !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.activeZoneMinutes: object expected"); - message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.fromObject(object.activeZoneMinutes); - } - if (object.heartRateVariability != null) { - if (typeof object.heartRateVariability !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.heartRateVariability: object expected"); - message.heartRateVariability = $root.google.devicesandservices.health.v4.HeartRateVariability.fromObject(object.heartRateVariability); - } - if (object.dailySleepTemperatureDerivations != null) { - if (typeof object.dailySleepTemperatureDerivations !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.dailySleepTemperatureDerivations: object expected"); - message.dailySleepTemperatureDerivations = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.fromObject(object.dailySleepTemperatureDerivations); - } - if (object.sedentaryPeriod != null) { - if (typeof object.sedentaryPeriod !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.sedentaryPeriod: object expected"); - message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriod.fromObject(object.sedentaryPeriod); - } - if (object.runVo2Max != null) { - if (typeof object.runVo2Max !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.runVo2Max: object expected"); - message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2Max.fromObject(object.runVo2Max); - } - if (object.oxygenSaturation != null) { - if (typeof object.oxygenSaturation !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.oxygenSaturation: object expected"); - message.oxygenSaturation = $root.google.devicesandservices.health.v4.OxygenSaturation.fromObject(object.oxygenSaturation); - } - if (object.dailyOxygenSaturation != null) { - if (typeof object.dailyOxygenSaturation !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.dailyOxygenSaturation: object expected"); - message.dailyOxygenSaturation = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.fromObject(object.dailyOxygenSaturation); - } - if (object.activityLevel != null) { - if (typeof object.activityLevel !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.activityLevel: object expected"); - message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevel.fromObject(object.activityLevel); - } - if (object.vo2Max != null) { - if (typeof object.vo2Max !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.vo2Max: object expected"); - message.vo2Max = $root.google.devicesandservices.health.v4.VO2Max.fromObject(object.vo2Max); - } - if (object.dailyVo2Max != null) { - if (typeof object.dailyVo2Max !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.dailyVo2Max: object expected"); - message.dailyVo2Max = $root.google.devicesandservices.health.v4.DailyVO2Max.fromObject(object.dailyVo2Max); - } - if (object.dailyHeartRateZones != null) { - if (typeof object.dailyHeartRateZones !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.dailyHeartRateZones: object expected"); - message.dailyHeartRateZones = $root.google.devicesandservices.health.v4.DailyHeartRateZones.fromObject(object.dailyHeartRateZones); - } - if (object.hydrationLog != null) { - if (typeof object.hydrationLog !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.hydrationLog: object expected"); - message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLog.fromObject(object.hydrationLog); - } - if (object.timeInHeartRateZone != null) { - if (typeof object.timeInHeartRateZone !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.timeInHeartRateZone: object expected"); - message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.fromObject(object.timeInHeartRateZone); - } - if (object.activeMinutes != null) { - if (typeof object.activeMinutes !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.activeMinutes: object expected"); - message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutes.fromObject(object.activeMinutes); - } - if (object.respiratoryRateSleepSummary != null) { - if (typeof object.respiratoryRateSleepSummary !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.respiratoryRateSleepSummary: object expected"); - message.respiratoryRateSleepSummary = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.fromObject(object.respiratoryRateSleepSummary); - } - if (object.dailyRespiratoryRate != null) { - if (typeof object.dailyRespiratoryRate !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.dailyRespiratoryRate: object expected"); - message.dailyRespiratoryRate = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.fromObject(object.dailyRespiratoryRate); - } - if (object.swimLengthsData != null) { - if (typeof object.swimLengthsData !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.swimLengthsData: object expected"); - message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsData.fromObject(object.swimLengthsData); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.height: object expected"); - message.height = $root.google.devicesandservices.health.v4.Height.fromObject(object.height); - } - if (object.basalEnergyBurned != null) { - if (typeof object.basalEnergyBurned !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.basalEnergyBurned: object expected"); - message.basalEnergyBurned = $root.google.devicesandservices.health.v4.BasalEnergyBurned.fromObject(object.basalEnergyBurned); - } - if (object.name != null) - message.name = String(object.name); - if (object.dataSource != null) { - if (typeof object.dataSource !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataPoint.dataSource: object expected"); - message.dataSource = $root.google.devicesandservices.health.v4.DataSource.fromObject(object.dataSource); + var message = new $root.google.devicesandservices.health.v4.Steps(); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.devicesandservices.health.v4.Steps.interval: object expected"); + message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.fromObject(object.interval); } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a DataPoint message. Also converts values to other types if specified. + * Creates a plain object from a Steps message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.DataPoint + * @memberof google.devicesandservices.health.v4.Steps * @static - * @param {google.devicesandservices.health.v4.DataPoint} message DataPoint + * @param {google.devicesandservices.health.v4.Steps} message Steps * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DataPoint.toObject = function toObject(message, options) { + Steps.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.dataSource = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.dataSource != null && message.hasOwnProperty("dataSource")) - object.dataSource = $root.google.devicesandservices.health.v4.DataSource.toObject(message.dataSource, options); - if (message.steps != null && message.hasOwnProperty("steps")) { - object.steps = $root.google.devicesandservices.health.v4.Steps.toObject(message.steps, options); - if (options.oneofs) - object.data = "steps"; - } - if (message.floors != null && message.hasOwnProperty("floors")) { - object.floors = $root.google.devicesandservices.health.v4.Floors.toObject(message.floors, options); + if (options.defaults) + object.interval = null; + if (message.interval != null && message.hasOwnProperty("interval")) + object.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.toObject(message.interval, options); + if (message.count != null && message.hasOwnProperty("count")) { + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; if (options.oneofs) - object.data = "floors"; + object._count = "count"; } - if (message.heartRate != null && message.hasOwnProperty("heartRate")) { - object.heartRate = $root.google.devicesandservices.health.v4.HeartRate.toObject(message.heartRate, options); - if (options.oneofs) - object.data = "heartRate"; + return object; + }; + + /** + * Converts this Steps to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.Steps + * @instance + * @returns {Object.} JSON object + */ + Steps.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Steps + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.Steps + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Steps.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (message.sleep != null && message.hasOwnProperty("sleep")) { - object.sleep = $root.google.devicesandservices.health.v4.Sleep.toObject(message.sleep, options); - if (options.oneofs) - object.data = "sleep"; - } - if (message.dailyRestingHeartRate != null && message.hasOwnProperty("dailyRestingHeartRate")) { - object.dailyRestingHeartRate = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.toObject(message.dailyRestingHeartRate, options); - if (options.oneofs) - object.data = "dailyRestingHeartRate"; - } - if (message.dailyHeartRateVariability != null && message.hasOwnProperty("dailyHeartRateVariability")) { - object.dailyHeartRateVariability = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.toObject(message.dailyHeartRateVariability, options); - if (options.oneofs) - object.data = "dailyHeartRateVariability"; - } - if (message.exercise != null && message.hasOwnProperty("exercise")) { - object.exercise = $root.google.devicesandservices.health.v4.Exercise.toObject(message.exercise, options); - if (options.oneofs) - object.data = "exercise"; - } - if (message.weight != null && message.hasOwnProperty("weight")) { - object.weight = $root.google.devicesandservices.health.v4.Weight.toObject(message.weight, options); - if (options.oneofs) - object.data = "weight"; - } - if (message.altitude != null && message.hasOwnProperty("altitude")) { - object.altitude = $root.google.devicesandservices.health.v4.Altitude.toObject(message.altitude, options); - if (options.oneofs) - object.data = "altitude"; - } - if (message.distance != null && message.hasOwnProperty("distance")) { - object.distance = $root.google.devicesandservices.health.v4.Distance.toObject(message.distance, options); - if (options.oneofs) - object.data = "distance"; - } - if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { - object.bodyFat = $root.google.devicesandservices.health.v4.BodyFat.toObject(message.bodyFat, options); - if (options.oneofs) - object.data = "bodyFat"; - } - if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { - object.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.toObject(message.activeZoneMinutes, options); - if (options.oneofs) - object.data = "activeZoneMinutes"; - } - if (message.heartRateVariability != null && message.hasOwnProperty("heartRateVariability")) { - object.heartRateVariability = $root.google.devicesandservices.health.v4.HeartRateVariability.toObject(message.heartRateVariability, options); - if (options.oneofs) - object.data = "heartRateVariability"; - } - if (message.dailySleepTemperatureDerivations != null && message.hasOwnProperty("dailySleepTemperatureDerivations")) { - object.dailySleepTemperatureDerivations = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.toObject(message.dailySleepTemperatureDerivations, options); - if (options.oneofs) - object.data = "dailySleepTemperatureDerivations"; - } - if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { - object.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriod.toObject(message.sedentaryPeriod, options); - if (options.oneofs) - object.data = "sedentaryPeriod"; - } - if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { - object.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2Max.toObject(message.runVo2Max, options); - if (options.oneofs) - object.data = "runVo2Max"; - } - if (message.oxygenSaturation != null && message.hasOwnProperty("oxygenSaturation")) { - object.oxygenSaturation = $root.google.devicesandservices.health.v4.OxygenSaturation.toObject(message.oxygenSaturation, options); - if (options.oneofs) - object.data = "oxygenSaturation"; - } - if (message.dailyOxygenSaturation != null && message.hasOwnProperty("dailyOxygenSaturation")) { - object.dailyOxygenSaturation = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.toObject(message.dailyOxygenSaturation, options); - if (options.oneofs) - object.data = "dailyOxygenSaturation"; - } - if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { - object.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevel.toObject(message.activityLevel, options); - if (options.oneofs) - object.data = "activityLevel"; - } - if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) { - object.vo2Max = $root.google.devicesandservices.health.v4.VO2Max.toObject(message.vo2Max, options); - if (options.oneofs) - object.data = "vo2Max"; - } - if (message.dailyVo2Max != null && message.hasOwnProperty("dailyVo2Max")) { - object.dailyVo2Max = $root.google.devicesandservices.health.v4.DailyVO2Max.toObject(message.dailyVo2Max, options); - if (options.oneofs) - object.data = "dailyVo2Max"; - } - if (message.dailyHeartRateZones != null && message.hasOwnProperty("dailyHeartRateZones")) { - object.dailyHeartRateZones = $root.google.devicesandservices.health.v4.DailyHeartRateZones.toObject(message.dailyHeartRateZones, options); - if (options.oneofs) - object.data = "dailyHeartRateZones"; - } - if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { - object.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLog.toObject(message.hydrationLog, options); - if (options.oneofs) - object.data = "hydrationLog"; - } - if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { - object.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.toObject(message.timeInHeartRateZone, options); - if (options.oneofs) - object.data = "timeInHeartRateZone"; - } - if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { - object.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutes.toObject(message.activeMinutes, options); - if (options.oneofs) - object.data = "activeMinutes"; - } - if (message.respiratoryRateSleepSummary != null && message.hasOwnProperty("respiratoryRateSleepSummary")) { - object.respiratoryRateSleepSummary = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.toObject(message.respiratoryRateSleepSummary, options); - if (options.oneofs) - object.data = "respiratoryRateSleepSummary"; - } - if (message.dailyRespiratoryRate != null && message.hasOwnProperty("dailyRespiratoryRate")) { - object.dailyRespiratoryRate = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.toObject(message.dailyRespiratoryRate, options); - if (options.oneofs) - object.data = "dailyRespiratoryRate"; - } - if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { - object.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsData.toObject(message.swimLengthsData, options); - if (options.oneofs) - object.data = "swimLengthsData"; - } - if (message.height != null && message.hasOwnProperty("height")) { - object.height = $root.google.devicesandservices.health.v4.Height.toObject(message.height, options); - if (options.oneofs) - object.data = "height"; - } - if (message.basalEnergyBurned != null && message.hasOwnProperty("basalEnergyBurned")) { - object.basalEnergyBurned = $root.google.devicesandservices.health.v4.BasalEnergyBurned.toObject(message.basalEnergyBurned, options); - if (options.oneofs) - object.data = "basalEnergyBurned"; - } - return object; - }; - - /** - * Converts this DataPoint to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.DataPoint - * @instance - * @returns {Object.} JSON object - */ - DataPoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataPoint - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.DataPoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.DataPoint"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.Steps"; }; - return DataPoint; + return Steps; })(); - v4.ReconciledDataPoint = (function() { + v4.StepsRollupValue = (function() { /** - * Properties of a ReconciledDataPoint. + * Properties of a StepsRollupValue. * @memberof google.devicesandservices.health.v4 - * @interface IReconciledDataPoint - * @property {google.devicesandservices.health.v4.ISteps|null} [steps] ReconciledDataPoint steps - * @property {google.devicesandservices.health.v4.IFloors|null} [floors] ReconciledDataPoint floors - * @property {google.devicesandservices.health.v4.IHeartRate|null} [heartRate] ReconciledDataPoint heartRate - * @property {google.devicesandservices.health.v4.ISleep|null} [sleep] ReconciledDataPoint sleep - * @property {google.devicesandservices.health.v4.IDailyRestingHeartRate|null} [dailyRestingHeartRate] ReconciledDataPoint dailyRestingHeartRate - * @property {google.devicesandservices.health.v4.IDailyHeartRateVariability|null} [dailyHeartRateVariability] ReconciledDataPoint dailyHeartRateVariability - * @property {google.devicesandservices.health.v4.IExercise|null} [exercise] ReconciledDataPoint exercise - * @property {google.devicesandservices.health.v4.IWeight|null} [weight] ReconciledDataPoint weight - * @property {google.devicesandservices.health.v4.IAltitude|null} [altitude] ReconciledDataPoint altitude - * @property {google.devicesandservices.health.v4.IDistance|null} [distance] ReconciledDataPoint distance - * @property {google.devicesandservices.health.v4.IBodyFat|null} [bodyFat] ReconciledDataPoint bodyFat - * @property {google.devicesandservices.health.v4.IActiveZoneMinutes|null} [activeZoneMinutes] ReconciledDataPoint activeZoneMinutes - * @property {google.devicesandservices.health.v4.IHeartRateVariability|null} [heartRateVariability] ReconciledDataPoint heartRateVariability - * @property {google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null} [dailySleepTemperatureDerivations] ReconciledDataPoint dailySleepTemperatureDerivations - * @property {google.devicesandservices.health.v4.ISedentaryPeriod|null} [sedentaryPeriod] ReconciledDataPoint sedentaryPeriod - * @property {google.devicesandservices.health.v4.IRunVO2Max|null} [runVo2Max] ReconciledDataPoint runVo2Max - * @property {google.devicesandservices.health.v4.IOxygenSaturation|null} [oxygenSaturation] ReconciledDataPoint oxygenSaturation - * @property {google.devicesandservices.health.v4.IDailyOxygenSaturation|null} [dailyOxygenSaturation] ReconciledDataPoint dailyOxygenSaturation - * @property {google.devicesandservices.health.v4.IActivityLevel|null} [activityLevel] ReconciledDataPoint activityLevel - * @property {google.devicesandservices.health.v4.IVO2Max|null} [vo2Max] ReconciledDataPoint vo2Max - * @property {google.devicesandservices.health.v4.IDailyVO2Max|null} [dailyVo2Max] ReconciledDataPoint dailyVo2Max - * @property {google.devicesandservices.health.v4.IDailyHeartRateZones|null} [dailyHeartRateZones] ReconciledDataPoint dailyHeartRateZones - * @property {google.devicesandservices.health.v4.IHydrationLog|null} [hydrationLog] ReconciledDataPoint hydrationLog - * @property {google.devicesandservices.health.v4.ITimeInHeartRateZone|null} [timeInHeartRateZone] ReconciledDataPoint timeInHeartRateZone - * @property {google.devicesandservices.health.v4.IActiveMinutes|null} [activeMinutes] ReconciledDataPoint activeMinutes - * @property {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null} [respiratoryRateSleepSummary] ReconciledDataPoint respiratoryRateSleepSummary - * @property {google.devicesandservices.health.v4.IDailyRespiratoryRate|null} [dailyRespiratoryRate] ReconciledDataPoint dailyRespiratoryRate - * @property {google.devicesandservices.health.v4.ISwimLengthsData|null} [swimLengthsData] ReconciledDataPoint swimLengthsData - * @property {google.devicesandservices.health.v4.IHeight|null} [height] ReconciledDataPoint height - * @property {google.devicesandservices.health.v4.IBasalEnergyBurned|null} [basalEnergyBurned] ReconciledDataPoint basalEnergyBurned - * @property {string|null} [dataPointName] ReconciledDataPoint dataPointName + * @interface IStepsRollupValue + * @property {number|Long|null} [countSum] StepsRollupValue countSum */ /** - * Constructs a new ReconciledDataPoint. + * Constructs a new StepsRollupValue. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a ReconciledDataPoint. - * @implements IReconciledDataPoint + * @classdesc Represents a StepsRollupValue. + * @implements IStepsRollupValue * @constructor - * @param {google.devicesandservices.health.v4.IReconciledDataPoint=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IStepsRollupValue=} [properties] Properties to set */ - function ReconciledDataPoint(properties) { + function StepsRollupValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23611,511 +26311,344 @@ } /** - * ReconciledDataPoint steps. - * @member {google.devicesandservices.health.v4.ISteps|null|undefined} steps - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * StepsRollupValue countSum. + * @member {number|Long|null|undefined} countSum + * @memberof google.devicesandservices.health.v4.StepsRollupValue * @instance */ - ReconciledDataPoint.prototype.steps = null; + StepsRollupValue.prototype.countSum = null; - /** - * ReconciledDataPoint floors. - * @member {google.devicesandservices.health.v4.IFloors|null|undefined} floors - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.floors = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * ReconciledDataPoint heartRate. - * @member {google.devicesandservices.health.v4.IHeartRate|null|undefined} heartRate - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.heartRate = null; + // Virtual OneOf for proto3 optional field + Object.defineProperty(StepsRollupValue.prototype, "_countSum", { + get: $util.oneOfGetter($oneOfFields = ["countSum"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * ReconciledDataPoint sleep. - * @member {google.devicesandservices.health.v4.ISleep|null|undefined} sleep - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance + * Creates a new StepsRollupValue instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.StepsRollupValue + * @static + * @param {google.devicesandservices.health.v4.IStepsRollupValue=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.StepsRollupValue} StepsRollupValue instance */ - ReconciledDataPoint.prototype.sleep = null; + StepsRollupValue.create = function create(properties) { + return new StepsRollupValue(properties); + }; /** - * ReconciledDataPoint dailyRestingHeartRate. - * @member {google.devicesandservices.health.v4.IDailyRestingHeartRate|null|undefined} dailyRestingHeartRate - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance + * Encodes the specified StepsRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.StepsRollupValue.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.StepsRollupValue + * @static + * @param {google.devicesandservices.health.v4.IStepsRollupValue} message StepsRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ReconciledDataPoint.prototype.dailyRestingHeartRate = null; + StepsRollupValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.countSum != null && Object.hasOwnProperty.call(message, "countSum")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.countSum); + return writer; + }; /** - * ReconciledDataPoint dailyHeartRateVariability. - * @member {google.devicesandservices.health.v4.IDailyHeartRateVariability|null|undefined} dailyHeartRateVariability - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance + * Encodes the specified StepsRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.StepsRollupValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.StepsRollupValue + * @static + * @param {google.devicesandservices.health.v4.IStepsRollupValue} message StepsRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ReconciledDataPoint.prototype.dailyHeartRateVariability = null; + StepsRollupValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * ReconciledDataPoint exercise. - * @member {google.devicesandservices.health.v4.IExercise|null|undefined} exercise - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance + * Decodes a StepsRollupValue message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.StepsRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.StepsRollupValue} StepsRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReconciledDataPoint.prototype.exercise = null; + StepsRollupValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.StepsRollupValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.countSum = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * ReconciledDataPoint weight. - * @member {google.devicesandservices.health.v4.IWeight|null|undefined} weight - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance + * Decodes a StepsRollupValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.StepsRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.StepsRollupValue} StepsRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReconciledDataPoint.prototype.weight = null; + StepsRollupValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * ReconciledDataPoint altitude. - * @member {google.devicesandservices.health.v4.IAltitude|null|undefined} altitude - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance + * Verifies a StepsRollupValue message. + * @function verify + * @memberof google.devicesandservices.health.v4.StepsRollupValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReconciledDataPoint.prototype.altitude = null; + StepsRollupValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.countSum != null && message.hasOwnProperty("countSum")) { + properties._countSum = 1; + if (!$util.isInteger(message.countSum) && !(message.countSum && $util.isInteger(message.countSum.low) && $util.isInteger(message.countSum.high))) + return "countSum: integer|Long expected"; + } + return null; + }; /** - * ReconciledDataPoint distance. - * @member {google.devicesandservices.health.v4.IDistance|null|undefined} distance - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance + * Creates a StepsRollupValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.StepsRollupValue + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.StepsRollupValue} StepsRollupValue */ - ReconciledDataPoint.prototype.distance = null; + StepsRollupValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.StepsRollupValue) + return object; + var message = new $root.google.devicesandservices.health.v4.StepsRollupValue(); + if (object.countSum != null) + if ($util.Long) + (message.countSum = $util.Long.fromValue(object.countSum)).unsigned = false; + else if (typeof object.countSum === "string") + message.countSum = parseInt(object.countSum, 10); + else if (typeof object.countSum === "number") + message.countSum = object.countSum; + else if (typeof object.countSum === "object") + message.countSum = new $util.LongBits(object.countSum.low >>> 0, object.countSum.high >>> 0).toNumber(); + return message; + }; /** - * ReconciledDataPoint bodyFat. - * @member {google.devicesandservices.health.v4.IBodyFat|null|undefined} bodyFat - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance + * Creates a plain object from a StepsRollupValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.StepsRollupValue + * @static + * @param {google.devicesandservices.health.v4.StepsRollupValue} message StepsRollupValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - ReconciledDataPoint.prototype.bodyFat = null; + StepsRollupValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.countSum != null && message.hasOwnProperty("countSum")) { + if (typeof message.countSum === "number") + object.countSum = options.longs === String ? String(message.countSum) : message.countSum; + else + object.countSum = options.longs === String ? $util.Long.prototype.toString.call(message.countSum) : options.longs === Number ? new $util.LongBits(message.countSum.low >>> 0, message.countSum.high >>> 0).toNumber() : message.countSum; + if (options.oneofs) + object._countSum = "countSum"; + } + return object; + }; /** - * ReconciledDataPoint activeZoneMinutes. - * @member {google.devicesandservices.health.v4.IActiveZoneMinutes|null|undefined} activeZoneMinutes - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * Converts this StepsRollupValue to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.StepsRollupValue * @instance + * @returns {Object.} JSON object */ - ReconciledDataPoint.prototype.activeZoneMinutes = null; + StepsRollupValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * ReconciledDataPoint heartRateVariability. - * @member {google.devicesandservices.health.v4.IHeartRateVariability|null|undefined} heartRateVariability - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance + * Gets the default type url for StepsRollupValue + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.StepsRollupValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - ReconciledDataPoint.prototype.heartRateVariability = null; + StepsRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.StepsRollupValue"; + }; - /** - * ReconciledDataPoint dailySleepTemperatureDerivations. - * @member {google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null|undefined} dailySleepTemperatureDerivations - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.dailySleepTemperatureDerivations = null; + return StepsRollupValue; + })(); - /** - * ReconciledDataPoint sedentaryPeriod. - * @member {google.devicesandservices.health.v4.ISedentaryPeriod|null|undefined} sedentaryPeriod - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.sedentaryPeriod = null; + v4.SwimLengthsData = (function() { /** - * ReconciledDataPoint runVo2Max. - * @member {google.devicesandservices.health.v4.IRunVO2Max|null|undefined} runVo2Max - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance + * Properties of a SwimLengthsData. + * @memberof google.devicesandservices.health.v4 + * @interface ISwimLengthsData + * @property {google.devicesandservices.health.v4.IObservationTimeInterval|null} [interval] SwimLengthsData interval + * @property {google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType|null} [swimStrokeType] SwimLengthsData swimStrokeType + * @property {number|Long|null} [strokeCount] SwimLengthsData strokeCount */ - ReconciledDataPoint.prototype.runVo2Max = null; /** - * ReconciledDataPoint oxygenSaturation. - * @member {google.devicesandservices.health.v4.IOxygenSaturation|null|undefined} oxygenSaturation - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance + * Constructs a new SwimLengthsData. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a SwimLengthsData. + * @implements ISwimLengthsData + * @constructor + * @param {google.devicesandservices.health.v4.ISwimLengthsData=} [properties] Properties to set */ - ReconciledDataPoint.prototype.oxygenSaturation = null; + function SwimLengthsData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * ReconciledDataPoint dailyOxygenSaturation. - * @member {google.devicesandservices.health.v4.IDailyOxygenSaturation|null|undefined} dailyOxygenSaturation - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * SwimLengthsData interval. + * @member {google.devicesandservices.health.v4.IObservationTimeInterval|null|undefined} interval + * @memberof google.devicesandservices.health.v4.SwimLengthsData * @instance */ - ReconciledDataPoint.prototype.dailyOxygenSaturation = null; + SwimLengthsData.prototype.interval = null; /** - * ReconciledDataPoint activityLevel. - * @member {google.devicesandservices.health.v4.IActivityLevel|null|undefined} activityLevel - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * SwimLengthsData swimStrokeType. + * @member {google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType} swimStrokeType + * @memberof google.devicesandservices.health.v4.SwimLengthsData * @instance */ - ReconciledDataPoint.prototype.activityLevel = null; + SwimLengthsData.prototype.swimStrokeType = 0; /** - * ReconciledDataPoint vo2Max. - * @member {google.devicesandservices.health.v4.IVO2Max|null|undefined} vo2Max - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * SwimLengthsData strokeCount. + * @member {number|Long|null|undefined} strokeCount + * @memberof google.devicesandservices.health.v4.SwimLengthsData * @instance */ - ReconciledDataPoint.prototype.vo2Max = null; + SwimLengthsData.prototype.strokeCount = null; - /** - * ReconciledDataPoint dailyVo2Max. - * @member {google.devicesandservices.health.v4.IDailyVO2Max|null|undefined} dailyVo2Max - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.dailyVo2Max = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SwimLengthsData.prototype, "_strokeCount", { + get: $util.oneOfGetter($oneOfFields = ["strokeCount"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * ReconciledDataPoint dailyHeartRateZones. - * @member {google.devicesandservices.health.v4.IDailyHeartRateZones|null|undefined} dailyHeartRateZones - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.dailyHeartRateZones = null; - - /** - * ReconciledDataPoint hydrationLog. - * @member {google.devicesandservices.health.v4.IHydrationLog|null|undefined} hydrationLog - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.hydrationLog = null; - - /** - * ReconciledDataPoint timeInHeartRateZone. - * @member {google.devicesandservices.health.v4.ITimeInHeartRateZone|null|undefined} timeInHeartRateZone - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.timeInHeartRateZone = null; - - /** - * ReconciledDataPoint activeMinutes. - * @member {google.devicesandservices.health.v4.IActiveMinutes|null|undefined} activeMinutes - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.activeMinutes = null; - - /** - * ReconciledDataPoint respiratoryRateSleepSummary. - * @member {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null|undefined} respiratoryRateSleepSummary - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.respiratoryRateSleepSummary = null; - - /** - * ReconciledDataPoint dailyRespiratoryRate. - * @member {google.devicesandservices.health.v4.IDailyRespiratoryRate|null|undefined} dailyRespiratoryRate - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.dailyRespiratoryRate = null; - - /** - * ReconciledDataPoint swimLengthsData. - * @member {google.devicesandservices.health.v4.ISwimLengthsData|null|undefined} swimLengthsData - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.swimLengthsData = null; - - /** - * ReconciledDataPoint height. - * @member {google.devicesandservices.health.v4.IHeight|null|undefined} height - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.height = null; - - /** - * ReconciledDataPoint basalEnergyBurned. - * @member {google.devicesandservices.health.v4.IBasalEnergyBurned|null|undefined} basalEnergyBurned - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.basalEnergyBurned = null; - - /** - * ReconciledDataPoint dataPointName. - * @member {string} dataPointName - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - ReconciledDataPoint.prototype.dataPointName = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ReconciledDataPoint data. - * @member {"steps"|"floors"|"heartRate"|"sleep"|"dailyRestingHeartRate"|"dailyHeartRateVariability"|"exercise"|"weight"|"altitude"|"distance"|"bodyFat"|"activeZoneMinutes"|"heartRateVariability"|"dailySleepTemperatureDerivations"|"sedentaryPeriod"|"runVo2Max"|"oxygenSaturation"|"dailyOxygenSaturation"|"activityLevel"|"vo2Max"|"dailyVo2Max"|"dailyHeartRateZones"|"hydrationLog"|"timeInHeartRateZone"|"activeMinutes"|"respiratoryRateSleepSummary"|"dailyRespiratoryRate"|"swimLengthsData"|"height"|"basalEnergyBurned"|undefined} data - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - */ - Object.defineProperty(ReconciledDataPoint.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = ["steps", "floors", "heartRate", "sleep", "dailyRestingHeartRate", "dailyHeartRateVariability", "exercise", "weight", "altitude", "distance", "bodyFat", "activeZoneMinutes", "heartRateVariability", "dailySleepTemperatureDerivations", "sedentaryPeriod", "runVo2Max", "oxygenSaturation", "dailyOxygenSaturation", "activityLevel", "vo2Max", "dailyVo2Max", "dailyHeartRateZones", "hydrationLog", "timeInHeartRateZone", "activeMinutes", "respiratoryRateSleepSummary", "dailyRespiratoryRate", "swimLengthsData", "height", "basalEnergyBurned"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ReconciledDataPoint instance using the specified properties. + * Creates a new SwimLengthsData instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @memberof google.devicesandservices.health.v4.SwimLengthsData * @static - * @param {google.devicesandservices.health.v4.IReconciledDataPoint=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.ReconciledDataPoint} ReconciledDataPoint instance + * @param {google.devicesandservices.health.v4.ISwimLengthsData=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.SwimLengthsData} SwimLengthsData instance */ - ReconciledDataPoint.create = function create(properties) { - return new ReconciledDataPoint(properties); + SwimLengthsData.create = function create(properties) { + return new SwimLengthsData(properties); }; /** - * Encodes the specified ReconciledDataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.ReconciledDataPoint.verify|verify} messages. + * Encodes the specified SwimLengthsData message. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsData.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @memberof google.devicesandservices.health.v4.SwimLengthsData * @static - * @param {google.devicesandservices.health.v4.IReconciledDataPoint} message ReconciledDataPoint message or plain object to encode + * @param {google.devicesandservices.health.v4.ISwimLengthsData} message SwimLengthsData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReconciledDataPoint.encode = function encode(message, writer) { + SwimLengthsData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataPointName != null && Object.hasOwnProperty.call(message, "dataPointName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataPointName); - if (message.steps != null && Object.hasOwnProperty.call(message, "steps")) - $root.google.devicesandservices.health.v4.Steps.encode(message.steps, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.floors != null && Object.hasOwnProperty.call(message, "floors")) - $root.google.devicesandservices.health.v4.Floors.encode(message.floors, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.heartRate != null && Object.hasOwnProperty.call(message, "heartRate")) - $root.google.devicesandservices.health.v4.HeartRate.encode(message.heartRate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.sleep != null && Object.hasOwnProperty.call(message, "sleep")) - $root.google.devicesandservices.health.v4.Sleep.encode(message.sleep, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.dailyRestingHeartRate != null && Object.hasOwnProperty.call(message, "dailyRestingHeartRate")) - $root.google.devicesandservices.health.v4.DailyRestingHeartRate.encode(message.dailyRestingHeartRate, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.dailyHeartRateVariability != null && Object.hasOwnProperty.call(message, "dailyHeartRateVariability")) - $root.google.devicesandservices.health.v4.DailyHeartRateVariability.encode(message.dailyHeartRateVariability, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.exercise != null && Object.hasOwnProperty.call(message, "exercise")) - $root.google.devicesandservices.health.v4.Exercise.encode(message.exercise, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - $root.google.devicesandservices.health.v4.Weight.encode(message.weight, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.altitude != null && Object.hasOwnProperty.call(message, "altitude")) - $root.google.devicesandservices.health.v4.Altitude.encode(message.altitude, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) - $root.google.devicesandservices.health.v4.Distance.encode(message.distance, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.bodyFat != null && Object.hasOwnProperty.call(message, "bodyFat")) - $root.google.devicesandservices.health.v4.BodyFat.encode(message.bodyFat, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.activeZoneMinutes != null && Object.hasOwnProperty.call(message, "activeZoneMinutes")) - $root.google.devicesandservices.health.v4.ActiveZoneMinutes.encode(message.activeZoneMinutes, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.heartRateVariability != null && Object.hasOwnProperty.call(message, "heartRateVariability")) - $root.google.devicesandservices.health.v4.HeartRateVariability.encode(message.heartRateVariability, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.dailySleepTemperatureDerivations != null && Object.hasOwnProperty.call(message, "dailySleepTemperatureDerivations")) - $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.encode(message.dailySleepTemperatureDerivations, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.sedentaryPeriod != null && Object.hasOwnProperty.call(message, "sedentaryPeriod")) - $root.google.devicesandservices.health.v4.SedentaryPeriod.encode(message.sedentaryPeriod, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.runVo2Max != null && Object.hasOwnProperty.call(message, "runVo2Max")) - $root.google.devicesandservices.health.v4.RunVO2Max.encode(message.runVo2Max, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.oxygenSaturation != null && Object.hasOwnProperty.call(message, "oxygenSaturation")) - $root.google.devicesandservices.health.v4.OxygenSaturation.encode(message.oxygenSaturation, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.dailyOxygenSaturation != null && Object.hasOwnProperty.call(message, "dailyOxygenSaturation")) - $root.google.devicesandservices.health.v4.DailyOxygenSaturation.encode(message.dailyOxygenSaturation, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.activityLevel != null && Object.hasOwnProperty.call(message, "activityLevel")) - $root.google.devicesandservices.health.v4.ActivityLevel.encode(message.activityLevel, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.vo2Max != null && Object.hasOwnProperty.call(message, "vo2Max")) - $root.google.devicesandservices.health.v4.VO2Max.encode(message.vo2Max, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.dailyVo2Max != null && Object.hasOwnProperty.call(message, "dailyVo2Max")) - $root.google.devicesandservices.health.v4.DailyVO2Max.encode(message.dailyVo2Max, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.dailyHeartRateZones != null && Object.hasOwnProperty.call(message, "dailyHeartRateZones")) - $root.google.devicesandservices.health.v4.DailyHeartRateZones.encode(message.dailyHeartRateZones, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); - if (message.hydrationLog != null && Object.hasOwnProperty.call(message, "hydrationLog")) - $root.google.devicesandservices.health.v4.HydrationLog.encode(message.hydrationLog, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); - if (message.timeInHeartRateZone != null && Object.hasOwnProperty.call(message, "timeInHeartRateZone")) - $root.google.devicesandservices.health.v4.TimeInHeartRateZone.encode(message.timeInHeartRateZone, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.activeMinutes != null && Object.hasOwnProperty.call(message, "activeMinutes")) - $root.google.devicesandservices.health.v4.ActiveMinutes.encode(message.activeMinutes, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); - if (message.respiratoryRateSleepSummary != null && Object.hasOwnProperty.call(message, "respiratoryRateSleepSummary")) - $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.encode(message.respiratoryRateSleepSummary, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); - if (message.dailyRespiratoryRate != null && Object.hasOwnProperty.call(message, "dailyRespiratoryRate")) - $root.google.devicesandservices.health.v4.DailyRespiratoryRate.encode(message.dailyRespiratoryRate, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); - if (message.swimLengthsData != null && Object.hasOwnProperty.call(message, "swimLengthsData")) - $root.google.devicesandservices.health.v4.SwimLengthsData.encode(message.swimLengthsData, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.google.devicesandservices.health.v4.Height.encode(message.height, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); - if (message.basalEnergyBurned != null && Object.hasOwnProperty.call(message, "basalEnergyBurned")) - $root.google.devicesandservices.health.v4.BasalEnergyBurned.encode(message.basalEnergyBurned, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.devicesandservices.health.v4.ObservationTimeInterval.encode(message.interval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.swimStrokeType != null && Object.hasOwnProperty.call(message, "swimStrokeType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.swimStrokeType); + if (message.strokeCount != null && Object.hasOwnProperty.call(message, "strokeCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.strokeCount); return writer; }; /** - * Encodes the specified ReconciledDataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ReconciledDataPoint.verify|verify} messages. + * Encodes the specified SwimLengthsData message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsData.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @memberof google.devicesandservices.health.v4.SwimLengthsData * @static - * @param {google.devicesandservices.health.v4.IReconciledDataPoint} message ReconciledDataPoint message or plain object to encode + * @param {google.devicesandservices.health.v4.ISwimLengthsData} message SwimLengthsData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReconciledDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + SwimLengthsData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReconciledDataPoint message from the specified reader or buffer. + * Decodes a SwimLengthsData message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @memberof google.devicesandservices.health.v4.SwimLengthsData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.ReconciledDataPoint} ReconciledDataPoint + * @returns {google.devicesandservices.health.v4.SwimLengthsData} SwimLengthsData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReconciledDataPoint.decode = function decode(reader, length, error) { + SwimLengthsData.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ReconciledDataPoint(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.SwimLengthsData(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 4: { - message.steps = $root.google.devicesandservices.health.v4.Steps.decode(reader, reader.uint32()); - break; - } - case 5: { - message.floors = $root.google.devicesandservices.health.v4.Floors.decode(reader, reader.uint32()); - break; - } - case 6: { - message.heartRate = $root.google.devicesandservices.health.v4.HeartRate.decode(reader, reader.uint32()); - break; - } - case 8: { - message.sleep = $root.google.devicesandservices.health.v4.Sleep.decode(reader, reader.uint32()); - break; - } - case 9: { - message.dailyRestingHeartRate = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.decode(reader, reader.uint32()); - break; - } - case 10: { - message.dailyHeartRateVariability = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.decode(reader, reader.uint32()); - break; - } - case 11: { - message.exercise = $root.google.devicesandservices.health.v4.Exercise.decode(reader, reader.uint32()); - break; - } - case 12: { - message.weight = $root.google.devicesandservices.health.v4.Weight.decode(reader, reader.uint32()); - break; - } - case 13: { - message.altitude = $root.google.devicesandservices.health.v4.Altitude.decode(reader, reader.uint32()); - break; - } - case 14: { - message.distance = $root.google.devicesandservices.health.v4.Distance.decode(reader, reader.uint32()); - break; - } - case 15: { - message.bodyFat = $root.google.devicesandservices.health.v4.BodyFat.decode(reader, reader.uint32()); - break; - } - case 17: { - message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.decode(reader, reader.uint32()); - break; - } - case 19: { - message.heartRateVariability = $root.google.devicesandservices.health.v4.HeartRateVariability.decode(reader, reader.uint32()); - break; - } - case 20: { - message.dailySleepTemperatureDerivations = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.decode(reader, reader.uint32()); - break; - } - case 21: { - message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriod.decode(reader, reader.uint32()); - break; - } - case 22: { - message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2Max.decode(reader, reader.uint32()); - break; - } - case 24: { - message.oxygenSaturation = $root.google.devicesandservices.health.v4.OxygenSaturation.decode(reader, reader.uint32()); - break; - } - case 25: { - message.dailyOxygenSaturation = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.decode(reader, reader.uint32()); - break; - } - case 26: { - message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevel.decode(reader, reader.uint32()); - break; - } - case 27: { - message.vo2Max = $root.google.devicesandservices.health.v4.VO2Max.decode(reader, reader.uint32()); - break; - } - case 28: { - message.dailyVo2Max = $root.google.devicesandservices.health.v4.DailyVO2Max.decode(reader, reader.uint32()); - break; - } - case 32: { - message.dailyHeartRateZones = $root.google.devicesandservices.health.v4.DailyHeartRateZones.decode(reader, reader.uint32()); - break; - } - case 33: { - message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLog.decode(reader, reader.uint32()); - break; - } - case 35: { - message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.decode(reader, reader.uint32()); - break; - } - case 36: { - message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutes.decode(reader, reader.uint32()); - break; - } - case 37: { - message.respiratoryRateSleepSummary = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.decode(reader, reader.uint32()); - break; - } - case 38: { - message.dailyRespiratoryRate = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.decode(reader, reader.uint32()); - break; - } - case 39: { - message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsData.decode(reader, reader.uint32()); - break; - } - case 40: { - message.height = $root.google.devicesandservices.health.v4.Height.decode(reader, reader.uint32()); + case 1: { + message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.decode(reader, reader.uint32()); break; } - case 41: { - message.basalEnergyBurned = $root.google.devicesandservices.health.v4.BasalEnergyBurned.decode(reader, reader.uint32()); + case 2: { + message.swimStrokeType = reader.int32(); break; } - case 1: { - message.dataPointName = reader.string(); + case 3: { + message.strokeCount = reader.int64(); break; } default: @@ -24127,1588 +26660,15795 @@ }; /** - * Decodes a ReconciledDataPoint message from the specified reader or buffer, length delimited. + * Decodes a SwimLengthsData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @memberof google.devicesandservices.health.v4.SwimLengthsData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.ReconciledDataPoint} ReconciledDataPoint + * @returns {google.devicesandservices.health.v4.SwimLengthsData} SwimLengthsData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReconciledDataPoint.decodeDelimited = function decodeDelimited(reader) { + SwimLengthsData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReconciledDataPoint message. + * Verifies a SwimLengthsData message. * @function verify - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @memberof google.devicesandservices.health.v4.SwimLengthsData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReconciledDataPoint.verify = function verify(message) { + SwimLengthsData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.steps != null && message.hasOwnProperty("steps")) { - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Steps.verify(message.steps); - if (error) - return "steps." + error; - } - } - if (message.floors != null && message.hasOwnProperty("floors")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Floors.verify(message.floors); - if (error) - return "floors." + error; - } - } - if (message.heartRate != null && message.hasOwnProperty("heartRate")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.HeartRate.verify(message.heartRate); - if (error) - return "heartRate." + error; - } + if (message.interval != null && message.hasOwnProperty("interval")) { + var error = $root.google.devicesandservices.health.v4.ObservationTimeInterval.verify(message.interval); + if (error) + return "interval." + error; } - if (message.sleep != null && message.hasOwnProperty("sleep")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Sleep.verify(message.sleep); - if (error) - return "sleep." + error; + if (message.swimStrokeType != null && message.hasOwnProperty("swimStrokeType")) + switch (message.swimStrokeType) { + default: + return "swimStrokeType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; } + if (message.strokeCount != null && message.hasOwnProperty("strokeCount")) { + properties._strokeCount = 1; + if (!$util.isInteger(message.strokeCount) && !(message.strokeCount && $util.isInteger(message.strokeCount.low) && $util.isInteger(message.strokeCount.high))) + return "strokeCount: integer|Long expected"; } - if (message.dailyRestingHeartRate != null && message.hasOwnProperty("dailyRestingHeartRate")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.verify(message.dailyRestingHeartRate); - if (error) - return "dailyRestingHeartRate." + error; - } + return null; + }; + + /** + * Creates a SwimLengthsData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.SwimLengthsData + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.SwimLengthsData} SwimLengthsData + */ + SwimLengthsData.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.SwimLengthsData) + return object; + var message = new $root.google.devicesandservices.health.v4.SwimLengthsData(); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.devicesandservices.health.v4.SwimLengthsData.interval: object expected"); + message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.fromObject(object.interval); } - if (message.dailyHeartRateVariability != null && message.hasOwnProperty("dailyHeartRateVariability")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.verify(message.dailyHeartRateVariability); - if (error) - return "dailyHeartRateVariability." + error; + switch (object.swimStrokeType) { + default: + if (typeof object.swimStrokeType === "number") { + message.swimStrokeType = object.swimStrokeType; + break; } + break; + case "SWIM_STROKE_TYPE_UNSPECIFIED": + case 0: + message.swimStrokeType = 0; + break; + case "FREESTYLE": + case 1: + message.swimStrokeType = 1; + break; + case "BACKSTROKE": + case 2: + message.swimStrokeType = 2; + break; + case "BREASTSTROKE": + case 3: + message.swimStrokeType = 3; + break; + case "BUTTERFLY": + case 4: + message.swimStrokeType = 4; + break; } - if (message.exercise != null && message.hasOwnProperty("exercise")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Exercise.verify(message.exercise); - if (error) - return "exercise." + error; - } + if (object.strokeCount != null) + if ($util.Long) + (message.strokeCount = $util.Long.fromValue(object.strokeCount)).unsigned = false; + else if (typeof object.strokeCount === "string") + message.strokeCount = parseInt(object.strokeCount, 10); + else if (typeof object.strokeCount === "number") + message.strokeCount = object.strokeCount; + else if (typeof object.strokeCount === "object") + message.strokeCount = new $util.LongBits(object.strokeCount.low >>> 0, object.strokeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SwimLengthsData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.SwimLengthsData + * @static + * @param {google.devicesandservices.health.v4.SwimLengthsData} message SwimLengthsData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SwimLengthsData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.interval = null; + object.swimStrokeType = options.enums === String ? "SWIM_STROKE_TYPE_UNSPECIFIED" : 0; } - if (message.weight != null && message.hasOwnProperty("weight")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Weight.verify(message.weight); - if (error) - return "weight." + error; - } + if (message.interval != null && message.hasOwnProperty("interval")) + object.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.toObject(message.interval, options); + if (message.swimStrokeType != null && message.hasOwnProperty("swimStrokeType")) + object.swimStrokeType = options.enums === String ? $root.google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType[message.swimStrokeType] === undefined ? message.swimStrokeType : $root.google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType[message.swimStrokeType] : message.swimStrokeType; + if (message.strokeCount != null && message.hasOwnProperty("strokeCount")) { + if (typeof message.strokeCount === "number") + object.strokeCount = options.longs === String ? String(message.strokeCount) : message.strokeCount; + else + object.strokeCount = options.longs === String ? $util.Long.prototype.toString.call(message.strokeCount) : options.longs === Number ? new $util.LongBits(message.strokeCount.low >>> 0, message.strokeCount.high >>> 0).toNumber() : message.strokeCount; + if (options.oneofs) + object._strokeCount = "strokeCount"; } - if (message.altitude != null && message.hasOwnProperty("altitude")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Altitude.verify(message.altitude); - if (error) - return "altitude." + error; - } - } - if (message.distance != null && message.hasOwnProperty("distance")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Distance.verify(message.distance); - if (error) - return "distance." + error; - } - } - if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.BodyFat.verify(message.bodyFat); - if (error) - return "bodyFat." + error; - } - } - if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.verify(message.activeZoneMinutes); - if (error) - return "activeZoneMinutes." + error; - } - } - if (message.heartRateVariability != null && message.hasOwnProperty("heartRateVariability")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.HeartRateVariability.verify(message.heartRateVariability); - if (error) - return "heartRateVariability." + error; - } - } - if (message.dailySleepTemperatureDerivations != null && message.hasOwnProperty("dailySleepTemperatureDerivations")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.verify(message.dailySleepTemperatureDerivations); - if (error) - return "dailySleepTemperatureDerivations." + error; - } - } - if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.SedentaryPeriod.verify(message.sedentaryPeriod); - if (error) - return "sedentaryPeriod." + error; - } - } - if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.RunVO2Max.verify(message.runVo2Max); - if (error) - return "runVo2Max." + error; - } - } - if (message.oxygenSaturation != null && message.hasOwnProperty("oxygenSaturation")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.OxygenSaturation.verify(message.oxygenSaturation); - if (error) - return "oxygenSaturation." + error; - } - } - if (message.dailyOxygenSaturation != null && message.hasOwnProperty("dailyOxygenSaturation")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.verify(message.dailyOxygenSaturation); - if (error) - return "dailyOxygenSaturation." + error; - } - } - if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.ActivityLevel.verify(message.activityLevel); - if (error) - return "activityLevel." + error; - } - } - if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.VO2Max.verify(message.vo2Max); - if (error) - return "vo2Max." + error; - } - } - if (message.dailyVo2Max != null && message.hasOwnProperty("dailyVo2Max")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.DailyVO2Max.verify(message.dailyVo2Max); - if (error) - return "dailyVo2Max." + error; - } - } - if (message.dailyHeartRateZones != null && message.hasOwnProperty("dailyHeartRateZones")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.DailyHeartRateZones.verify(message.dailyHeartRateZones); - if (error) - return "dailyHeartRateZones." + error; - } - } - if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.HydrationLog.verify(message.hydrationLog); - if (error) - return "hydrationLog." + error; - } - } - if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.verify(message.timeInHeartRateZone); - if (error) - return "timeInHeartRateZone." + error; - } - } - if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.ActiveMinutes.verify(message.activeMinutes); - if (error) - return "activeMinutes." + error; - } - } - if (message.respiratoryRateSleepSummary != null && message.hasOwnProperty("respiratoryRateSleepSummary")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.verify(message.respiratoryRateSleepSummary); - if (error) - return "respiratoryRateSleepSummary." + error; - } - } - if (message.dailyRespiratoryRate != null && message.hasOwnProperty("dailyRespiratoryRate")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.verify(message.dailyRespiratoryRate); - if (error) - return "dailyRespiratoryRate." + error; - } - } - if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.SwimLengthsData.verify(message.swimLengthsData); - if (error) - return "swimLengthsData." + error; - } + return object; + }; + + /** + * Converts this SwimLengthsData to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.SwimLengthsData + * @instance + * @returns {Object.} JSON object + */ + SwimLengthsData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SwimLengthsData + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.SwimLengthsData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SwimLengthsData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (message.height != null && message.hasOwnProperty("height")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.Height.verify(message.height); - if (error) - return "height." + error; + return typeUrlPrefix + "/google.devicesandservices.health.v4.SwimLengthsData"; + }; + + /** + * SwimStrokeType enum. + * @name google.devicesandservices.health.v4.SwimLengthsData.SwimStrokeType + * @enum {number} + * @property {number} SWIM_STROKE_TYPE_UNSPECIFIED=0 SWIM_STROKE_TYPE_UNSPECIFIED value + * @property {number} FREESTYLE=1 FREESTYLE value + * @property {number} BACKSTROKE=2 BACKSTROKE value + * @property {number} BREASTSTROKE=3 BREASTSTROKE value + * @property {number} BUTTERFLY=4 BUTTERFLY value + */ + SwimLengthsData.SwimStrokeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SWIM_STROKE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FREESTYLE"] = 1; + values[valuesById[2] = "BACKSTROKE"] = 2; + values[valuesById[3] = "BREASTSTROKE"] = 3; + values[valuesById[4] = "BUTTERFLY"] = 4; + return values; + })(); + + return SwimLengthsData; + })(); + + v4.SwimLengthsDataRollupValue = (function() { + + /** + * Properties of a SwimLengthsDataRollupValue. + * @memberof google.devicesandservices.health.v4 + * @interface ISwimLengthsDataRollupValue + * @property {number|Long|null} [strokeCountSum] SwimLengthsDataRollupValue strokeCountSum + */ + + /** + * Constructs a new SwimLengthsDataRollupValue. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a SwimLengthsDataRollupValue. + * @implements ISwimLengthsDataRollupValue + * @constructor + * @param {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue=} [properties] Properties to set + */ + function SwimLengthsDataRollupValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SwimLengthsDataRollupValue strokeCountSum. + * @member {number|Long|null|undefined} strokeCountSum + * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @instance + */ + SwimLengthsDataRollupValue.prototype.strokeCountSum = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SwimLengthsDataRollupValue.prototype, "_strokeCountSum", { + get: $util.oneOfGetter($oneOfFields = ["strokeCountSum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SwimLengthsDataRollupValue instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @static + * @param {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.SwimLengthsDataRollupValue} SwimLengthsDataRollupValue instance + */ + SwimLengthsDataRollupValue.create = function create(properties) { + return new SwimLengthsDataRollupValue(properties); + }; + + /** + * Encodes the specified SwimLengthsDataRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsDataRollupValue.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @static + * @param {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue} message SwimLengthsDataRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SwimLengthsDataRollupValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.strokeCountSum != null && Object.hasOwnProperty.call(message, "strokeCountSum")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.strokeCountSum); + return writer; + }; + + /** + * Encodes the specified SwimLengthsDataRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SwimLengthsDataRollupValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @static + * @param {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue} message SwimLengthsDataRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SwimLengthsDataRollupValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SwimLengthsDataRollupValue message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.SwimLengthsDataRollupValue} SwimLengthsDataRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SwimLengthsDataRollupValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.strokeCountSum = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; } } - if (message.basalEnergyBurned != null && message.hasOwnProperty("basalEnergyBurned")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.devicesandservices.health.v4.BasalEnergyBurned.verify(message.basalEnergyBurned); - if (error) - return "basalEnergyBurned." + error; - } + return message; + }; + + /** + * Decodes a SwimLengthsDataRollupValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.SwimLengthsDataRollupValue} SwimLengthsDataRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SwimLengthsDataRollupValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SwimLengthsDataRollupValue message. + * @function verify + * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SwimLengthsDataRollupValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.strokeCountSum != null && message.hasOwnProperty("strokeCountSum")) { + properties._strokeCountSum = 1; + if (!$util.isInteger(message.strokeCountSum) && !(message.strokeCountSum && $util.isInteger(message.strokeCountSum.low) && $util.isInteger(message.strokeCountSum.high))) + return "strokeCountSum: integer|Long expected"; } - if (message.dataPointName != null && message.hasOwnProperty("dataPointName")) - if (!$util.isString(message.dataPointName)) - return "dataPointName: string expected"; return null; }; /** - * Creates a ReconciledDataPoint message from a plain object. Also converts values to their respective internal types. + * Creates a SwimLengthsDataRollupValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.ReconciledDataPoint} ReconciledDataPoint + * @returns {google.devicesandservices.health.v4.SwimLengthsDataRollupValue} SwimLengthsDataRollupValue */ - ReconciledDataPoint.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.ReconciledDataPoint) + SwimLengthsDataRollupValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue) return object; - var message = new $root.google.devicesandservices.health.v4.ReconciledDataPoint(); - if (object.steps != null) { - if (typeof object.steps !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.steps: object expected"); - message.steps = $root.google.devicesandservices.health.v4.Steps.fromObject(object.steps); - } - if (object.floors != null) { - if (typeof object.floors !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.floors: object expected"); - message.floors = $root.google.devicesandservices.health.v4.Floors.fromObject(object.floors); - } - if (object.heartRate != null) { - if (typeof object.heartRate !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.heartRate: object expected"); - message.heartRate = $root.google.devicesandservices.health.v4.HeartRate.fromObject(object.heartRate); - } - if (object.sleep != null) { - if (typeof object.sleep !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.sleep: object expected"); - message.sleep = $root.google.devicesandservices.health.v4.Sleep.fromObject(object.sleep); - } - if (object.dailyRestingHeartRate != null) { - if (typeof object.dailyRestingHeartRate !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.dailyRestingHeartRate: object expected"); - message.dailyRestingHeartRate = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.fromObject(object.dailyRestingHeartRate); - } - if (object.dailyHeartRateVariability != null) { - if (typeof object.dailyHeartRateVariability !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.dailyHeartRateVariability: object expected"); - message.dailyHeartRateVariability = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.fromObject(object.dailyHeartRateVariability); - } - if (object.exercise != null) { - if (typeof object.exercise !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.exercise: object expected"); - message.exercise = $root.google.devicesandservices.health.v4.Exercise.fromObject(object.exercise); - } - if (object.weight != null) { - if (typeof object.weight !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.weight: object expected"); - message.weight = $root.google.devicesandservices.health.v4.Weight.fromObject(object.weight); + var message = new $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue(); + if (object.strokeCountSum != null) + if ($util.Long) + (message.strokeCountSum = $util.Long.fromValue(object.strokeCountSum)).unsigned = false; + else if (typeof object.strokeCountSum === "string") + message.strokeCountSum = parseInt(object.strokeCountSum, 10); + else if (typeof object.strokeCountSum === "number") + message.strokeCountSum = object.strokeCountSum; + else if (typeof object.strokeCountSum === "object") + message.strokeCountSum = new $util.LongBits(object.strokeCountSum.low >>> 0, object.strokeCountSum.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SwimLengthsDataRollupValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @static + * @param {google.devicesandservices.health.v4.SwimLengthsDataRollupValue} message SwimLengthsDataRollupValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SwimLengthsDataRollupValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.strokeCountSum != null && message.hasOwnProperty("strokeCountSum")) { + if (typeof message.strokeCountSum === "number") + object.strokeCountSum = options.longs === String ? String(message.strokeCountSum) : message.strokeCountSum; + else + object.strokeCountSum = options.longs === String ? $util.Long.prototype.toString.call(message.strokeCountSum) : options.longs === Number ? new $util.LongBits(message.strokeCountSum.low >>> 0, message.strokeCountSum.high >>> 0).toNumber() : message.strokeCountSum; + if (options.oneofs) + object._strokeCountSum = "strokeCountSum"; } - if (object.altitude != null) { - if (typeof object.altitude !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.altitude: object expected"); - message.altitude = $root.google.devicesandservices.health.v4.Altitude.fromObject(object.altitude); + return object; + }; + + /** + * Converts this SwimLengthsDataRollupValue to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @instance + * @returns {Object.} JSON object + */ + SwimLengthsDataRollupValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SwimLengthsDataRollupValue + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.SwimLengthsDataRollupValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SwimLengthsDataRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (object.distance != null) { - if (typeof object.distance !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.distance: object expected"); - message.distance = $root.google.devicesandservices.health.v4.Distance.fromObject(object.distance); - } - if (object.bodyFat != null) { - if (typeof object.bodyFat !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.bodyFat: object expected"); - message.bodyFat = $root.google.devicesandservices.health.v4.BodyFat.fromObject(object.bodyFat); - } - if (object.activeZoneMinutes != null) { - if (typeof object.activeZoneMinutes !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.activeZoneMinutes: object expected"); - message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.fromObject(object.activeZoneMinutes); - } - if (object.heartRateVariability != null) { - if (typeof object.heartRateVariability !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.heartRateVariability: object expected"); - message.heartRateVariability = $root.google.devicesandservices.health.v4.HeartRateVariability.fromObject(object.heartRateVariability); + return typeUrlPrefix + "/google.devicesandservices.health.v4.SwimLengthsDataRollupValue"; + }; + + return SwimLengthsDataRollupValue; + })(); + + v4.TimeInHeartRateZone = (function() { + + /** + * Properties of a TimeInHeartRateZone. + * @memberof google.devicesandservices.health.v4 + * @interface ITimeInHeartRateZone + * @property {google.devicesandservices.health.v4.IObservationTimeInterval|null} [interval] TimeInHeartRateZone interval + * @property {google.devicesandservices.health.v4.HeartRateZoneType|null} [heartRateZoneType] TimeInHeartRateZone heartRateZoneType + */ + + /** + * Constructs a new TimeInHeartRateZone. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a TimeInHeartRateZone. + * @implements ITimeInHeartRateZone + * @constructor + * @param {google.devicesandservices.health.v4.ITimeInHeartRateZone=} [properties] Properties to set + */ + function TimeInHeartRateZone(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeInHeartRateZone interval. + * @member {google.devicesandservices.health.v4.IObservationTimeInterval|null|undefined} interval + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @instance + */ + TimeInHeartRateZone.prototype.interval = null; + + /** + * TimeInHeartRateZone heartRateZoneType. + * @member {google.devicesandservices.health.v4.HeartRateZoneType} heartRateZoneType + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @instance + */ + TimeInHeartRateZone.prototype.heartRateZoneType = 0; + + /** + * Creates a new TimeInHeartRateZone instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @static + * @param {google.devicesandservices.health.v4.ITimeInHeartRateZone=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.TimeInHeartRateZone} TimeInHeartRateZone instance + */ + TimeInHeartRateZone.create = function create(properties) { + return new TimeInHeartRateZone(properties); + }; + + /** + * Encodes the specified TimeInHeartRateZone message. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZone.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @static + * @param {google.devicesandservices.health.v4.ITimeInHeartRateZone} message TimeInHeartRateZone message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeInHeartRateZone.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.devicesandservices.health.v4.ObservationTimeInterval.encode(message.interval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.heartRateZoneType != null && Object.hasOwnProperty.call(message, "heartRateZoneType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.heartRateZoneType); + return writer; + }; + + /** + * Encodes the specified TimeInHeartRateZone message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZone.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @static + * @param {google.devicesandservices.health.v4.ITimeInHeartRateZone} message TimeInHeartRateZone message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeInHeartRateZone.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeInHeartRateZone message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.TimeInHeartRateZone} TimeInHeartRateZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeInHeartRateZone.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.TimeInHeartRateZone(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.decode(reader, reader.uint32()); + break; + } + case 2: { + message.heartRateZoneType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - if (object.dailySleepTemperatureDerivations != null) { - if (typeof object.dailySleepTemperatureDerivations !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.dailySleepTemperatureDerivations: object expected"); - message.dailySleepTemperatureDerivations = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.fromObject(object.dailySleepTemperatureDerivations); + return message; + }; + + /** + * Decodes a TimeInHeartRateZone message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.TimeInHeartRateZone} TimeInHeartRateZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeInHeartRateZone.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeInHeartRateZone message. + * @function verify + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeInHeartRateZone.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interval != null && message.hasOwnProperty("interval")) { + var error = $root.google.devicesandservices.health.v4.ObservationTimeInterval.verify(message.interval); + if (error) + return "interval." + error; } - if (object.sedentaryPeriod != null) { - if (typeof object.sedentaryPeriod !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.sedentaryPeriod: object expected"); - message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriod.fromObject(object.sedentaryPeriod); + if (message.heartRateZoneType != null && message.hasOwnProperty("heartRateZoneType")) + switch (message.heartRateZoneType) { + default: + return "heartRateZoneType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a TimeInHeartRateZone message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.TimeInHeartRateZone} TimeInHeartRateZone + */ + TimeInHeartRateZone.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.TimeInHeartRateZone) + return object; + var message = new $root.google.devicesandservices.health.v4.TimeInHeartRateZone(); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.devicesandservices.health.v4.TimeInHeartRateZone.interval: object expected"); + message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.fromObject(object.interval); } - if (object.runVo2Max != null) { - if (typeof object.runVo2Max !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.runVo2Max: object expected"); - message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2Max.fromObject(object.runVo2Max); + switch (object.heartRateZoneType) { + default: + if (typeof object.heartRateZoneType === "number") { + message.heartRateZoneType = object.heartRateZoneType; + break; + } + break; + case "HEART_RATE_ZONE_TYPE_UNSPECIFIED": + case 0: + message.heartRateZoneType = 0; + break; + case "LIGHT": + case 1: + message.heartRateZoneType = 1; + break; + case "MODERATE": + case 2: + message.heartRateZoneType = 2; + break; + case "VIGOROUS": + case 3: + message.heartRateZoneType = 3; + break; + case "PEAK": + case 4: + message.heartRateZoneType = 4; + break; } - if (object.oxygenSaturation != null) { - if (typeof object.oxygenSaturation !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.oxygenSaturation: object expected"); - message.oxygenSaturation = $root.google.devicesandservices.health.v4.OxygenSaturation.fromObject(object.oxygenSaturation); + return message; + }; + + /** + * Creates a plain object from a TimeInHeartRateZone message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @static + * @param {google.devicesandservices.health.v4.TimeInHeartRateZone} message TimeInHeartRateZone + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeInHeartRateZone.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.interval = null; + object.heartRateZoneType = options.enums === String ? "HEART_RATE_ZONE_TYPE_UNSPECIFIED" : 0; } - if (object.dailyOxygenSaturation != null) { - if (typeof object.dailyOxygenSaturation !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.dailyOxygenSaturation: object expected"); - message.dailyOxygenSaturation = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.fromObject(object.dailyOxygenSaturation); + if (message.interval != null && message.hasOwnProperty("interval")) + object.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.toObject(message.interval, options); + if (message.heartRateZoneType != null && message.hasOwnProperty("heartRateZoneType")) + object.heartRateZoneType = options.enums === String ? $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZoneType] === undefined ? message.heartRateZoneType : $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZoneType] : message.heartRateZoneType; + return object; + }; + + /** + * Converts this TimeInHeartRateZone to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @instance + * @returns {Object.} JSON object + */ + TimeInHeartRateZone.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeInHeartRateZone + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZone + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeInHeartRateZone.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (object.activityLevel != null) { - if (typeof object.activityLevel !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.activityLevel: object expected"); - message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevel.fromObject(object.activityLevel); + return typeUrlPrefix + "/google.devicesandservices.health.v4.TimeInHeartRateZone"; + }; + + return TimeInHeartRateZone; + })(); + + v4.TimeInHeartRateZoneRollupValue = (function() { + + /** + * Properties of a TimeInHeartRateZoneRollupValue. + * @memberof google.devicesandservices.health.v4 + * @interface ITimeInHeartRateZoneRollupValue + * @property {Array.|null} [timeInHeartRateZones] TimeInHeartRateZoneRollupValue timeInHeartRateZones + */ + + /** + * Constructs a new TimeInHeartRateZoneRollupValue. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a TimeInHeartRateZoneRollupValue. + * @implements ITimeInHeartRateZoneRollupValue + * @constructor + * @param {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue=} [properties] Properties to set + */ + function TimeInHeartRateZoneRollupValue(properties) { + this.timeInHeartRateZones = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeInHeartRateZoneRollupValue timeInHeartRateZones. + * @member {Array.} timeInHeartRateZones + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @instance + */ + TimeInHeartRateZoneRollupValue.prototype.timeInHeartRateZones = $util.emptyArray; + + /** + * Creates a new TimeInHeartRateZoneRollupValue instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @static + * @param {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue} TimeInHeartRateZoneRollupValue instance + */ + TimeInHeartRateZoneRollupValue.create = function create(properties) { + return new TimeInHeartRateZoneRollupValue(properties); + }; + + /** + * Encodes the specified TimeInHeartRateZoneRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @static + * @param {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue} message TimeInHeartRateZoneRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeInHeartRateZoneRollupValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeInHeartRateZones != null && message.timeInHeartRateZones.length) + for (var i = 0; i < message.timeInHeartRateZones.length; ++i) + $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.encode(message.timeInHeartRateZones[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeInHeartRateZoneRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @static + * @param {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue} message TimeInHeartRateZoneRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeInHeartRateZoneRollupValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeInHeartRateZoneRollupValue message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue} TimeInHeartRateZoneRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeInHeartRateZoneRollupValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.timeInHeartRateZones && message.timeInHeartRateZones.length)) + message.timeInHeartRateZones = []; + message.timeInHeartRateZones.push($root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - if (object.vo2Max != null) { - if (typeof object.vo2Max !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.vo2Max: object expected"); - message.vo2Max = $root.google.devicesandservices.health.v4.VO2Max.fromObject(object.vo2Max); + return message; + }; + + /** + * Decodes a TimeInHeartRateZoneRollupValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue} TimeInHeartRateZoneRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeInHeartRateZoneRollupValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeInHeartRateZoneRollupValue message. + * @function verify + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeInHeartRateZoneRollupValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeInHeartRateZones != null && message.hasOwnProperty("timeInHeartRateZones")) { + if (!Array.isArray(message.timeInHeartRateZones)) + return "timeInHeartRateZones: array expected"; + for (var i = 0; i < message.timeInHeartRateZones.length; ++i) { + var error = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.verify(message.timeInHeartRateZones[i]); + if (error) + return "timeInHeartRateZones." + error; + } } - if (object.dailyVo2Max != null) { - if (typeof object.dailyVo2Max !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.dailyVo2Max: object expected"); - message.dailyVo2Max = $root.google.devicesandservices.health.v4.DailyVO2Max.fromObject(object.dailyVo2Max); + return null; + }; + + /** + * Creates a TimeInHeartRateZoneRollupValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue} TimeInHeartRateZoneRollupValue + */ + TimeInHeartRateZoneRollupValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue) + return object; + var message = new $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue(); + if (object.timeInHeartRateZones) { + if (!Array.isArray(object.timeInHeartRateZones)) + throw TypeError(".google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.timeInHeartRateZones: array expected"); + message.timeInHeartRateZones = []; + for (var i = 0; i < object.timeInHeartRateZones.length; ++i) { + if (typeof object.timeInHeartRateZones[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.timeInHeartRateZones: object expected"); + message.timeInHeartRateZones[i] = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.fromObject(object.timeInHeartRateZones[i]); + } } - if (object.dailyHeartRateZones != null) { - if (typeof object.dailyHeartRateZones !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.dailyHeartRateZones: object expected"); - message.dailyHeartRateZones = $root.google.devicesandservices.health.v4.DailyHeartRateZones.fromObject(object.dailyHeartRateZones); + return message; + }; + + /** + * Creates a plain object from a TimeInHeartRateZoneRollupValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @static + * @param {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue} message TimeInHeartRateZoneRollupValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeInHeartRateZoneRollupValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.timeInHeartRateZones = []; + if (message.timeInHeartRateZones && message.timeInHeartRateZones.length) { + object.timeInHeartRateZones = []; + for (var j = 0; j < message.timeInHeartRateZones.length; ++j) + object.timeInHeartRateZones[j] = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.toObject(message.timeInHeartRateZones[j], options); + } + return object; + }; + + /** + * Converts this TimeInHeartRateZoneRollupValue to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @instance + * @returns {Object.} JSON object + */ + TimeInHeartRateZoneRollupValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeInHeartRateZoneRollupValue + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeInHeartRateZoneRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue"; + }; + + TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue = (function() { + + /** + * Properties of a TimeInHeartRateZoneValue. + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @interface ITimeInHeartRateZoneValue + * @property {google.devicesandservices.health.v4.HeartRateZoneType|null} [heartRateZone] TimeInHeartRateZoneValue heartRateZone + * @property {google.protobuf.IDuration|null} [duration] TimeInHeartRateZoneValue duration + */ + + /** + * Constructs a new TimeInHeartRateZoneValue. + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue + * @classdesc Represents a TimeInHeartRateZoneValue. + * @implements ITimeInHeartRateZoneValue + * @constructor + * @param {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue=} [properties] Properties to set + */ + function TimeInHeartRateZoneValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeInHeartRateZoneValue heartRateZone. + * @member {google.devicesandservices.health.v4.HeartRateZoneType} heartRateZone + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @instance + */ + TimeInHeartRateZoneValue.prototype.heartRateZone = 0; + + /** + * TimeInHeartRateZoneValue duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @instance + */ + TimeInHeartRateZoneValue.prototype.duration = null; + + /** + * Creates a new TimeInHeartRateZoneValue instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @static + * @param {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue} TimeInHeartRateZoneValue instance + */ + TimeInHeartRateZoneValue.create = function create(properties) { + return new TimeInHeartRateZoneValue(properties); + }; + + /** + * Encodes the specified TimeInHeartRateZoneValue message. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @static + * @param {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue} message TimeInHeartRateZoneValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeInHeartRateZoneValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.heartRateZone != null && Object.hasOwnProperty.call(message, "heartRateZone")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.heartRateZone); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeInHeartRateZoneValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @static + * @param {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.ITimeInHeartRateZoneValue} message TimeInHeartRateZoneValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeInHeartRateZoneValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeInHeartRateZoneValue message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue} TimeInHeartRateZoneValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeInHeartRateZoneValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.heartRateZone = reader.int32(); + break; + } + case 2: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeInHeartRateZoneValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue} TimeInHeartRateZoneValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeInHeartRateZoneValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeInHeartRateZoneValue message. + * @function verify + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeInHeartRateZoneValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.heartRateZone != null && message.hasOwnProperty("heartRateZone")) + switch (message.heartRateZone) { + default: + return "heartRateZone: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + return null; + }; + + /** + * Creates a TimeInHeartRateZoneValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue} TimeInHeartRateZoneValue + */ + TimeInHeartRateZoneValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue) + return object; + var message = new $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue(); + switch (object.heartRateZone) { + default: + if (typeof object.heartRateZone === "number") { + message.heartRateZone = object.heartRateZone; + break; + } + break; + case "HEART_RATE_ZONE_TYPE_UNSPECIFIED": + case 0: + message.heartRateZone = 0; + break; + case "LIGHT": + case 1: + message.heartRateZone = 1; + break; + case "MODERATE": + case 2: + message.heartRateZone = 2; + break; + case "VIGOROUS": + case 3: + message.heartRateZone = 3; + break; + case "PEAK": + case 4: + message.heartRateZone = 4; + break; + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from a TimeInHeartRateZoneValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @static + * @param {google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue} message TimeInHeartRateZoneValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeInHeartRateZoneValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.heartRateZone = options.enums === String ? "HEART_RATE_ZONE_TYPE_UNSPECIFIED" : 0; + object.duration = null; + } + if (message.heartRateZone != null && message.hasOwnProperty("heartRateZone")) + object.heartRateZone = options.enums === String ? $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZone] === undefined ? message.heartRateZone : $root.google.devicesandservices.health.v4.HeartRateZoneType[message.heartRateZone] : message.heartRateZone; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this TimeInHeartRateZoneValue to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @instance + * @returns {Object.} JSON object + */ + TimeInHeartRateZoneValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeInHeartRateZoneValue + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeInHeartRateZoneValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.TimeInHeartRateZoneValue"; + }; + + return TimeInHeartRateZoneValue; + })(); + + return TimeInHeartRateZoneRollupValue; + })(); + + v4.TotalCaloriesRollupValue = (function() { + + /** + * Properties of a TotalCaloriesRollupValue. + * @memberof google.devicesandservices.health.v4 + * @interface ITotalCaloriesRollupValue + * @property {number|null} [kcalSum] TotalCaloriesRollupValue kcalSum + */ + + /** + * Constructs a new TotalCaloriesRollupValue. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a TotalCaloriesRollupValue. + * @implements ITotalCaloriesRollupValue + * @constructor + * @param {google.devicesandservices.health.v4.ITotalCaloriesRollupValue=} [properties] Properties to set + */ + function TotalCaloriesRollupValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TotalCaloriesRollupValue kcalSum. + * @member {number|null|undefined} kcalSum + * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue + * @instance + */ + TotalCaloriesRollupValue.prototype.kcalSum = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TotalCaloriesRollupValue.prototype, "_kcalSum", { + get: $util.oneOfGetter($oneOfFields = ["kcalSum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TotalCaloriesRollupValue instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue + * @static + * @param {google.devicesandservices.health.v4.ITotalCaloriesRollupValue=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.TotalCaloriesRollupValue} TotalCaloriesRollupValue instance + */ + TotalCaloriesRollupValue.create = function create(properties) { + return new TotalCaloriesRollupValue(properties); + }; + + /** + * Encodes the specified TotalCaloriesRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.TotalCaloriesRollupValue.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue + * @static + * @param {google.devicesandservices.health.v4.ITotalCaloriesRollupValue} message TotalCaloriesRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TotalCaloriesRollupValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kcalSum != null && Object.hasOwnProperty.call(message, "kcalSum")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.kcalSum); + return writer; + }; + + /** + * Encodes the specified TotalCaloriesRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.TotalCaloriesRollupValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue + * @static + * @param {google.devicesandservices.health.v4.ITotalCaloriesRollupValue} message TotalCaloriesRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TotalCaloriesRollupValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TotalCaloriesRollupValue message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.TotalCaloriesRollupValue} TotalCaloriesRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TotalCaloriesRollupValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kcalSum = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TotalCaloriesRollupValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.TotalCaloriesRollupValue} TotalCaloriesRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TotalCaloriesRollupValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TotalCaloriesRollupValue message. + * @function verify + * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TotalCaloriesRollupValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.kcalSum != null && message.hasOwnProperty("kcalSum")) { + properties._kcalSum = 1; + if (typeof message.kcalSum !== "number") + return "kcalSum: number expected"; + } + return null; + }; + + /** + * Creates a TotalCaloriesRollupValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.TotalCaloriesRollupValue} TotalCaloriesRollupValue + */ + TotalCaloriesRollupValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue) + return object; + var message = new $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue(); + if (object.kcalSum != null) + message.kcalSum = Number(object.kcalSum); + return message; + }; + + /** + * Creates a plain object from a TotalCaloriesRollupValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue + * @static + * @param {google.devicesandservices.health.v4.TotalCaloriesRollupValue} message TotalCaloriesRollupValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TotalCaloriesRollupValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.kcalSum != null && message.hasOwnProperty("kcalSum")) { + object.kcalSum = options.json && !isFinite(message.kcalSum) ? String(message.kcalSum) : message.kcalSum; + if (options.oneofs) + object._kcalSum = "kcalSum"; + } + return object; + }; + + /** + * Converts this TotalCaloriesRollupValue to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue + * @instance + * @returns {Object.} JSON object + */ + TotalCaloriesRollupValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TotalCaloriesRollupValue + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.TotalCaloriesRollupValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TotalCaloriesRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.TotalCaloriesRollupValue"; + }; + + return TotalCaloriesRollupValue; + })(); + + v4.VO2Max = (function() { + + /** + * Properties of a VO2Max. + * @memberof google.devicesandservices.health.v4 + * @interface IVO2Max + * @property {google.devicesandservices.health.v4.IObservationSampleTime|null} [sampleTime] VO2Max sampleTime + * @property {number|null} [vo2Max] VO2Max vo2Max + * @property {google.devicesandservices.health.v4.VO2Max.MeasurementMethod|null} [measurementMethod] VO2Max measurementMethod + */ + + /** + * Constructs a new VO2Max. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a VO2Max. + * @implements IVO2Max + * @constructor + * @param {google.devicesandservices.health.v4.IVO2Max=} [properties] Properties to set + */ + function VO2Max(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VO2Max sampleTime. + * @member {google.devicesandservices.health.v4.IObservationSampleTime|null|undefined} sampleTime + * @memberof google.devicesandservices.health.v4.VO2Max + * @instance + */ + VO2Max.prototype.sampleTime = null; + + /** + * VO2Max vo2Max. + * @member {number|null|undefined} vo2Max + * @memberof google.devicesandservices.health.v4.VO2Max + * @instance + */ + VO2Max.prototype.vo2Max = null; + + /** + * VO2Max measurementMethod. + * @member {google.devicesandservices.health.v4.VO2Max.MeasurementMethod} measurementMethod + * @memberof google.devicesandservices.health.v4.VO2Max + * @instance + */ + VO2Max.prototype.measurementMethod = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VO2Max.prototype, "_vo2Max", { + get: $util.oneOfGetter($oneOfFields = ["vo2Max"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VO2Max instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.VO2Max + * @static + * @param {google.devicesandservices.health.v4.IVO2Max=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.VO2Max} VO2Max instance + */ + VO2Max.create = function create(properties) { + return new VO2Max(properties); + }; + + /** + * Encodes the specified VO2Max message. Does not implicitly {@link google.devicesandservices.health.v4.VO2Max.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.VO2Max + * @static + * @param {google.devicesandservices.health.v4.IVO2Max} message VO2Max message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VO2Max.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sampleTime != null && Object.hasOwnProperty.call(message, "sampleTime")) + $root.google.devicesandservices.health.v4.ObservationSampleTime.encode(message.sampleTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.vo2Max != null && Object.hasOwnProperty.call(message, "vo2Max")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.vo2Max); + if (message.measurementMethod != null && Object.hasOwnProperty.call(message, "measurementMethod")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.measurementMethod); + return writer; + }; + + /** + * Encodes the specified VO2Max message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.VO2Max.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.VO2Max + * @static + * @param {google.devicesandservices.health.v4.IVO2Max} message VO2Max message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VO2Max.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VO2Max message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.VO2Max + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.VO2Max} VO2Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VO2Max.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.VO2Max(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.decode(reader, reader.uint32()); + break; + } + case 2: { + message.vo2Max = reader.double(); + break; + } + case 4: { + message.measurementMethod = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VO2Max message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.VO2Max + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.VO2Max} VO2Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VO2Max.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VO2Max message. + * @function verify + * @memberof google.devicesandservices.health.v4.VO2Max + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VO2Max.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { + var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); + if (error) + return "sampleTime." + error; + } + if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) { + properties._vo2Max = 1; + if (typeof message.vo2Max !== "number") + return "vo2Max: number expected"; + } + if (message.measurementMethod != null && message.hasOwnProperty("measurementMethod")) + switch (message.measurementMethod) { + default: + return "measurementMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + return null; + }; + + /** + * Creates a VO2Max message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.VO2Max + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.VO2Max} VO2Max + */ + VO2Max.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.VO2Max) + return object; + var message = new $root.google.devicesandservices.health.v4.VO2Max(); + if (object.sampleTime != null) { + if (typeof object.sampleTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.VO2Max.sampleTime: object expected"); + message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.fromObject(object.sampleTime); + } + if (object.vo2Max != null) + message.vo2Max = Number(object.vo2Max); + switch (object.measurementMethod) { + default: + if (typeof object.measurementMethod === "number") { + message.measurementMethod = object.measurementMethod; + break; + } + break; + case "MEASUREMENT_METHOD_UNSPECIFIED": + case 0: + message.measurementMethod = 0; + break; + case "FITBIT_RUN": + case 1: + message.measurementMethod = 1; + break; + case "GOOGLE_DEMOGRAPHIC": + case 2: + message.measurementMethod = 2; + break; + case "COOPER_TEST": + case 3: + message.measurementMethod = 3; + break; + case "HEART_RATE_RATIO": + case 4: + message.measurementMethod = 4; + break; + case "METABOLIC_CART": + case 5: + message.measurementMethod = 5; + break; + case "MULTISTAGE_FITNESS_TEST": + case 6: + message.measurementMethod = 6; + break; + case "ROCKPORT_FITNESS_TEST": + case 7: + message.measurementMethod = 7; + break; + case "MAX_EXERCISE": + case 8: + message.measurementMethod = 8; + break; + case "PREDICTION_SUB_MAX_EXERCISE": + case 9: + message.measurementMethod = 9; + break; + case "PREDICTION_NON_EXERCISE": + case 10: + message.measurementMethod = 10; + break; + case "OTHER": + case 11: + message.measurementMethod = 11; + break; + } + return message; + }; + + /** + * Creates a plain object from a VO2Max message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.VO2Max + * @static + * @param {google.devicesandservices.health.v4.VO2Max} message VO2Max + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VO2Max.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sampleTime = null; + object.measurementMethod = options.enums === String ? "MEASUREMENT_METHOD_UNSPECIFIED" : 0; + } + if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) + object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); + if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) { + object.vo2Max = options.json && !isFinite(message.vo2Max) ? String(message.vo2Max) : message.vo2Max; + if (options.oneofs) + object._vo2Max = "vo2Max"; + } + if (message.measurementMethod != null && message.hasOwnProperty("measurementMethod")) + object.measurementMethod = options.enums === String ? $root.google.devicesandservices.health.v4.VO2Max.MeasurementMethod[message.measurementMethod] === undefined ? message.measurementMethod : $root.google.devicesandservices.health.v4.VO2Max.MeasurementMethod[message.measurementMethod] : message.measurementMethod; + return object; + }; + + /** + * Converts this VO2Max to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.VO2Max + * @instance + * @returns {Object.} JSON object + */ + VO2Max.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VO2Max + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.VO2Max + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VO2Max.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.VO2Max"; + }; + + /** + * MeasurementMethod enum. + * @name google.devicesandservices.health.v4.VO2Max.MeasurementMethod + * @enum {number} + * @property {number} MEASUREMENT_METHOD_UNSPECIFIED=0 MEASUREMENT_METHOD_UNSPECIFIED value + * @property {number} FITBIT_RUN=1 FITBIT_RUN value + * @property {number} GOOGLE_DEMOGRAPHIC=2 GOOGLE_DEMOGRAPHIC value + * @property {number} COOPER_TEST=3 COOPER_TEST value + * @property {number} HEART_RATE_RATIO=4 HEART_RATE_RATIO value + * @property {number} METABOLIC_CART=5 METABOLIC_CART value + * @property {number} MULTISTAGE_FITNESS_TEST=6 MULTISTAGE_FITNESS_TEST value + * @property {number} ROCKPORT_FITNESS_TEST=7 ROCKPORT_FITNESS_TEST value + * @property {number} MAX_EXERCISE=8 MAX_EXERCISE value + * @property {number} PREDICTION_SUB_MAX_EXERCISE=9 PREDICTION_SUB_MAX_EXERCISE value + * @property {number} PREDICTION_NON_EXERCISE=10 PREDICTION_NON_EXERCISE value + * @property {number} OTHER=11 OTHER value + */ + VO2Max.MeasurementMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEASUREMENT_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "FITBIT_RUN"] = 1; + values[valuesById[2] = "GOOGLE_DEMOGRAPHIC"] = 2; + values[valuesById[3] = "COOPER_TEST"] = 3; + values[valuesById[4] = "HEART_RATE_RATIO"] = 4; + values[valuesById[5] = "METABOLIC_CART"] = 5; + values[valuesById[6] = "MULTISTAGE_FITNESS_TEST"] = 6; + values[valuesById[7] = "ROCKPORT_FITNESS_TEST"] = 7; + values[valuesById[8] = "MAX_EXERCISE"] = 8; + values[valuesById[9] = "PREDICTION_SUB_MAX_EXERCISE"] = 9; + values[valuesById[10] = "PREDICTION_NON_EXERCISE"] = 10; + values[valuesById[11] = "OTHER"] = 11; + return values; + })(); + + return VO2Max; + })(); + + v4.Weight = (function() { + + /** + * Properties of a Weight. + * @memberof google.devicesandservices.health.v4 + * @interface IWeight + * @property {google.devicesandservices.health.v4.IObservationSampleTime|null} [sampleTime] Weight sampleTime + * @property {number|null} [weightGrams] Weight weightGrams + * @property {string|null} [notes] Weight notes + */ + + /** + * Constructs a new Weight. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a Weight. + * @implements IWeight + * @constructor + * @param {google.devicesandservices.health.v4.IWeight=} [properties] Properties to set + */ + function Weight(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Weight sampleTime. + * @member {google.devicesandservices.health.v4.IObservationSampleTime|null|undefined} sampleTime + * @memberof google.devicesandservices.health.v4.Weight + * @instance + */ + Weight.prototype.sampleTime = null; + + /** + * Weight weightGrams. + * @member {number|null|undefined} weightGrams + * @memberof google.devicesandservices.health.v4.Weight + * @instance + */ + Weight.prototype.weightGrams = null; + + /** + * Weight notes. + * @member {string} notes + * @memberof google.devicesandservices.health.v4.Weight + * @instance + */ + Weight.prototype.notes = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Weight.prototype, "_weightGrams", { + get: $util.oneOfGetter($oneOfFields = ["weightGrams"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Weight instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.Weight + * @static + * @param {google.devicesandservices.health.v4.IWeight=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Weight} Weight instance + */ + Weight.create = function create(properties) { + return new Weight(properties); + }; + + /** + * Encodes the specified Weight message. Does not implicitly {@link google.devicesandservices.health.v4.Weight.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.Weight + * @static + * @param {google.devicesandservices.health.v4.IWeight} message Weight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Weight.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sampleTime != null && Object.hasOwnProperty.call(message, "sampleTime")) + $root.google.devicesandservices.health.v4.ObservationSampleTime.encode(message.sampleTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.weightGrams != null && Object.hasOwnProperty.call(message, "weightGrams")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.weightGrams); + if (message.notes != null && Object.hasOwnProperty.call(message, "notes")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.notes); + return writer; + }; + + /** + * Encodes the specified Weight message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Weight.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.Weight + * @static + * @param {google.devicesandservices.health.v4.IWeight} message Weight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Weight.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Weight message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.Weight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.Weight} Weight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Weight.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Weight(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.decode(reader, reader.uint32()); + break; + } + case 3: { + message.weightGrams = reader.double(); + break; + } + case 4: { + message.notes = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Weight message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.Weight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.Weight} Weight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Weight.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Weight message. + * @function verify + * @memberof google.devicesandservices.health.v4.Weight + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Weight.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { + var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); + if (error) + return "sampleTime." + error; + } + if (message.weightGrams != null && message.hasOwnProperty("weightGrams")) { + properties._weightGrams = 1; + if (typeof message.weightGrams !== "number") + return "weightGrams: number expected"; + } + if (message.notes != null && message.hasOwnProperty("notes")) + if (!$util.isString(message.notes)) + return "notes: string expected"; + return null; + }; + + /** + * Creates a Weight message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.Weight + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.Weight} Weight + */ + Weight.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Weight) + return object; + var message = new $root.google.devicesandservices.health.v4.Weight(); + if (object.sampleTime != null) { + if (typeof object.sampleTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.Weight.sampleTime: object expected"); + message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.fromObject(object.sampleTime); + } + if (object.weightGrams != null) + message.weightGrams = Number(object.weightGrams); + if (object.notes != null) + message.notes = String(object.notes); + return message; + }; + + /** + * Creates a plain object from a Weight message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.Weight + * @static + * @param {google.devicesandservices.health.v4.Weight} message Weight + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Weight.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sampleTime = null; + object.notes = ""; + } + if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) + object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); + if (message.weightGrams != null && message.hasOwnProperty("weightGrams")) { + object.weightGrams = options.json && !isFinite(message.weightGrams) ? String(message.weightGrams) : message.weightGrams; + if (options.oneofs) + object._weightGrams = "weightGrams"; + } + if (message.notes != null && message.hasOwnProperty("notes")) + object.notes = message.notes; + return object; + }; + + /** + * Converts this Weight to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.Weight + * @instance + * @returns {Object.} JSON object + */ + Weight.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Weight + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.Weight + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Weight.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.Weight"; + }; + + return Weight; + })(); + + v4.WeightRollupValue = (function() { + + /** + * Properties of a WeightRollupValue. + * @memberof google.devicesandservices.health.v4 + * @interface IWeightRollupValue + * @property {number|null} [weightGramsAvg] WeightRollupValue weightGramsAvg + */ + + /** + * Constructs a new WeightRollupValue. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a WeightRollupValue. + * @implements IWeightRollupValue + * @constructor + * @param {google.devicesandservices.health.v4.IWeightRollupValue=} [properties] Properties to set + */ + function WeightRollupValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WeightRollupValue weightGramsAvg. + * @member {number|null|undefined} weightGramsAvg + * @memberof google.devicesandservices.health.v4.WeightRollupValue + * @instance + */ + WeightRollupValue.prototype.weightGramsAvg = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WeightRollupValue.prototype, "_weightGramsAvg", { + get: $util.oneOfGetter($oneOfFields = ["weightGramsAvg"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WeightRollupValue instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.WeightRollupValue + * @static + * @param {google.devicesandservices.health.v4.IWeightRollupValue=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.WeightRollupValue} WeightRollupValue instance + */ + WeightRollupValue.create = function create(properties) { + return new WeightRollupValue(properties); + }; + + /** + * Encodes the specified WeightRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.WeightRollupValue.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.WeightRollupValue + * @static + * @param {google.devicesandservices.health.v4.IWeightRollupValue} message WeightRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeightRollupValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.weightGramsAvg != null && Object.hasOwnProperty.call(message, "weightGramsAvg")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.weightGramsAvg); + return writer; + }; + + /** + * Encodes the specified WeightRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.WeightRollupValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.WeightRollupValue + * @static + * @param {google.devicesandservices.health.v4.IWeightRollupValue} message WeightRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeightRollupValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeightRollupValue message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.WeightRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.WeightRollupValue} WeightRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeightRollupValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.WeightRollupValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.weightGramsAvg = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WeightRollupValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.WeightRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.WeightRollupValue} WeightRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeightRollupValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeightRollupValue message. + * @function verify + * @memberof google.devicesandservices.health.v4.WeightRollupValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeightRollupValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.weightGramsAvg != null && message.hasOwnProperty("weightGramsAvg")) { + properties._weightGramsAvg = 1; + if (typeof message.weightGramsAvg !== "number") + return "weightGramsAvg: number expected"; + } + return null; + }; + + /** + * Creates a WeightRollupValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.WeightRollupValue + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.WeightRollupValue} WeightRollupValue + */ + WeightRollupValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.WeightRollupValue) + return object; + var message = new $root.google.devicesandservices.health.v4.WeightRollupValue(); + if (object.weightGramsAvg != null) + message.weightGramsAvg = Number(object.weightGramsAvg); + return message; + }; + + /** + * Creates a plain object from a WeightRollupValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.WeightRollupValue + * @static + * @param {google.devicesandservices.health.v4.WeightRollupValue} message WeightRollupValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeightRollupValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.weightGramsAvg != null && message.hasOwnProperty("weightGramsAvg")) { + object.weightGramsAvg = options.json && !isFinite(message.weightGramsAvg) ? String(message.weightGramsAvg) : message.weightGramsAvg; + if (options.oneofs) + object._weightGramsAvg = "weightGramsAvg"; + } + return object; + }; + + /** + * Converts this WeightRollupValue to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.WeightRollupValue + * @instance + * @returns {Object.} JSON object + */ + WeightRollupValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WeightRollupValue + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.WeightRollupValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeightRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.WeightRollupValue"; + }; + + return WeightRollupValue; + })(); + + v4.BloodGlucose = (function() { + + /** + * Properties of a BloodGlucose. + * @memberof google.devicesandservices.health.v4 + * @interface IBloodGlucose + * @property {google.devicesandservices.health.v4.IObservationSampleTime|null} [sampleTime] BloodGlucose sampleTime + * @property {number|null} [bloodGlucoseMilligramsPerDeciliter] BloodGlucose bloodGlucoseMilligramsPerDeciliter + * @property {google.devicesandservices.health.v4.BloodGlucose.MeasurementSource|null} [measurementSource] BloodGlucose measurementSource + * @property {google.devicesandservices.health.v4.BloodGlucose.MealType|null} [mealType] BloodGlucose mealType + * @property {google.devicesandservices.health.v4.BloodGlucose.MeasurementTiming|null} [measurementTiming] BloodGlucose measurementTiming + * @property {google.devicesandservices.health.v4.BloodGlucose.Specimen|null} [specimen] BloodGlucose specimen + * @property {string|null} [notes] BloodGlucose notes + */ + + /** + * Constructs a new BloodGlucose. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a BloodGlucose. + * @implements IBloodGlucose + * @constructor + * @param {google.devicesandservices.health.v4.IBloodGlucose=} [properties] Properties to set + */ + function BloodGlucose(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BloodGlucose sampleTime. + * @member {google.devicesandservices.health.v4.IObservationSampleTime|null|undefined} sampleTime + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @instance + */ + BloodGlucose.prototype.sampleTime = null; + + /** + * BloodGlucose bloodGlucoseMilligramsPerDeciliter. + * @member {number|null|undefined} bloodGlucoseMilligramsPerDeciliter + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @instance + */ + BloodGlucose.prototype.bloodGlucoseMilligramsPerDeciliter = null; + + /** + * BloodGlucose measurementSource. + * @member {google.devicesandservices.health.v4.BloodGlucose.MeasurementSource} measurementSource + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @instance + */ + BloodGlucose.prototype.measurementSource = 0; + + /** + * BloodGlucose mealType. + * @member {google.devicesandservices.health.v4.BloodGlucose.MealType} mealType + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @instance + */ + BloodGlucose.prototype.mealType = 0; + + /** + * BloodGlucose measurementTiming. + * @member {google.devicesandservices.health.v4.BloodGlucose.MeasurementTiming} measurementTiming + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @instance + */ + BloodGlucose.prototype.measurementTiming = 0; + + /** + * BloodGlucose specimen. + * @member {google.devicesandservices.health.v4.BloodGlucose.Specimen} specimen + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @instance + */ + BloodGlucose.prototype.specimen = 0; + + /** + * BloodGlucose notes. + * @member {string} notes + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @instance + */ + BloodGlucose.prototype.notes = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BloodGlucose.prototype, "_bloodGlucoseMilligramsPerDeciliter", { + get: $util.oneOfGetter($oneOfFields = ["bloodGlucoseMilligramsPerDeciliter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BloodGlucose instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @static + * @param {google.devicesandservices.health.v4.IBloodGlucose=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.BloodGlucose} BloodGlucose instance + */ + BloodGlucose.create = function create(properties) { + return new BloodGlucose(properties); + }; + + /** + * Encodes the specified BloodGlucose message. Does not implicitly {@link google.devicesandservices.health.v4.BloodGlucose.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @static + * @param {google.devicesandservices.health.v4.IBloodGlucose} message BloodGlucose message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BloodGlucose.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sampleTime != null && Object.hasOwnProperty.call(message, "sampleTime")) + $root.google.devicesandservices.health.v4.ObservationSampleTime.encode(message.sampleTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bloodGlucoseMilligramsPerDeciliter != null && Object.hasOwnProperty.call(message, "bloodGlucoseMilligramsPerDeciliter")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.bloodGlucoseMilligramsPerDeciliter); + if (message.measurementSource != null && Object.hasOwnProperty.call(message, "measurementSource")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.measurementSource); + if (message.mealType != null && Object.hasOwnProperty.call(message, "mealType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.mealType); + if (message.measurementTiming != null && Object.hasOwnProperty.call(message, "measurementTiming")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.measurementTiming); + if (message.specimen != null && Object.hasOwnProperty.call(message, "specimen")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.specimen); + if (message.notes != null && Object.hasOwnProperty.call(message, "notes")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.notes); + return writer; + }; + + /** + * Encodes the specified BloodGlucose message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BloodGlucose.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @static + * @param {google.devicesandservices.health.v4.IBloodGlucose} message BloodGlucose message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BloodGlucose.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BloodGlucose message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.BloodGlucose} BloodGlucose + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BloodGlucose.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.BloodGlucose(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bloodGlucoseMilligramsPerDeciliter = reader.double(); + break; + } + case 3: { + message.measurementSource = reader.int32(); + break; + } + case 4: { + message.mealType = reader.int32(); + break; + } + case 5: { + message.measurementTiming = reader.int32(); + break; + } + case 6: { + message.specimen = reader.int32(); + break; + } + case 8: { + message.notes = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BloodGlucose message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.BloodGlucose} BloodGlucose + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BloodGlucose.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BloodGlucose message. + * @function verify + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BloodGlucose.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) { + var error = $root.google.devicesandservices.health.v4.ObservationSampleTime.verify(message.sampleTime); + if (error) + return "sampleTime." + error; + } + if (message.bloodGlucoseMilligramsPerDeciliter != null && message.hasOwnProperty("bloodGlucoseMilligramsPerDeciliter")) { + properties._bloodGlucoseMilligramsPerDeciliter = 1; + if (typeof message.bloodGlucoseMilligramsPerDeciliter !== "number") + return "bloodGlucoseMilligramsPerDeciliter: number expected"; + } + if (message.measurementSource != null && message.hasOwnProperty("measurementSource")) + switch (message.measurementSource) { + default: + return "measurementSource: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.mealType != null && message.hasOwnProperty("mealType")) + switch (message.mealType) { + default: + return "mealType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.measurementTiming != null && message.hasOwnProperty("measurementTiming")) + switch (message.measurementTiming) { + default: + return "measurementTiming: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.specimen != null && message.hasOwnProperty("specimen")) + switch (message.specimen) { + default: + return "specimen: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.notes != null && message.hasOwnProperty("notes")) + if (!$util.isString(message.notes)) + return "notes: string expected"; + return null; + }; + + /** + * Creates a BloodGlucose message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.BloodGlucose} BloodGlucose + */ + BloodGlucose.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.BloodGlucose) + return object; + var message = new $root.google.devicesandservices.health.v4.BloodGlucose(); + if (object.sampleTime != null) { + if (typeof object.sampleTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.BloodGlucose.sampleTime: object expected"); + message.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.fromObject(object.sampleTime); + } + if (object.bloodGlucoseMilligramsPerDeciliter != null) + message.bloodGlucoseMilligramsPerDeciliter = Number(object.bloodGlucoseMilligramsPerDeciliter); + switch (object.measurementSource) { + default: + if (typeof object.measurementSource === "number") { + message.measurementSource = object.measurementSource; + break; + } + break; + case "MEASUREMENT_SOURCE_UNSPECIFIED": + case 0: + message.measurementSource = 0; + break; + case "SELF_MONITORING_BLOOD_GLUCOSE": + case 1: + message.measurementSource = 1; + break; + case "CONTINUOUS_GLUCOSE_MONITORING": + case 2: + message.measurementSource = 2; + break; + case "LAB_TEST": + case 3: + message.measurementSource = 3; + break; + } + switch (object.mealType) { + default: + if (typeof object.mealType === "number") { + message.mealType = object.mealType; + break; + } + break; + case "MEAL_TYPE_UNSPECIFIED": + case 0: + message.mealType = 0; + break; + case "BREAKFAST": + case 1: + message.mealType = 1; + break; + case "LUNCH": + case 2: + message.mealType = 2; + break; + case "DINNER": + case 3: + message.mealType = 3; + break; + case "SNACK": + case 4: + message.mealType = 4; + break; + } + switch (object.measurementTiming) { + default: + if (typeof object.measurementTiming === "number") { + message.measurementTiming = object.measurementTiming; + break; + } + break; + case "MEASUREMENT_TIMING_UNSPECIFIED": + case 0: + message.measurementTiming = 0; + break; + case "AFTER_MEAL": + case 1: + message.measurementTiming = 1; + break; + case "BEFORE_MEAL": + case 2: + message.measurementTiming = 2; + break; + case "FASTING": + case 3: + message.measurementTiming = 3; + break; + case "GENERAL": + case 4: + message.measurementTiming = 4; + break; + case "BEFORE_BED": + case 5: + message.measurementTiming = 5; + break; + case "OVER_NIGHT": + case 6: + message.measurementTiming = 6; + break; + } + switch (object.specimen) { + default: + if (typeof object.specimen === "number") { + message.specimen = object.specimen; + break; + } + break; + case "SPECIMEN_UNSPECIFIED": + case 0: + message.specimen = 0; + break; + case "CAPILLARY_BLOOD": + case 1: + message.specimen = 1; + break; + case "INTERSTITIAL_FLUID": + case 2: + message.specimen = 2; + break; + case "PLASMA": + case 3: + message.specimen = 3; + break; + case "SERUM": + case 4: + message.specimen = 4; + break; + case "TEARS": + case 5: + message.specimen = 5; + break; + case "WHOLE_BLOOD": + case 6: + message.specimen = 6; + break; + } + if (object.notes != null) + message.notes = String(object.notes); + return message; + }; + + /** + * Creates a plain object from a BloodGlucose message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @static + * @param {google.devicesandservices.health.v4.BloodGlucose} message BloodGlucose + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BloodGlucose.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sampleTime = null; + object.measurementSource = options.enums === String ? "MEASUREMENT_SOURCE_UNSPECIFIED" : 0; + object.mealType = options.enums === String ? "MEAL_TYPE_UNSPECIFIED" : 0; + object.measurementTiming = options.enums === String ? "MEASUREMENT_TIMING_UNSPECIFIED" : 0; + object.specimen = options.enums === String ? "SPECIMEN_UNSPECIFIED" : 0; + object.notes = ""; + } + if (message.sampleTime != null && message.hasOwnProperty("sampleTime")) + object.sampleTime = $root.google.devicesandservices.health.v4.ObservationSampleTime.toObject(message.sampleTime, options); + if (message.bloodGlucoseMilligramsPerDeciliter != null && message.hasOwnProperty("bloodGlucoseMilligramsPerDeciliter")) { + object.bloodGlucoseMilligramsPerDeciliter = options.json && !isFinite(message.bloodGlucoseMilligramsPerDeciliter) ? String(message.bloodGlucoseMilligramsPerDeciliter) : message.bloodGlucoseMilligramsPerDeciliter; + if (options.oneofs) + object._bloodGlucoseMilligramsPerDeciliter = "bloodGlucoseMilligramsPerDeciliter"; + } + if (message.measurementSource != null && message.hasOwnProperty("measurementSource")) + object.measurementSource = options.enums === String ? $root.google.devicesandservices.health.v4.BloodGlucose.MeasurementSource[message.measurementSource] === undefined ? message.measurementSource : $root.google.devicesandservices.health.v4.BloodGlucose.MeasurementSource[message.measurementSource] : message.measurementSource; + if (message.mealType != null && message.hasOwnProperty("mealType")) + object.mealType = options.enums === String ? $root.google.devicesandservices.health.v4.BloodGlucose.MealType[message.mealType] === undefined ? message.mealType : $root.google.devicesandservices.health.v4.BloodGlucose.MealType[message.mealType] : message.mealType; + if (message.measurementTiming != null && message.hasOwnProperty("measurementTiming")) + object.measurementTiming = options.enums === String ? $root.google.devicesandservices.health.v4.BloodGlucose.MeasurementTiming[message.measurementTiming] === undefined ? message.measurementTiming : $root.google.devicesandservices.health.v4.BloodGlucose.MeasurementTiming[message.measurementTiming] : message.measurementTiming; + if (message.specimen != null && message.hasOwnProperty("specimen")) + object.specimen = options.enums === String ? $root.google.devicesandservices.health.v4.BloodGlucose.Specimen[message.specimen] === undefined ? message.specimen : $root.google.devicesandservices.health.v4.BloodGlucose.Specimen[message.specimen] : message.specimen; + if (message.notes != null && message.hasOwnProperty("notes")) + object.notes = message.notes; + return object; + }; + + /** + * Converts this BloodGlucose to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @instance + * @returns {Object.} JSON object + */ + BloodGlucose.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BloodGlucose + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.BloodGlucose + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BloodGlucose.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.BloodGlucose"; + }; + + /** + * MeasurementSource enum. + * @name google.devicesandservices.health.v4.BloodGlucose.MeasurementSource + * @enum {number} + * @property {number} MEASUREMENT_SOURCE_UNSPECIFIED=0 MEASUREMENT_SOURCE_UNSPECIFIED value + * @property {number} SELF_MONITORING_BLOOD_GLUCOSE=1 SELF_MONITORING_BLOOD_GLUCOSE value + * @property {number} CONTINUOUS_GLUCOSE_MONITORING=2 CONTINUOUS_GLUCOSE_MONITORING value + * @property {number} LAB_TEST=3 LAB_TEST value + */ + BloodGlucose.MeasurementSource = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEASUREMENT_SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SELF_MONITORING_BLOOD_GLUCOSE"] = 1; + values[valuesById[2] = "CONTINUOUS_GLUCOSE_MONITORING"] = 2; + values[valuesById[3] = "LAB_TEST"] = 3; + return values; + })(); + + /** + * MealType enum. + * @name google.devicesandservices.health.v4.BloodGlucose.MealType + * @enum {number} + * @property {number} MEAL_TYPE_UNSPECIFIED=0 MEAL_TYPE_UNSPECIFIED value + * @property {number} BREAKFAST=1 BREAKFAST value + * @property {number} LUNCH=2 LUNCH value + * @property {number} DINNER=3 DINNER value + * @property {number} SNACK=4 SNACK value + */ + BloodGlucose.MealType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEAL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BREAKFAST"] = 1; + values[valuesById[2] = "LUNCH"] = 2; + values[valuesById[3] = "DINNER"] = 3; + values[valuesById[4] = "SNACK"] = 4; + return values; + })(); + + /** + * MeasurementTiming enum. + * @name google.devicesandservices.health.v4.BloodGlucose.MeasurementTiming + * @enum {number} + * @property {number} MEASUREMENT_TIMING_UNSPECIFIED=0 MEASUREMENT_TIMING_UNSPECIFIED value + * @property {number} AFTER_MEAL=1 AFTER_MEAL value + * @property {number} BEFORE_MEAL=2 BEFORE_MEAL value + * @property {number} FASTING=3 FASTING value + * @property {number} GENERAL=4 GENERAL value + * @property {number} BEFORE_BED=5 BEFORE_BED value + * @property {number} OVER_NIGHT=6 OVER_NIGHT value + */ + BloodGlucose.MeasurementTiming = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEASUREMENT_TIMING_UNSPECIFIED"] = 0; + values[valuesById[1] = "AFTER_MEAL"] = 1; + values[valuesById[2] = "BEFORE_MEAL"] = 2; + values[valuesById[3] = "FASTING"] = 3; + values[valuesById[4] = "GENERAL"] = 4; + values[valuesById[5] = "BEFORE_BED"] = 5; + values[valuesById[6] = "OVER_NIGHT"] = 6; + return values; + })(); + + /** + * Specimen enum. + * @name google.devicesandservices.health.v4.BloodGlucose.Specimen + * @enum {number} + * @property {number} SPECIMEN_UNSPECIFIED=0 SPECIMEN_UNSPECIFIED value + * @property {number} CAPILLARY_BLOOD=1 CAPILLARY_BLOOD value + * @property {number} INTERSTITIAL_FLUID=2 INTERSTITIAL_FLUID value + * @property {number} PLASMA=3 PLASMA value + * @property {number} SERUM=4 SERUM value + * @property {number} TEARS=5 TEARS value + * @property {number} WHOLE_BLOOD=6 WHOLE_BLOOD value + */ + BloodGlucose.Specimen = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPECIMEN_UNSPECIFIED"] = 0; + values[valuesById[1] = "CAPILLARY_BLOOD"] = 1; + values[valuesById[2] = "INTERSTITIAL_FLUID"] = 2; + values[valuesById[3] = "PLASMA"] = 3; + values[valuesById[4] = "SERUM"] = 4; + values[valuesById[5] = "TEARS"] = 5; + values[valuesById[6] = "WHOLE_BLOOD"] = 6; + return values; + })(); + + return BloodGlucose; + })(); + + v4.BloodGlucoseRollupValue = (function() { + + /** + * Properties of a BloodGlucoseRollupValue. + * @memberof google.devicesandservices.health.v4 + * @interface IBloodGlucoseRollupValue + * @property {number|null} [bloodGlucoseMilligramsPerDeciliterAvg] BloodGlucoseRollupValue bloodGlucoseMilligramsPerDeciliterAvg + */ + + /** + * Constructs a new BloodGlucoseRollupValue. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a BloodGlucoseRollupValue. + * @implements IBloodGlucoseRollupValue + * @constructor + * @param {google.devicesandservices.health.v4.IBloodGlucoseRollupValue=} [properties] Properties to set + */ + function BloodGlucoseRollupValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BloodGlucoseRollupValue bloodGlucoseMilligramsPerDeciliterAvg. + * @member {number|null|undefined} bloodGlucoseMilligramsPerDeciliterAvg + * @memberof google.devicesandservices.health.v4.BloodGlucoseRollupValue + * @instance + */ + BloodGlucoseRollupValue.prototype.bloodGlucoseMilligramsPerDeciliterAvg = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BloodGlucoseRollupValue.prototype, "_bloodGlucoseMilligramsPerDeciliterAvg", { + get: $util.oneOfGetter($oneOfFields = ["bloodGlucoseMilligramsPerDeciliterAvg"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BloodGlucoseRollupValue instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.BloodGlucoseRollupValue + * @static + * @param {google.devicesandservices.health.v4.IBloodGlucoseRollupValue=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.BloodGlucoseRollupValue} BloodGlucoseRollupValue instance + */ + BloodGlucoseRollupValue.create = function create(properties) { + return new BloodGlucoseRollupValue(properties); + }; + + /** + * Encodes the specified BloodGlucoseRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.BloodGlucoseRollupValue.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.BloodGlucoseRollupValue + * @static + * @param {google.devicesandservices.health.v4.IBloodGlucoseRollupValue} message BloodGlucoseRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BloodGlucoseRollupValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bloodGlucoseMilligramsPerDeciliterAvg != null && Object.hasOwnProperty.call(message, "bloodGlucoseMilligramsPerDeciliterAvg")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.bloodGlucoseMilligramsPerDeciliterAvg); + return writer; + }; + + /** + * Encodes the specified BloodGlucoseRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BloodGlucoseRollupValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.BloodGlucoseRollupValue + * @static + * @param {google.devicesandservices.health.v4.IBloodGlucoseRollupValue} message BloodGlucoseRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BloodGlucoseRollupValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BloodGlucoseRollupValue message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.BloodGlucoseRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.BloodGlucoseRollupValue} BloodGlucoseRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BloodGlucoseRollupValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.BloodGlucoseRollupValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bloodGlucoseMilligramsPerDeciliterAvg = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BloodGlucoseRollupValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.BloodGlucoseRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.BloodGlucoseRollupValue} BloodGlucoseRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BloodGlucoseRollupValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BloodGlucoseRollupValue message. + * @function verify + * @memberof google.devicesandservices.health.v4.BloodGlucoseRollupValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BloodGlucoseRollupValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bloodGlucoseMilligramsPerDeciliterAvg != null && message.hasOwnProperty("bloodGlucoseMilligramsPerDeciliterAvg")) { + properties._bloodGlucoseMilligramsPerDeciliterAvg = 1; + if (typeof message.bloodGlucoseMilligramsPerDeciliterAvg !== "number") + return "bloodGlucoseMilligramsPerDeciliterAvg: number expected"; + } + return null; + }; + + /** + * Creates a BloodGlucoseRollupValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.BloodGlucoseRollupValue + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.BloodGlucoseRollupValue} BloodGlucoseRollupValue + */ + BloodGlucoseRollupValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.BloodGlucoseRollupValue) + return object; + var message = new $root.google.devicesandservices.health.v4.BloodGlucoseRollupValue(); + if (object.bloodGlucoseMilligramsPerDeciliterAvg != null) + message.bloodGlucoseMilligramsPerDeciliterAvg = Number(object.bloodGlucoseMilligramsPerDeciliterAvg); + return message; + }; + + /** + * Creates a plain object from a BloodGlucoseRollupValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.BloodGlucoseRollupValue + * @static + * @param {google.devicesandservices.health.v4.BloodGlucoseRollupValue} message BloodGlucoseRollupValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BloodGlucoseRollupValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.bloodGlucoseMilligramsPerDeciliterAvg != null && message.hasOwnProperty("bloodGlucoseMilligramsPerDeciliterAvg")) { + object.bloodGlucoseMilligramsPerDeciliterAvg = options.json && !isFinite(message.bloodGlucoseMilligramsPerDeciliterAvg) ? String(message.bloodGlucoseMilligramsPerDeciliterAvg) : message.bloodGlucoseMilligramsPerDeciliterAvg; + if (options.oneofs) + object._bloodGlucoseMilligramsPerDeciliterAvg = "bloodGlucoseMilligramsPerDeciliterAvg"; + } + return object; + }; + + /** + * Converts this BloodGlucoseRollupValue to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.BloodGlucoseRollupValue + * @instance + * @returns {Object.} JSON object + */ + BloodGlucoseRollupValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BloodGlucoseRollupValue + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.BloodGlucoseRollupValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BloodGlucoseRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.BloodGlucoseRollupValue"; + }; + + return BloodGlucoseRollupValue; + })(); + + v4.SedentaryPeriod = (function() { + + /** + * Properties of a SedentaryPeriod. + * @memberof google.devicesandservices.health.v4 + * @interface ISedentaryPeriod + * @property {google.devicesandservices.health.v4.IObservationTimeInterval|null} [interval] SedentaryPeriod interval + */ + + /** + * Constructs a new SedentaryPeriod. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a SedentaryPeriod. + * @implements ISedentaryPeriod + * @constructor + * @param {google.devicesandservices.health.v4.ISedentaryPeriod=} [properties] Properties to set + */ + function SedentaryPeriod(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SedentaryPeriod interval. + * @member {google.devicesandservices.health.v4.IObservationTimeInterval|null|undefined} interval + * @memberof google.devicesandservices.health.v4.SedentaryPeriod + * @instance + */ + SedentaryPeriod.prototype.interval = null; + + /** + * Creates a new SedentaryPeriod instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.SedentaryPeriod + * @static + * @param {google.devicesandservices.health.v4.ISedentaryPeriod=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.SedentaryPeriod} SedentaryPeriod instance + */ + SedentaryPeriod.create = function create(properties) { + return new SedentaryPeriod(properties); + }; + + /** + * Encodes the specified SedentaryPeriod message. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriod.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.SedentaryPeriod + * @static + * @param {google.devicesandservices.health.v4.ISedentaryPeriod} message SedentaryPeriod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SedentaryPeriod.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.devicesandservices.health.v4.ObservationTimeInterval.encode(message.interval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SedentaryPeriod message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.SedentaryPeriod + * @static + * @param {google.devicesandservices.health.v4.ISedentaryPeriod} message SedentaryPeriod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SedentaryPeriod.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SedentaryPeriod message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.SedentaryPeriod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.SedentaryPeriod} SedentaryPeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SedentaryPeriod.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.SedentaryPeriod(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SedentaryPeriod message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.SedentaryPeriod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.SedentaryPeriod} SedentaryPeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SedentaryPeriod.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SedentaryPeriod message. + * @function verify + * @memberof google.devicesandservices.health.v4.SedentaryPeriod + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SedentaryPeriod.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interval != null && message.hasOwnProperty("interval")) { + var error = $root.google.devicesandservices.health.v4.ObservationTimeInterval.verify(message.interval); + if (error) + return "interval." + error; + } + return null; + }; + + /** + * Creates a SedentaryPeriod message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.SedentaryPeriod + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.SedentaryPeriod} SedentaryPeriod + */ + SedentaryPeriod.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.SedentaryPeriod) + return object; + var message = new $root.google.devicesandservices.health.v4.SedentaryPeriod(); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.devicesandservices.health.v4.SedentaryPeriod.interval: object expected"); + message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.fromObject(object.interval); + } + return message; + }; + + /** + * Creates a plain object from a SedentaryPeriod message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.SedentaryPeriod + * @static + * @param {google.devicesandservices.health.v4.SedentaryPeriod} message SedentaryPeriod + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SedentaryPeriod.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.interval = null; + if (message.interval != null && message.hasOwnProperty("interval")) + object.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.toObject(message.interval, options); + return object; + }; + + /** + * Converts this SedentaryPeriod to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.SedentaryPeriod + * @instance + * @returns {Object.} JSON object + */ + SedentaryPeriod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SedentaryPeriod + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.SedentaryPeriod + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SedentaryPeriod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.SedentaryPeriod"; + }; + + return SedentaryPeriod; + })(); + + v4.SedentaryPeriodRollupValue = (function() { + + /** + * Properties of a SedentaryPeriodRollupValue. + * @memberof google.devicesandservices.health.v4 + * @interface ISedentaryPeriodRollupValue + * @property {google.protobuf.IDuration|null} [durationSum] SedentaryPeriodRollupValue durationSum + */ + + /** + * Constructs a new SedentaryPeriodRollupValue. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a SedentaryPeriodRollupValue. + * @implements ISedentaryPeriodRollupValue + * @constructor + * @param {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue=} [properties] Properties to set + */ + function SedentaryPeriodRollupValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SedentaryPeriodRollupValue durationSum. + * @member {google.protobuf.IDuration|null|undefined} durationSum + * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue + * @instance + */ + SedentaryPeriodRollupValue.prototype.durationSum = null; + + /** + * Creates a new SedentaryPeriodRollupValue instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue + * @static + * @param {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.SedentaryPeriodRollupValue} SedentaryPeriodRollupValue instance + */ + SedentaryPeriodRollupValue.create = function create(properties) { + return new SedentaryPeriodRollupValue(properties); + }; + + /** + * Encodes the specified SedentaryPeriodRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriodRollupValue.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue + * @static + * @param {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue} message SedentaryPeriodRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SedentaryPeriodRollupValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.durationSum != null && Object.hasOwnProperty.call(message, "durationSum")) + $root.google.protobuf.Duration.encode(message.durationSum, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SedentaryPeriodRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SedentaryPeriodRollupValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue + * @static + * @param {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue} message SedentaryPeriodRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SedentaryPeriodRollupValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SedentaryPeriodRollupValue message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.SedentaryPeriodRollupValue} SedentaryPeriodRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SedentaryPeriodRollupValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.durationSum = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SedentaryPeriodRollupValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.SedentaryPeriodRollupValue} SedentaryPeriodRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SedentaryPeriodRollupValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SedentaryPeriodRollupValue message. + * @function verify + * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SedentaryPeriodRollupValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.durationSum != null && message.hasOwnProperty("durationSum")) { + var error = $root.google.protobuf.Duration.verify(message.durationSum); + if (error) + return "durationSum." + error; + } + return null; + }; + + /** + * Creates a SedentaryPeriodRollupValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.SedentaryPeriodRollupValue} SedentaryPeriodRollupValue + */ + SedentaryPeriodRollupValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue) + return object; + var message = new $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue(); + if (object.durationSum != null) { + if (typeof object.durationSum !== "object") + throw TypeError(".google.devicesandservices.health.v4.SedentaryPeriodRollupValue.durationSum: object expected"); + message.durationSum = $root.google.protobuf.Duration.fromObject(object.durationSum); + } + return message; + }; + + /** + * Creates a plain object from a SedentaryPeriodRollupValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue + * @static + * @param {google.devicesandservices.health.v4.SedentaryPeriodRollupValue} message SedentaryPeriodRollupValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SedentaryPeriodRollupValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.durationSum = null; + if (message.durationSum != null && message.hasOwnProperty("durationSum")) + object.durationSum = $root.google.protobuf.Duration.toObject(message.durationSum, options); + return object; + }; + + /** + * Converts this SedentaryPeriodRollupValue to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue + * @instance + * @returns {Object.} JSON object + */ + SedentaryPeriodRollupValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SedentaryPeriodRollupValue + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.SedentaryPeriodRollupValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SedentaryPeriodRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.SedentaryPeriodRollupValue"; + }; + + return SedentaryPeriodRollupValue; + })(); + + v4.ActiveEnergyBurned = (function() { + + /** + * Properties of an ActiveEnergyBurned. + * @memberof google.devicesandservices.health.v4 + * @interface IActiveEnergyBurned + * @property {google.devicesandservices.health.v4.IObservationTimeInterval|null} [interval] ActiveEnergyBurned interval + * @property {number|null} [kcal] ActiveEnergyBurned kcal + */ + + /** + * Constructs a new ActiveEnergyBurned. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents an ActiveEnergyBurned. + * @implements IActiveEnergyBurned + * @constructor + * @param {google.devicesandservices.health.v4.IActiveEnergyBurned=} [properties] Properties to set + */ + function ActiveEnergyBurned(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActiveEnergyBurned interval. + * @member {google.devicesandservices.health.v4.IObservationTimeInterval|null|undefined} interval + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurned + * @instance + */ + ActiveEnergyBurned.prototype.interval = null; + + /** + * ActiveEnergyBurned kcal. + * @member {number|null|undefined} kcal + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurned + * @instance + */ + ActiveEnergyBurned.prototype.kcal = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ActiveEnergyBurned.prototype, "_kcal", { + get: $util.oneOfGetter($oneOfFields = ["kcal"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ActiveEnergyBurned instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurned + * @static + * @param {google.devicesandservices.health.v4.IActiveEnergyBurned=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ActiveEnergyBurned} ActiveEnergyBurned instance + */ + ActiveEnergyBurned.create = function create(properties) { + return new ActiveEnergyBurned(properties); + }; + + /** + * Encodes the specified ActiveEnergyBurned message. Does not implicitly {@link google.devicesandservices.health.v4.ActiveEnergyBurned.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurned + * @static + * @param {google.devicesandservices.health.v4.IActiveEnergyBurned} message ActiveEnergyBurned message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActiveEnergyBurned.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.devicesandservices.health.v4.ObservationTimeInterval.encode(message.interval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.kcal != null && Object.hasOwnProperty.call(message, "kcal")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.kcal); + return writer; + }; + + /** + * Encodes the specified ActiveEnergyBurned message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ActiveEnergyBurned.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurned + * @static + * @param {google.devicesandservices.health.v4.IActiveEnergyBurned} message ActiveEnergyBurned message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActiveEnergyBurned.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActiveEnergyBurned message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurned + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.ActiveEnergyBurned} ActiveEnergyBurned + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActiveEnergyBurned.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ActiveEnergyBurned(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.decode(reader, reader.uint32()); + break; + } + case 2: { + message.kcal = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActiveEnergyBurned message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurned + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.ActiveEnergyBurned} ActiveEnergyBurned + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActiveEnergyBurned.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActiveEnergyBurned message. + * @function verify + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurned + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActiveEnergyBurned.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.interval != null && message.hasOwnProperty("interval")) { + var error = $root.google.devicesandservices.health.v4.ObservationTimeInterval.verify(message.interval); + if (error) + return "interval." + error; + } + if (message.kcal != null && message.hasOwnProperty("kcal")) { + properties._kcal = 1; + if (typeof message.kcal !== "number") + return "kcal: number expected"; + } + return null; + }; + + /** + * Creates an ActiveEnergyBurned message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurned + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.ActiveEnergyBurned} ActiveEnergyBurned + */ + ActiveEnergyBurned.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ActiveEnergyBurned) + return object; + var message = new $root.google.devicesandservices.health.v4.ActiveEnergyBurned(); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.devicesandservices.health.v4.ActiveEnergyBurned.interval: object expected"); + message.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.fromObject(object.interval); + } + if (object.kcal != null) + message.kcal = Number(object.kcal); + return message; + }; + + /** + * Creates a plain object from an ActiveEnergyBurned message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurned + * @static + * @param {google.devicesandservices.health.v4.ActiveEnergyBurned} message ActiveEnergyBurned + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActiveEnergyBurned.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.interval = null; + if (message.interval != null && message.hasOwnProperty("interval")) + object.interval = $root.google.devicesandservices.health.v4.ObservationTimeInterval.toObject(message.interval, options); + if (message.kcal != null && message.hasOwnProperty("kcal")) { + object.kcal = options.json && !isFinite(message.kcal) ? String(message.kcal) : message.kcal; + if (options.oneofs) + object._kcal = "kcal"; + } + return object; + }; + + /** + * Converts this ActiveEnergyBurned to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurned + * @instance + * @returns {Object.} JSON object + */ + ActiveEnergyBurned.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActiveEnergyBurned + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurned + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActiveEnergyBurned.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.ActiveEnergyBurned"; + }; + + return ActiveEnergyBurned; + })(); + + v4.ActiveEnergyBurnedRollupValue = (function() { + + /** + * Properties of an ActiveEnergyBurnedRollupValue. + * @memberof google.devicesandservices.health.v4 + * @interface IActiveEnergyBurnedRollupValue + * @property {number|null} [kcalSum] ActiveEnergyBurnedRollupValue kcalSum + */ + + /** + * Constructs a new ActiveEnergyBurnedRollupValue. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents an ActiveEnergyBurnedRollupValue. + * @implements IActiveEnergyBurnedRollupValue + * @constructor + * @param {google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue=} [properties] Properties to set + */ + function ActiveEnergyBurnedRollupValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActiveEnergyBurnedRollupValue kcalSum. + * @member {number|null|undefined} kcalSum + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue + * @instance + */ + ActiveEnergyBurnedRollupValue.prototype.kcalSum = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ActiveEnergyBurnedRollupValue.prototype, "_kcalSum", { + get: $util.oneOfGetter($oneOfFields = ["kcalSum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ActiveEnergyBurnedRollupValue instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue + * @static + * @param {google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue} ActiveEnergyBurnedRollupValue instance + */ + ActiveEnergyBurnedRollupValue.create = function create(properties) { + return new ActiveEnergyBurnedRollupValue(properties); + }; + + /** + * Encodes the specified ActiveEnergyBurnedRollupValue message. Does not implicitly {@link google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue + * @static + * @param {google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue} message ActiveEnergyBurnedRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActiveEnergyBurnedRollupValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kcalSum != null && Object.hasOwnProperty.call(message, "kcalSum")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.kcalSum); + return writer; + }; + + /** + * Encodes the specified ActiveEnergyBurnedRollupValue message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue + * @static + * @param {google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue} message ActiveEnergyBurnedRollupValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActiveEnergyBurnedRollupValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActiveEnergyBurnedRollupValue message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue} ActiveEnergyBurnedRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActiveEnergyBurnedRollupValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kcalSum = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActiveEnergyBurnedRollupValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue} ActiveEnergyBurnedRollupValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActiveEnergyBurnedRollupValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActiveEnergyBurnedRollupValue message. + * @function verify + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActiveEnergyBurnedRollupValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.kcalSum != null && message.hasOwnProperty("kcalSum")) { + properties._kcalSum = 1; + if (typeof message.kcalSum !== "number") + return "kcalSum: number expected"; + } + return null; + }; + + /** + * Creates an ActiveEnergyBurnedRollupValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue} ActiveEnergyBurnedRollupValue + */ + ActiveEnergyBurnedRollupValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue) + return object; + var message = new $root.google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue(); + if (object.kcalSum != null) + message.kcalSum = Number(object.kcalSum); + return message; + }; + + /** + * Creates a plain object from an ActiveEnergyBurnedRollupValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue + * @static + * @param {google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue} message ActiveEnergyBurnedRollupValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActiveEnergyBurnedRollupValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.kcalSum != null && message.hasOwnProperty("kcalSum")) { + object.kcalSum = options.json && !isFinite(message.kcalSum) ? String(message.kcalSum) : message.kcalSum; + if (options.oneofs) + object._kcalSum = "kcalSum"; + } + return object; + }; + + /** + * Converts this ActiveEnergyBurnedRollupValue to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue + * @instance + * @returns {Object.} JSON object + */ + ActiveEnergyBurnedRollupValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActiveEnergyBurnedRollupValue + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActiveEnergyBurnedRollupValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue"; + }; + + return ActiveEnergyBurnedRollupValue; + })(); + + v4.MedicalDeviceInfo = (function() { + + /** + * Properties of a MedicalDeviceInfo. + * @memberof google.devicesandservices.health.v4 + * @interface IMedicalDeviceInfo + * @property {string|null} [algorithmVersion] MedicalDeviceInfo algorithmVersion + * @property {string|null} [serviceVersion] MedicalDeviceInfo serviceVersion + * @property {string|null} [firmwareVersion] MedicalDeviceInfo firmwareVersion + * @property {string|null} [featureVersion] MedicalDeviceInfo featureVersion + * @property {string|null} [deviceModel] MedicalDeviceInfo deviceModel + */ + + /** + * Constructs a new MedicalDeviceInfo. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a MedicalDeviceInfo. + * @implements IMedicalDeviceInfo + * @constructor + * @param {google.devicesandservices.health.v4.IMedicalDeviceInfo=} [properties] Properties to set + */ + function MedicalDeviceInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MedicalDeviceInfo algorithmVersion. + * @member {string} algorithmVersion + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @instance + */ + MedicalDeviceInfo.prototype.algorithmVersion = ""; + + /** + * MedicalDeviceInfo serviceVersion. + * @member {string} serviceVersion + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @instance + */ + MedicalDeviceInfo.prototype.serviceVersion = ""; + + /** + * MedicalDeviceInfo firmwareVersion. + * @member {string} firmwareVersion + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @instance + */ + MedicalDeviceInfo.prototype.firmwareVersion = ""; + + /** + * MedicalDeviceInfo featureVersion. + * @member {string} featureVersion + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @instance + */ + MedicalDeviceInfo.prototype.featureVersion = ""; + + /** + * MedicalDeviceInfo deviceModel. + * @member {string} deviceModel + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @instance + */ + MedicalDeviceInfo.prototype.deviceModel = ""; + + /** + * Creates a new MedicalDeviceInfo instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @static + * @param {google.devicesandservices.health.v4.IMedicalDeviceInfo=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.MedicalDeviceInfo} MedicalDeviceInfo instance + */ + MedicalDeviceInfo.create = function create(properties) { + return new MedicalDeviceInfo(properties); + }; + + /** + * Encodes the specified MedicalDeviceInfo message. Does not implicitly {@link google.devicesandservices.health.v4.MedicalDeviceInfo.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @static + * @param {google.devicesandservices.health.v4.IMedicalDeviceInfo} message MedicalDeviceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MedicalDeviceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.algorithmVersion != null && Object.hasOwnProperty.call(message, "algorithmVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.algorithmVersion); + if (message.serviceVersion != null && Object.hasOwnProperty.call(message, "serviceVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceVersion); + if (message.firmwareVersion != null && Object.hasOwnProperty.call(message, "firmwareVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.firmwareVersion); + if (message.featureVersion != null && Object.hasOwnProperty.call(message, "featureVersion")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.featureVersion); + if (message.deviceModel != null && Object.hasOwnProperty.call(message, "deviceModel")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.deviceModel); + return writer; + }; + + /** + * Encodes the specified MedicalDeviceInfo message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.MedicalDeviceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @static + * @param {google.devicesandservices.health.v4.IMedicalDeviceInfo} message MedicalDeviceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MedicalDeviceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MedicalDeviceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.MedicalDeviceInfo} MedicalDeviceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MedicalDeviceInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.MedicalDeviceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.algorithmVersion = reader.string(); + break; + } + case 2: { + message.serviceVersion = reader.string(); + break; + } + case 3: { + message.firmwareVersion = reader.string(); + break; + } + case 4: { + message.featureVersion = reader.string(); + break; + } + case 5: { + message.deviceModel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MedicalDeviceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.MedicalDeviceInfo} MedicalDeviceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MedicalDeviceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MedicalDeviceInfo message. + * @function verify + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MedicalDeviceInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.algorithmVersion != null && message.hasOwnProperty("algorithmVersion")) + if (!$util.isString(message.algorithmVersion)) + return "algorithmVersion: string expected"; + if (message.serviceVersion != null && message.hasOwnProperty("serviceVersion")) + if (!$util.isString(message.serviceVersion)) + return "serviceVersion: string expected"; + if (message.firmwareVersion != null && message.hasOwnProperty("firmwareVersion")) + if (!$util.isString(message.firmwareVersion)) + return "firmwareVersion: string expected"; + if (message.featureVersion != null && message.hasOwnProperty("featureVersion")) + if (!$util.isString(message.featureVersion)) + return "featureVersion: string expected"; + if (message.deviceModel != null && message.hasOwnProperty("deviceModel")) + if (!$util.isString(message.deviceModel)) + return "deviceModel: string expected"; + return null; + }; + + /** + * Creates a MedicalDeviceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.MedicalDeviceInfo} MedicalDeviceInfo + */ + MedicalDeviceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.MedicalDeviceInfo) + return object; + var message = new $root.google.devicesandservices.health.v4.MedicalDeviceInfo(); + if (object.algorithmVersion != null) + message.algorithmVersion = String(object.algorithmVersion); + if (object.serviceVersion != null) + message.serviceVersion = String(object.serviceVersion); + if (object.firmwareVersion != null) + message.firmwareVersion = String(object.firmwareVersion); + if (object.featureVersion != null) + message.featureVersion = String(object.featureVersion); + if (object.deviceModel != null) + message.deviceModel = String(object.deviceModel); + return message; + }; + + /** + * Creates a plain object from a MedicalDeviceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @static + * @param {google.devicesandservices.health.v4.MedicalDeviceInfo} message MedicalDeviceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MedicalDeviceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.algorithmVersion = ""; + object.serviceVersion = ""; + object.firmwareVersion = ""; + object.featureVersion = ""; + object.deviceModel = ""; + } + if (message.algorithmVersion != null && message.hasOwnProperty("algorithmVersion")) + object.algorithmVersion = message.algorithmVersion; + if (message.serviceVersion != null && message.hasOwnProperty("serviceVersion")) + object.serviceVersion = message.serviceVersion; + if (message.firmwareVersion != null && message.hasOwnProperty("firmwareVersion")) + object.firmwareVersion = message.firmwareVersion; + if (message.featureVersion != null && message.hasOwnProperty("featureVersion")) + object.featureVersion = message.featureVersion; + if (message.deviceModel != null && message.hasOwnProperty("deviceModel")) + object.deviceModel = message.deviceModel; + return object; + }; + + /** + * Converts this MedicalDeviceInfo to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @instance + * @returns {Object.} JSON object + */ + MedicalDeviceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MedicalDeviceInfo + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.MedicalDeviceInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MedicalDeviceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.MedicalDeviceInfo"; + }; + + return MedicalDeviceInfo; + })(); + + v4.DataPointsService = (function() { + + /** + * Constructs a new DataPointsService service. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a DataPointsService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function DataPointsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DataPointsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DataPointsService; + + /** + * Creates new DataPointsService service using the specified rpc implementation. + * @function create + * @memberof google.devicesandservices.health.v4.DataPointsService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {DataPointsService} RPC service. Useful where requests and/or responses are streamed. + */ + DataPointsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|getDataPoint}. + * @memberof google.devicesandservices.health.v4.DataPointsService + * @typedef GetDataPointCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.DataPoint} [response] DataPoint + */ + + /** + * Calls GetDataPoint. + * @function getDataPoint + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IGetDataPointRequest} request GetDataPointRequest message or plain object + * @param {google.devicesandservices.health.v4.DataPointsService.GetDataPointCallback} callback Node-style callback called with the error, if any, and DataPoint + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPointsService.prototype.getDataPoint = function getDataPoint(request, callback) { + return this.rpcCall(getDataPoint, $root.google.devicesandservices.health.v4.GetDataPointRequest, $root.google.devicesandservices.health.v4.DataPoint, request, callback); + }, "name", { value: "GetDataPoint" }); + + /** + * Calls GetDataPoint. + * @function getDataPoint + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IGetDataPointRequest} request GetDataPointRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|listDataPoints}. + * @memberof google.devicesandservices.health.v4.DataPointsService + * @typedef ListDataPointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.ListDataPointsResponse} [response] ListDataPointsResponse + */ + + /** + * Calls ListDataPoints. + * @function listDataPoints + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IListDataPointsRequest} request ListDataPointsRequest message or plain object + * @param {google.devicesandservices.health.v4.DataPointsService.ListDataPointsCallback} callback Node-style callback called with the error, if any, and ListDataPointsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPointsService.prototype.listDataPoints = function listDataPoints(request, callback) { + return this.rpcCall(listDataPoints, $root.google.devicesandservices.health.v4.ListDataPointsRequest, $root.google.devicesandservices.health.v4.ListDataPointsResponse, request, callback); + }, "name", { value: "ListDataPoints" }); + + /** + * Calls ListDataPoints. + * @function listDataPoints + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IListDataPointsRequest} request ListDataPointsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|createDataPoint}. + * @memberof google.devicesandservices.health.v4.DataPointsService + * @typedef CreateDataPointCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateDataPoint. + * @function createDataPoint + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.ICreateDataPointRequest} request CreateDataPointRequest message or plain object + * @param {google.devicesandservices.health.v4.DataPointsService.CreateDataPointCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPointsService.prototype.createDataPoint = function createDataPoint(request, callback) { + return this.rpcCall(createDataPoint, $root.google.devicesandservices.health.v4.CreateDataPointRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDataPoint" }); + + /** + * Calls CreateDataPoint. + * @function createDataPoint + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.ICreateDataPointRequest} request CreateDataPointRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|updateDataPoint}. + * @memberof google.devicesandservices.health.v4.DataPointsService + * @typedef UpdateDataPointCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDataPoint. + * @function updateDataPoint + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IUpdateDataPointRequest} request UpdateDataPointRequest message or plain object + * @param {google.devicesandservices.health.v4.DataPointsService.UpdateDataPointCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPointsService.prototype.updateDataPoint = function updateDataPoint(request, callback) { + return this.rpcCall(updateDataPoint, $root.google.devicesandservices.health.v4.UpdateDataPointRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDataPoint" }); + + /** + * Calls UpdateDataPoint. + * @function updateDataPoint + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IUpdateDataPointRequest} request UpdateDataPointRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|batchDeleteDataPoints}. + * @memberof google.devicesandservices.health.v4.DataPointsService + * @typedef BatchDeleteDataPointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchDeleteDataPoints. + * @function batchDeleteDataPoints + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest} request BatchDeleteDataPointsRequest message or plain object + * @param {google.devicesandservices.health.v4.DataPointsService.BatchDeleteDataPointsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPointsService.prototype.batchDeleteDataPoints = function batchDeleteDataPoints(request, callback) { + return this.rpcCall(batchDeleteDataPoints, $root.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchDeleteDataPoints" }); + + /** + * Calls BatchDeleteDataPoints. + * @function batchDeleteDataPoints + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest} request BatchDeleteDataPointsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|reconcileDataPoints}. + * @memberof google.devicesandservices.health.v4.DataPointsService + * @typedef ReconcileDataPointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.ReconcileDataPointsResponse} [response] ReconcileDataPointsResponse + */ + + /** + * Calls ReconcileDataPoints. + * @function reconcileDataPoints + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IReconcileDataPointsRequest} request ReconcileDataPointsRequest message or plain object + * @param {google.devicesandservices.health.v4.DataPointsService.ReconcileDataPointsCallback} callback Node-style callback called with the error, if any, and ReconcileDataPointsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPointsService.prototype.reconcileDataPoints = function reconcileDataPoints(request, callback) { + return this.rpcCall(reconcileDataPoints, $root.google.devicesandservices.health.v4.ReconcileDataPointsRequest, $root.google.devicesandservices.health.v4.ReconcileDataPointsResponse, request, callback); + }, "name", { value: "ReconcileDataPoints" }); + + /** + * Calls ReconcileDataPoints. + * @function reconcileDataPoints + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IReconcileDataPointsRequest} request ReconcileDataPointsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|rollUpDataPoints}. + * @memberof google.devicesandservices.health.v4.DataPointsService + * @typedef RollUpDataPointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.RollUpDataPointsResponse} [response] RollUpDataPointsResponse + */ + + /** + * Calls RollUpDataPoints. + * @function rollUpDataPoints + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IRollUpDataPointsRequest} request RollUpDataPointsRequest message or plain object + * @param {google.devicesandservices.health.v4.DataPointsService.RollUpDataPointsCallback} callback Node-style callback called with the error, if any, and RollUpDataPointsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPointsService.prototype.rollUpDataPoints = function rollUpDataPoints(request, callback) { + return this.rpcCall(rollUpDataPoints, $root.google.devicesandservices.health.v4.RollUpDataPointsRequest, $root.google.devicesandservices.health.v4.RollUpDataPointsResponse, request, callback); + }, "name", { value: "RollUpDataPoints" }); + + /** + * Calls RollUpDataPoints. + * @function rollUpDataPoints + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IRollUpDataPointsRequest} request RollUpDataPointsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|dailyRollUpDataPoints}. + * @memberof google.devicesandservices.health.v4.DataPointsService + * @typedef DailyRollUpDataPointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.DailyRollUpDataPointsResponse} [response] DailyRollUpDataPointsResponse + */ + + /** + * Calls DailyRollUpDataPoints. + * @function dailyRollUpDataPoints + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest} request DailyRollUpDataPointsRequest message or plain object + * @param {google.devicesandservices.health.v4.DataPointsService.DailyRollUpDataPointsCallback} callback Node-style callback called with the error, if any, and DailyRollUpDataPointsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPointsService.prototype.dailyRollUpDataPoints = function dailyRollUpDataPoints(request, callback) { + return this.rpcCall(dailyRollUpDataPoints, $root.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest, $root.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse, request, callback); + }, "name", { value: "DailyRollUpDataPoints" }); + + /** + * Calls DailyRollUpDataPoints. + * @function dailyRollUpDataPoints + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest} request DailyRollUpDataPointsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataPointsService|exportExerciseTcx}. + * @memberof google.devicesandservices.health.v4.DataPointsService + * @typedef ExportExerciseTcxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.ExportExerciseTcxResponse} [response] ExportExerciseTcxResponse + */ + + /** + * Calls ExportExerciseTcx. + * @function exportExerciseTcx + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IExportExerciseTcxRequest} request ExportExerciseTcxRequest message or plain object + * @param {google.devicesandservices.health.v4.DataPointsService.ExportExerciseTcxCallback} callback Node-style callback called with the error, if any, and ExportExerciseTcxResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPointsService.prototype.exportExerciseTcx = function exportExerciseTcx(request, callback) { + return this.rpcCall(exportExerciseTcx, $root.google.devicesandservices.health.v4.ExportExerciseTcxRequest, $root.google.devicesandservices.health.v4.ExportExerciseTcxResponse, request, callback); + }, "name", { value: "ExportExerciseTcx" }); + + /** + * Calls ExportExerciseTcx. + * @function exportExerciseTcx + * @memberof google.devicesandservices.health.v4.DataPointsService + * @instance + * @param {google.devicesandservices.health.v4.IExportExerciseTcxRequest} request ExportExerciseTcxRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DataPointsService; + })(); + + v4.DataPoint = (function() { + + /** + * Properties of a DataPoint. + * @memberof google.devicesandservices.health.v4 + * @interface IDataPoint + * @property {google.devicesandservices.health.v4.ISteps|null} [steps] DataPoint steps + * @property {google.devicesandservices.health.v4.IFloors|null} [floors] DataPoint floors + * @property {google.devicesandservices.health.v4.IHeartRate|null} [heartRate] DataPoint heartRate + * @property {google.devicesandservices.health.v4.ISleep|null} [sleep] DataPoint sleep + * @property {google.devicesandservices.health.v4.IDailyRestingHeartRate|null} [dailyRestingHeartRate] DataPoint dailyRestingHeartRate + * @property {google.devicesandservices.health.v4.IDailyHeartRateVariability|null} [dailyHeartRateVariability] DataPoint dailyHeartRateVariability + * @property {google.devicesandservices.health.v4.IExercise|null} [exercise] DataPoint exercise + * @property {google.devicesandservices.health.v4.IWeight|null} [weight] DataPoint weight + * @property {google.devicesandservices.health.v4.IAltitude|null} [altitude] DataPoint altitude + * @property {google.devicesandservices.health.v4.IDistance|null} [distance] DataPoint distance + * @property {google.devicesandservices.health.v4.IBodyFat|null} [bodyFat] DataPoint bodyFat + * @property {google.devicesandservices.health.v4.IActiveZoneMinutes|null} [activeZoneMinutes] DataPoint activeZoneMinutes + * @property {google.devicesandservices.health.v4.IHeartRateVariability|null} [heartRateVariability] DataPoint heartRateVariability + * @property {google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null} [dailySleepTemperatureDerivations] DataPoint dailySleepTemperatureDerivations + * @property {google.devicesandservices.health.v4.ISedentaryPeriod|null} [sedentaryPeriod] DataPoint sedentaryPeriod + * @property {google.devicesandservices.health.v4.IRunVO2Max|null} [runVo2Max] DataPoint runVo2Max + * @property {google.devicesandservices.health.v4.IOxygenSaturation|null} [oxygenSaturation] DataPoint oxygenSaturation + * @property {google.devicesandservices.health.v4.IDailyOxygenSaturation|null} [dailyOxygenSaturation] DataPoint dailyOxygenSaturation + * @property {google.devicesandservices.health.v4.IActivityLevel|null} [activityLevel] DataPoint activityLevel + * @property {google.devicesandservices.health.v4.IVO2Max|null} [vo2Max] DataPoint vo2Max + * @property {google.devicesandservices.health.v4.IDailyVO2Max|null} [dailyVo2Max] DataPoint dailyVo2Max + * @property {google.devicesandservices.health.v4.INutritionLog|null} [nutritionLog] DataPoint nutritionLog + * @property {google.devicesandservices.health.v4.IIrregularRhythmNotification|null} [irregularRhythmNotification] DataPoint irregularRhythmNotification + * @property {google.devicesandservices.health.v4.IElectrocardiogram|null} [electrocardiogram] DataPoint electrocardiogram + * @property {google.devicesandservices.health.v4.IDailyHeartRateZones|null} [dailyHeartRateZones] DataPoint dailyHeartRateZones + * @property {google.devicesandservices.health.v4.IHydrationLog|null} [hydrationLog] DataPoint hydrationLog + * @property {google.devicesandservices.health.v4.IFood|null} [food] DataPoint food + * @property {google.devicesandservices.health.v4.ITimeInHeartRateZone|null} [timeInHeartRateZone] DataPoint timeInHeartRateZone + * @property {google.devicesandservices.health.v4.IActiveMinutes|null} [activeMinutes] DataPoint activeMinutes + * @property {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null} [respiratoryRateSleepSummary] DataPoint respiratoryRateSleepSummary + * @property {google.devicesandservices.health.v4.IDailyRespiratoryRate|null} [dailyRespiratoryRate] DataPoint dailyRespiratoryRate + * @property {google.devicesandservices.health.v4.ISwimLengthsData|null} [swimLengthsData] DataPoint swimLengthsData + * @property {google.devicesandservices.health.v4.IHeight|null} [height] DataPoint height + * @property {google.devicesandservices.health.v4.IBasalEnergyBurned|null} [basalEnergyBurned] DataPoint basalEnergyBurned + * @property {google.devicesandservices.health.v4.ICoreBodyTemperature|null} [coreBodyTemperature] DataPoint coreBodyTemperature + * @property {google.devicesandservices.health.v4.IActiveEnergyBurned|null} [activeEnergyBurned] DataPoint activeEnergyBurned + * @property {google.devicesandservices.health.v4.IFoodMeasurementUnit|null} [foodMeasurementUnit] DataPoint foodMeasurementUnit + * @property {google.devicesandservices.health.v4.IBloodGlucose|null} [bloodGlucose] DataPoint bloodGlucose + * @property {string|null} [name] DataPoint name + * @property {google.devicesandservices.health.v4.IDataSource|null} [dataSource] DataPoint dataSource + */ + + /** + * Constructs a new DataPoint. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a DataPoint. + * @implements IDataPoint + * @constructor + * @param {google.devicesandservices.health.v4.IDataPoint=} [properties] Properties to set + */ + function DataPoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataPoint steps. + * @member {google.devicesandservices.health.v4.ISteps|null|undefined} steps + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.steps = null; + + /** + * DataPoint floors. + * @member {google.devicesandservices.health.v4.IFloors|null|undefined} floors + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.floors = null; + + /** + * DataPoint heartRate. + * @member {google.devicesandservices.health.v4.IHeartRate|null|undefined} heartRate + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.heartRate = null; + + /** + * DataPoint sleep. + * @member {google.devicesandservices.health.v4.ISleep|null|undefined} sleep + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.sleep = null; + + /** + * DataPoint dailyRestingHeartRate. + * @member {google.devicesandservices.health.v4.IDailyRestingHeartRate|null|undefined} dailyRestingHeartRate + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.dailyRestingHeartRate = null; + + /** + * DataPoint dailyHeartRateVariability. + * @member {google.devicesandservices.health.v4.IDailyHeartRateVariability|null|undefined} dailyHeartRateVariability + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.dailyHeartRateVariability = null; + + /** + * DataPoint exercise. + * @member {google.devicesandservices.health.v4.IExercise|null|undefined} exercise + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.exercise = null; + + /** + * DataPoint weight. + * @member {google.devicesandservices.health.v4.IWeight|null|undefined} weight + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.weight = null; + + /** + * DataPoint altitude. + * @member {google.devicesandservices.health.v4.IAltitude|null|undefined} altitude + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.altitude = null; + + /** + * DataPoint distance. + * @member {google.devicesandservices.health.v4.IDistance|null|undefined} distance + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.distance = null; + + /** + * DataPoint bodyFat. + * @member {google.devicesandservices.health.v4.IBodyFat|null|undefined} bodyFat + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.bodyFat = null; + + /** + * DataPoint activeZoneMinutes. + * @member {google.devicesandservices.health.v4.IActiveZoneMinutes|null|undefined} activeZoneMinutes + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.activeZoneMinutes = null; + + /** + * DataPoint heartRateVariability. + * @member {google.devicesandservices.health.v4.IHeartRateVariability|null|undefined} heartRateVariability + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.heartRateVariability = null; + + /** + * DataPoint dailySleepTemperatureDerivations. + * @member {google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null|undefined} dailySleepTemperatureDerivations + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.dailySleepTemperatureDerivations = null; + + /** + * DataPoint sedentaryPeriod. + * @member {google.devicesandservices.health.v4.ISedentaryPeriod|null|undefined} sedentaryPeriod + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.sedentaryPeriod = null; + + /** + * DataPoint runVo2Max. + * @member {google.devicesandservices.health.v4.IRunVO2Max|null|undefined} runVo2Max + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.runVo2Max = null; + + /** + * DataPoint oxygenSaturation. + * @member {google.devicesandservices.health.v4.IOxygenSaturation|null|undefined} oxygenSaturation + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.oxygenSaturation = null; + + /** + * DataPoint dailyOxygenSaturation. + * @member {google.devicesandservices.health.v4.IDailyOxygenSaturation|null|undefined} dailyOxygenSaturation + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.dailyOxygenSaturation = null; + + /** + * DataPoint activityLevel. + * @member {google.devicesandservices.health.v4.IActivityLevel|null|undefined} activityLevel + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.activityLevel = null; + + /** + * DataPoint vo2Max. + * @member {google.devicesandservices.health.v4.IVO2Max|null|undefined} vo2Max + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.vo2Max = null; + + /** + * DataPoint dailyVo2Max. + * @member {google.devicesandservices.health.v4.IDailyVO2Max|null|undefined} dailyVo2Max + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.dailyVo2Max = null; + + /** + * DataPoint nutritionLog. + * @member {google.devicesandservices.health.v4.INutritionLog|null|undefined} nutritionLog + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.nutritionLog = null; + + /** + * DataPoint irregularRhythmNotification. + * @member {google.devicesandservices.health.v4.IIrregularRhythmNotification|null|undefined} irregularRhythmNotification + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.irregularRhythmNotification = null; + + /** + * DataPoint electrocardiogram. + * @member {google.devicesandservices.health.v4.IElectrocardiogram|null|undefined} electrocardiogram + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.electrocardiogram = null; + + /** + * DataPoint dailyHeartRateZones. + * @member {google.devicesandservices.health.v4.IDailyHeartRateZones|null|undefined} dailyHeartRateZones + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.dailyHeartRateZones = null; + + /** + * DataPoint hydrationLog. + * @member {google.devicesandservices.health.v4.IHydrationLog|null|undefined} hydrationLog + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.hydrationLog = null; + + /** + * DataPoint food. + * @member {google.devicesandservices.health.v4.IFood|null|undefined} food + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.food = null; + + /** + * DataPoint timeInHeartRateZone. + * @member {google.devicesandservices.health.v4.ITimeInHeartRateZone|null|undefined} timeInHeartRateZone + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.timeInHeartRateZone = null; + + /** + * DataPoint activeMinutes. + * @member {google.devicesandservices.health.v4.IActiveMinutes|null|undefined} activeMinutes + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.activeMinutes = null; + + /** + * DataPoint respiratoryRateSleepSummary. + * @member {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null|undefined} respiratoryRateSleepSummary + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.respiratoryRateSleepSummary = null; + + /** + * DataPoint dailyRespiratoryRate. + * @member {google.devicesandservices.health.v4.IDailyRespiratoryRate|null|undefined} dailyRespiratoryRate + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.dailyRespiratoryRate = null; + + /** + * DataPoint swimLengthsData. + * @member {google.devicesandservices.health.v4.ISwimLengthsData|null|undefined} swimLengthsData + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.swimLengthsData = null; + + /** + * DataPoint height. + * @member {google.devicesandservices.health.v4.IHeight|null|undefined} height + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.height = null; + + /** + * DataPoint basalEnergyBurned. + * @member {google.devicesandservices.health.v4.IBasalEnergyBurned|null|undefined} basalEnergyBurned + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.basalEnergyBurned = null; + + /** + * DataPoint coreBodyTemperature. + * @member {google.devicesandservices.health.v4.ICoreBodyTemperature|null|undefined} coreBodyTemperature + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.coreBodyTemperature = null; + + /** + * DataPoint activeEnergyBurned. + * @member {google.devicesandservices.health.v4.IActiveEnergyBurned|null|undefined} activeEnergyBurned + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.activeEnergyBurned = null; + + /** + * DataPoint foodMeasurementUnit. + * @member {google.devicesandservices.health.v4.IFoodMeasurementUnit|null|undefined} foodMeasurementUnit + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.foodMeasurementUnit = null; + + /** + * DataPoint bloodGlucose. + * @member {google.devicesandservices.health.v4.IBloodGlucose|null|undefined} bloodGlucose + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.bloodGlucose = null; + + /** + * DataPoint name. + * @member {string} name + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.name = ""; + + /** + * DataPoint dataSource. + * @member {google.devicesandservices.health.v4.IDataSource|null|undefined} dataSource + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + DataPoint.prototype.dataSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataPoint data. + * @member {"steps"|"floors"|"heartRate"|"sleep"|"dailyRestingHeartRate"|"dailyHeartRateVariability"|"exercise"|"weight"|"altitude"|"distance"|"bodyFat"|"activeZoneMinutes"|"heartRateVariability"|"dailySleepTemperatureDerivations"|"sedentaryPeriod"|"runVo2Max"|"oxygenSaturation"|"dailyOxygenSaturation"|"activityLevel"|"vo2Max"|"dailyVo2Max"|"nutritionLog"|"irregularRhythmNotification"|"electrocardiogram"|"dailyHeartRateZones"|"hydrationLog"|"food"|"timeInHeartRateZone"|"activeMinutes"|"respiratoryRateSleepSummary"|"dailyRespiratoryRate"|"swimLengthsData"|"height"|"basalEnergyBurned"|"coreBodyTemperature"|"activeEnergyBurned"|"foodMeasurementUnit"|"bloodGlucose"|undefined} data + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + */ + Object.defineProperty(DataPoint.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["steps", "floors", "heartRate", "sleep", "dailyRestingHeartRate", "dailyHeartRateVariability", "exercise", "weight", "altitude", "distance", "bodyFat", "activeZoneMinutes", "heartRateVariability", "dailySleepTemperatureDerivations", "sedentaryPeriod", "runVo2Max", "oxygenSaturation", "dailyOxygenSaturation", "activityLevel", "vo2Max", "dailyVo2Max", "nutritionLog", "irregularRhythmNotification", "electrocardiogram", "dailyHeartRateZones", "hydrationLog", "food", "timeInHeartRateZone", "activeMinutes", "respiratoryRateSleepSummary", "dailyRespiratoryRate", "swimLengthsData", "height", "basalEnergyBurned", "coreBodyTemperature", "activeEnergyBurned", "foodMeasurementUnit", "bloodGlucose"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataPoint instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.DataPoint + * @static + * @param {google.devicesandservices.health.v4.IDataPoint=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DataPoint} DataPoint instance + */ + DataPoint.create = function create(properties) { + return new DataPoint(properties); + }; + + /** + * Encodes the specified DataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.DataPoint.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.DataPoint + * @static + * @param {google.devicesandservices.health.v4.IDataPoint} message DataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataPoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) + $root.google.devicesandservices.health.v4.DataSource.encode(message.dataSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.steps != null && Object.hasOwnProperty.call(message, "steps")) + $root.google.devicesandservices.health.v4.Steps.encode(message.steps, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.floors != null && Object.hasOwnProperty.call(message, "floors")) + $root.google.devicesandservices.health.v4.Floors.encode(message.floors, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.heartRate != null && Object.hasOwnProperty.call(message, "heartRate")) + $root.google.devicesandservices.health.v4.HeartRate.encode(message.heartRate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.sleep != null && Object.hasOwnProperty.call(message, "sleep")) + $root.google.devicesandservices.health.v4.Sleep.encode(message.sleep, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dailyRestingHeartRate != null && Object.hasOwnProperty.call(message, "dailyRestingHeartRate")) + $root.google.devicesandservices.health.v4.DailyRestingHeartRate.encode(message.dailyRestingHeartRate, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.dailyHeartRateVariability != null && Object.hasOwnProperty.call(message, "dailyHeartRateVariability")) + $root.google.devicesandservices.health.v4.DailyHeartRateVariability.encode(message.dailyHeartRateVariability, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.exercise != null && Object.hasOwnProperty.call(message, "exercise")) + $root.google.devicesandservices.health.v4.Exercise.encode(message.exercise, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + $root.google.devicesandservices.health.v4.Weight.encode(message.weight, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.altitude != null && Object.hasOwnProperty.call(message, "altitude")) + $root.google.devicesandservices.health.v4.Altitude.encode(message.altitude, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) + $root.google.devicesandservices.health.v4.Distance.encode(message.distance, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.bodyFat != null && Object.hasOwnProperty.call(message, "bodyFat")) + $root.google.devicesandservices.health.v4.BodyFat.encode(message.bodyFat, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.activeZoneMinutes != null && Object.hasOwnProperty.call(message, "activeZoneMinutes")) + $root.google.devicesandservices.health.v4.ActiveZoneMinutes.encode(message.activeZoneMinutes, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.heartRateVariability != null && Object.hasOwnProperty.call(message, "heartRateVariability")) + $root.google.devicesandservices.health.v4.HeartRateVariability.encode(message.heartRateVariability, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.dailySleepTemperatureDerivations != null && Object.hasOwnProperty.call(message, "dailySleepTemperatureDerivations")) + $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.encode(message.dailySleepTemperatureDerivations, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.sedentaryPeriod != null && Object.hasOwnProperty.call(message, "sedentaryPeriod")) + $root.google.devicesandservices.health.v4.SedentaryPeriod.encode(message.sedentaryPeriod, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.runVo2Max != null && Object.hasOwnProperty.call(message, "runVo2Max")) + $root.google.devicesandservices.health.v4.RunVO2Max.encode(message.runVo2Max, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.oxygenSaturation != null && Object.hasOwnProperty.call(message, "oxygenSaturation")) + $root.google.devicesandservices.health.v4.OxygenSaturation.encode(message.oxygenSaturation, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.dailyOxygenSaturation != null && Object.hasOwnProperty.call(message, "dailyOxygenSaturation")) + $root.google.devicesandservices.health.v4.DailyOxygenSaturation.encode(message.dailyOxygenSaturation, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.activityLevel != null && Object.hasOwnProperty.call(message, "activityLevel")) + $root.google.devicesandservices.health.v4.ActivityLevel.encode(message.activityLevel, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.vo2Max != null && Object.hasOwnProperty.call(message, "vo2Max")) + $root.google.devicesandservices.health.v4.VO2Max.encode(message.vo2Max, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.dailyVo2Max != null && Object.hasOwnProperty.call(message, "dailyVo2Max")) + $root.google.devicesandservices.health.v4.DailyVO2Max.encode(message.dailyVo2Max, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.nutritionLog != null && Object.hasOwnProperty.call(message, "nutritionLog")) + $root.google.devicesandservices.health.v4.NutritionLog.encode(message.nutritionLog, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.irregularRhythmNotification != null && Object.hasOwnProperty.call(message, "irregularRhythmNotification")) + $root.google.devicesandservices.health.v4.IrregularRhythmNotification.encode(message.irregularRhythmNotification, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.electrocardiogram != null && Object.hasOwnProperty.call(message, "electrocardiogram")) + $root.google.devicesandservices.health.v4.Electrocardiogram.encode(message.electrocardiogram, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.dailyHeartRateZones != null && Object.hasOwnProperty.call(message, "dailyHeartRateZones")) + $root.google.devicesandservices.health.v4.DailyHeartRateZones.encode(message.dailyHeartRateZones, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.hydrationLog != null && Object.hasOwnProperty.call(message, "hydrationLog")) + $root.google.devicesandservices.health.v4.HydrationLog.encode(message.hydrationLog, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.food != null && Object.hasOwnProperty.call(message, "food")) + $root.google.devicesandservices.health.v4.Food.encode(message.food, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.timeInHeartRateZone != null && Object.hasOwnProperty.call(message, "timeInHeartRateZone")) + $root.google.devicesandservices.health.v4.TimeInHeartRateZone.encode(message.timeInHeartRateZone, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.activeMinutes != null && Object.hasOwnProperty.call(message, "activeMinutes")) + $root.google.devicesandservices.health.v4.ActiveMinutes.encode(message.activeMinutes, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); + if (message.respiratoryRateSleepSummary != null && Object.hasOwnProperty.call(message, "respiratoryRateSleepSummary")) + $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.encode(message.respiratoryRateSleepSummary, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + if (message.dailyRespiratoryRate != null && Object.hasOwnProperty.call(message, "dailyRespiratoryRate")) + $root.google.devicesandservices.health.v4.DailyRespiratoryRate.encode(message.dailyRespiratoryRate, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + if (message.swimLengthsData != null && Object.hasOwnProperty.call(message, "swimLengthsData")) + $root.google.devicesandservices.health.v4.SwimLengthsData.encode(message.swimLengthsData, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + $root.google.devicesandservices.health.v4.Height.encode(message.height, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); + if (message.basalEnergyBurned != null && Object.hasOwnProperty.call(message, "basalEnergyBurned")) + $root.google.devicesandservices.health.v4.BasalEnergyBurned.encode(message.basalEnergyBurned, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + if (message.coreBodyTemperature != null && Object.hasOwnProperty.call(message, "coreBodyTemperature")) + $root.google.devicesandservices.health.v4.CoreBodyTemperature.encode(message.coreBodyTemperature, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.activeEnergyBurned != null && Object.hasOwnProperty.call(message, "activeEnergyBurned")) + $root.google.devicesandservices.health.v4.ActiveEnergyBurned.encode(message.activeEnergyBurned, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.foodMeasurementUnit != null && Object.hasOwnProperty.call(message, "foodMeasurementUnit")) + $root.google.devicesandservices.health.v4.FoodMeasurementUnit.encode(message.foodMeasurementUnit, writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); + if (message.bloodGlucose != null && Object.hasOwnProperty.call(message, "bloodGlucose")) + $root.google.devicesandservices.health.v4.BloodGlucose.encode(message.bloodGlucose, writer.uint32(/* id 46, wireType 2 =*/370).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.DataPoint + * @static + * @param {google.devicesandservices.health.v4.IDataPoint} message DataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataPoint message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.DataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.DataPoint} DataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataPoint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DataPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.steps = $root.google.devicesandservices.health.v4.Steps.decode(reader, reader.uint32()); + break; + } + case 5: { + message.floors = $root.google.devicesandservices.health.v4.Floors.decode(reader, reader.uint32()); + break; + } + case 6: { + message.heartRate = $root.google.devicesandservices.health.v4.HeartRate.decode(reader, reader.uint32()); + break; + } + case 8: { + message.sleep = $root.google.devicesandservices.health.v4.Sleep.decode(reader, reader.uint32()); + break; + } + case 9: { + message.dailyRestingHeartRate = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.decode(reader, reader.uint32()); + break; + } + case 10: { + message.dailyHeartRateVariability = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.decode(reader, reader.uint32()); + break; + } + case 11: { + message.exercise = $root.google.devicesandservices.health.v4.Exercise.decode(reader, reader.uint32()); + break; + } + case 12: { + message.weight = $root.google.devicesandservices.health.v4.Weight.decode(reader, reader.uint32()); + break; + } + case 13: { + message.altitude = $root.google.devicesandservices.health.v4.Altitude.decode(reader, reader.uint32()); + break; + } + case 14: { + message.distance = $root.google.devicesandservices.health.v4.Distance.decode(reader, reader.uint32()); + break; + } + case 15: { + message.bodyFat = $root.google.devicesandservices.health.v4.BodyFat.decode(reader, reader.uint32()); + break; + } + case 17: { + message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.decode(reader, reader.uint32()); + break; + } + case 19: { + message.heartRateVariability = $root.google.devicesandservices.health.v4.HeartRateVariability.decode(reader, reader.uint32()); + break; + } + case 20: { + message.dailySleepTemperatureDerivations = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.decode(reader, reader.uint32()); + break; + } + case 21: { + message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriod.decode(reader, reader.uint32()); + break; + } + case 22: { + message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2Max.decode(reader, reader.uint32()); + break; + } + case 24: { + message.oxygenSaturation = $root.google.devicesandservices.health.v4.OxygenSaturation.decode(reader, reader.uint32()); + break; + } + case 25: { + message.dailyOxygenSaturation = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.decode(reader, reader.uint32()); + break; + } + case 26: { + message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevel.decode(reader, reader.uint32()); + break; + } + case 27: { + message.vo2Max = $root.google.devicesandservices.health.v4.VO2Max.decode(reader, reader.uint32()); + break; + } + case 28: { + message.dailyVo2Max = $root.google.devicesandservices.health.v4.DailyVO2Max.decode(reader, reader.uint32()); + break; + } + case 29: { + message.nutritionLog = $root.google.devicesandservices.health.v4.NutritionLog.decode(reader, reader.uint32()); + break; + } + case 30: { + message.irregularRhythmNotification = $root.google.devicesandservices.health.v4.IrregularRhythmNotification.decode(reader, reader.uint32()); + break; + } + case 31: { + message.electrocardiogram = $root.google.devicesandservices.health.v4.Electrocardiogram.decode(reader, reader.uint32()); + break; + } + case 32: { + message.dailyHeartRateZones = $root.google.devicesandservices.health.v4.DailyHeartRateZones.decode(reader, reader.uint32()); + break; + } + case 33: { + message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLog.decode(reader, reader.uint32()); + break; + } + case 34: { + message.food = $root.google.devicesandservices.health.v4.Food.decode(reader, reader.uint32()); + break; + } + case 35: { + message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.decode(reader, reader.uint32()); + break; + } + case 36: { + message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutes.decode(reader, reader.uint32()); + break; + } + case 37: { + message.respiratoryRateSleepSummary = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.decode(reader, reader.uint32()); + break; + } + case 38: { + message.dailyRespiratoryRate = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.decode(reader, reader.uint32()); + break; + } + case 39: { + message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsData.decode(reader, reader.uint32()); + break; + } + case 40: { + message.height = $root.google.devicesandservices.health.v4.Height.decode(reader, reader.uint32()); + break; + } + case 41: { + message.basalEnergyBurned = $root.google.devicesandservices.health.v4.BasalEnergyBurned.decode(reader, reader.uint32()); + break; + } + case 42: { + message.coreBodyTemperature = $root.google.devicesandservices.health.v4.CoreBodyTemperature.decode(reader, reader.uint32()); + break; + } + case 44: { + message.activeEnergyBurned = $root.google.devicesandservices.health.v4.ActiveEnergyBurned.decode(reader, reader.uint32()); + break; + } + case 45: { + message.foodMeasurementUnit = $root.google.devicesandservices.health.v4.FoodMeasurementUnit.decode(reader, reader.uint32()); + break; + } + case 46: { + message.bloodGlucose = $root.google.devicesandservices.health.v4.BloodGlucose.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.dataSource = $root.google.devicesandservices.health.v4.DataSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.DataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.DataPoint} DataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataPoint message. + * @function verify + * @memberof google.devicesandservices.health.v4.DataPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.steps != null && message.hasOwnProperty("steps")) { + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Steps.verify(message.steps); + if (error) + return "steps." + error; + } + } + if (message.floors != null && message.hasOwnProperty("floors")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Floors.verify(message.floors); + if (error) + return "floors." + error; + } + } + if (message.heartRate != null && message.hasOwnProperty("heartRate")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.HeartRate.verify(message.heartRate); + if (error) + return "heartRate." + error; + } + } + if (message.sleep != null && message.hasOwnProperty("sleep")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Sleep.verify(message.sleep); + if (error) + return "sleep." + error; + } + } + if (message.dailyRestingHeartRate != null && message.hasOwnProperty("dailyRestingHeartRate")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.verify(message.dailyRestingHeartRate); + if (error) + return "dailyRestingHeartRate." + error; + } + } + if (message.dailyHeartRateVariability != null && message.hasOwnProperty("dailyHeartRateVariability")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.verify(message.dailyHeartRateVariability); + if (error) + return "dailyHeartRateVariability." + error; + } + } + if (message.exercise != null && message.hasOwnProperty("exercise")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Exercise.verify(message.exercise); + if (error) + return "exercise." + error; + } + } + if (message.weight != null && message.hasOwnProperty("weight")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Weight.verify(message.weight); + if (error) + return "weight." + error; + } + } + if (message.altitude != null && message.hasOwnProperty("altitude")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Altitude.verify(message.altitude); + if (error) + return "altitude." + error; + } + } + if (message.distance != null && message.hasOwnProperty("distance")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Distance.verify(message.distance); + if (error) + return "distance." + error; + } + } + if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.BodyFat.verify(message.bodyFat); + if (error) + return "bodyFat." + error; + } + } + if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.verify(message.activeZoneMinutes); + if (error) + return "activeZoneMinutes." + error; + } + } + if (message.heartRateVariability != null && message.hasOwnProperty("heartRateVariability")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.HeartRateVariability.verify(message.heartRateVariability); + if (error) + return "heartRateVariability." + error; + } + } + if (message.dailySleepTemperatureDerivations != null && message.hasOwnProperty("dailySleepTemperatureDerivations")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.verify(message.dailySleepTemperatureDerivations); + if (error) + return "dailySleepTemperatureDerivations." + error; + } + } + if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.SedentaryPeriod.verify(message.sedentaryPeriod); + if (error) + return "sedentaryPeriod." + error; + } + } + if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.RunVO2Max.verify(message.runVo2Max); + if (error) + return "runVo2Max." + error; + } + } + if (message.oxygenSaturation != null && message.hasOwnProperty("oxygenSaturation")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.OxygenSaturation.verify(message.oxygenSaturation); + if (error) + return "oxygenSaturation." + error; + } + } + if (message.dailyOxygenSaturation != null && message.hasOwnProperty("dailyOxygenSaturation")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.verify(message.dailyOxygenSaturation); + if (error) + return "dailyOxygenSaturation." + error; + } + } + if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.ActivityLevel.verify(message.activityLevel); + if (error) + return "activityLevel." + error; + } + } + if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.VO2Max.verify(message.vo2Max); + if (error) + return "vo2Max." + error; + } + } + if (message.dailyVo2Max != null && message.hasOwnProperty("dailyVo2Max")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.DailyVO2Max.verify(message.dailyVo2Max); + if (error) + return "dailyVo2Max." + error; + } + } + if (message.nutritionLog != null && message.hasOwnProperty("nutritionLog")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.NutritionLog.verify(message.nutritionLog); + if (error) + return "nutritionLog." + error; + } + } + if (message.irregularRhythmNotification != null && message.hasOwnProperty("irregularRhythmNotification")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.IrregularRhythmNotification.verify(message.irregularRhythmNotification); + if (error) + return "irregularRhythmNotification." + error; + } + } + if (message.electrocardiogram != null && message.hasOwnProperty("electrocardiogram")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Electrocardiogram.verify(message.electrocardiogram); + if (error) + return "electrocardiogram." + error; + } + } + if (message.dailyHeartRateZones != null && message.hasOwnProperty("dailyHeartRateZones")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.DailyHeartRateZones.verify(message.dailyHeartRateZones); + if (error) + return "dailyHeartRateZones." + error; + } + } + if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.HydrationLog.verify(message.hydrationLog); + if (error) + return "hydrationLog." + error; + } + } + if (message.food != null && message.hasOwnProperty("food")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Food.verify(message.food); + if (error) + return "food." + error; + } + } + if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.verify(message.timeInHeartRateZone); + if (error) + return "timeInHeartRateZone." + error; + } + } + if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.ActiveMinutes.verify(message.activeMinutes); + if (error) + return "activeMinutes." + error; + } + } + if (message.respiratoryRateSleepSummary != null && message.hasOwnProperty("respiratoryRateSleepSummary")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.verify(message.respiratoryRateSleepSummary); + if (error) + return "respiratoryRateSleepSummary." + error; + } + } + if (message.dailyRespiratoryRate != null && message.hasOwnProperty("dailyRespiratoryRate")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.verify(message.dailyRespiratoryRate); + if (error) + return "dailyRespiratoryRate." + error; + } + } + if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.SwimLengthsData.verify(message.swimLengthsData); + if (error) + return "swimLengthsData." + error; + } + } + if (message.height != null && message.hasOwnProperty("height")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Height.verify(message.height); + if (error) + return "height." + error; + } + } + if (message.basalEnergyBurned != null && message.hasOwnProperty("basalEnergyBurned")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.BasalEnergyBurned.verify(message.basalEnergyBurned); + if (error) + return "basalEnergyBurned." + error; + } + } + if (message.coreBodyTemperature != null && message.hasOwnProperty("coreBodyTemperature")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.CoreBodyTemperature.verify(message.coreBodyTemperature); + if (error) + return "coreBodyTemperature." + error; + } + } + if (message.activeEnergyBurned != null && message.hasOwnProperty("activeEnergyBurned")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.ActiveEnergyBurned.verify(message.activeEnergyBurned); + if (error) + return "activeEnergyBurned." + error; + } + } + if (message.foodMeasurementUnit != null && message.hasOwnProperty("foodMeasurementUnit")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.FoodMeasurementUnit.verify(message.foodMeasurementUnit); + if (error) + return "foodMeasurementUnit." + error; + } + } + if (message.bloodGlucose != null && message.hasOwnProperty("bloodGlucose")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.BloodGlucose.verify(message.bloodGlucose); + if (error) + return "bloodGlucose." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.dataSource != null && message.hasOwnProperty("dataSource")) { + var error = $root.google.devicesandservices.health.v4.DataSource.verify(message.dataSource); + if (error) + return "dataSource." + error; + } + return null; + }; + + /** + * Creates a DataPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.DataPoint + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.DataPoint} DataPoint + */ + DataPoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DataPoint) + return object; + var message = new $root.google.devicesandservices.health.v4.DataPoint(); + if (object.steps != null) { + if (typeof object.steps !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.steps: object expected"); + message.steps = $root.google.devicesandservices.health.v4.Steps.fromObject(object.steps); + } + if (object.floors != null) { + if (typeof object.floors !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.floors: object expected"); + message.floors = $root.google.devicesandservices.health.v4.Floors.fromObject(object.floors); + } + if (object.heartRate != null) { + if (typeof object.heartRate !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.heartRate: object expected"); + message.heartRate = $root.google.devicesandservices.health.v4.HeartRate.fromObject(object.heartRate); + } + if (object.sleep != null) { + if (typeof object.sleep !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.sleep: object expected"); + message.sleep = $root.google.devicesandservices.health.v4.Sleep.fromObject(object.sleep); + } + if (object.dailyRestingHeartRate != null) { + if (typeof object.dailyRestingHeartRate !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.dailyRestingHeartRate: object expected"); + message.dailyRestingHeartRate = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.fromObject(object.dailyRestingHeartRate); + } + if (object.dailyHeartRateVariability != null) { + if (typeof object.dailyHeartRateVariability !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.dailyHeartRateVariability: object expected"); + message.dailyHeartRateVariability = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.fromObject(object.dailyHeartRateVariability); + } + if (object.exercise != null) { + if (typeof object.exercise !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.exercise: object expected"); + message.exercise = $root.google.devicesandservices.health.v4.Exercise.fromObject(object.exercise); + } + if (object.weight != null) { + if (typeof object.weight !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.weight: object expected"); + message.weight = $root.google.devicesandservices.health.v4.Weight.fromObject(object.weight); + } + if (object.altitude != null) { + if (typeof object.altitude !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.altitude: object expected"); + message.altitude = $root.google.devicesandservices.health.v4.Altitude.fromObject(object.altitude); + } + if (object.distance != null) { + if (typeof object.distance !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.distance: object expected"); + message.distance = $root.google.devicesandservices.health.v4.Distance.fromObject(object.distance); + } + if (object.bodyFat != null) { + if (typeof object.bodyFat !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.bodyFat: object expected"); + message.bodyFat = $root.google.devicesandservices.health.v4.BodyFat.fromObject(object.bodyFat); + } + if (object.activeZoneMinutes != null) { + if (typeof object.activeZoneMinutes !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.activeZoneMinutes: object expected"); + message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.fromObject(object.activeZoneMinutes); + } + if (object.heartRateVariability != null) { + if (typeof object.heartRateVariability !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.heartRateVariability: object expected"); + message.heartRateVariability = $root.google.devicesandservices.health.v4.HeartRateVariability.fromObject(object.heartRateVariability); + } + if (object.dailySleepTemperatureDerivations != null) { + if (typeof object.dailySleepTemperatureDerivations !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.dailySleepTemperatureDerivations: object expected"); + message.dailySleepTemperatureDerivations = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.fromObject(object.dailySleepTemperatureDerivations); + } + if (object.sedentaryPeriod != null) { + if (typeof object.sedentaryPeriod !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.sedentaryPeriod: object expected"); + message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriod.fromObject(object.sedentaryPeriod); + } + if (object.runVo2Max != null) { + if (typeof object.runVo2Max !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.runVo2Max: object expected"); + message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2Max.fromObject(object.runVo2Max); + } + if (object.oxygenSaturation != null) { + if (typeof object.oxygenSaturation !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.oxygenSaturation: object expected"); + message.oxygenSaturation = $root.google.devicesandservices.health.v4.OxygenSaturation.fromObject(object.oxygenSaturation); + } + if (object.dailyOxygenSaturation != null) { + if (typeof object.dailyOxygenSaturation !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.dailyOxygenSaturation: object expected"); + message.dailyOxygenSaturation = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.fromObject(object.dailyOxygenSaturation); + } + if (object.activityLevel != null) { + if (typeof object.activityLevel !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.activityLevel: object expected"); + message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevel.fromObject(object.activityLevel); + } + if (object.vo2Max != null) { + if (typeof object.vo2Max !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.vo2Max: object expected"); + message.vo2Max = $root.google.devicesandservices.health.v4.VO2Max.fromObject(object.vo2Max); + } + if (object.dailyVo2Max != null) { + if (typeof object.dailyVo2Max !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.dailyVo2Max: object expected"); + message.dailyVo2Max = $root.google.devicesandservices.health.v4.DailyVO2Max.fromObject(object.dailyVo2Max); + } + if (object.nutritionLog != null) { + if (typeof object.nutritionLog !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.nutritionLog: object expected"); + message.nutritionLog = $root.google.devicesandservices.health.v4.NutritionLog.fromObject(object.nutritionLog); + } + if (object.irregularRhythmNotification != null) { + if (typeof object.irregularRhythmNotification !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.irregularRhythmNotification: object expected"); + message.irregularRhythmNotification = $root.google.devicesandservices.health.v4.IrregularRhythmNotification.fromObject(object.irregularRhythmNotification); + } + if (object.electrocardiogram != null) { + if (typeof object.electrocardiogram !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.electrocardiogram: object expected"); + message.electrocardiogram = $root.google.devicesandservices.health.v4.Electrocardiogram.fromObject(object.electrocardiogram); + } + if (object.dailyHeartRateZones != null) { + if (typeof object.dailyHeartRateZones !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.dailyHeartRateZones: object expected"); + message.dailyHeartRateZones = $root.google.devicesandservices.health.v4.DailyHeartRateZones.fromObject(object.dailyHeartRateZones); + } + if (object.hydrationLog != null) { + if (typeof object.hydrationLog !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.hydrationLog: object expected"); + message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLog.fromObject(object.hydrationLog); + } + if (object.food != null) { + if (typeof object.food !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.food: object expected"); + message.food = $root.google.devicesandservices.health.v4.Food.fromObject(object.food); + } + if (object.timeInHeartRateZone != null) { + if (typeof object.timeInHeartRateZone !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.timeInHeartRateZone: object expected"); + message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.fromObject(object.timeInHeartRateZone); + } + if (object.activeMinutes != null) { + if (typeof object.activeMinutes !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.activeMinutes: object expected"); + message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutes.fromObject(object.activeMinutes); + } + if (object.respiratoryRateSleepSummary != null) { + if (typeof object.respiratoryRateSleepSummary !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.respiratoryRateSleepSummary: object expected"); + message.respiratoryRateSleepSummary = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.fromObject(object.respiratoryRateSleepSummary); + } + if (object.dailyRespiratoryRate != null) { + if (typeof object.dailyRespiratoryRate !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.dailyRespiratoryRate: object expected"); + message.dailyRespiratoryRate = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.fromObject(object.dailyRespiratoryRate); + } + if (object.swimLengthsData != null) { + if (typeof object.swimLengthsData !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.swimLengthsData: object expected"); + message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsData.fromObject(object.swimLengthsData); + } + if (object.height != null) { + if (typeof object.height !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.height: object expected"); + message.height = $root.google.devicesandservices.health.v4.Height.fromObject(object.height); + } + if (object.basalEnergyBurned != null) { + if (typeof object.basalEnergyBurned !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.basalEnergyBurned: object expected"); + message.basalEnergyBurned = $root.google.devicesandservices.health.v4.BasalEnergyBurned.fromObject(object.basalEnergyBurned); + } + if (object.coreBodyTemperature != null) { + if (typeof object.coreBodyTemperature !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.coreBodyTemperature: object expected"); + message.coreBodyTemperature = $root.google.devicesandservices.health.v4.CoreBodyTemperature.fromObject(object.coreBodyTemperature); + } + if (object.activeEnergyBurned != null) { + if (typeof object.activeEnergyBurned !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.activeEnergyBurned: object expected"); + message.activeEnergyBurned = $root.google.devicesandservices.health.v4.ActiveEnergyBurned.fromObject(object.activeEnergyBurned); + } + if (object.foodMeasurementUnit != null) { + if (typeof object.foodMeasurementUnit !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.foodMeasurementUnit: object expected"); + message.foodMeasurementUnit = $root.google.devicesandservices.health.v4.FoodMeasurementUnit.fromObject(object.foodMeasurementUnit); + } + if (object.bloodGlucose != null) { + if (typeof object.bloodGlucose !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.bloodGlucose: object expected"); + message.bloodGlucose = $root.google.devicesandservices.health.v4.BloodGlucose.fromObject(object.bloodGlucose); + } + if (object.name != null) + message.name = String(object.name); + if (object.dataSource != null) { + if (typeof object.dataSource !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataPoint.dataSource: object expected"); + message.dataSource = $root.google.devicesandservices.health.v4.DataSource.fromObject(object.dataSource); + } + return message; + }; + + /** + * Creates a plain object from a DataPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.DataPoint + * @static + * @param {google.devicesandservices.health.v4.DataPoint} message DataPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.dataSource = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + object.dataSource = $root.google.devicesandservices.health.v4.DataSource.toObject(message.dataSource, options); + if (message.steps != null && message.hasOwnProperty("steps")) { + object.steps = $root.google.devicesandservices.health.v4.Steps.toObject(message.steps, options); + if (options.oneofs) + object.data = "steps"; + } + if (message.floors != null && message.hasOwnProperty("floors")) { + object.floors = $root.google.devicesandservices.health.v4.Floors.toObject(message.floors, options); + if (options.oneofs) + object.data = "floors"; + } + if (message.heartRate != null && message.hasOwnProperty("heartRate")) { + object.heartRate = $root.google.devicesandservices.health.v4.HeartRate.toObject(message.heartRate, options); + if (options.oneofs) + object.data = "heartRate"; + } + if (message.sleep != null && message.hasOwnProperty("sleep")) { + object.sleep = $root.google.devicesandservices.health.v4.Sleep.toObject(message.sleep, options); + if (options.oneofs) + object.data = "sleep"; + } + if (message.dailyRestingHeartRate != null && message.hasOwnProperty("dailyRestingHeartRate")) { + object.dailyRestingHeartRate = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.toObject(message.dailyRestingHeartRate, options); + if (options.oneofs) + object.data = "dailyRestingHeartRate"; + } + if (message.dailyHeartRateVariability != null && message.hasOwnProperty("dailyHeartRateVariability")) { + object.dailyHeartRateVariability = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.toObject(message.dailyHeartRateVariability, options); + if (options.oneofs) + object.data = "dailyHeartRateVariability"; + } + if (message.exercise != null && message.hasOwnProperty("exercise")) { + object.exercise = $root.google.devicesandservices.health.v4.Exercise.toObject(message.exercise, options); + if (options.oneofs) + object.data = "exercise"; + } + if (message.weight != null && message.hasOwnProperty("weight")) { + object.weight = $root.google.devicesandservices.health.v4.Weight.toObject(message.weight, options); + if (options.oneofs) + object.data = "weight"; + } + if (message.altitude != null && message.hasOwnProperty("altitude")) { + object.altitude = $root.google.devicesandservices.health.v4.Altitude.toObject(message.altitude, options); + if (options.oneofs) + object.data = "altitude"; + } + if (message.distance != null && message.hasOwnProperty("distance")) { + object.distance = $root.google.devicesandservices.health.v4.Distance.toObject(message.distance, options); + if (options.oneofs) + object.data = "distance"; + } + if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { + object.bodyFat = $root.google.devicesandservices.health.v4.BodyFat.toObject(message.bodyFat, options); + if (options.oneofs) + object.data = "bodyFat"; + } + if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { + object.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.toObject(message.activeZoneMinutes, options); + if (options.oneofs) + object.data = "activeZoneMinutes"; + } + if (message.heartRateVariability != null && message.hasOwnProperty("heartRateVariability")) { + object.heartRateVariability = $root.google.devicesandservices.health.v4.HeartRateVariability.toObject(message.heartRateVariability, options); + if (options.oneofs) + object.data = "heartRateVariability"; + } + if (message.dailySleepTemperatureDerivations != null && message.hasOwnProperty("dailySleepTemperatureDerivations")) { + object.dailySleepTemperatureDerivations = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.toObject(message.dailySleepTemperatureDerivations, options); + if (options.oneofs) + object.data = "dailySleepTemperatureDerivations"; + } + if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { + object.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriod.toObject(message.sedentaryPeriod, options); + if (options.oneofs) + object.data = "sedentaryPeriod"; + } + if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { + object.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2Max.toObject(message.runVo2Max, options); + if (options.oneofs) + object.data = "runVo2Max"; + } + if (message.oxygenSaturation != null && message.hasOwnProperty("oxygenSaturation")) { + object.oxygenSaturation = $root.google.devicesandservices.health.v4.OxygenSaturation.toObject(message.oxygenSaturation, options); + if (options.oneofs) + object.data = "oxygenSaturation"; + } + if (message.dailyOxygenSaturation != null && message.hasOwnProperty("dailyOxygenSaturation")) { + object.dailyOxygenSaturation = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.toObject(message.dailyOxygenSaturation, options); + if (options.oneofs) + object.data = "dailyOxygenSaturation"; + } + if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { + object.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevel.toObject(message.activityLevel, options); + if (options.oneofs) + object.data = "activityLevel"; + } + if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) { + object.vo2Max = $root.google.devicesandservices.health.v4.VO2Max.toObject(message.vo2Max, options); + if (options.oneofs) + object.data = "vo2Max"; + } + if (message.dailyVo2Max != null && message.hasOwnProperty("dailyVo2Max")) { + object.dailyVo2Max = $root.google.devicesandservices.health.v4.DailyVO2Max.toObject(message.dailyVo2Max, options); + if (options.oneofs) + object.data = "dailyVo2Max"; + } + if (message.nutritionLog != null && message.hasOwnProperty("nutritionLog")) { + object.nutritionLog = $root.google.devicesandservices.health.v4.NutritionLog.toObject(message.nutritionLog, options); + if (options.oneofs) + object.data = "nutritionLog"; + } + if (message.irregularRhythmNotification != null && message.hasOwnProperty("irregularRhythmNotification")) { + object.irregularRhythmNotification = $root.google.devicesandservices.health.v4.IrregularRhythmNotification.toObject(message.irregularRhythmNotification, options); + if (options.oneofs) + object.data = "irregularRhythmNotification"; + } + if (message.electrocardiogram != null && message.hasOwnProperty("electrocardiogram")) { + object.electrocardiogram = $root.google.devicesandservices.health.v4.Electrocardiogram.toObject(message.electrocardiogram, options); + if (options.oneofs) + object.data = "electrocardiogram"; + } + if (message.dailyHeartRateZones != null && message.hasOwnProperty("dailyHeartRateZones")) { + object.dailyHeartRateZones = $root.google.devicesandservices.health.v4.DailyHeartRateZones.toObject(message.dailyHeartRateZones, options); + if (options.oneofs) + object.data = "dailyHeartRateZones"; + } + if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { + object.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLog.toObject(message.hydrationLog, options); + if (options.oneofs) + object.data = "hydrationLog"; + } + if (message.food != null && message.hasOwnProperty("food")) { + object.food = $root.google.devicesandservices.health.v4.Food.toObject(message.food, options); + if (options.oneofs) + object.data = "food"; + } + if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { + object.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.toObject(message.timeInHeartRateZone, options); + if (options.oneofs) + object.data = "timeInHeartRateZone"; + } + if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { + object.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutes.toObject(message.activeMinutes, options); + if (options.oneofs) + object.data = "activeMinutes"; + } + if (message.respiratoryRateSleepSummary != null && message.hasOwnProperty("respiratoryRateSleepSummary")) { + object.respiratoryRateSleepSummary = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.toObject(message.respiratoryRateSleepSummary, options); + if (options.oneofs) + object.data = "respiratoryRateSleepSummary"; + } + if (message.dailyRespiratoryRate != null && message.hasOwnProperty("dailyRespiratoryRate")) { + object.dailyRespiratoryRate = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.toObject(message.dailyRespiratoryRate, options); + if (options.oneofs) + object.data = "dailyRespiratoryRate"; + } + if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { + object.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsData.toObject(message.swimLengthsData, options); + if (options.oneofs) + object.data = "swimLengthsData"; + } + if (message.height != null && message.hasOwnProperty("height")) { + object.height = $root.google.devicesandservices.health.v4.Height.toObject(message.height, options); + if (options.oneofs) + object.data = "height"; + } + if (message.basalEnergyBurned != null && message.hasOwnProperty("basalEnergyBurned")) { + object.basalEnergyBurned = $root.google.devicesandservices.health.v4.BasalEnergyBurned.toObject(message.basalEnergyBurned, options); + if (options.oneofs) + object.data = "basalEnergyBurned"; + } + if (message.coreBodyTemperature != null && message.hasOwnProperty("coreBodyTemperature")) { + object.coreBodyTemperature = $root.google.devicesandservices.health.v4.CoreBodyTemperature.toObject(message.coreBodyTemperature, options); + if (options.oneofs) + object.data = "coreBodyTemperature"; + } + if (message.activeEnergyBurned != null && message.hasOwnProperty("activeEnergyBurned")) { + object.activeEnergyBurned = $root.google.devicesandservices.health.v4.ActiveEnergyBurned.toObject(message.activeEnergyBurned, options); + if (options.oneofs) + object.data = "activeEnergyBurned"; + } + if (message.foodMeasurementUnit != null && message.hasOwnProperty("foodMeasurementUnit")) { + object.foodMeasurementUnit = $root.google.devicesandservices.health.v4.FoodMeasurementUnit.toObject(message.foodMeasurementUnit, options); + if (options.oneofs) + object.data = "foodMeasurementUnit"; + } + if (message.bloodGlucose != null && message.hasOwnProperty("bloodGlucose")) { + object.bloodGlucose = $root.google.devicesandservices.health.v4.BloodGlucose.toObject(message.bloodGlucose, options); + if (options.oneofs) + object.data = "bloodGlucose"; + } + return object; + }; + + /** + * Converts this DataPoint to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.DataPoint + * @instance + * @returns {Object.} JSON object + */ + DataPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataPoint + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.DataPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.DataPoint"; + }; + + return DataPoint; + })(); + + v4.ReconciledDataPoint = (function() { + + /** + * Properties of a ReconciledDataPoint. + * @memberof google.devicesandservices.health.v4 + * @interface IReconciledDataPoint + * @property {google.devicesandservices.health.v4.ISteps|null} [steps] ReconciledDataPoint steps + * @property {google.devicesandservices.health.v4.IFloors|null} [floors] ReconciledDataPoint floors + * @property {google.devicesandservices.health.v4.IHeartRate|null} [heartRate] ReconciledDataPoint heartRate + * @property {google.devicesandservices.health.v4.ISleep|null} [sleep] ReconciledDataPoint sleep + * @property {google.devicesandservices.health.v4.IDailyRestingHeartRate|null} [dailyRestingHeartRate] ReconciledDataPoint dailyRestingHeartRate + * @property {google.devicesandservices.health.v4.IDailyHeartRateVariability|null} [dailyHeartRateVariability] ReconciledDataPoint dailyHeartRateVariability + * @property {google.devicesandservices.health.v4.IExercise|null} [exercise] ReconciledDataPoint exercise + * @property {google.devicesandservices.health.v4.IWeight|null} [weight] ReconciledDataPoint weight + * @property {google.devicesandservices.health.v4.IAltitude|null} [altitude] ReconciledDataPoint altitude + * @property {google.devicesandservices.health.v4.IDistance|null} [distance] ReconciledDataPoint distance + * @property {google.devicesandservices.health.v4.IBodyFat|null} [bodyFat] ReconciledDataPoint bodyFat + * @property {google.devicesandservices.health.v4.IActiveZoneMinutes|null} [activeZoneMinutes] ReconciledDataPoint activeZoneMinutes + * @property {google.devicesandservices.health.v4.IHeartRateVariability|null} [heartRateVariability] ReconciledDataPoint heartRateVariability + * @property {google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null} [dailySleepTemperatureDerivations] ReconciledDataPoint dailySleepTemperatureDerivations + * @property {google.devicesandservices.health.v4.ISedentaryPeriod|null} [sedentaryPeriod] ReconciledDataPoint sedentaryPeriod + * @property {google.devicesandservices.health.v4.IRunVO2Max|null} [runVo2Max] ReconciledDataPoint runVo2Max + * @property {google.devicesandservices.health.v4.IOxygenSaturation|null} [oxygenSaturation] ReconciledDataPoint oxygenSaturation + * @property {google.devicesandservices.health.v4.IDailyOxygenSaturation|null} [dailyOxygenSaturation] ReconciledDataPoint dailyOxygenSaturation + * @property {google.devicesandservices.health.v4.IActivityLevel|null} [activityLevel] ReconciledDataPoint activityLevel + * @property {google.devicesandservices.health.v4.IVO2Max|null} [vo2Max] ReconciledDataPoint vo2Max + * @property {google.devicesandservices.health.v4.IDailyVO2Max|null} [dailyVo2Max] ReconciledDataPoint dailyVo2Max + * @property {google.devicesandservices.health.v4.INutritionLog|null} [nutritionLog] ReconciledDataPoint nutritionLog + * @property {google.devicesandservices.health.v4.IDailyHeartRateZones|null} [dailyHeartRateZones] ReconciledDataPoint dailyHeartRateZones + * @property {google.devicesandservices.health.v4.IHydrationLog|null} [hydrationLog] ReconciledDataPoint hydrationLog + * @property {google.devicesandservices.health.v4.ITimeInHeartRateZone|null} [timeInHeartRateZone] ReconciledDataPoint timeInHeartRateZone + * @property {google.devicesandservices.health.v4.IActiveMinutes|null} [activeMinutes] ReconciledDataPoint activeMinutes + * @property {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null} [respiratoryRateSleepSummary] ReconciledDataPoint respiratoryRateSleepSummary + * @property {google.devicesandservices.health.v4.IDailyRespiratoryRate|null} [dailyRespiratoryRate] ReconciledDataPoint dailyRespiratoryRate + * @property {google.devicesandservices.health.v4.ISwimLengthsData|null} [swimLengthsData] ReconciledDataPoint swimLengthsData + * @property {google.devicesandservices.health.v4.IHeight|null} [height] ReconciledDataPoint height + * @property {google.devicesandservices.health.v4.IBasalEnergyBurned|null} [basalEnergyBurned] ReconciledDataPoint basalEnergyBurned + * @property {google.devicesandservices.health.v4.ICoreBodyTemperature|null} [coreBodyTemperature] ReconciledDataPoint coreBodyTemperature + * @property {google.devicesandservices.health.v4.IActiveEnergyBurned|null} [activeEnergyBurned] ReconciledDataPoint activeEnergyBurned + * @property {google.devicesandservices.health.v4.IBloodGlucose|null} [bloodGlucose] ReconciledDataPoint bloodGlucose + * @property {string|null} [dataPointName] ReconciledDataPoint dataPointName + */ + + /** + * Constructs a new ReconciledDataPoint. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a ReconciledDataPoint. + * @implements IReconciledDataPoint + * @constructor + * @param {google.devicesandservices.health.v4.IReconciledDataPoint=} [properties] Properties to set + */ + function ReconciledDataPoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReconciledDataPoint steps. + * @member {google.devicesandservices.health.v4.ISteps|null|undefined} steps + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.steps = null; + + /** + * ReconciledDataPoint floors. + * @member {google.devicesandservices.health.v4.IFloors|null|undefined} floors + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.floors = null; + + /** + * ReconciledDataPoint heartRate. + * @member {google.devicesandservices.health.v4.IHeartRate|null|undefined} heartRate + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.heartRate = null; + + /** + * ReconciledDataPoint sleep. + * @member {google.devicesandservices.health.v4.ISleep|null|undefined} sleep + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.sleep = null; + + /** + * ReconciledDataPoint dailyRestingHeartRate. + * @member {google.devicesandservices.health.v4.IDailyRestingHeartRate|null|undefined} dailyRestingHeartRate + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.dailyRestingHeartRate = null; + + /** + * ReconciledDataPoint dailyHeartRateVariability. + * @member {google.devicesandservices.health.v4.IDailyHeartRateVariability|null|undefined} dailyHeartRateVariability + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.dailyHeartRateVariability = null; + + /** + * ReconciledDataPoint exercise. + * @member {google.devicesandservices.health.v4.IExercise|null|undefined} exercise + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.exercise = null; + + /** + * ReconciledDataPoint weight. + * @member {google.devicesandservices.health.v4.IWeight|null|undefined} weight + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.weight = null; + + /** + * ReconciledDataPoint altitude. + * @member {google.devicesandservices.health.v4.IAltitude|null|undefined} altitude + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.altitude = null; + + /** + * ReconciledDataPoint distance. + * @member {google.devicesandservices.health.v4.IDistance|null|undefined} distance + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.distance = null; + + /** + * ReconciledDataPoint bodyFat. + * @member {google.devicesandservices.health.v4.IBodyFat|null|undefined} bodyFat + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.bodyFat = null; + + /** + * ReconciledDataPoint activeZoneMinutes. + * @member {google.devicesandservices.health.v4.IActiveZoneMinutes|null|undefined} activeZoneMinutes + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.activeZoneMinutes = null; + + /** + * ReconciledDataPoint heartRateVariability. + * @member {google.devicesandservices.health.v4.IHeartRateVariability|null|undefined} heartRateVariability + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.heartRateVariability = null; + + /** + * ReconciledDataPoint dailySleepTemperatureDerivations. + * @member {google.devicesandservices.health.v4.IDailySleepTemperatureDerivations|null|undefined} dailySleepTemperatureDerivations + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.dailySleepTemperatureDerivations = null; + + /** + * ReconciledDataPoint sedentaryPeriod. + * @member {google.devicesandservices.health.v4.ISedentaryPeriod|null|undefined} sedentaryPeriod + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.sedentaryPeriod = null; + + /** + * ReconciledDataPoint runVo2Max. + * @member {google.devicesandservices.health.v4.IRunVO2Max|null|undefined} runVo2Max + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.runVo2Max = null; + + /** + * ReconciledDataPoint oxygenSaturation. + * @member {google.devicesandservices.health.v4.IOxygenSaturation|null|undefined} oxygenSaturation + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.oxygenSaturation = null; + + /** + * ReconciledDataPoint dailyOxygenSaturation. + * @member {google.devicesandservices.health.v4.IDailyOxygenSaturation|null|undefined} dailyOxygenSaturation + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.dailyOxygenSaturation = null; + + /** + * ReconciledDataPoint activityLevel. + * @member {google.devicesandservices.health.v4.IActivityLevel|null|undefined} activityLevel + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.activityLevel = null; + + /** + * ReconciledDataPoint vo2Max. + * @member {google.devicesandservices.health.v4.IVO2Max|null|undefined} vo2Max + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.vo2Max = null; + + /** + * ReconciledDataPoint dailyVo2Max. + * @member {google.devicesandservices.health.v4.IDailyVO2Max|null|undefined} dailyVo2Max + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.dailyVo2Max = null; + + /** + * ReconciledDataPoint nutritionLog. + * @member {google.devicesandservices.health.v4.INutritionLog|null|undefined} nutritionLog + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.nutritionLog = null; + + /** + * ReconciledDataPoint dailyHeartRateZones. + * @member {google.devicesandservices.health.v4.IDailyHeartRateZones|null|undefined} dailyHeartRateZones + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.dailyHeartRateZones = null; + + /** + * ReconciledDataPoint hydrationLog. + * @member {google.devicesandservices.health.v4.IHydrationLog|null|undefined} hydrationLog + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.hydrationLog = null; + + /** + * ReconciledDataPoint timeInHeartRateZone. + * @member {google.devicesandservices.health.v4.ITimeInHeartRateZone|null|undefined} timeInHeartRateZone + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.timeInHeartRateZone = null; + + /** + * ReconciledDataPoint activeMinutes. + * @member {google.devicesandservices.health.v4.IActiveMinutes|null|undefined} activeMinutes + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.activeMinutes = null; + + /** + * ReconciledDataPoint respiratoryRateSleepSummary. + * @member {google.devicesandservices.health.v4.IRespiratoryRateSleepSummary|null|undefined} respiratoryRateSleepSummary + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.respiratoryRateSleepSummary = null; + + /** + * ReconciledDataPoint dailyRespiratoryRate. + * @member {google.devicesandservices.health.v4.IDailyRespiratoryRate|null|undefined} dailyRespiratoryRate + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.dailyRespiratoryRate = null; + + /** + * ReconciledDataPoint swimLengthsData. + * @member {google.devicesandservices.health.v4.ISwimLengthsData|null|undefined} swimLengthsData + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.swimLengthsData = null; + + /** + * ReconciledDataPoint height. + * @member {google.devicesandservices.health.v4.IHeight|null|undefined} height + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.height = null; + + /** + * ReconciledDataPoint basalEnergyBurned. + * @member {google.devicesandservices.health.v4.IBasalEnergyBurned|null|undefined} basalEnergyBurned + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.basalEnergyBurned = null; + + /** + * ReconciledDataPoint coreBodyTemperature. + * @member {google.devicesandservices.health.v4.ICoreBodyTemperature|null|undefined} coreBodyTemperature + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.coreBodyTemperature = null; + + /** + * ReconciledDataPoint activeEnergyBurned. + * @member {google.devicesandservices.health.v4.IActiveEnergyBurned|null|undefined} activeEnergyBurned + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.activeEnergyBurned = null; + + /** + * ReconciledDataPoint bloodGlucose. + * @member {google.devicesandservices.health.v4.IBloodGlucose|null|undefined} bloodGlucose + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.bloodGlucose = null; + + /** + * ReconciledDataPoint dataPointName. + * @member {string} dataPointName + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + ReconciledDataPoint.prototype.dataPointName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReconciledDataPoint data. + * @member {"steps"|"floors"|"heartRate"|"sleep"|"dailyRestingHeartRate"|"dailyHeartRateVariability"|"exercise"|"weight"|"altitude"|"distance"|"bodyFat"|"activeZoneMinutes"|"heartRateVariability"|"dailySleepTemperatureDerivations"|"sedentaryPeriod"|"runVo2Max"|"oxygenSaturation"|"dailyOxygenSaturation"|"activityLevel"|"vo2Max"|"dailyVo2Max"|"nutritionLog"|"dailyHeartRateZones"|"hydrationLog"|"timeInHeartRateZone"|"activeMinutes"|"respiratoryRateSleepSummary"|"dailyRespiratoryRate"|"swimLengthsData"|"height"|"basalEnergyBurned"|"coreBodyTemperature"|"activeEnergyBurned"|"bloodGlucose"|undefined} data + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + */ + Object.defineProperty(ReconciledDataPoint.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["steps", "floors", "heartRate", "sleep", "dailyRestingHeartRate", "dailyHeartRateVariability", "exercise", "weight", "altitude", "distance", "bodyFat", "activeZoneMinutes", "heartRateVariability", "dailySleepTemperatureDerivations", "sedentaryPeriod", "runVo2Max", "oxygenSaturation", "dailyOxygenSaturation", "activityLevel", "vo2Max", "dailyVo2Max", "nutritionLog", "dailyHeartRateZones", "hydrationLog", "timeInHeartRateZone", "activeMinutes", "respiratoryRateSleepSummary", "dailyRespiratoryRate", "swimLengthsData", "height", "basalEnergyBurned", "coreBodyTemperature", "activeEnergyBurned", "bloodGlucose"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReconciledDataPoint instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @static + * @param {google.devicesandservices.health.v4.IReconciledDataPoint=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ReconciledDataPoint} ReconciledDataPoint instance + */ + ReconciledDataPoint.create = function create(properties) { + return new ReconciledDataPoint(properties); + }; + + /** + * Encodes the specified ReconciledDataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.ReconciledDataPoint.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @static + * @param {google.devicesandservices.health.v4.IReconciledDataPoint} message ReconciledDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReconciledDataPoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataPointName != null && Object.hasOwnProperty.call(message, "dataPointName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataPointName); + if (message.steps != null && Object.hasOwnProperty.call(message, "steps")) + $root.google.devicesandservices.health.v4.Steps.encode(message.steps, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.floors != null && Object.hasOwnProperty.call(message, "floors")) + $root.google.devicesandservices.health.v4.Floors.encode(message.floors, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.heartRate != null && Object.hasOwnProperty.call(message, "heartRate")) + $root.google.devicesandservices.health.v4.HeartRate.encode(message.heartRate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.sleep != null && Object.hasOwnProperty.call(message, "sleep")) + $root.google.devicesandservices.health.v4.Sleep.encode(message.sleep, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dailyRestingHeartRate != null && Object.hasOwnProperty.call(message, "dailyRestingHeartRate")) + $root.google.devicesandservices.health.v4.DailyRestingHeartRate.encode(message.dailyRestingHeartRate, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.dailyHeartRateVariability != null && Object.hasOwnProperty.call(message, "dailyHeartRateVariability")) + $root.google.devicesandservices.health.v4.DailyHeartRateVariability.encode(message.dailyHeartRateVariability, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.exercise != null && Object.hasOwnProperty.call(message, "exercise")) + $root.google.devicesandservices.health.v4.Exercise.encode(message.exercise, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + $root.google.devicesandservices.health.v4.Weight.encode(message.weight, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.altitude != null && Object.hasOwnProperty.call(message, "altitude")) + $root.google.devicesandservices.health.v4.Altitude.encode(message.altitude, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) + $root.google.devicesandservices.health.v4.Distance.encode(message.distance, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.bodyFat != null && Object.hasOwnProperty.call(message, "bodyFat")) + $root.google.devicesandservices.health.v4.BodyFat.encode(message.bodyFat, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.activeZoneMinutes != null && Object.hasOwnProperty.call(message, "activeZoneMinutes")) + $root.google.devicesandservices.health.v4.ActiveZoneMinutes.encode(message.activeZoneMinutes, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.heartRateVariability != null && Object.hasOwnProperty.call(message, "heartRateVariability")) + $root.google.devicesandservices.health.v4.HeartRateVariability.encode(message.heartRateVariability, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.dailySleepTemperatureDerivations != null && Object.hasOwnProperty.call(message, "dailySleepTemperatureDerivations")) + $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.encode(message.dailySleepTemperatureDerivations, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.sedentaryPeriod != null && Object.hasOwnProperty.call(message, "sedentaryPeriod")) + $root.google.devicesandservices.health.v4.SedentaryPeriod.encode(message.sedentaryPeriod, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.runVo2Max != null && Object.hasOwnProperty.call(message, "runVo2Max")) + $root.google.devicesandservices.health.v4.RunVO2Max.encode(message.runVo2Max, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.oxygenSaturation != null && Object.hasOwnProperty.call(message, "oxygenSaturation")) + $root.google.devicesandservices.health.v4.OxygenSaturation.encode(message.oxygenSaturation, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.dailyOxygenSaturation != null && Object.hasOwnProperty.call(message, "dailyOxygenSaturation")) + $root.google.devicesandservices.health.v4.DailyOxygenSaturation.encode(message.dailyOxygenSaturation, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.activityLevel != null && Object.hasOwnProperty.call(message, "activityLevel")) + $root.google.devicesandservices.health.v4.ActivityLevel.encode(message.activityLevel, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.vo2Max != null && Object.hasOwnProperty.call(message, "vo2Max")) + $root.google.devicesandservices.health.v4.VO2Max.encode(message.vo2Max, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.dailyVo2Max != null && Object.hasOwnProperty.call(message, "dailyVo2Max")) + $root.google.devicesandservices.health.v4.DailyVO2Max.encode(message.dailyVo2Max, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.nutritionLog != null && Object.hasOwnProperty.call(message, "nutritionLog")) + $root.google.devicesandservices.health.v4.NutritionLog.encode(message.nutritionLog, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.dailyHeartRateZones != null && Object.hasOwnProperty.call(message, "dailyHeartRateZones")) + $root.google.devicesandservices.health.v4.DailyHeartRateZones.encode(message.dailyHeartRateZones, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.hydrationLog != null && Object.hasOwnProperty.call(message, "hydrationLog")) + $root.google.devicesandservices.health.v4.HydrationLog.encode(message.hydrationLog, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.timeInHeartRateZone != null && Object.hasOwnProperty.call(message, "timeInHeartRateZone")) + $root.google.devicesandservices.health.v4.TimeInHeartRateZone.encode(message.timeInHeartRateZone, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.activeMinutes != null && Object.hasOwnProperty.call(message, "activeMinutes")) + $root.google.devicesandservices.health.v4.ActiveMinutes.encode(message.activeMinutes, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); + if (message.respiratoryRateSleepSummary != null && Object.hasOwnProperty.call(message, "respiratoryRateSleepSummary")) + $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.encode(message.respiratoryRateSleepSummary, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + if (message.dailyRespiratoryRate != null && Object.hasOwnProperty.call(message, "dailyRespiratoryRate")) + $root.google.devicesandservices.health.v4.DailyRespiratoryRate.encode(message.dailyRespiratoryRate, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + if (message.swimLengthsData != null && Object.hasOwnProperty.call(message, "swimLengthsData")) + $root.google.devicesandservices.health.v4.SwimLengthsData.encode(message.swimLengthsData, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + $root.google.devicesandservices.health.v4.Height.encode(message.height, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); + if (message.basalEnergyBurned != null && Object.hasOwnProperty.call(message, "basalEnergyBurned")) + $root.google.devicesandservices.health.v4.BasalEnergyBurned.encode(message.basalEnergyBurned, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + if (message.coreBodyTemperature != null && Object.hasOwnProperty.call(message, "coreBodyTemperature")) + $root.google.devicesandservices.health.v4.CoreBodyTemperature.encode(message.coreBodyTemperature, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.activeEnergyBurned != null && Object.hasOwnProperty.call(message, "activeEnergyBurned")) + $root.google.devicesandservices.health.v4.ActiveEnergyBurned.encode(message.activeEnergyBurned, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.bloodGlucose != null && Object.hasOwnProperty.call(message, "bloodGlucose")) + $root.google.devicesandservices.health.v4.BloodGlucose.encode(message.bloodGlucose, writer.uint32(/* id 46, wireType 2 =*/370).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReconciledDataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ReconciledDataPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @static + * @param {google.devicesandservices.health.v4.IReconciledDataPoint} message ReconciledDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReconciledDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReconciledDataPoint message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.ReconciledDataPoint} ReconciledDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReconciledDataPoint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ReconciledDataPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.steps = $root.google.devicesandservices.health.v4.Steps.decode(reader, reader.uint32()); + break; + } + case 5: { + message.floors = $root.google.devicesandservices.health.v4.Floors.decode(reader, reader.uint32()); + break; + } + case 6: { + message.heartRate = $root.google.devicesandservices.health.v4.HeartRate.decode(reader, reader.uint32()); + break; + } + case 8: { + message.sleep = $root.google.devicesandservices.health.v4.Sleep.decode(reader, reader.uint32()); + break; + } + case 9: { + message.dailyRestingHeartRate = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.decode(reader, reader.uint32()); + break; + } + case 10: { + message.dailyHeartRateVariability = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.decode(reader, reader.uint32()); + break; + } + case 11: { + message.exercise = $root.google.devicesandservices.health.v4.Exercise.decode(reader, reader.uint32()); + break; + } + case 12: { + message.weight = $root.google.devicesandservices.health.v4.Weight.decode(reader, reader.uint32()); + break; + } + case 13: { + message.altitude = $root.google.devicesandservices.health.v4.Altitude.decode(reader, reader.uint32()); + break; + } + case 14: { + message.distance = $root.google.devicesandservices.health.v4.Distance.decode(reader, reader.uint32()); + break; + } + case 15: { + message.bodyFat = $root.google.devicesandservices.health.v4.BodyFat.decode(reader, reader.uint32()); + break; + } + case 17: { + message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.decode(reader, reader.uint32()); + break; + } + case 19: { + message.heartRateVariability = $root.google.devicesandservices.health.v4.HeartRateVariability.decode(reader, reader.uint32()); + break; + } + case 20: { + message.dailySleepTemperatureDerivations = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.decode(reader, reader.uint32()); + break; + } + case 21: { + message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriod.decode(reader, reader.uint32()); + break; + } + case 22: { + message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2Max.decode(reader, reader.uint32()); + break; + } + case 24: { + message.oxygenSaturation = $root.google.devicesandservices.health.v4.OxygenSaturation.decode(reader, reader.uint32()); + break; + } + case 25: { + message.dailyOxygenSaturation = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.decode(reader, reader.uint32()); + break; + } + case 26: { + message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevel.decode(reader, reader.uint32()); + break; + } + case 27: { + message.vo2Max = $root.google.devicesandservices.health.v4.VO2Max.decode(reader, reader.uint32()); + break; + } + case 28: { + message.dailyVo2Max = $root.google.devicesandservices.health.v4.DailyVO2Max.decode(reader, reader.uint32()); + break; + } + case 29: { + message.nutritionLog = $root.google.devicesandservices.health.v4.NutritionLog.decode(reader, reader.uint32()); + break; + } + case 32: { + message.dailyHeartRateZones = $root.google.devicesandservices.health.v4.DailyHeartRateZones.decode(reader, reader.uint32()); + break; + } + case 33: { + message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLog.decode(reader, reader.uint32()); + break; + } + case 35: { + message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.decode(reader, reader.uint32()); + break; + } + case 36: { + message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutes.decode(reader, reader.uint32()); + break; + } + case 37: { + message.respiratoryRateSleepSummary = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.decode(reader, reader.uint32()); + break; + } + case 38: { + message.dailyRespiratoryRate = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.decode(reader, reader.uint32()); + break; + } + case 39: { + message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsData.decode(reader, reader.uint32()); + break; + } + case 40: { + message.height = $root.google.devicesandservices.health.v4.Height.decode(reader, reader.uint32()); + break; + } + case 41: { + message.basalEnergyBurned = $root.google.devicesandservices.health.v4.BasalEnergyBurned.decode(reader, reader.uint32()); + break; + } + case 42: { + message.coreBodyTemperature = $root.google.devicesandservices.health.v4.CoreBodyTemperature.decode(reader, reader.uint32()); + break; + } + case 44: { + message.activeEnergyBurned = $root.google.devicesandservices.health.v4.ActiveEnergyBurned.decode(reader, reader.uint32()); + break; + } + case 46: { + message.bloodGlucose = $root.google.devicesandservices.health.v4.BloodGlucose.decode(reader, reader.uint32()); + break; + } + case 1: { + message.dataPointName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReconciledDataPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.ReconciledDataPoint} ReconciledDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReconciledDataPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReconciledDataPoint message. + * @function verify + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReconciledDataPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.steps != null && message.hasOwnProperty("steps")) { + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Steps.verify(message.steps); + if (error) + return "steps." + error; + } + } + if (message.floors != null && message.hasOwnProperty("floors")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Floors.verify(message.floors); + if (error) + return "floors." + error; + } + } + if (message.heartRate != null && message.hasOwnProperty("heartRate")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.HeartRate.verify(message.heartRate); + if (error) + return "heartRate." + error; + } + } + if (message.sleep != null && message.hasOwnProperty("sleep")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Sleep.verify(message.sleep); + if (error) + return "sleep." + error; + } + } + if (message.dailyRestingHeartRate != null && message.hasOwnProperty("dailyRestingHeartRate")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.verify(message.dailyRestingHeartRate); + if (error) + return "dailyRestingHeartRate." + error; + } + } + if (message.dailyHeartRateVariability != null && message.hasOwnProperty("dailyHeartRateVariability")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.verify(message.dailyHeartRateVariability); + if (error) + return "dailyHeartRateVariability." + error; + } + } + if (message.exercise != null && message.hasOwnProperty("exercise")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Exercise.verify(message.exercise); + if (error) + return "exercise." + error; + } + } + if (message.weight != null && message.hasOwnProperty("weight")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Weight.verify(message.weight); + if (error) + return "weight." + error; + } + } + if (message.altitude != null && message.hasOwnProperty("altitude")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Altitude.verify(message.altitude); + if (error) + return "altitude." + error; + } + } + if (message.distance != null && message.hasOwnProperty("distance")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Distance.verify(message.distance); + if (error) + return "distance." + error; + } + } + if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.BodyFat.verify(message.bodyFat); + if (error) + return "bodyFat." + error; + } + } + if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.verify(message.activeZoneMinutes); + if (error) + return "activeZoneMinutes." + error; + } + } + if (message.heartRateVariability != null && message.hasOwnProperty("heartRateVariability")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.HeartRateVariability.verify(message.heartRateVariability); + if (error) + return "heartRateVariability." + error; + } + } + if (message.dailySleepTemperatureDerivations != null && message.hasOwnProperty("dailySleepTemperatureDerivations")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.verify(message.dailySleepTemperatureDerivations); + if (error) + return "dailySleepTemperatureDerivations." + error; + } + } + if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.SedentaryPeriod.verify(message.sedentaryPeriod); + if (error) + return "sedentaryPeriod." + error; + } + } + if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.RunVO2Max.verify(message.runVo2Max); + if (error) + return "runVo2Max." + error; + } + } + if (message.oxygenSaturation != null && message.hasOwnProperty("oxygenSaturation")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.OxygenSaturation.verify(message.oxygenSaturation); + if (error) + return "oxygenSaturation." + error; + } + } + if (message.dailyOxygenSaturation != null && message.hasOwnProperty("dailyOxygenSaturation")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.verify(message.dailyOxygenSaturation); + if (error) + return "dailyOxygenSaturation." + error; + } + } + if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.ActivityLevel.verify(message.activityLevel); + if (error) + return "activityLevel." + error; + } + } + if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.VO2Max.verify(message.vo2Max); + if (error) + return "vo2Max." + error; + } + } + if (message.dailyVo2Max != null && message.hasOwnProperty("dailyVo2Max")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.DailyVO2Max.verify(message.dailyVo2Max); + if (error) + return "dailyVo2Max." + error; + } + } + if (message.nutritionLog != null && message.hasOwnProperty("nutritionLog")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.NutritionLog.verify(message.nutritionLog); + if (error) + return "nutritionLog." + error; + } + } + if (message.dailyHeartRateZones != null && message.hasOwnProperty("dailyHeartRateZones")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.DailyHeartRateZones.verify(message.dailyHeartRateZones); + if (error) + return "dailyHeartRateZones." + error; + } + } + if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.HydrationLog.verify(message.hydrationLog); + if (error) + return "hydrationLog." + error; + } + } + if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.verify(message.timeInHeartRateZone); + if (error) + return "timeInHeartRateZone." + error; + } + } + if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.ActiveMinutes.verify(message.activeMinutes); + if (error) + return "activeMinutes." + error; + } + } + if (message.respiratoryRateSleepSummary != null && message.hasOwnProperty("respiratoryRateSleepSummary")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.verify(message.respiratoryRateSleepSummary); + if (error) + return "respiratoryRateSleepSummary." + error; + } + } + if (message.dailyRespiratoryRate != null && message.hasOwnProperty("dailyRespiratoryRate")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.verify(message.dailyRespiratoryRate); + if (error) + return "dailyRespiratoryRate." + error; + } + } + if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.SwimLengthsData.verify(message.swimLengthsData); + if (error) + return "swimLengthsData." + error; + } + } + if (message.height != null && message.hasOwnProperty("height")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.Height.verify(message.height); + if (error) + return "height." + error; + } + } + if (message.basalEnergyBurned != null && message.hasOwnProperty("basalEnergyBurned")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.BasalEnergyBurned.verify(message.basalEnergyBurned); + if (error) + return "basalEnergyBurned." + error; + } + } + if (message.coreBodyTemperature != null && message.hasOwnProperty("coreBodyTemperature")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.CoreBodyTemperature.verify(message.coreBodyTemperature); + if (error) + return "coreBodyTemperature." + error; + } + } + if (message.activeEnergyBurned != null && message.hasOwnProperty("activeEnergyBurned")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.ActiveEnergyBurned.verify(message.activeEnergyBurned); + if (error) + return "activeEnergyBurned." + error; + } + } + if (message.bloodGlucose != null && message.hasOwnProperty("bloodGlucose")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.devicesandservices.health.v4.BloodGlucose.verify(message.bloodGlucose); + if (error) + return "bloodGlucose." + error; + } + } + if (message.dataPointName != null && message.hasOwnProperty("dataPointName")) + if (!$util.isString(message.dataPointName)) + return "dataPointName: string expected"; + return null; + }; + + /** + * Creates a ReconciledDataPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.ReconciledDataPoint} ReconciledDataPoint + */ + ReconciledDataPoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ReconciledDataPoint) + return object; + var message = new $root.google.devicesandservices.health.v4.ReconciledDataPoint(); + if (object.steps != null) { + if (typeof object.steps !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.steps: object expected"); + message.steps = $root.google.devicesandservices.health.v4.Steps.fromObject(object.steps); + } + if (object.floors != null) { + if (typeof object.floors !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.floors: object expected"); + message.floors = $root.google.devicesandservices.health.v4.Floors.fromObject(object.floors); + } + if (object.heartRate != null) { + if (typeof object.heartRate !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.heartRate: object expected"); + message.heartRate = $root.google.devicesandservices.health.v4.HeartRate.fromObject(object.heartRate); + } + if (object.sleep != null) { + if (typeof object.sleep !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.sleep: object expected"); + message.sleep = $root.google.devicesandservices.health.v4.Sleep.fromObject(object.sleep); + } + if (object.dailyRestingHeartRate != null) { + if (typeof object.dailyRestingHeartRate !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.dailyRestingHeartRate: object expected"); + message.dailyRestingHeartRate = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.fromObject(object.dailyRestingHeartRate); + } + if (object.dailyHeartRateVariability != null) { + if (typeof object.dailyHeartRateVariability !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.dailyHeartRateVariability: object expected"); + message.dailyHeartRateVariability = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.fromObject(object.dailyHeartRateVariability); + } + if (object.exercise != null) { + if (typeof object.exercise !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.exercise: object expected"); + message.exercise = $root.google.devicesandservices.health.v4.Exercise.fromObject(object.exercise); + } + if (object.weight != null) { + if (typeof object.weight !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.weight: object expected"); + message.weight = $root.google.devicesandservices.health.v4.Weight.fromObject(object.weight); + } + if (object.altitude != null) { + if (typeof object.altitude !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.altitude: object expected"); + message.altitude = $root.google.devicesandservices.health.v4.Altitude.fromObject(object.altitude); + } + if (object.distance != null) { + if (typeof object.distance !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.distance: object expected"); + message.distance = $root.google.devicesandservices.health.v4.Distance.fromObject(object.distance); + } + if (object.bodyFat != null) { + if (typeof object.bodyFat !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.bodyFat: object expected"); + message.bodyFat = $root.google.devicesandservices.health.v4.BodyFat.fromObject(object.bodyFat); + } + if (object.activeZoneMinutes != null) { + if (typeof object.activeZoneMinutes !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.activeZoneMinutes: object expected"); + message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.fromObject(object.activeZoneMinutes); + } + if (object.heartRateVariability != null) { + if (typeof object.heartRateVariability !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.heartRateVariability: object expected"); + message.heartRateVariability = $root.google.devicesandservices.health.v4.HeartRateVariability.fromObject(object.heartRateVariability); + } + if (object.dailySleepTemperatureDerivations != null) { + if (typeof object.dailySleepTemperatureDerivations !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.dailySleepTemperatureDerivations: object expected"); + message.dailySleepTemperatureDerivations = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.fromObject(object.dailySleepTemperatureDerivations); + } + if (object.sedentaryPeriod != null) { + if (typeof object.sedentaryPeriod !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.sedentaryPeriod: object expected"); + message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriod.fromObject(object.sedentaryPeriod); + } + if (object.runVo2Max != null) { + if (typeof object.runVo2Max !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.runVo2Max: object expected"); + message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2Max.fromObject(object.runVo2Max); + } + if (object.oxygenSaturation != null) { + if (typeof object.oxygenSaturation !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.oxygenSaturation: object expected"); + message.oxygenSaturation = $root.google.devicesandservices.health.v4.OxygenSaturation.fromObject(object.oxygenSaturation); + } + if (object.dailyOxygenSaturation != null) { + if (typeof object.dailyOxygenSaturation !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.dailyOxygenSaturation: object expected"); + message.dailyOxygenSaturation = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.fromObject(object.dailyOxygenSaturation); + } + if (object.activityLevel != null) { + if (typeof object.activityLevel !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.activityLevel: object expected"); + message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevel.fromObject(object.activityLevel); + } + if (object.vo2Max != null) { + if (typeof object.vo2Max !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.vo2Max: object expected"); + message.vo2Max = $root.google.devicesandservices.health.v4.VO2Max.fromObject(object.vo2Max); + } + if (object.dailyVo2Max != null) { + if (typeof object.dailyVo2Max !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.dailyVo2Max: object expected"); + message.dailyVo2Max = $root.google.devicesandservices.health.v4.DailyVO2Max.fromObject(object.dailyVo2Max); + } + if (object.nutritionLog != null) { + if (typeof object.nutritionLog !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.nutritionLog: object expected"); + message.nutritionLog = $root.google.devicesandservices.health.v4.NutritionLog.fromObject(object.nutritionLog); + } + if (object.dailyHeartRateZones != null) { + if (typeof object.dailyHeartRateZones !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.dailyHeartRateZones: object expected"); + message.dailyHeartRateZones = $root.google.devicesandservices.health.v4.DailyHeartRateZones.fromObject(object.dailyHeartRateZones); + } + if (object.hydrationLog != null) { + if (typeof object.hydrationLog !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.hydrationLog: object expected"); + message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLog.fromObject(object.hydrationLog); + } + if (object.timeInHeartRateZone != null) { + if (typeof object.timeInHeartRateZone !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.timeInHeartRateZone: object expected"); + message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.fromObject(object.timeInHeartRateZone); + } + if (object.activeMinutes != null) { + if (typeof object.activeMinutes !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.activeMinutes: object expected"); + message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutes.fromObject(object.activeMinutes); + } + if (object.respiratoryRateSleepSummary != null) { + if (typeof object.respiratoryRateSleepSummary !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.respiratoryRateSleepSummary: object expected"); + message.respiratoryRateSleepSummary = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.fromObject(object.respiratoryRateSleepSummary); + } + if (object.dailyRespiratoryRate != null) { + if (typeof object.dailyRespiratoryRate !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.dailyRespiratoryRate: object expected"); + message.dailyRespiratoryRate = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.fromObject(object.dailyRespiratoryRate); + } + if (object.swimLengthsData != null) { + if (typeof object.swimLengthsData !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.swimLengthsData: object expected"); + message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsData.fromObject(object.swimLengthsData); + } + if (object.height != null) { + if (typeof object.height !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.height: object expected"); + message.height = $root.google.devicesandservices.health.v4.Height.fromObject(object.height); + } + if (object.basalEnergyBurned != null) { + if (typeof object.basalEnergyBurned !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.basalEnergyBurned: object expected"); + message.basalEnergyBurned = $root.google.devicesandservices.health.v4.BasalEnergyBurned.fromObject(object.basalEnergyBurned); + } + if (object.coreBodyTemperature != null) { + if (typeof object.coreBodyTemperature !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.coreBodyTemperature: object expected"); + message.coreBodyTemperature = $root.google.devicesandservices.health.v4.CoreBodyTemperature.fromObject(object.coreBodyTemperature); + } + if (object.activeEnergyBurned != null) { + if (typeof object.activeEnergyBurned !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.activeEnergyBurned: object expected"); + message.activeEnergyBurned = $root.google.devicesandservices.health.v4.ActiveEnergyBurned.fromObject(object.activeEnergyBurned); + } + if (object.bloodGlucose != null) { + if (typeof object.bloodGlucose !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.bloodGlucose: object expected"); + message.bloodGlucose = $root.google.devicesandservices.health.v4.BloodGlucose.fromObject(object.bloodGlucose); + } + if (object.dataPointName != null) + message.dataPointName = String(object.dataPointName); + return message; + }; + + /** + * Creates a plain object from a ReconciledDataPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @static + * @param {google.devicesandservices.health.v4.ReconciledDataPoint} message ReconciledDataPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReconciledDataPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dataPointName = ""; + if (message.dataPointName != null && message.hasOwnProperty("dataPointName")) + object.dataPointName = message.dataPointName; + if (message.steps != null && message.hasOwnProperty("steps")) { + object.steps = $root.google.devicesandservices.health.v4.Steps.toObject(message.steps, options); + if (options.oneofs) + object.data = "steps"; + } + if (message.floors != null && message.hasOwnProperty("floors")) { + object.floors = $root.google.devicesandservices.health.v4.Floors.toObject(message.floors, options); + if (options.oneofs) + object.data = "floors"; + } + if (message.heartRate != null && message.hasOwnProperty("heartRate")) { + object.heartRate = $root.google.devicesandservices.health.v4.HeartRate.toObject(message.heartRate, options); + if (options.oneofs) + object.data = "heartRate"; + } + if (message.sleep != null && message.hasOwnProperty("sleep")) { + object.sleep = $root.google.devicesandservices.health.v4.Sleep.toObject(message.sleep, options); + if (options.oneofs) + object.data = "sleep"; + } + if (message.dailyRestingHeartRate != null && message.hasOwnProperty("dailyRestingHeartRate")) { + object.dailyRestingHeartRate = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.toObject(message.dailyRestingHeartRate, options); + if (options.oneofs) + object.data = "dailyRestingHeartRate"; + } + if (message.dailyHeartRateVariability != null && message.hasOwnProperty("dailyHeartRateVariability")) { + object.dailyHeartRateVariability = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.toObject(message.dailyHeartRateVariability, options); + if (options.oneofs) + object.data = "dailyHeartRateVariability"; + } + if (message.exercise != null && message.hasOwnProperty("exercise")) { + object.exercise = $root.google.devicesandservices.health.v4.Exercise.toObject(message.exercise, options); + if (options.oneofs) + object.data = "exercise"; + } + if (message.weight != null && message.hasOwnProperty("weight")) { + object.weight = $root.google.devicesandservices.health.v4.Weight.toObject(message.weight, options); + if (options.oneofs) + object.data = "weight"; + } + if (message.altitude != null && message.hasOwnProperty("altitude")) { + object.altitude = $root.google.devicesandservices.health.v4.Altitude.toObject(message.altitude, options); + if (options.oneofs) + object.data = "altitude"; + } + if (message.distance != null && message.hasOwnProperty("distance")) { + object.distance = $root.google.devicesandservices.health.v4.Distance.toObject(message.distance, options); + if (options.oneofs) + object.data = "distance"; + } + if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { + object.bodyFat = $root.google.devicesandservices.health.v4.BodyFat.toObject(message.bodyFat, options); + if (options.oneofs) + object.data = "bodyFat"; + } + if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { + object.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.toObject(message.activeZoneMinutes, options); + if (options.oneofs) + object.data = "activeZoneMinutes"; + } + if (message.heartRateVariability != null && message.hasOwnProperty("heartRateVariability")) { + object.heartRateVariability = $root.google.devicesandservices.health.v4.HeartRateVariability.toObject(message.heartRateVariability, options); + if (options.oneofs) + object.data = "heartRateVariability"; + } + if (message.dailySleepTemperatureDerivations != null && message.hasOwnProperty("dailySleepTemperatureDerivations")) { + object.dailySleepTemperatureDerivations = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.toObject(message.dailySleepTemperatureDerivations, options); + if (options.oneofs) + object.data = "dailySleepTemperatureDerivations"; + } + if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { + object.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriod.toObject(message.sedentaryPeriod, options); + if (options.oneofs) + object.data = "sedentaryPeriod"; + } + if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { + object.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2Max.toObject(message.runVo2Max, options); + if (options.oneofs) + object.data = "runVo2Max"; + } + if (message.oxygenSaturation != null && message.hasOwnProperty("oxygenSaturation")) { + object.oxygenSaturation = $root.google.devicesandservices.health.v4.OxygenSaturation.toObject(message.oxygenSaturation, options); + if (options.oneofs) + object.data = "oxygenSaturation"; + } + if (message.dailyOxygenSaturation != null && message.hasOwnProperty("dailyOxygenSaturation")) { + object.dailyOxygenSaturation = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.toObject(message.dailyOxygenSaturation, options); + if (options.oneofs) + object.data = "dailyOxygenSaturation"; + } + if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { + object.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevel.toObject(message.activityLevel, options); + if (options.oneofs) + object.data = "activityLevel"; + } + if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) { + object.vo2Max = $root.google.devicesandservices.health.v4.VO2Max.toObject(message.vo2Max, options); + if (options.oneofs) + object.data = "vo2Max"; + } + if (message.dailyVo2Max != null && message.hasOwnProperty("dailyVo2Max")) { + object.dailyVo2Max = $root.google.devicesandservices.health.v4.DailyVO2Max.toObject(message.dailyVo2Max, options); + if (options.oneofs) + object.data = "dailyVo2Max"; + } + if (message.nutritionLog != null && message.hasOwnProperty("nutritionLog")) { + object.nutritionLog = $root.google.devicesandservices.health.v4.NutritionLog.toObject(message.nutritionLog, options); + if (options.oneofs) + object.data = "nutritionLog"; + } + if (message.dailyHeartRateZones != null && message.hasOwnProperty("dailyHeartRateZones")) { + object.dailyHeartRateZones = $root.google.devicesandservices.health.v4.DailyHeartRateZones.toObject(message.dailyHeartRateZones, options); + if (options.oneofs) + object.data = "dailyHeartRateZones"; + } + if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { + object.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLog.toObject(message.hydrationLog, options); + if (options.oneofs) + object.data = "hydrationLog"; + } + if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { + object.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.toObject(message.timeInHeartRateZone, options); + if (options.oneofs) + object.data = "timeInHeartRateZone"; + } + if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { + object.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutes.toObject(message.activeMinutes, options); + if (options.oneofs) + object.data = "activeMinutes"; + } + if (message.respiratoryRateSleepSummary != null && message.hasOwnProperty("respiratoryRateSleepSummary")) { + object.respiratoryRateSleepSummary = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.toObject(message.respiratoryRateSleepSummary, options); + if (options.oneofs) + object.data = "respiratoryRateSleepSummary"; + } + if (message.dailyRespiratoryRate != null && message.hasOwnProperty("dailyRespiratoryRate")) { + object.dailyRespiratoryRate = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.toObject(message.dailyRespiratoryRate, options); + if (options.oneofs) + object.data = "dailyRespiratoryRate"; + } + if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { + object.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsData.toObject(message.swimLengthsData, options); + if (options.oneofs) + object.data = "swimLengthsData"; + } + if (message.height != null && message.hasOwnProperty("height")) { + object.height = $root.google.devicesandservices.health.v4.Height.toObject(message.height, options); + if (options.oneofs) + object.data = "height"; + } + if (message.basalEnergyBurned != null && message.hasOwnProperty("basalEnergyBurned")) { + object.basalEnergyBurned = $root.google.devicesandservices.health.v4.BasalEnergyBurned.toObject(message.basalEnergyBurned, options); + if (options.oneofs) + object.data = "basalEnergyBurned"; + } + if (message.coreBodyTemperature != null && message.hasOwnProperty("coreBodyTemperature")) { + object.coreBodyTemperature = $root.google.devicesandservices.health.v4.CoreBodyTemperature.toObject(message.coreBodyTemperature, options); + if (options.oneofs) + object.data = "coreBodyTemperature"; + } + if (message.activeEnergyBurned != null && message.hasOwnProperty("activeEnergyBurned")) { + object.activeEnergyBurned = $root.google.devicesandservices.health.v4.ActiveEnergyBurned.toObject(message.activeEnergyBurned, options); + if (options.oneofs) + object.data = "activeEnergyBurned"; + } + if (message.bloodGlucose != null && message.hasOwnProperty("bloodGlucose")) { + object.bloodGlucose = $root.google.devicesandservices.health.v4.BloodGlucose.toObject(message.bloodGlucose, options); + if (options.oneofs) + object.data = "bloodGlucose"; + } + return object; + }; + + /** + * Converts this ReconciledDataPoint to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @instance + * @returns {Object.} JSON object + */ + ReconciledDataPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReconciledDataPoint + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.ReconciledDataPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReconciledDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.ReconciledDataPoint"; + }; + + return ReconciledDataPoint; + })(); + + v4.RollupDataPoint = (function() { + + /** + * Properties of a RollupDataPoint. + * @memberof google.devicesandservices.health.v4 + * @interface IRollupDataPoint + * @property {google.devicesandservices.health.v4.IStepsRollupValue|null} [steps] RollupDataPoint steps + * @property {google.devicesandservices.health.v4.IFloorsRollupValue|null} [floors] RollupDataPoint floors + * @property {google.devicesandservices.health.v4.IHeartRateRollupValue|null} [heartRate] RollupDataPoint heartRate + * @property {google.devicesandservices.health.v4.IWeightRollupValue|null} [weight] RollupDataPoint weight + * @property {google.devicesandservices.health.v4.IAltitudeRollupValue|null} [altitude] RollupDataPoint altitude + * @property {google.devicesandservices.health.v4.IDistanceRollupValue|null} [distance] RollupDataPoint distance + * @property {google.devicesandservices.health.v4.IBodyFatRollupValue|null} [bodyFat] RollupDataPoint bodyFat + * @property {google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null} [totalCalories] RollupDataPoint totalCalories + * @property {google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null} [activeZoneMinutes] RollupDataPoint activeZoneMinutes + * @property {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null} [sedentaryPeriod] RollupDataPoint sedentaryPeriod + * @property {google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null} [runVo2Max] RollupDataPoint runVo2Max + * @property {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null} [caloriesInHeartRateZone] RollupDataPoint caloriesInHeartRateZone + * @property {google.devicesandservices.health.v4.IActivityLevelRollupValue|null} [activityLevel] RollupDataPoint activityLevel + * @property {google.devicesandservices.health.v4.INutritionLogRollupValue|null} [nutritionLog] RollupDataPoint nutritionLog + * @property {google.devicesandservices.health.v4.IHydrationLogRollupValue|null} [hydrationLog] RollupDataPoint hydrationLog + * @property {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null} [timeInHeartRateZone] RollupDataPoint timeInHeartRateZone + * @property {google.devicesandservices.health.v4.IActiveMinutesRollupValue|null} [activeMinutes] RollupDataPoint activeMinutes + * @property {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null} [swimLengthsData] RollupDataPoint swimLengthsData + * @property {google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue|null} [coreBodyTemperature] RollupDataPoint coreBodyTemperature + * @property {google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue|null} [activeEnergyBurned] RollupDataPoint activeEnergyBurned + * @property {google.devicesandservices.health.v4.IBloodGlucoseRollupValue|null} [bloodGlucose] RollupDataPoint bloodGlucose + * @property {google.protobuf.ITimestamp|null} [startTime] RollupDataPoint startTime + * @property {google.protobuf.ITimestamp|null} [endTime] RollupDataPoint endTime + */ + + /** + * Constructs a new RollupDataPoint. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a RollupDataPoint. + * @implements IRollupDataPoint + * @constructor + * @param {google.devicesandservices.health.v4.IRollupDataPoint=} [properties] Properties to set + */ + function RollupDataPoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RollupDataPoint steps. + * @member {google.devicesandservices.health.v4.IStepsRollupValue|null|undefined} steps + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.steps = null; + + /** + * RollupDataPoint floors. + * @member {google.devicesandservices.health.v4.IFloorsRollupValue|null|undefined} floors + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.floors = null; + + /** + * RollupDataPoint heartRate. + * @member {google.devicesandservices.health.v4.IHeartRateRollupValue|null|undefined} heartRate + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.heartRate = null; + + /** + * RollupDataPoint weight. + * @member {google.devicesandservices.health.v4.IWeightRollupValue|null|undefined} weight + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.weight = null; + + /** + * RollupDataPoint altitude. + * @member {google.devicesandservices.health.v4.IAltitudeRollupValue|null|undefined} altitude + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.altitude = null; + + /** + * RollupDataPoint distance. + * @member {google.devicesandservices.health.v4.IDistanceRollupValue|null|undefined} distance + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.distance = null; + + /** + * RollupDataPoint bodyFat. + * @member {google.devicesandservices.health.v4.IBodyFatRollupValue|null|undefined} bodyFat + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.bodyFat = null; + + /** + * RollupDataPoint totalCalories. + * @member {google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null|undefined} totalCalories + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.totalCalories = null; + + /** + * RollupDataPoint activeZoneMinutes. + * @member {google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null|undefined} activeZoneMinutes + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.activeZoneMinutes = null; + + /** + * RollupDataPoint sedentaryPeriod. + * @member {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null|undefined} sedentaryPeriod + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.sedentaryPeriod = null; + + /** + * RollupDataPoint runVo2Max. + * @member {google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null|undefined} runVo2Max + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.runVo2Max = null; + + /** + * RollupDataPoint caloriesInHeartRateZone. + * @member {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null|undefined} caloriesInHeartRateZone + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.caloriesInHeartRateZone = null; + + /** + * RollupDataPoint activityLevel. + * @member {google.devicesandservices.health.v4.IActivityLevelRollupValue|null|undefined} activityLevel + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.activityLevel = null; + + /** + * RollupDataPoint nutritionLog. + * @member {google.devicesandservices.health.v4.INutritionLogRollupValue|null|undefined} nutritionLog + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.nutritionLog = null; + + /** + * RollupDataPoint hydrationLog. + * @member {google.devicesandservices.health.v4.IHydrationLogRollupValue|null|undefined} hydrationLog + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.hydrationLog = null; + + /** + * RollupDataPoint timeInHeartRateZone. + * @member {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null|undefined} timeInHeartRateZone + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.timeInHeartRateZone = null; + + /** + * RollupDataPoint activeMinutes. + * @member {google.devicesandservices.health.v4.IActiveMinutesRollupValue|null|undefined} activeMinutes + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.activeMinutes = null; + + /** + * RollupDataPoint swimLengthsData. + * @member {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null|undefined} swimLengthsData + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.swimLengthsData = null; + + /** + * RollupDataPoint coreBodyTemperature. + * @member {google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue|null|undefined} coreBodyTemperature + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.coreBodyTemperature = null; + + /** + * RollupDataPoint activeEnergyBurned. + * @member {google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue|null|undefined} activeEnergyBurned + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.activeEnergyBurned = null; + + /** + * RollupDataPoint bloodGlucose. + * @member {google.devicesandservices.health.v4.IBloodGlucoseRollupValue|null|undefined} bloodGlucose + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.bloodGlucose = null; + + /** + * RollupDataPoint startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.startTime = null; + + /** + * RollupDataPoint endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + RollupDataPoint.prototype.endTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RollupDataPoint value. + * @member {"steps"|"floors"|"heartRate"|"weight"|"altitude"|"distance"|"bodyFat"|"totalCalories"|"activeZoneMinutes"|"sedentaryPeriod"|"runVo2Max"|"caloriesInHeartRateZone"|"activityLevel"|"nutritionLog"|"hydrationLog"|"timeInHeartRateZone"|"activeMinutes"|"swimLengthsData"|"coreBodyTemperature"|"activeEnergyBurned"|"bloodGlucose"|undefined} value + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + */ + Object.defineProperty(RollupDataPoint.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["steps", "floors", "heartRate", "weight", "altitude", "distance", "bodyFat", "totalCalories", "activeZoneMinutes", "sedentaryPeriod", "runVo2Max", "caloriesInHeartRateZone", "activityLevel", "nutritionLog", "hydrationLog", "timeInHeartRateZone", "activeMinutes", "swimLengthsData", "coreBodyTemperature", "activeEnergyBurned", "bloodGlucose"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RollupDataPoint instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @static + * @param {google.devicesandservices.health.v4.IRollupDataPoint=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.RollupDataPoint} RollupDataPoint instance + */ + RollupDataPoint.create = function create(properties) { + return new RollupDataPoint(properties); + }; + + /** + * Encodes the specified RollupDataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.RollupDataPoint.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @static + * @param {google.devicesandservices.health.v4.IRollupDataPoint} message RollupDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollupDataPoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.steps != null && Object.hasOwnProperty.call(message, "steps")) + $root.google.devicesandservices.health.v4.StepsRollupValue.encode(message.steps, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.floors != null && Object.hasOwnProperty.call(message, "floors")) + $root.google.devicesandservices.health.v4.FloorsRollupValue.encode(message.floors, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.heartRate != null && Object.hasOwnProperty.call(message, "heartRate")) + $root.google.devicesandservices.health.v4.HeartRateRollupValue.encode(message.heartRate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + $root.google.devicesandservices.health.v4.WeightRollupValue.encode(message.weight, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.altitude != null && Object.hasOwnProperty.call(message, "altitude")) + $root.google.devicesandservices.health.v4.AltitudeRollupValue.encode(message.altitude, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) + $root.google.devicesandservices.health.v4.DistanceRollupValue.encode(message.distance, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.bodyFat != null && Object.hasOwnProperty.call(message, "bodyFat")) + $root.google.devicesandservices.health.v4.BodyFatRollupValue.encode(message.bodyFat, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.totalCalories != null && Object.hasOwnProperty.call(message, "totalCalories")) + $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.encode(message.totalCalories, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.activeZoneMinutes != null && Object.hasOwnProperty.call(message, "activeZoneMinutes")) + $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.encode(message.activeZoneMinutes, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.sedentaryPeriod != null && Object.hasOwnProperty.call(message, "sedentaryPeriod")) + $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.encode(message.sedentaryPeriod, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.runVo2Max != null && Object.hasOwnProperty.call(message, "runVo2Max")) + $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.encode(message.runVo2Max, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.caloriesInHeartRateZone != null && Object.hasOwnProperty.call(message, "caloriesInHeartRateZone")) + $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.encode(message.caloriesInHeartRateZone, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.activityLevel != null && Object.hasOwnProperty.call(message, "activityLevel")) + $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.encode(message.activityLevel, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.nutritionLog != null && Object.hasOwnProperty.call(message, "nutritionLog")) + $root.google.devicesandservices.health.v4.NutritionLogRollupValue.encode(message.nutritionLog, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.hydrationLog != null && Object.hasOwnProperty.call(message, "hydrationLog")) + $root.google.devicesandservices.health.v4.HydrationLogRollupValue.encode(message.hydrationLog, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.timeInHeartRateZone != null && Object.hasOwnProperty.call(message, "timeInHeartRateZone")) + $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.encode(message.timeInHeartRateZone, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.activeMinutes != null && Object.hasOwnProperty.call(message, "activeMinutes")) + $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.encode(message.activeMinutes, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.swimLengthsData != null && Object.hasOwnProperty.call(message, "swimLengthsData")) + $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.encode(message.swimLengthsData, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.coreBodyTemperature != null && Object.hasOwnProperty.call(message, "coreBodyTemperature")) + $root.google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue.encode(message.coreBodyTemperature, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.activeEnergyBurned != null && Object.hasOwnProperty.call(message, "activeEnergyBurned")) + $root.google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue.encode(message.activeEnergyBurned, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.bloodGlucose != null && Object.hasOwnProperty.call(message, "bloodGlucose")) + $root.google.devicesandservices.health.v4.BloodGlucoseRollupValue.encode(message.bloodGlucose, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RollupDataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RollupDataPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @static + * @param {google.devicesandservices.health.v4.IRollupDataPoint} message RollupDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollupDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RollupDataPoint message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.RollupDataPoint} RollupDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollupDataPoint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.RollupDataPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.steps = $root.google.devicesandservices.health.v4.StepsRollupValue.decode(reader, reader.uint32()); + break; + } + case 6: { + message.floors = $root.google.devicesandservices.health.v4.FloorsRollupValue.decode(reader, reader.uint32()); + break; + } + case 7: { + message.heartRate = $root.google.devicesandservices.health.v4.HeartRateRollupValue.decode(reader, reader.uint32()); + break; + } + case 8: { + message.weight = $root.google.devicesandservices.health.v4.WeightRollupValue.decode(reader, reader.uint32()); + break; + } + case 9: { + message.altitude = $root.google.devicesandservices.health.v4.AltitudeRollupValue.decode(reader, reader.uint32()); + break; + } + case 10: { + message.distance = $root.google.devicesandservices.health.v4.DistanceRollupValue.decode(reader, reader.uint32()); + break; + } + case 11: { + message.bodyFat = $root.google.devicesandservices.health.v4.BodyFatRollupValue.decode(reader, reader.uint32()); + break; + } + case 12: { + message.totalCalories = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.decode(reader, reader.uint32()); + break; + } + case 13: { + message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.decode(reader, reader.uint32()); + break; + } + case 15: { + message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.decode(reader, reader.uint32()); + break; + } + case 16: { + message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.decode(reader, reader.uint32()); + break; + } + case 17: { + message.caloriesInHeartRateZone = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.decode(reader, reader.uint32()); + break; + } + case 18: { + message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.decode(reader, reader.uint32()); + break; + } + case 19: { + message.nutritionLog = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.decode(reader, reader.uint32()); + break; + } + case 20: { + message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.decode(reader, reader.uint32()); + break; + } + case 21: { + message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.decode(reader, reader.uint32()); + break; + } + case 22: { + message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.decode(reader, reader.uint32()); + break; + } + case 23: { + message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.decode(reader, reader.uint32()); + break; + } + case 24: { + message.coreBodyTemperature = $root.google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue.decode(reader, reader.uint32()); + break; + } + case 25: { + message.activeEnergyBurned = $root.google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue.decode(reader, reader.uint32()); + break; + } + case 26: { + message.bloodGlucose = $root.google.devicesandservices.health.v4.BloodGlucoseRollupValue.decode(reader, reader.uint32()); + break; + } + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RollupDataPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.RollupDataPoint} RollupDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollupDataPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RollupDataPoint message. + * @function verify + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollupDataPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.steps != null && message.hasOwnProperty("steps")) { + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.StepsRollupValue.verify(message.steps); + if (error) + return "steps." + error; + } + } + if (message.floors != null && message.hasOwnProperty("floors")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.FloorsRollupValue.verify(message.floors); + if (error) + return "floors." + error; + } + } + if (message.heartRate != null && message.hasOwnProperty("heartRate")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.HeartRateRollupValue.verify(message.heartRate); + if (error) + return "heartRate." + error; + } + } + if (message.weight != null && message.hasOwnProperty("weight")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.WeightRollupValue.verify(message.weight); + if (error) + return "weight." + error; + } + } + if (message.altitude != null && message.hasOwnProperty("altitude")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.AltitudeRollupValue.verify(message.altitude); + if (error) + return "altitude." + error; + } + } + if (message.distance != null && message.hasOwnProperty("distance")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.DistanceRollupValue.verify(message.distance); + if (error) + return "distance." + error; + } + } + if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.BodyFatRollupValue.verify(message.bodyFat); + if (error) + return "bodyFat." + error; + } + } + if (message.totalCalories != null && message.hasOwnProperty("totalCalories")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.verify(message.totalCalories); + if (error) + return "totalCalories." + error; + } + } + if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.verify(message.activeZoneMinutes); + if (error) + return "activeZoneMinutes." + error; + } + } + if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.verify(message.sedentaryPeriod); + if (error) + return "sedentaryPeriod." + error; + } + } + if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.verify(message.runVo2Max); + if (error) + return "runVo2Max." + error; + } + } + if (message.caloriesInHeartRateZone != null && message.hasOwnProperty("caloriesInHeartRateZone")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.verify(message.caloriesInHeartRateZone); + if (error) + return "caloriesInHeartRateZone." + error; + } + } + if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.verify(message.activityLevel); + if (error) + return "activityLevel." + error; + } + } + if (message.nutritionLog != null && message.hasOwnProperty("nutritionLog")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.verify(message.nutritionLog); + if (error) + return "nutritionLog." + error; + } + } + if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.verify(message.hydrationLog); + if (error) + return "hydrationLog." + error; + } + } + if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.verify(message.timeInHeartRateZone); + if (error) + return "timeInHeartRateZone." + error; + } + } + if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.verify(message.activeMinutes); + if (error) + return "activeMinutes." + error; + } + } + if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.verify(message.swimLengthsData); + if (error) + return "swimLengthsData." + error; + } + } + if (message.coreBodyTemperature != null && message.hasOwnProperty("coreBodyTemperature")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue.verify(message.coreBodyTemperature); + if (error) + return "coreBodyTemperature." + error; + } + } + if (message.activeEnergyBurned != null && message.hasOwnProperty("activeEnergyBurned")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue.verify(message.activeEnergyBurned); + if (error) + return "activeEnergyBurned." + error; + } + } + if (message.bloodGlucose != null && message.hasOwnProperty("bloodGlucose")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.BloodGlucoseRollupValue.verify(message.bloodGlucose); + if (error) + return "bloodGlucose." + error; + } + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a RollupDataPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.RollupDataPoint} RollupDataPoint + */ + RollupDataPoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.RollupDataPoint) + return object; + var message = new $root.google.devicesandservices.health.v4.RollupDataPoint(); + if (object.steps != null) { + if (typeof object.steps !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.steps: object expected"); + message.steps = $root.google.devicesandservices.health.v4.StepsRollupValue.fromObject(object.steps); + } + if (object.floors != null) { + if (typeof object.floors !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.floors: object expected"); + message.floors = $root.google.devicesandservices.health.v4.FloorsRollupValue.fromObject(object.floors); + } + if (object.heartRate != null) { + if (typeof object.heartRate !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.heartRate: object expected"); + message.heartRate = $root.google.devicesandservices.health.v4.HeartRateRollupValue.fromObject(object.heartRate); + } + if (object.weight != null) { + if (typeof object.weight !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.weight: object expected"); + message.weight = $root.google.devicesandservices.health.v4.WeightRollupValue.fromObject(object.weight); + } + if (object.altitude != null) { + if (typeof object.altitude !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.altitude: object expected"); + message.altitude = $root.google.devicesandservices.health.v4.AltitudeRollupValue.fromObject(object.altitude); + } + if (object.distance != null) { + if (typeof object.distance !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.distance: object expected"); + message.distance = $root.google.devicesandservices.health.v4.DistanceRollupValue.fromObject(object.distance); + } + if (object.bodyFat != null) { + if (typeof object.bodyFat !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.bodyFat: object expected"); + message.bodyFat = $root.google.devicesandservices.health.v4.BodyFatRollupValue.fromObject(object.bodyFat); + } + if (object.totalCalories != null) { + if (typeof object.totalCalories !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.totalCalories: object expected"); + message.totalCalories = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.fromObject(object.totalCalories); + } + if (object.activeZoneMinutes != null) { + if (typeof object.activeZoneMinutes !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.activeZoneMinutes: object expected"); + message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.fromObject(object.activeZoneMinutes); + } + if (object.sedentaryPeriod != null) { + if (typeof object.sedentaryPeriod !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.sedentaryPeriod: object expected"); + message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.fromObject(object.sedentaryPeriod); + } + if (object.runVo2Max != null) { + if (typeof object.runVo2Max !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.runVo2Max: object expected"); + message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.fromObject(object.runVo2Max); + } + if (object.caloriesInHeartRateZone != null) { + if (typeof object.caloriesInHeartRateZone !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.caloriesInHeartRateZone: object expected"); + message.caloriesInHeartRateZone = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.fromObject(object.caloriesInHeartRateZone); + } + if (object.activityLevel != null) { + if (typeof object.activityLevel !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.activityLevel: object expected"); + message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.fromObject(object.activityLevel); + } + if (object.nutritionLog != null) { + if (typeof object.nutritionLog !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.nutritionLog: object expected"); + message.nutritionLog = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.fromObject(object.nutritionLog); + } + if (object.hydrationLog != null) { + if (typeof object.hydrationLog !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.hydrationLog: object expected"); + message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.fromObject(object.hydrationLog); + } + if (object.timeInHeartRateZone != null) { + if (typeof object.timeInHeartRateZone !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.timeInHeartRateZone: object expected"); + message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.fromObject(object.timeInHeartRateZone); + } + if (object.activeMinutes != null) { + if (typeof object.activeMinutes !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.activeMinutes: object expected"); + message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.fromObject(object.activeMinutes); + } + if (object.swimLengthsData != null) { + if (typeof object.swimLengthsData !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.swimLengthsData: object expected"); + message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.fromObject(object.swimLengthsData); + } + if (object.coreBodyTemperature != null) { + if (typeof object.coreBodyTemperature !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.coreBodyTemperature: object expected"); + message.coreBodyTemperature = $root.google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue.fromObject(object.coreBodyTemperature); + } + if (object.activeEnergyBurned != null) { + if (typeof object.activeEnergyBurned !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.activeEnergyBurned: object expected"); + message.activeEnergyBurned = $root.google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue.fromObject(object.activeEnergyBurned); + } + if (object.bloodGlucose != null) { + if (typeof object.bloodGlucose !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.bloodGlucose: object expected"); + message.bloodGlucose = $root.google.devicesandservices.health.v4.BloodGlucoseRollupValue.fromObject(object.bloodGlucose); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a RollupDataPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @static + * @param {google.devicesandservices.health.v4.RollupDataPoint} message RollupDataPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RollupDataPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.steps != null && message.hasOwnProperty("steps")) { + object.steps = $root.google.devicesandservices.health.v4.StepsRollupValue.toObject(message.steps, options); + if (options.oneofs) + object.value = "steps"; + } + if (message.floors != null && message.hasOwnProperty("floors")) { + object.floors = $root.google.devicesandservices.health.v4.FloorsRollupValue.toObject(message.floors, options); + if (options.oneofs) + object.value = "floors"; + } + if (message.heartRate != null && message.hasOwnProperty("heartRate")) { + object.heartRate = $root.google.devicesandservices.health.v4.HeartRateRollupValue.toObject(message.heartRate, options); + if (options.oneofs) + object.value = "heartRate"; + } + if (message.weight != null && message.hasOwnProperty("weight")) { + object.weight = $root.google.devicesandservices.health.v4.WeightRollupValue.toObject(message.weight, options); + if (options.oneofs) + object.value = "weight"; + } + if (message.altitude != null && message.hasOwnProperty("altitude")) { + object.altitude = $root.google.devicesandservices.health.v4.AltitudeRollupValue.toObject(message.altitude, options); + if (options.oneofs) + object.value = "altitude"; + } + if (message.distance != null && message.hasOwnProperty("distance")) { + object.distance = $root.google.devicesandservices.health.v4.DistanceRollupValue.toObject(message.distance, options); + if (options.oneofs) + object.value = "distance"; + } + if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { + object.bodyFat = $root.google.devicesandservices.health.v4.BodyFatRollupValue.toObject(message.bodyFat, options); + if (options.oneofs) + object.value = "bodyFat"; + } + if (message.totalCalories != null && message.hasOwnProperty("totalCalories")) { + object.totalCalories = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.toObject(message.totalCalories, options); + if (options.oneofs) + object.value = "totalCalories"; + } + if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { + object.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.toObject(message.activeZoneMinutes, options); + if (options.oneofs) + object.value = "activeZoneMinutes"; + } + if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { + object.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.toObject(message.sedentaryPeriod, options); + if (options.oneofs) + object.value = "sedentaryPeriod"; + } + if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { + object.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.toObject(message.runVo2Max, options); + if (options.oneofs) + object.value = "runVo2Max"; + } + if (message.caloriesInHeartRateZone != null && message.hasOwnProperty("caloriesInHeartRateZone")) { + object.caloriesInHeartRateZone = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.toObject(message.caloriesInHeartRateZone, options); + if (options.oneofs) + object.value = "caloriesInHeartRateZone"; + } + if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { + object.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.toObject(message.activityLevel, options); + if (options.oneofs) + object.value = "activityLevel"; + } + if (message.nutritionLog != null && message.hasOwnProperty("nutritionLog")) { + object.nutritionLog = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.toObject(message.nutritionLog, options); + if (options.oneofs) + object.value = "nutritionLog"; + } + if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { + object.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.toObject(message.hydrationLog, options); + if (options.oneofs) + object.value = "hydrationLog"; + } + if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { + object.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.toObject(message.timeInHeartRateZone, options); + if (options.oneofs) + object.value = "timeInHeartRateZone"; + } + if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { + object.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.toObject(message.activeMinutes, options); + if (options.oneofs) + object.value = "activeMinutes"; + } + if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { + object.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.toObject(message.swimLengthsData, options); + if (options.oneofs) + object.value = "swimLengthsData"; + } + if (message.coreBodyTemperature != null && message.hasOwnProperty("coreBodyTemperature")) { + object.coreBodyTemperature = $root.google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue.toObject(message.coreBodyTemperature, options); + if (options.oneofs) + object.value = "coreBodyTemperature"; + } + if (message.activeEnergyBurned != null && message.hasOwnProperty("activeEnergyBurned")) { + object.activeEnergyBurned = $root.google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue.toObject(message.activeEnergyBurned, options); + if (options.oneofs) + object.value = "activeEnergyBurned"; + } + if (message.bloodGlucose != null && message.hasOwnProperty("bloodGlucose")) { + object.bloodGlucose = $root.google.devicesandservices.health.v4.BloodGlucoseRollupValue.toObject(message.bloodGlucose, options); + if (options.oneofs) + object.value = "bloodGlucose"; + } + return object; + }; + + /** + * Converts this RollupDataPoint to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @instance + * @returns {Object.} JSON object + */ + RollupDataPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RollupDataPoint + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RollupDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.RollupDataPoint"; + }; + + return RollupDataPoint; + })(); + + v4.DailyRollupDataPoint = (function() { + + /** + * Properties of a DailyRollupDataPoint. + * @memberof google.devicesandservices.health.v4 + * @interface IDailyRollupDataPoint + * @property {google.devicesandservices.health.v4.IStepsRollupValue|null} [steps] DailyRollupDataPoint steps + * @property {google.devicesandservices.health.v4.IFloorsRollupValue|null} [floors] DailyRollupDataPoint floors + * @property {google.devicesandservices.health.v4.IHeartRateRollupValue|null} [heartRate] DailyRollupDataPoint heartRate + * @property {google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue|null} [restingHeartRatePersonalRange] DailyRollupDataPoint restingHeartRatePersonalRange + * @property {google.devicesandservices.health.v4.IHeartRateVariabilityPersonalRangeRollupValue|null} [heartRateVariabilityPersonalRange] DailyRollupDataPoint heartRateVariabilityPersonalRange + * @property {google.devicesandservices.health.v4.IWeightRollupValue|null} [weight] DailyRollupDataPoint weight + * @property {google.devicesandservices.health.v4.IAltitudeRollupValue|null} [altitude] DailyRollupDataPoint altitude + * @property {google.devicesandservices.health.v4.IDistanceRollupValue|null} [distance] DailyRollupDataPoint distance + * @property {google.devicesandservices.health.v4.IBodyFatRollupValue|null} [bodyFat] DailyRollupDataPoint bodyFat + * @property {google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null} [totalCalories] DailyRollupDataPoint totalCalories + * @property {google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null} [activeZoneMinutes] DailyRollupDataPoint activeZoneMinutes + * @property {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null} [sedentaryPeriod] DailyRollupDataPoint sedentaryPeriod + * @property {google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null} [runVo2Max] DailyRollupDataPoint runVo2Max + * @property {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null} [caloriesInHeartRateZone] DailyRollupDataPoint caloriesInHeartRateZone + * @property {google.devicesandservices.health.v4.IActivityLevelRollupValue|null} [activityLevel] DailyRollupDataPoint activityLevel + * @property {google.devicesandservices.health.v4.INutritionLogRollupValue|null} [nutritionLog] DailyRollupDataPoint nutritionLog + * @property {google.devicesandservices.health.v4.IHydrationLogRollupValue|null} [hydrationLog] DailyRollupDataPoint hydrationLog + * @property {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null} [timeInHeartRateZone] DailyRollupDataPoint timeInHeartRateZone + * @property {google.devicesandservices.health.v4.IActiveMinutesRollupValue|null} [activeMinutes] DailyRollupDataPoint activeMinutes + * @property {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null} [swimLengthsData] DailyRollupDataPoint swimLengthsData + * @property {google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue|null} [coreBodyTemperature] DailyRollupDataPoint coreBodyTemperature + * @property {google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue|null} [activeEnergyBurned] DailyRollupDataPoint activeEnergyBurned + * @property {google.devicesandservices.health.v4.IBloodGlucoseRollupValue|null} [bloodGlucose] DailyRollupDataPoint bloodGlucose + * @property {google.devicesandservices.health.v4.ICivilDateTime|null} [civilStartTime] DailyRollupDataPoint civilStartTime + * @property {google.devicesandservices.health.v4.ICivilDateTime|null} [civilEndTime] DailyRollupDataPoint civilEndTime + */ + + /** + * Constructs a new DailyRollupDataPoint. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a DailyRollupDataPoint. + * @implements IDailyRollupDataPoint + * @constructor + * @param {google.devicesandservices.health.v4.IDailyRollupDataPoint=} [properties] Properties to set + */ + function DailyRollupDataPoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DailyRollupDataPoint steps. + * @member {google.devicesandservices.health.v4.IStepsRollupValue|null|undefined} steps + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.steps = null; + + /** + * DailyRollupDataPoint floors. + * @member {google.devicesandservices.health.v4.IFloorsRollupValue|null|undefined} floors + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.floors = null; + + /** + * DailyRollupDataPoint heartRate. + * @member {google.devicesandservices.health.v4.IHeartRateRollupValue|null|undefined} heartRate + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.heartRate = null; + + /** + * DailyRollupDataPoint restingHeartRatePersonalRange. + * @member {google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue|null|undefined} restingHeartRatePersonalRange + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.restingHeartRatePersonalRange = null; + + /** + * DailyRollupDataPoint heartRateVariabilityPersonalRange. + * @member {google.devicesandservices.health.v4.IHeartRateVariabilityPersonalRangeRollupValue|null|undefined} heartRateVariabilityPersonalRange + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.heartRateVariabilityPersonalRange = null; + + /** + * DailyRollupDataPoint weight. + * @member {google.devicesandservices.health.v4.IWeightRollupValue|null|undefined} weight + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.weight = null; + + /** + * DailyRollupDataPoint altitude. + * @member {google.devicesandservices.health.v4.IAltitudeRollupValue|null|undefined} altitude + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.altitude = null; + + /** + * DailyRollupDataPoint distance. + * @member {google.devicesandservices.health.v4.IDistanceRollupValue|null|undefined} distance + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.distance = null; + + /** + * DailyRollupDataPoint bodyFat. + * @member {google.devicesandservices.health.v4.IBodyFatRollupValue|null|undefined} bodyFat + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.bodyFat = null; + + /** + * DailyRollupDataPoint totalCalories. + * @member {google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null|undefined} totalCalories + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.totalCalories = null; + + /** + * DailyRollupDataPoint activeZoneMinutes. + * @member {google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null|undefined} activeZoneMinutes + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.activeZoneMinutes = null; + + /** + * DailyRollupDataPoint sedentaryPeriod. + * @member {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null|undefined} sedentaryPeriod + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.sedentaryPeriod = null; + + /** + * DailyRollupDataPoint runVo2Max. + * @member {google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null|undefined} runVo2Max + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.runVo2Max = null; + + /** + * DailyRollupDataPoint caloriesInHeartRateZone. + * @member {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null|undefined} caloriesInHeartRateZone + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.caloriesInHeartRateZone = null; + + /** + * DailyRollupDataPoint activityLevel. + * @member {google.devicesandservices.health.v4.IActivityLevelRollupValue|null|undefined} activityLevel + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.activityLevel = null; + + /** + * DailyRollupDataPoint nutritionLog. + * @member {google.devicesandservices.health.v4.INutritionLogRollupValue|null|undefined} nutritionLog + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.nutritionLog = null; + + /** + * DailyRollupDataPoint hydrationLog. + * @member {google.devicesandservices.health.v4.IHydrationLogRollupValue|null|undefined} hydrationLog + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.hydrationLog = null; + + /** + * DailyRollupDataPoint timeInHeartRateZone. + * @member {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null|undefined} timeInHeartRateZone + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.timeInHeartRateZone = null; + + /** + * DailyRollupDataPoint activeMinutes. + * @member {google.devicesandservices.health.v4.IActiveMinutesRollupValue|null|undefined} activeMinutes + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.activeMinutes = null; + + /** + * DailyRollupDataPoint swimLengthsData. + * @member {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null|undefined} swimLengthsData + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.swimLengthsData = null; + + /** + * DailyRollupDataPoint coreBodyTemperature. + * @member {google.devicesandservices.health.v4.ICoreBodyTemperatureRollupValue|null|undefined} coreBodyTemperature + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.coreBodyTemperature = null; + + /** + * DailyRollupDataPoint activeEnergyBurned. + * @member {google.devicesandservices.health.v4.IActiveEnergyBurnedRollupValue|null|undefined} activeEnergyBurned + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.activeEnergyBurned = null; + + /** + * DailyRollupDataPoint bloodGlucose. + * @member {google.devicesandservices.health.v4.IBloodGlucoseRollupValue|null|undefined} bloodGlucose + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.bloodGlucose = null; + + /** + * DailyRollupDataPoint civilStartTime. + * @member {google.devicesandservices.health.v4.ICivilDateTime|null|undefined} civilStartTime + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.civilStartTime = null; + + /** + * DailyRollupDataPoint civilEndTime. + * @member {google.devicesandservices.health.v4.ICivilDateTime|null|undefined} civilEndTime + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + DailyRollupDataPoint.prototype.civilEndTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DailyRollupDataPoint value. + * @member {"steps"|"floors"|"heartRate"|"restingHeartRatePersonalRange"|"heartRateVariabilityPersonalRange"|"weight"|"altitude"|"distance"|"bodyFat"|"totalCalories"|"activeZoneMinutes"|"sedentaryPeriod"|"runVo2Max"|"caloriesInHeartRateZone"|"activityLevel"|"nutritionLog"|"hydrationLog"|"timeInHeartRateZone"|"activeMinutes"|"swimLengthsData"|"coreBodyTemperature"|"activeEnergyBurned"|"bloodGlucose"|undefined} value + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + */ + Object.defineProperty(DailyRollupDataPoint.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["steps", "floors", "heartRate", "restingHeartRatePersonalRange", "heartRateVariabilityPersonalRange", "weight", "altitude", "distance", "bodyFat", "totalCalories", "activeZoneMinutes", "sedentaryPeriod", "runVo2Max", "caloriesInHeartRateZone", "activityLevel", "nutritionLog", "hydrationLog", "timeInHeartRateZone", "activeMinutes", "swimLengthsData", "coreBodyTemperature", "activeEnergyBurned", "bloodGlucose"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DailyRollupDataPoint instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @static + * @param {google.devicesandservices.health.v4.IDailyRollupDataPoint=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DailyRollupDataPoint} DailyRollupDataPoint instance + */ + DailyRollupDataPoint.create = function create(properties) { + return new DailyRollupDataPoint(properties); + }; + + /** + * Encodes the specified DailyRollupDataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollupDataPoint.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @static + * @param {google.devicesandservices.health.v4.IDailyRollupDataPoint} message DailyRollupDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DailyRollupDataPoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.civilStartTime != null && Object.hasOwnProperty.call(message, "civilStartTime")) + $root.google.devicesandservices.health.v4.CivilDateTime.encode(message.civilStartTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.civilEndTime != null && Object.hasOwnProperty.call(message, "civilEndTime")) + $root.google.devicesandservices.health.v4.CivilDateTime.encode(message.civilEndTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.steps != null && Object.hasOwnProperty.call(message, "steps")) + $root.google.devicesandservices.health.v4.StepsRollupValue.encode(message.steps, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.floors != null && Object.hasOwnProperty.call(message, "floors")) + $root.google.devicesandservices.health.v4.FloorsRollupValue.encode(message.floors, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.heartRate != null && Object.hasOwnProperty.call(message, "heartRate")) + $root.google.devicesandservices.health.v4.HeartRateRollupValue.encode(message.heartRate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.restingHeartRatePersonalRange != null && Object.hasOwnProperty.call(message, "restingHeartRatePersonalRange")) + $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.encode(message.restingHeartRatePersonalRange, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.heartRateVariabilityPersonalRange != null && Object.hasOwnProperty.call(message, "heartRateVariabilityPersonalRange")) + $root.google.devicesandservices.health.v4.HeartRateVariabilityPersonalRangeRollupValue.encode(message.heartRateVariabilityPersonalRange, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + $root.google.devicesandservices.health.v4.WeightRollupValue.encode(message.weight, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.altitude != null && Object.hasOwnProperty.call(message, "altitude")) + $root.google.devicesandservices.health.v4.AltitudeRollupValue.encode(message.altitude, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) + $root.google.devicesandservices.health.v4.DistanceRollupValue.encode(message.distance, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.bodyFat != null && Object.hasOwnProperty.call(message, "bodyFat")) + $root.google.devicesandservices.health.v4.BodyFatRollupValue.encode(message.bodyFat, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.totalCalories != null && Object.hasOwnProperty.call(message, "totalCalories")) + $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.encode(message.totalCalories, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.activeZoneMinutes != null && Object.hasOwnProperty.call(message, "activeZoneMinutes")) + $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.encode(message.activeZoneMinutes, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.sedentaryPeriod != null && Object.hasOwnProperty.call(message, "sedentaryPeriod")) + $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.encode(message.sedentaryPeriod, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.runVo2Max != null && Object.hasOwnProperty.call(message, "runVo2Max")) + $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.encode(message.runVo2Max, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.caloriesInHeartRateZone != null && Object.hasOwnProperty.call(message, "caloriesInHeartRateZone")) + $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.encode(message.caloriesInHeartRateZone, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.activityLevel != null && Object.hasOwnProperty.call(message, "activityLevel")) + $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.encode(message.activityLevel, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.nutritionLog != null && Object.hasOwnProperty.call(message, "nutritionLog")) + $root.google.devicesandservices.health.v4.NutritionLogRollupValue.encode(message.nutritionLog, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.hydrationLog != null && Object.hasOwnProperty.call(message, "hydrationLog")) + $root.google.devicesandservices.health.v4.HydrationLogRollupValue.encode(message.hydrationLog, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.timeInHeartRateZone != null && Object.hasOwnProperty.call(message, "timeInHeartRateZone")) + $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.encode(message.timeInHeartRateZone, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.activeMinutes != null && Object.hasOwnProperty.call(message, "activeMinutes")) + $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.encode(message.activeMinutes, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.swimLengthsData != null && Object.hasOwnProperty.call(message, "swimLengthsData")) + $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.encode(message.swimLengthsData, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.coreBodyTemperature != null && Object.hasOwnProperty.call(message, "coreBodyTemperature")) + $root.google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue.encode(message.coreBodyTemperature, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.activeEnergyBurned != null && Object.hasOwnProperty.call(message, "activeEnergyBurned")) + $root.google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue.encode(message.activeEnergyBurned, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.bloodGlucose != null && Object.hasOwnProperty.call(message, "bloodGlucose")) + $root.google.devicesandservices.health.v4.BloodGlucoseRollupValue.encode(message.bloodGlucose, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DailyRollupDataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollupDataPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @static + * @param {google.devicesandservices.health.v4.IDailyRollupDataPoint} message DailyRollupDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DailyRollupDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DailyRollupDataPoint message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.DailyRollupDataPoint} DailyRollupDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DailyRollupDataPoint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DailyRollupDataPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.steps = $root.google.devicesandservices.health.v4.StepsRollupValue.decode(reader, reader.uint32()); + break; + } + case 6: { + message.floors = $root.google.devicesandservices.health.v4.FloorsRollupValue.decode(reader, reader.uint32()); + break; + } + case 7: { + message.heartRate = $root.google.devicesandservices.health.v4.HeartRateRollupValue.decode(reader, reader.uint32()); + break; + } + case 8: { + message.restingHeartRatePersonalRange = $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.decode(reader, reader.uint32()); + break; + } + case 9: { + message.heartRateVariabilityPersonalRange = $root.google.devicesandservices.health.v4.HeartRateVariabilityPersonalRangeRollupValue.decode(reader, reader.uint32()); + break; + } + case 10: { + message.weight = $root.google.devicesandservices.health.v4.WeightRollupValue.decode(reader, reader.uint32()); + break; + } + case 11: { + message.altitude = $root.google.devicesandservices.health.v4.AltitudeRollupValue.decode(reader, reader.uint32()); + break; + } + case 12: { + message.distance = $root.google.devicesandservices.health.v4.DistanceRollupValue.decode(reader, reader.uint32()); + break; + } + case 13: { + message.bodyFat = $root.google.devicesandservices.health.v4.BodyFatRollupValue.decode(reader, reader.uint32()); + break; + } + case 14: { + message.totalCalories = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.decode(reader, reader.uint32()); + break; + } + case 15: { + message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.decode(reader, reader.uint32()); + break; + } + case 17: { + message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.decode(reader, reader.uint32()); + break; + } + case 18: { + message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.decode(reader, reader.uint32()); + break; + } + case 19: { + message.caloriesInHeartRateZone = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.decode(reader, reader.uint32()); + break; + } + case 20: { + message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.decode(reader, reader.uint32()); + break; + } + case 21: { + message.nutritionLog = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.decode(reader, reader.uint32()); + break; + } + case 22: { + message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.decode(reader, reader.uint32()); + break; + } + case 23: { + message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.decode(reader, reader.uint32()); + break; + } + case 24: { + message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.decode(reader, reader.uint32()); + break; + } + case 25: { + message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.decode(reader, reader.uint32()); + break; + } + case 26: { + message.coreBodyTemperature = $root.google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue.decode(reader, reader.uint32()); + break; + } + case 27: { + message.activeEnergyBurned = $root.google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue.decode(reader, reader.uint32()); + break; + } + case 28: { + message.bloodGlucose = $root.google.devicesandservices.health.v4.BloodGlucoseRollupValue.decode(reader, reader.uint32()); + break; + } + case 1: { + message.civilStartTime = $root.google.devicesandservices.health.v4.CivilDateTime.decode(reader, reader.uint32()); + break; + } + case 2: { + message.civilEndTime = $root.google.devicesandservices.health.v4.CivilDateTime.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DailyRollupDataPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.DailyRollupDataPoint} DailyRollupDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DailyRollupDataPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DailyRollupDataPoint message. + * @function verify + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DailyRollupDataPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.steps != null && message.hasOwnProperty("steps")) { + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.StepsRollupValue.verify(message.steps); + if (error) + return "steps." + error; + } + } + if (message.floors != null && message.hasOwnProperty("floors")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.FloorsRollupValue.verify(message.floors); + if (error) + return "floors." + error; + } + } + if (message.heartRate != null && message.hasOwnProperty("heartRate")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.HeartRateRollupValue.verify(message.heartRate); + if (error) + return "heartRate." + error; + } + } + if (message.restingHeartRatePersonalRange != null && message.hasOwnProperty("restingHeartRatePersonalRange")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.verify(message.restingHeartRatePersonalRange); + if (error) + return "restingHeartRatePersonalRange." + error; + } + } + if (message.heartRateVariabilityPersonalRange != null && message.hasOwnProperty("heartRateVariabilityPersonalRange")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.HeartRateVariabilityPersonalRangeRollupValue.verify(message.heartRateVariabilityPersonalRange); + if (error) + return "heartRateVariabilityPersonalRange." + error; + } + } + if (message.weight != null && message.hasOwnProperty("weight")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.WeightRollupValue.verify(message.weight); + if (error) + return "weight." + error; + } + } + if (message.altitude != null && message.hasOwnProperty("altitude")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.AltitudeRollupValue.verify(message.altitude); + if (error) + return "altitude." + error; + } + } + if (message.distance != null && message.hasOwnProperty("distance")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.DistanceRollupValue.verify(message.distance); + if (error) + return "distance." + error; + } + } + if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.BodyFatRollupValue.verify(message.bodyFat); + if (error) + return "bodyFat." + error; + } + } + if (message.totalCalories != null && message.hasOwnProperty("totalCalories")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.verify(message.totalCalories); + if (error) + return "totalCalories." + error; + } + } + if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.verify(message.activeZoneMinutes); + if (error) + return "activeZoneMinutes." + error; + } + } + if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.verify(message.sedentaryPeriod); + if (error) + return "sedentaryPeriod." + error; + } + } + if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.verify(message.runVo2Max); + if (error) + return "runVo2Max." + error; + } + } + if (message.caloriesInHeartRateZone != null && message.hasOwnProperty("caloriesInHeartRateZone")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.verify(message.caloriesInHeartRateZone); + if (error) + return "caloriesInHeartRateZone." + error; + } + } + if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.verify(message.activityLevel); + if (error) + return "activityLevel." + error; + } + } + if (message.nutritionLog != null && message.hasOwnProperty("nutritionLog")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.verify(message.nutritionLog); + if (error) + return "nutritionLog." + error; + } + } + if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.verify(message.hydrationLog); + if (error) + return "hydrationLog." + error; + } + } + if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.verify(message.timeInHeartRateZone); + if (error) + return "timeInHeartRateZone." + error; + } + } + if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.verify(message.activeMinutes); + if (error) + return "activeMinutes." + error; + } + } + if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.verify(message.swimLengthsData); + if (error) + return "swimLengthsData." + error; + } + } + if (message.coreBodyTemperature != null && message.hasOwnProperty("coreBodyTemperature")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue.verify(message.coreBodyTemperature); + if (error) + return "coreBodyTemperature." + error; + } + } + if (message.activeEnergyBurned != null && message.hasOwnProperty("activeEnergyBurned")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue.verify(message.activeEnergyBurned); + if (error) + return "activeEnergyBurned." + error; + } + } + if (message.bloodGlucose != null && message.hasOwnProperty("bloodGlucose")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.devicesandservices.health.v4.BloodGlucoseRollupValue.verify(message.bloodGlucose); + if (error) + return "bloodGlucose." + error; + } + } + if (message.civilStartTime != null && message.hasOwnProperty("civilStartTime")) { + var error = $root.google.devicesandservices.health.v4.CivilDateTime.verify(message.civilStartTime); + if (error) + return "civilStartTime." + error; + } + if (message.civilEndTime != null && message.hasOwnProperty("civilEndTime")) { + var error = $root.google.devicesandservices.health.v4.CivilDateTime.verify(message.civilEndTime); + if (error) + return "civilEndTime." + error; + } + return null; + }; + + /** + * Creates a DailyRollupDataPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.DailyRollupDataPoint} DailyRollupDataPoint + */ + DailyRollupDataPoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DailyRollupDataPoint) + return object; + var message = new $root.google.devicesandservices.health.v4.DailyRollupDataPoint(); + if (object.steps != null) { + if (typeof object.steps !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.steps: object expected"); + message.steps = $root.google.devicesandservices.health.v4.StepsRollupValue.fromObject(object.steps); + } + if (object.floors != null) { + if (typeof object.floors !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.floors: object expected"); + message.floors = $root.google.devicesandservices.health.v4.FloorsRollupValue.fromObject(object.floors); + } + if (object.heartRate != null) { + if (typeof object.heartRate !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.heartRate: object expected"); + message.heartRate = $root.google.devicesandservices.health.v4.HeartRateRollupValue.fromObject(object.heartRate); + } + if (object.restingHeartRatePersonalRange != null) { + if (typeof object.restingHeartRatePersonalRange !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.restingHeartRatePersonalRange: object expected"); + message.restingHeartRatePersonalRange = $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.fromObject(object.restingHeartRatePersonalRange); + } + if (object.heartRateVariabilityPersonalRange != null) { + if (typeof object.heartRateVariabilityPersonalRange !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.heartRateVariabilityPersonalRange: object expected"); + message.heartRateVariabilityPersonalRange = $root.google.devicesandservices.health.v4.HeartRateVariabilityPersonalRangeRollupValue.fromObject(object.heartRateVariabilityPersonalRange); + } + if (object.weight != null) { + if (typeof object.weight !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.weight: object expected"); + message.weight = $root.google.devicesandservices.health.v4.WeightRollupValue.fromObject(object.weight); + } + if (object.altitude != null) { + if (typeof object.altitude !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.altitude: object expected"); + message.altitude = $root.google.devicesandservices.health.v4.AltitudeRollupValue.fromObject(object.altitude); + } + if (object.distance != null) { + if (typeof object.distance !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.distance: object expected"); + message.distance = $root.google.devicesandservices.health.v4.DistanceRollupValue.fromObject(object.distance); + } + if (object.bodyFat != null) { + if (typeof object.bodyFat !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.bodyFat: object expected"); + message.bodyFat = $root.google.devicesandservices.health.v4.BodyFatRollupValue.fromObject(object.bodyFat); + } + if (object.totalCalories != null) { + if (typeof object.totalCalories !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.totalCalories: object expected"); + message.totalCalories = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.fromObject(object.totalCalories); + } + if (object.activeZoneMinutes != null) { + if (typeof object.activeZoneMinutes !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.activeZoneMinutes: object expected"); + message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.fromObject(object.activeZoneMinutes); + } + if (object.sedentaryPeriod != null) { + if (typeof object.sedentaryPeriod !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.sedentaryPeriod: object expected"); + message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.fromObject(object.sedentaryPeriod); + } + if (object.runVo2Max != null) { + if (typeof object.runVo2Max !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.runVo2Max: object expected"); + message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.fromObject(object.runVo2Max); + } + if (object.caloriesInHeartRateZone != null) { + if (typeof object.caloriesInHeartRateZone !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.caloriesInHeartRateZone: object expected"); + message.caloriesInHeartRateZone = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.fromObject(object.caloriesInHeartRateZone); + } + if (object.activityLevel != null) { + if (typeof object.activityLevel !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.activityLevel: object expected"); + message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.fromObject(object.activityLevel); + } + if (object.nutritionLog != null) { + if (typeof object.nutritionLog !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.nutritionLog: object expected"); + message.nutritionLog = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.fromObject(object.nutritionLog); } if (object.hydrationLog != null) { if (typeof object.hydrationLog !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.hydrationLog: object expected"); - message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLog.fromObject(object.hydrationLog); + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.hydrationLog: object expected"); + message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.fromObject(object.hydrationLog); + } + if (object.timeInHeartRateZone != null) { + if (typeof object.timeInHeartRateZone !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.timeInHeartRateZone: object expected"); + message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.fromObject(object.timeInHeartRateZone); + } + if (object.activeMinutes != null) { + if (typeof object.activeMinutes !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.activeMinutes: object expected"); + message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.fromObject(object.activeMinutes); + } + if (object.swimLengthsData != null) { + if (typeof object.swimLengthsData !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.swimLengthsData: object expected"); + message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.fromObject(object.swimLengthsData); + } + if (object.coreBodyTemperature != null) { + if (typeof object.coreBodyTemperature !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.coreBodyTemperature: object expected"); + message.coreBodyTemperature = $root.google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue.fromObject(object.coreBodyTemperature); + } + if (object.activeEnergyBurned != null) { + if (typeof object.activeEnergyBurned !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.activeEnergyBurned: object expected"); + message.activeEnergyBurned = $root.google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue.fromObject(object.activeEnergyBurned); + } + if (object.bloodGlucose != null) { + if (typeof object.bloodGlucose !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.bloodGlucose: object expected"); + message.bloodGlucose = $root.google.devicesandservices.health.v4.BloodGlucoseRollupValue.fromObject(object.bloodGlucose); + } + if (object.civilStartTime != null) { + if (typeof object.civilStartTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.civilStartTime: object expected"); + message.civilStartTime = $root.google.devicesandservices.health.v4.CivilDateTime.fromObject(object.civilStartTime); + } + if (object.civilEndTime != null) { + if (typeof object.civilEndTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.civilEndTime: object expected"); + message.civilEndTime = $root.google.devicesandservices.health.v4.CivilDateTime.fromObject(object.civilEndTime); + } + return message; + }; + + /** + * Creates a plain object from a DailyRollupDataPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @static + * @param {google.devicesandservices.health.v4.DailyRollupDataPoint} message DailyRollupDataPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DailyRollupDataPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.civilStartTime = null; + object.civilEndTime = null; + } + if (message.civilStartTime != null && message.hasOwnProperty("civilStartTime")) + object.civilStartTime = $root.google.devicesandservices.health.v4.CivilDateTime.toObject(message.civilStartTime, options); + if (message.civilEndTime != null && message.hasOwnProperty("civilEndTime")) + object.civilEndTime = $root.google.devicesandservices.health.v4.CivilDateTime.toObject(message.civilEndTime, options); + if (message.steps != null && message.hasOwnProperty("steps")) { + object.steps = $root.google.devicesandservices.health.v4.StepsRollupValue.toObject(message.steps, options); + if (options.oneofs) + object.value = "steps"; + } + if (message.floors != null && message.hasOwnProperty("floors")) { + object.floors = $root.google.devicesandservices.health.v4.FloorsRollupValue.toObject(message.floors, options); + if (options.oneofs) + object.value = "floors"; + } + if (message.heartRate != null && message.hasOwnProperty("heartRate")) { + object.heartRate = $root.google.devicesandservices.health.v4.HeartRateRollupValue.toObject(message.heartRate, options); + if (options.oneofs) + object.value = "heartRate"; + } + if (message.restingHeartRatePersonalRange != null && message.hasOwnProperty("restingHeartRatePersonalRange")) { + object.restingHeartRatePersonalRange = $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.toObject(message.restingHeartRatePersonalRange, options); + if (options.oneofs) + object.value = "restingHeartRatePersonalRange"; + } + if (message.heartRateVariabilityPersonalRange != null && message.hasOwnProperty("heartRateVariabilityPersonalRange")) { + object.heartRateVariabilityPersonalRange = $root.google.devicesandservices.health.v4.HeartRateVariabilityPersonalRangeRollupValue.toObject(message.heartRateVariabilityPersonalRange, options); + if (options.oneofs) + object.value = "heartRateVariabilityPersonalRange"; + } + if (message.weight != null && message.hasOwnProperty("weight")) { + object.weight = $root.google.devicesandservices.health.v4.WeightRollupValue.toObject(message.weight, options); + if (options.oneofs) + object.value = "weight"; + } + if (message.altitude != null && message.hasOwnProperty("altitude")) { + object.altitude = $root.google.devicesandservices.health.v4.AltitudeRollupValue.toObject(message.altitude, options); + if (options.oneofs) + object.value = "altitude"; + } + if (message.distance != null && message.hasOwnProperty("distance")) { + object.distance = $root.google.devicesandservices.health.v4.DistanceRollupValue.toObject(message.distance, options); + if (options.oneofs) + object.value = "distance"; + } + if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { + object.bodyFat = $root.google.devicesandservices.health.v4.BodyFatRollupValue.toObject(message.bodyFat, options); + if (options.oneofs) + object.value = "bodyFat"; + } + if (message.totalCalories != null && message.hasOwnProperty("totalCalories")) { + object.totalCalories = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.toObject(message.totalCalories, options); + if (options.oneofs) + object.value = "totalCalories"; + } + if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { + object.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.toObject(message.activeZoneMinutes, options); + if (options.oneofs) + object.value = "activeZoneMinutes"; + } + if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { + object.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.toObject(message.sedentaryPeriod, options); + if (options.oneofs) + object.value = "sedentaryPeriod"; + } + if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { + object.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.toObject(message.runVo2Max, options); + if (options.oneofs) + object.value = "runVo2Max"; + } + if (message.caloriesInHeartRateZone != null && message.hasOwnProperty("caloriesInHeartRateZone")) { + object.caloriesInHeartRateZone = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.toObject(message.caloriesInHeartRateZone, options); + if (options.oneofs) + object.value = "caloriesInHeartRateZone"; + } + if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { + object.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.toObject(message.activityLevel, options); + if (options.oneofs) + object.value = "activityLevel"; + } + if (message.nutritionLog != null && message.hasOwnProperty("nutritionLog")) { + object.nutritionLog = $root.google.devicesandservices.health.v4.NutritionLogRollupValue.toObject(message.nutritionLog, options); + if (options.oneofs) + object.value = "nutritionLog"; + } + if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { + object.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.toObject(message.hydrationLog, options); + if (options.oneofs) + object.value = "hydrationLog"; + } + if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { + object.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.toObject(message.timeInHeartRateZone, options); + if (options.oneofs) + object.value = "timeInHeartRateZone"; + } + if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { + object.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.toObject(message.activeMinutes, options); + if (options.oneofs) + object.value = "activeMinutes"; + } + if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { + object.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.toObject(message.swimLengthsData, options); + if (options.oneofs) + object.value = "swimLengthsData"; + } + if (message.coreBodyTemperature != null && message.hasOwnProperty("coreBodyTemperature")) { + object.coreBodyTemperature = $root.google.devicesandservices.health.v4.CoreBodyTemperatureRollupValue.toObject(message.coreBodyTemperature, options); + if (options.oneofs) + object.value = "coreBodyTemperature"; + } + if (message.activeEnergyBurned != null && message.hasOwnProperty("activeEnergyBurned")) { + object.activeEnergyBurned = $root.google.devicesandservices.health.v4.ActiveEnergyBurnedRollupValue.toObject(message.activeEnergyBurned, options); + if (options.oneofs) + object.value = "activeEnergyBurned"; + } + if (message.bloodGlucose != null && message.hasOwnProperty("bloodGlucose")) { + object.bloodGlucose = $root.google.devicesandservices.health.v4.BloodGlucoseRollupValue.toObject(message.bloodGlucose, options); + if (options.oneofs) + object.value = "bloodGlucose"; + } + return object; + }; + + /** + * Converts this DailyRollupDataPoint to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @instance + * @returns {Object.} JSON object + */ + DailyRollupDataPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DailyRollupDataPoint + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DailyRollupDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.DailyRollupDataPoint"; + }; + + return DailyRollupDataPoint; + })(); + + v4.GetDataPointRequest = (function() { + + /** + * Properties of a GetDataPointRequest. + * @memberof google.devicesandservices.health.v4 + * @interface IGetDataPointRequest + * @property {string|null} [name] GetDataPointRequest name + */ + + /** + * Constructs a new GetDataPointRequest. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a GetDataPointRequest. + * @implements IGetDataPointRequest + * @constructor + * @param {google.devicesandservices.health.v4.IGetDataPointRequest=} [properties] Properties to set + */ + function GetDataPointRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataPointRequest name. + * @member {string} name + * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @instance + */ + GetDataPointRequest.prototype.name = ""; + + /** + * Creates a new GetDataPointRequest instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @static + * @param {google.devicesandservices.health.v4.IGetDataPointRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.GetDataPointRequest} GetDataPointRequest instance + */ + GetDataPointRequest.create = function create(properties) { + return new GetDataPointRequest(properties); + }; + + /** + * Encodes the specified GetDataPointRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetDataPointRequest.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @static + * @param {google.devicesandservices.health.v4.IGetDataPointRequest} message GetDataPointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataPointRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetDataPointRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetDataPointRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @static + * @param {google.devicesandservices.health.v4.IGetDataPointRequest} message GetDataPointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataPointRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataPointRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.GetDataPointRequest} GetDataPointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataPointRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.GetDataPointRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataPointRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.GetDataPointRequest} GetDataPointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataPointRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataPointRequest message. + * @function verify + * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataPointRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetDataPointRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.GetDataPointRequest} GetDataPointRequest + */ + GetDataPointRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.GetDataPointRequest) + return object; + var message = new $root.google.devicesandservices.health.v4.GetDataPointRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDataPointRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @static + * @param {google.devicesandservices.health.v4.GetDataPointRequest} message GetDataPointRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataPointRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetDataPointRequest to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataPointRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDataPointRequest + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDataPointRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.GetDataPointRequest"; + }; + + return GetDataPointRequest; + })(); + + v4.ListDataPointsRequest = (function() { + + /** + * Properties of a ListDataPointsRequest. + * @memberof google.devicesandservices.health.v4 + * @interface IListDataPointsRequest + * @property {string|null} [parent] ListDataPointsRequest parent + * @property {number|null} [pageSize] ListDataPointsRequest pageSize + * @property {string|null} [pageToken] ListDataPointsRequest pageToken + * @property {string|null} [filter] ListDataPointsRequest filter + */ + + /** + * Constructs a new ListDataPointsRequest. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a ListDataPointsRequest. + * @implements IListDataPointsRequest + * @constructor + * @param {google.devicesandservices.health.v4.IListDataPointsRequest=} [properties] Properties to set + */ + function ListDataPointsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataPointsRequest parent. + * @member {string} parent + * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @instance + */ + ListDataPointsRequest.prototype.parent = ""; + + /** + * ListDataPointsRequest pageSize. + * @member {number} pageSize + * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @instance + */ + ListDataPointsRequest.prototype.pageSize = 0; + + /** + * ListDataPointsRequest pageToken. + * @member {string} pageToken + * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @instance + */ + ListDataPointsRequest.prototype.pageToken = ""; + + /** + * ListDataPointsRequest filter. + * @member {string} filter + * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @instance + */ + ListDataPointsRequest.prototype.filter = ""; + + /** + * Creates a new ListDataPointsRequest instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IListDataPointsRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ListDataPointsRequest} ListDataPointsRequest instance + */ + ListDataPointsRequest.create = function create(properties) { + return new ListDataPointsRequest(properties); + }; + + /** + * Encodes the specified ListDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsRequest.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IListDataPointsRequest} message ListDataPointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataPointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IListDataPointsRequest} message ListDataPointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataPointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.ListDataPointsRequest} ListDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataPointsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ListDataPointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataPointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.ListDataPointsRequest} ListDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataPointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataPointsRequest message. + * @function verify + * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataPointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.ListDataPointsRequest} ListDataPointsRequest + */ + ListDataPointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ListDataPointsRequest) + return object; + var message = new $root.google.devicesandservices.health.v4.ListDataPointsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListDataPointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.ListDataPointsRequest} message ListDataPointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataPointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListDataPointsRequest to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDataPointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataPointsRequest + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataPointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.ListDataPointsRequest"; + }; + + return ListDataPointsRequest; + })(); + + v4.ListDataPointsResponse = (function() { + + /** + * Properties of a ListDataPointsResponse. + * @memberof google.devicesandservices.health.v4 + * @interface IListDataPointsResponse + * @property {Array.|null} [dataPoints] ListDataPointsResponse dataPoints + * @property {string|null} [nextPageToken] ListDataPointsResponse nextPageToken + */ + + /** + * Constructs a new ListDataPointsResponse. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a ListDataPointsResponse. + * @implements IListDataPointsResponse + * @constructor + * @param {google.devicesandservices.health.v4.IListDataPointsResponse=} [properties] Properties to set + */ + function ListDataPointsResponse(properties) { + this.dataPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataPointsResponse dataPoints. + * @member {Array.} dataPoints + * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @instance + */ + ListDataPointsResponse.prototype.dataPoints = $util.emptyArray; + + /** + * ListDataPointsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @instance + */ + ListDataPointsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDataPointsResponse instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IListDataPointsResponse=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ListDataPointsResponse} ListDataPointsResponse instance + */ + ListDataPointsResponse.create = function create(properties) { + return new ListDataPointsResponse(properties); + }; + + /** + * Encodes the specified ListDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsResponse.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IListDataPointsResponse} message ListDataPointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataPointsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataPoints != null && message.dataPoints.length) + for (var i = 0; i < message.dataPoints.length; ++i) + $root.google.devicesandservices.health.v4.DataPoint.encode(message.dataPoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IListDataPointsResponse} message ListDataPointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataPointsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.ListDataPointsResponse} ListDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataPointsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ListDataPointsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataPoints && message.dataPoints.length)) + message.dataPoints = []; + message.dataPoints.push($root.google.devicesandservices.health.v4.DataPoint.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataPointsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.ListDataPointsResponse} ListDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataPointsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataPointsResponse message. + * @function verify + * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataPointsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) + return "dataPoints: array expected"; + for (var i = 0; i < message.dataPoints.length; ++i) { + var error = $root.google.devicesandservices.health.v4.DataPoint.verify(message.dataPoints[i]); + if (error) + return "dataPoints." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.ListDataPointsResponse} ListDataPointsResponse + */ + ListDataPointsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ListDataPointsResponse) + return object; + var message = new $root.google.devicesandservices.health.v4.ListDataPointsResponse(); + if (object.dataPoints) { + if (!Array.isArray(object.dataPoints)) + throw TypeError(".google.devicesandservices.health.v4.ListDataPointsResponse.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object.dataPoints.length; ++i) { + if (typeof object.dataPoints[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.ListDataPointsResponse.dataPoints: object expected"); + message.dataPoints[i] = $root.google.devicesandservices.health.v4.DataPoint.fromObject(object.dataPoints[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDataPointsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.ListDataPointsResponse} message ListDataPointsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataPointsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataPoints = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.dataPoints && message.dataPoints.length) { + object.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) + object.dataPoints[j] = $root.google.devicesandservices.health.v4.DataPoint.toObject(message.dataPoints[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDataPointsResponse to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDataPointsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataPointsResponse + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataPointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.ListDataPointsResponse"; + }; + + return ListDataPointsResponse; + })(); + + v4.CreateDataPointRequest = (function() { + + /** + * Properties of a CreateDataPointRequest. + * @memberof google.devicesandservices.health.v4 + * @interface ICreateDataPointRequest + * @property {string|null} [parent] CreateDataPointRequest parent + * @property {google.devicesandservices.health.v4.IDataPoint|null} [dataPoint] CreateDataPointRequest dataPoint + */ + + /** + * Constructs a new CreateDataPointRequest. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a CreateDataPointRequest. + * @implements ICreateDataPointRequest + * @constructor + * @param {google.devicesandservices.health.v4.ICreateDataPointRequest=} [properties] Properties to set + */ + function CreateDataPointRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDataPointRequest parent. + * @member {string} parent + * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @instance + */ + CreateDataPointRequest.prototype.parent = ""; + + /** + * CreateDataPointRequest dataPoint. + * @member {google.devicesandservices.health.v4.IDataPoint|null|undefined} dataPoint + * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @instance + */ + CreateDataPointRequest.prototype.dataPoint = null; + + /** + * Creates a new CreateDataPointRequest instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @static + * @param {google.devicesandservices.health.v4.ICreateDataPointRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.CreateDataPointRequest} CreateDataPointRequest instance + */ + CreateDataPointRequest.create = function create(properties) { + return new CreateDataPointRequest(properties); + }; + + /** + * Encodes the specified CreateDataPointRequest message. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointRequest.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @static + * @param {google.devicesandservices.health.v4.ICreateDataPointRequest} message CreateDataPointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDataPointRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.dataPoint != null && Object.hasOwnProperty.call(message, "dataPoint")) + $root.google.devicesandservices.health.v4.DataPoint.encode(message.dataPoint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDataPointRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @static + * @param {google.devicesandservices.health.v4.ICreateDataPointRequest} message CreateDataPointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDataPointRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDataPointRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.CreateDataPointRequest} CreateDataPointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDataPointRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CreateDataPointRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.dataPoint = $root.google.devicesandservices.health.v4.DataPoint.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDataPointRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.CreateDataPointRequest} CreateDataPointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDataPointRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDataPointRequest message. + * @function verify + * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDataPointRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.dataPoint != null && message.hasOwnProperty("dataPoint")) { + var error = $root.google.devicesandservices.health.v4.DataPoint.verify(message.dataPoint); + if (error) + return "dataPoint." + error; + } + return null; + }; + + /** + * Creates a CreateDataPointRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.CreateDataPointRequest} CreateDataPointRequest + */ + CreateDataPointRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.CreateDataPointRequest) + return object; + var message = new $root.google.devicesandservices.health.v4.CreateDataPointRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dataPoint != null) { + if (typeof object.dataPoint !== "object") + throw TypeError(".google.devicesandservices.health.v4.CreateDataPointRequest.dataPoint: object expected"); + message.dataPoint = $root.google.devicesandservices.health.v4.DataPoint.fromObject(object.dataPoint); + } + return message; + }; + + /** + * Creates a plain object from a CreateDataPointRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @static + * @param {google.devicesandservices.health.v4.CreateDataPointRequest} message CreateDataPointRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDataPointRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dataPoint = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dataPoint != null && message.hasOwnProperty("dataPoint")) + object.dataPoint = $root.google.devicesandservices.health.v4.DataPoint.toObject(message.dataPoint, options); + return object; + }; + + /** + * Converts this CreateDataPointRequest to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDataPointRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDataPointRequest + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDataPointRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.CreateDataPointRequest"; + }; + + return CreateDataPointRequest; + })(); + + v4.CreateDataPointOperationMetadata = (function() { + + /** + * Properties of a CreateDataPointOperationMetadata. + * @memberof google.devicesandservices.health.v4 + * @interface ICreateDataPointOperationMetadata + */ + + /** + * Constructs a new CreateDataPointOperationMetadata. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a CreateDataPointOperationMetadata. + * @implements ICreateDataPointOperationMetadata + * @constructor + * @param {google.devicesandservices.health.v4.ICreateDataPointOperationMetadata=} [properties] Properties to set + */ + function CreateDataPointOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new CreateDataPointOperationMetadata instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @static + * @param {google.devicesandservices.health.v4.ICreateDataPointOperationMetadata=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.CreateDataPointOperationMetadata} CreateDataPointOperationMetadata instance + */ + CreateDataPointOperationMetadata.create = function create(properties) { + return new CreateDataPointOperationMetadata(properties); + }; + + /** + * Encodes the specified CreateDataPointOperationMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @static + * @param {google.devicesandservices.health.v4.ICreateDataPointOperationMetadata} message CreateDataPointOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDataPointOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateDataPointOperationMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @static + * @param {google.devicesandservices.health.v4.ICreateDataPointOperationMetadata} message CreateDataPointOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDataPointOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDataPointOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.CreateDataPointOperationMetadata} CreateDataPointOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDataPointOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CreateDataPointOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDataPointOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.CreateDataPointOperationMetadata} CreateDataPointOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDataPointOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDataPointOperationMetadata message. + * @function verify + * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDataPointOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CreateDataPointOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.CreateDataPointOperationMetadata} CreateDataPointOperationMetadata + */ + CreateDataPointOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.CreateDataPointOperationMetadata) + return object; + return new $root.google.devicesandservices.health.v4.CreateDataPointOperationMetadata(); + }; + + /** + * Creates a plain object from a CreateDataPointOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @static + * @param {google.devicesandservices.health.v4.CreateDataPointOperationMetadata} message CreateDataPointOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDataPointOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateDataPointOperationMetadata to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateDataPointOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDataPointOperationMetadata + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDataPointOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.CreateDataPointOperationMetadata"; + }; + + return CreateDataPointOperationMetadata; + })(); + + v4.UpdateDataPointRequest = (function() { + + /** + * Properties of an UpdateDataPointRequest. + * @memberof google.devicesandservices.health.v4 + * @interface IUpdateDataPointRequest + * @property {google.devicesandservices.health.v4.IDataPoint|null} [dataPoint] UpdateDataPointRequest dataPoint + */ + + /** + * Constructs a new UpdateDataPointRequest. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents an UpdateDataPointRequest. + * @implements IUpdateDataPointRequest + * @constructor + * @param {google.devicesandservices.health.v4.IUpdateDataPointRequest=} [properties] Properties to set + */ + function UpdateDataPointRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDataPointRequest dataPoint. + * @member {google.devicesandservices.health.v4.IDataPoint|null|undefined} dataPoint + * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @instance + */ + UpdateDataPointRequest.prototype.dataPoint = null; + + /** + * Creates a new UpdateDataPointRequest instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @static + * @param {google.devicesandservices.health.v4.IUpdateDataPointRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.UpdateDataPointRequest} UpdateDataPointRequest instance + */ + UpdateDataPointRequest.create = function create(properties) { + return new UpdateDataPointRequest(properties); + }; + + /** + * Encodes the specified UpdateDataPointRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointRequest.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @static + * @param {google.devicesandservices.health.v4.IUpdateDataPointRequest} message UpdateDataPointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataPointRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataPoint != null && Object.hasOwnProperty.call(message, "dataPoint")) + $root.google.devicesandservices.health.v4.DataPoint.encode(message.dataPoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDataPointRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @static + * @param {google.devicesandservices.health.v4.IUpdateDataPointRequest} message UpdateDataPointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataPointRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDataPointRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.UpdateDataPointRequest} UpdateDataPointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataPointRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.UpdateDataPointRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataPoint = $root.google.devicesandservices.health.v4.DataPoint.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDataPointRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.UpdateDataPointRequest} UpdateDataPointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataPointRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDataPointRequest message. + * @function verify + * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDataPointRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataPoint != null && message.hasOwnProperty("dataPoint")) { + var error = $root.google.devicesandservices.health.v4.DataPoint.verify(message.dataPoint); + if (error) + return "dataPoint." + error; + } + return null; + }; + + /** + * Creates an UpdateDataPointRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.UpdateDataPointRequest} UpdateDataPointRequest + */ + UpdateDataPointRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.UpdateDataPointRequest) + return object; + var message = new $root.google.devicesandservices.health.v4.UpdateDataPointRequest(); + if (object.dataPoint != null) { + if (typeof object.dataPoint !== "object") + throw TypeError(".google.devicesandservices.health.v4.UpdateDataPointRequest.dataPoint: object expected"); + message.dataPoint = $root.google.devicesandservices.health.v4.DataPoint.fromObject(object.dataPoint); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDataPointRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @static + * @param {google.devicesandservices.health.v4.UpdateDataPointRequest} message UpdateDataPointRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDataPointRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dataPoint = null; + if (message.dataPoint != null && message.hasOwnProperty("dataPoint")) + object.dataPoint = $root.google.devicesandservices.health.v4.DataPoint.toObject(message.dataPoint, options); + return object; + }; + + /** + * Converts this UpdateDataPointRequest to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDataPointRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDataPointRequest + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDataPointRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.UpdateDataPointRequest"; + }; + + return UpdateDataPointRequest; + })(); + + v4.UpdateDataPointOperationMetadata = (function() { + + /** + * Properties of an UpdateDataPointOperationMetadata. + * @memberof google.devicesandservices.health.v4 + * @interface IUpdateDataPointOperationMetadata + */ + + /** + * Constructs a new UpdateDataPointOperationMetadata. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents an UpdateDataPointOperationMetadata. + * @implements IUpdateDataPointOperationMetadata + * @constructor + * @param {google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata=} [properties] Properties to set + */ + function UpdateDataPointOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new UpdateDataPointOperationMetadata instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @static + * @param {google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.UpdateDataPointOperationMetadata} UpdateDataPointOperationMetadata instance + */ + UpdateDataPointOperationMetadata.create = function create(properties) { + return new UpdateDataPointOperationMetadata(properties); + }; + + /** + * Encodes the specified UpdateDataPointOperationMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @static + * @param {google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata} message UpdateDataPointOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataPointOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UpdateDataPointOperationMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @static + * @param {google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata} message UpdateDataPointOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataPointOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDataPointOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.UpdateDataPointOperationMetadata} UpdateDataPointOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataPointOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.UpdateDataPointOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDataPointOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.UpdateDataPointOperationMetadata} UpdateDataPointOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataPointOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDataPointOperationMetadata message. + * @function verify + * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDataPointOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UpdateDataPointOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.UpdateDataPointOperationMetadata} UpdateDataPointOperationMetadata + */ + UpdateDataPointOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.UpdateDataPointOperationMetadata) + return object; + return new $root.google.devicesandservices.health.v4.UpdateDataPointOperationMetadata(); + }; + + /** + * Creates a plain object from an UpdateDataPointOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @static + * @param {google.devicesandservices.health.v4.UpdateDataPointOperationMetadata} message UpdateDataPointOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDataPointOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UpdateDataPointOperationMetadata to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateDataPointOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDataPointOperationMetadata + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDataPointOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.UpdateDataPointOperationMetadata"; + }; + + return UpdateDataPointOperationMetadata; + })(); + + v4.BatchDeleteDataPointsRequest = (function() { + + /** + * Properties of a BatchDeleteDataPointsRequest. + * @memberof google.devicesandservices.health.v4 + * @interface IBatchDeleteDataPointsRequest + * @property {string|null} [parent] BatchDeleteDataPointsRequest parent + * @property {Array.|null} [names] BatchDeleteDataPointsRequest names + */ + + /** + * Constructs a new BatchDeleteDataPointsRequest. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a BatchDeleteDataPointsRequest. + * @implements IBatchDeleteDataPointsRequest + * @constructor + * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest=} [properties] Properties to set + */ + function BatchDeleteDataPointsRequest(properties) { + this.names = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteDataPointsRequest parent. + * @member {string} parent + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @instance + */ + BatchDeleteDataPointsRequest.prototype.parent = ""; + + /** + * BatchDeleteDataPointsRequest names. + * @member {Array.} names + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @instance + */ + BatchDeleteDataPointsRequest.prototype.names = $util.emptyArray; + + /** + * Creates a new BatchDeleteDataPointsRequest instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsRequest} BatchDeleteDataPointsRequest instance + */ + BatchDeleteDataPointsRequest.create = function create(properties) { + return new BatchDeleteDataPointsRequest(properties); + }; + + /** + * Encodes the specified BatchDeleteDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsRequest.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest} message BatchDeleteDataPointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteDataPointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.names[i]); + return writer; + }; + + /** + * Encodes the specified BatchDeleteDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest} message BatchDeleteDataPointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteDataPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteDataPointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsRequest} BatchDeleteDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteDataPointsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteDataPointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsRequest} BatchDeleteDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteDataPointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteDataPointsRequest message. + * @function verify + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteDataPointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.names != null && message.hasOwnProperty("names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) + if (!$util.isString(message.names[i])) + return "names: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchDeleteDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsRequest} BatchDeleteDataPointsRequest + */ + BatchDeleteDataPointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest) + return object; + var message = new $root.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".google.devicesandservices.health.v4.BatchDeleteDataPointsRequest.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) + message.names[i] = String(object.names[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteDataPointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.BatchDeleteDataPointsRequest} message BatchDeleteDataPointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteDataPointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.names = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = message.names[j]; + } + return object; + }; + + /** + * Converts this BatchDeleteDataPointsRequest to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteDataPointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteDataPointsRequest + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteDataPointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.BatchDeleteDataPointsRequest"; + }; + + return BatchDeleteDataPointsRequest; + })(); + + v4.BatchDeleteDataPointsResponse = (function() { + + /** + * Properties of a BatchDeleteDataPointsResponse. + * @memberof google.devicesandservices.health.v4 + * @interface IBatchDeleteDataPointsResponse + * @property {Array.|null} [dataPoints] BatchDeleteDataPointsResponse dataPoints + */ + + /** + * Constructs a new BatchDeleteDataPointsResponse. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a BatchDeleteDataPointsResponse. + * @implements IBatchDeleteDataPointsResponse + * @constructor + * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse=} [properties] Properties to set + */ + function BatchDeleteDataPointsResponse(properties) { + this.dataPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteDataPointsResponse dataPoints. + * @member {Array.} dataPoints + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @instance + */ + BatchDeleteDataPointsResponse.prototype.dataPoints = $util.emptyArray; + + /** + * Creates a new BatchDeleteDataPointsResponse instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsResponse} BatchDeleteDataPointsResponse instance + */ + BatchDeleteDataPointsResponse.create = function create(properties) { + return new BatchDeleteDataPointsResponse(properties); + }; + + /** + * Encodes the specified BatchDeleteDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsResponse.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse} message BatchDeleteDataPointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteDataPointsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataPoints != null && message.dataPoints.length) + for (var i = 0; i < message.dataPoints.length; ++i) + $root.google.devicesandservices.health.v4.DataPoint.encode(message.dataPoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchDeleteDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse} message BatchDeleteDataPointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteDataPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteDataPointsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsResponse} BatchDeleteDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteDataPointsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.BatchDeleteDataPointsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataPoints && message.dataPoints.length)) + message.dataPoints = []; + message.dataPoints.push($root.google.devicesandservices.health.v4.DataPoint.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteDataPointsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsResponse} BatchDeleteDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteDataPointsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteDataPointsResponse message. + * @function verify + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteDataPointsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) + return "dataPoints: array expected"; + for (var i = 0; i < message.dataPoints.length; ++i) { + var error = $root.google.devicesandservices.health.v4.DataPoint.verify(message.dataPoints[i]); + if (error) + return "dataPoints." + error; + } + } + return null; + }; + + /** + * Creates a BatchDeleteDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsResponse} BatchDeleteDataPointsResponse + */ + BatchDeleteDataPointsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.BatchDeleteDataPointsResponse) + return object; + var message = new $root.google.devicesandservices.health.v4.BatchDeleteDataPointsResponse(); + if (object.dataPoints) { + if (!Array.isArray(object.dataPoints)) + throw TypeError(".google.devicesandservices.health.v4.BatchDeleteDataPointsResponse.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object.dataPoints.length; ++i) { + if (typeof object.dataPoints[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.BatchDeleteDataPointsResponse.dataPoints: object expected"); + message.dataPoints[i] = $root.google.devicesandservices.health.v4.DataPoint.fromObject(object.dataPoints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteDataPointsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.BatchDeleteDataPointsResponse} message BatchDeleteDataPointsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteDataPointsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataPoints = []; + if (message.dataPoints && message.dataPoints.length) { + object.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) + object.dataPoints[j] = $root.google.devicesandservices.health.v4.DataPoint.toObject(message.dataPoints[j], options); + } + return object; + }; + + /** + * Converts this BatchDeleteDataPointsResponse to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteDataPointsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteDataPointsResponse + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteDataPointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.BatchDeleteDataPointsResponse"; + }; + + return BatchDeleteDataPointsResponse; + })(); + + v4.BatchDeleteDataPointsOperationMetadata = (function() { + + /** + * Properties of a BatchDeleteDataPointsOperationMetadata. + * @memberof google.devicesandservices.health.v4 + * @interface IBatchDeleteDataPointsOperationMetadata + * @property {Object.|null} [failedRequests] BatchDeleteDataPointsOperationMetadata failedRequests + */ + + /** + * Constructs a new BatchDeleteDataPointsOperationMetadata. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a BatchDeleteDataPointsOperationMetadata. + * @implements IBatchDeleteDataPointsOperationMetadata + * @constructor + * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata=} [properties] Properties to set + */ + function BatchDeleteDataPointsOperationMetadata(properties) { + this.failedRequests = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteDataPointsOperationMetadata failedRequests. + * @member {Object.} failedRequests + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @instance + */ + BatchDeleteDataPointsOperationMetadata.prototype.failedRequests = $util.emptyObject; + + /** + * Creates a new BatchDeleteDataPointsOperationMetadata instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @static + * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata} BatchDeleteDataPointsOperationMetadata instance + */ + BatchDeleteDataPointsOperationMetadata.create = function create(properties) { + return new BatchDeleteDataPointsOperationMetadata(properties); + }; + + /** + * Encodes the specified BatchDeleteDataPointsOperationMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @static + * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata} message BatchDeleteDataPointsOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteDataPointsOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.failedRequests != null && Object.hasOwnProperty.call(message, "failedRequests")) + for (var keys = Object.keys(message.failedRequests), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); + $root.google.rpc.Status.encode(message.failedRequests[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified BatchDeleteDataPointsOperationMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @static + * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata} message BatchDeleteDataPointsOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteDataPointsOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteDataPointsOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata} BatchDeleteDataPointsOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteDataPointsOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.failedRequests === $util.emptyObject) + message.failedRequests = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.int32(); + break; + case 2: + value = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.failedRequests[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteDataPointsOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata} BatchDeleteDataPointsOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteDataPointsOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteDataPointsOperationMetadata message. + * @function verify + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteDataPointsOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.failedRequests != null && message.hasOwnProperty("failedRequests")) { + if (!$util.isObject(message.failedRequests)) + return "failedRequests: object expected"; + var key = Object.keys(message.failedRequests); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "failedRequests: integer key{k:int32} expected"; + { + var error = $root.google.rpc.Status.verify(message.failedRequests[key[i]]); + if (error) + return "failedRequests." + error; + } + } + } + return null; + }; + + /** + * Creates a BatchDeleteDataPointsOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata} BatchDeleteDataPointsOperationMetadata + */ + BatchDeleteDataPointsOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata) + return object; + var message = new $root.google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata(); + if (object.failedRequests) { + if (typeof object.failedRequests !== "object") + throw TypeError(".google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata.failedRequests: object expected"); + message.failedRequests = {}; + for (var keys = Object.keys(object.failedRequests), i = 0; i < keys.length; ++i) { + if (typeof object.failedRequests[keys[i]] !== "object") + throw TypeError(".google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata.failedRequests: object expected"); + message.failedRequests[keys[i]] = $root.google.rpc.Status.fromObject(object.failedRequests[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteDataPointsOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @static + * @param {google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata} message BatchDeleteDataPointsOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteDataPointsOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.failedRequests = {}; + var keys2; + if (message.failedRequests && (keys2 = Object.keys(message.failedRequests)).length) { + object.failedRequests = {}; + for (var j = 0; j < keys2.length; ++j) + object.failedRequests[keys2[j]] = $root.google.rpc.Status.toObject(message.failedRequests[keys2[j]], options); + } + return object; + }; + + /** + * Converts this BatchDeleteDataPointsOperationMetadata to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteDataPointsOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteDataPointsOperationMetadata + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteDataPointsOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata"; + }; + + return BatchDeleteDataPointsOperationMetadata; + })(); + + v4.ReconcileDataPointsRequest = (function() { + + /** + * Properties of a ReconcileDataPointsRequest. + * @memberof google.devicesandservices.health.v4 + * @interface IReconcileDataPointsRequest + * @property {string|null} [parent] ReconcileDataPointsRequest parent + * @property {number|null} [pageSize] ReconcileDataPointsRequest pageSize + * @property {string|null} [pageToken] ReconcileDataPointsRequest pageToken + * @property {string|null} [filter] ReconcileDataPointsRequest filter + * @property {string|null} [dataSourceFamily] ReconcileDataPointsRequest dataSourceFamily + */ + + /** + * Constructs a new ReconcileDataPointsRequest. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a ReconcileDataPointsRequest. + * @implements IReconcileDataPointsRequest + * @constructor + * @param {google.devicesandservices.health.v4.IReconcileDataPointsRequest=} [properties] Properties to set + */ + function ReconcileDataPointsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReconcileDataPointsRequest parent. + * @member {string} parent + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @instance + */ + ReconcileDataPointsRequest.prototype.parent = ""; + + /** + * ReconcileDataPointsRequest pageSize. + * @member {number} pageSize + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @instance + */ + ReconcileDataPointsRequest.prototype.pageSize = 0; + + /** + * ReconcileDataPointsRequest pageToken. + * @member {string} pageToken + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @instance + */ + ReconcileDataPointsRequest.prototype.pageToken = ""; + + /** + * ReconcileDataPointsRequest filter. + * @member {string} filter + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @instance + */ + ReconcileDataPointsRequest.prototype.filter = ""; + + /** + * ReconcileDataPointsRequest dataSourceFamily. + * @member {string} dataSourceFamily + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @instance + */ + ReconcileDataPointsRequest.prototype.dataSourceFamily = ""; + + /** + * Creates a new ReconcileDataPointsRequest instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IReconcileDataPointsRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ReconcileDataPointsRequest} ReconcileDataPointsRequest instance + */ + ReconcileDataPointsRequest.create = function create(properties) { + return new ReconcileDataPointsRequest(properties); + }; + + /** + * Encodes the specified ReconcileDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsRequest.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IReconcileDataPointsRequest} message ReconcileDataPointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReconcileDataPointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.dataSourceFamily != null && Object.hasOwnProperty.call(message, "dataSourceFamily")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.dataSourceFamily); + return writer; + }; + + /** + * Encodes the specified ReconcileDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IReconcileDataPointsRequest} message ReconcileDataPointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReconcileDataPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReconcileDataPointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.ReconcileDataPointsRequest} ReconcileDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReconcileDataPointsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ReconcileDataPointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.dataSourceFamily = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReconcileDataPointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.ReconcileDataPointsRequest} ReconcileDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReconcileDataPointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReconcileDataPointsRequest message. + * @function verify + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReconcileDataPointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.dataSourceFamily != null && message.hasOwnProperty("dataSourceFamily")) + if (!$util.isString(message.dataSourceFamily)) + return "dataSourceFamily: string expected"; + return null; + }; + + /** + * Creates a ReconcileDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.ReconcileDataPointsRequest} ReconcileDataPointsRequest + */ + ReconcileDataPointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ReconcileDataPointsRequest) + return object; + var message = new $root.google.devicesandservices.health.v4.ReconcileDataPointsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.dataSourceFamily != null) + message.dataSourceFamily = String(object.dataSourceFamily); + return message; + }; + + /** + * Creates a plain object from a ReconcileDataPointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.ReconcileDataPointsRequest} message ReconcileDataPointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReconcileDataPointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.dataSourceFamily = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.dataSourceFamily != null && message.hasOwnProperty("dataSourceFamily")) + object.dataSourceFamily = message.dataSourceFamily; + return object; + }; + + /** + * Converts this ReconcileDataPointsRequest to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @instance + * @returns {Object.} JSON object + */ + ReconcileDataPointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReconcileDataPointsRequest + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReconcileDataPointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.ReconcileDataPointsRequest"; + }; + + return ReconcileDataPointsRequest; + })(); + + v4.ReconcileDataPointsResponse = (function() { + + /** + * Properties of a ReconcileDataPointsResponse. + * @memberof google.devicesandservices.health.v4 + * @interface IReconcileDataPointsResponse + * @property {Array.|null} [dataPoints] ReconcileDataPointsResponse dataPoints + * @property {string|null} [nextPageToken] ReconcileDataPointsResponse nextPageToken + */ + + /** + * Constructs a new ReconcileDataPointsResponse. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a ReconcileDataPointsResponse. + * @implements IReconcileDataPointsResponse + * @constructor + * @param {google.devicesandservices.health.v4.IReconcileDataPointsResponse=} [properties] Properties to set + */ + function ReconcileDataPointsResponse(properties) { + this.dataPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReconcileDataPointsResponse dataPoints. + * @member {Array.} dataPoints + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @instance + */ + ReconcileDataPointsResponse.prototype.dataPoints = $util.emptyArray; + + /** + * ReconcileDataPointsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @instance + */ + ReconcileDataPointsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ReconcileDataPointsResponse instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IReconcileDataPointsResponse=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ReconcileDataPointsResponse} ReconcileDataPointsResponse instance + */ + ReconcileDataPointsResponse.create = function create(properties) { + return new ReconcileDataPointsResponse(properties); + }; + + /** + * Encodes the specified ReconcileDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsResponse.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IReconcileDataPointsResponse} message ReconcileDataPointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReconcileDataPointsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataPoints != null && message.dataPoints.length) + for (var i = 0; i < message.dataPoints.length; ++i) + $root.google.devicesandservices.health.v4.ReconciledDataPoint.encode(message.dataPoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ReconcileDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IReconcileDataPointsResponse} message ReconcileDataPointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReconcileDataPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReconcileDataPointsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.ReconcileDataPointsResponse} ReconcileDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReconcileDataPointsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ReconcileDataPointsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataPoints && message.dataPoints.length)) + message.dataPoints = []; + message.dataPoints.push($root.google.devicesandservices.health.v4.ReconciledDataPoint.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReconcileDataPointsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.ReconcileDataPointsResponse} ReconcileDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReconcileDataPointsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReconcileDataPointsResponse message. + * @function verify + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReconcileDataPointsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) + return "dataPoints: array expected"; + for (var i = 0; i < message.dataPoints.length; ++i) { + var error = $root.google.devicesandservices.health.v4.ReconciledDataPoint.verify(message.dataPoints[i]); + if (error) + return "dataPoints." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ReconcileDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.ReconcileDataPointsResponse} ReconcileDataPointsResponse + */ + ReconcileDataPointsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ReconcileDataPointsResponse) + return object; + var message = new $root.google.devicesandservices.health.v4.ReconcileDataPointsResponse(); + if (object.dataPoints) { + if (!Array.isArray(object.dataPoints)) + throw TypeError(".google.devicesandservices.health.v4.ReconcileDataPointsResponse.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object.dataPoints.length; ++i) { + if (typeof object.dataPoints[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.ReconcileDataPointsResponse.dataPoints: object expected"); + message.dataPoints[i] = $root.google.devicesandservices.health.v4.ReconciledDataPoint.fromObject(object.dataPoints[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ReconcileDataPointsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.ReconcileDataPointsResponse} message ReconcileDataPointsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReconcileDataPointsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataPoints = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.dataPoints && message.dataPoints.length) { + object.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) + object.dataPoints[j] = $root.google.devicesandservices.health.v4.ReconciledDataPoint.toObject(message.dataPoints[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ReconcileDataPointsResponse to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @instance + * @returns {Object.} JSON object + */ + ReconcileDataPointsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReconcileDataPointsResponse + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReconcileDataPointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.ReconcileDataPointsResponse"; + }; + + return ReconcileDataPointsResponse; + })(); + + v4.RollUpDataPointsRequest = (function() { + + /** + * Properties of a RollUpDataPointsRequest. + * @memberof google.devicesandservices.health.v4 + * @interface IRollUpDataPointsRequest + * @property {string|null} [parent] RollUpDataPointsRequest parent + * @property {google.type.IInterval|null} [range] RollUpDataPointsRequest range + * @property {google.protobuf.IDuration|null} [windowSize] RollUpDataPointsRequest windowSize + * @property {number|null} [pageSize] RollUpDataPointsRequest pageSize + * @property {string|null} [pageToken] RollUpDataPointsRequest pageToken + * @property {string|null} [dataSourceFamily] RollUpDataPointsRequest dataSourceFamily + */ + + /** + * Constructs a new RollUpDataPointsRequest. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a RollUpDataPointsRequest. + * @implements IRollUpDataPointsRequest + * @constructor + * @param {google.devicesandservices.health.v4.IRollUpDataPointsRequest=} [properties] Properties to set + */ + function RollUpDataPointsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RollUpDataPointsRequest parent. + * @member {string} parent + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @instance + */ + RollUpDataPointsRequest.prototype.parent = ""; + + /** + * RollUpDataPointsRequest range. + * @member {google.type.IInterval|null|undefined} range + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @instance + */ + RollUpDataPointsRequest.prototype.range = null; + + /** + * RollUpDataPointsRequest windowSize. + * @member {google.protobuf.IDuration|null|undefined} windowSize + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @instance + */ + RollUpDataPointsRequest.prototype.windowSize = null; + + /** + * RollUpDataPointsRequest pageSize. + * @member {number} pageSize + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @instance + */ + RollUpDataPointsRequest.prototype.pageSize = 0; + + /** + * RollUpDataPointsRequest pageToken. + * @member {string} pageToken + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @instance + */ + RollUpDataPointsRequest.prototype.pageToken = ""; + + /** + * RollUpDataPointsRequest dataSourceFamily. + * @member {string} dataSourceFamily + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @instance + */ + RollUpDataPointsRequest.prototype.dataSourceFamily = ""; + + /** + * Creates a new RollUpDataPointsRequest instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IRollUpDataPointsRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.RollUpDataPointsRequest} RollUpDataPointsRequest instance + */ + RollUpDataPointsRequest.create = function create(properties) { + return new RollUpDataPointsRequest(properties); + }; + + /** + * Encodes the specified RollUpDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsRequest.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IRollUpDataPointsRequest} message RollUpDataPointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollUpDataPointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + $root.google.type.Interval.encode(message.range, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.windowSize != null && Object.hasOwnProperty.call(message, "windowSize")) + $root.google.protobuf.Duration.encode(message.windowSize, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.dataSourceFamily != null && Object.hasOwnProperty.call(message, "dataSourceFamily")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.dataSourceFamily); + return writer; + }; + + /** + * Encodes the specified RollUpDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IRollUpDataPointsRequest} message RollUpDataPointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollUpDataPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RollUpDataPointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.RollUpDataPointsRequest} RollUpDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollUpDataPointsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.RollUpDataPointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.range = $root.google.type.Interval.decode(reader, reader.uint32()); + break; + } + case 3: { + message.windowSize = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 7: { + message.dataSourceFamily = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RollUpDataPointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.RollUpDataPointsRequest} RollUpDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollUpDataPointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RollUpDataPointsRequest message. + * @function verify + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollUpDataPointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.range != null && message.hasOwnProperty("range")) { + var error = $root.google.type.Interval.verify(message.range); + if (error) + return "range." + error; + } + if (message.windowSize != null && message.hasOwnProperty("windowSize")) { + var error = $root.google.protobuf.Duration.verify(message.windowSize); + if (error) + return "windowSize." + error; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.dataSourceFamily != null && message.hasOwnProperty("dataSourceFamily")) + if (!$util.isString(message.dataSourceFamily)) + return "dataSourceFamily: string expected"; + return null; + }; + + /** + * Creates a RollUpDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.RollUpDataPointsRequest} RollUpDataPointsRequest + */ + RollUpDataPointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.RollUpDataPointsRequest) + return object; + var message = new $root.google.devicesandservices.health.v4.RollUpDataPointsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollUpDataPointsRequest.range: object expected"); + message.range = $root.google.type.Interval.fromObject(object.range); + } + if (object.windowSize != null) { + if (typeof object.windowSize !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollUpDataPointsRequest.windowSize: object expected"); + message.windowSize = $root.google.protobuf.Duration.fromObject(object.windowSize); + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.dataSourceFamily != null) + message.dataSourceFamily = String(object.dataSourceFamily); + return message; + }; + + /** + * Creates a plain object from a RollUpDataPointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.RollUpDataPointsRequest} message RollUpDataPointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RollUpDataPointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.range = null; + object.windowSize = null; + object.pageSize = 0; + object.pageToken = ""; + object.dataSourceFamily = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.range != null && message.hasOwnProperty("range")) + object.range = $root.google.type.Interval.toObject(message.range, options); + if (message.windowSize != null && message.hasOwnProperty("windowSize")) + object.windowSize = $root.google.protobuf.Duration.toObject(message.windowSize, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.dataSourceFamily != null && message.hasOwnProperty("dataSourceFamily")) + object.dataSourceFamily = message.dataSourceFamily; + return object; + }; + + /** + * Converts this RollUpDataPointsRequest to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @instance + * @returns {Object.} JSON object + */ + RollUpDataPointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RollUpDataPointsRequest + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RollUpDataPointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.RollUpDataPointsRequest"; + }; + + return RollUpDataPointsRequest; + })(); + + v4.RollUpDataPointsResponse = (function() { + + /** + * Properties of a RollUpDataPointsResponse. + * @memberof google.devicesandservices.health.v4 + * @interface IRollUpDataPointsResponse + * @property {Array.|null} [rollupDataPoints] RollUpDataPointsResponse rollupDataPoints + * @property {string|null} [nextPageToken] RollUpDataPointsResponse nextPageToken + */ + + /** + * Constructs a new RollUpDataPointsResponse. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a RollUpDataPointsResponse. + * @implements IRollUpDataPointsResponse + * @constructor + * @param {google.devicesandservices.health.v4.IRollUpDataPointsResponse=} [properties] Properties to set + */ + function RollUpDataPointsResponse(properties) { + this.rollupDataPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RollUpDataPointsResponse rollupDataPoints. + * @member {Array.} rollupDataPoints + * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @instance + */ + RollUpDataPointsResponse.prototype.rollupDataPoints = $util.emptyArray; + + /** + * RollUpDataPointsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @instance + */ + RollUpDataPointsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new RollUpDataPointsResponse instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IRollUpDataPointsResponse=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.RollUpDataPointsResponse} RollUpDataPointsResponse instance + */ + RollUpDataPointsResponse.create = function create(properties) { + return new RollUpDataPointsResponse(properties); + }; + + /** + * Encodes the specified RollUpDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsResponse.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IRollUpDataPointsResponse} message RollUpDataPointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollUpDataPointsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rollupDataPoints != null && message.rollupDataPoints.length) + for (var i = 0; i < message.rollupDataPoints.length; ++i) + $root.google.devicesandservices.health.v4.RollupDataPoint.encode(message.rollupDataPoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified RollUpDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IRollUpDataPointsResponse} message RollUpDataPointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollUpDataPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RollUpDataPointsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.RollUpDataPointsResponse} RollUpDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollUpDataPointsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.RollUpDataPointsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rollupDataPoints && message.rollupDataPoints.length)) + message.rollupDataPoints = []; + message.rollupDataPoints.push($root.google.devicesandservices.health.v4.RollupDataPoint.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RollUpDataPointsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.RollUpDataPointsResponse} RollUpDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollUpDataPointsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RollUpDataPointsResponse message. + * @function verify + * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollUpDataPointsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rollupDataPoints != null && message.hasOwnProperty("rollupDataPoints")) { + if (!Array.isArray(message.rollupDataPoints)) + return "rollupDataPoints: array expected"; + for (var i = 0; i < message.rollupDataPoints.length; ++i) { + var error = $root.google.devicesandservices.health.v4.RollupDataPoint.verify(message.rollupDataPoints[i]); + if (error) + return "rollupDataPoints." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a RollUpDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.RollUpDataPointsResponse} RollUpDataPointsResponse + */ + RollUpDataPointsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.RollUpDataPointsResponse) + return object; + var message = new $root.google.devicesandservices.health.v4.RollUpDataPointsResponse(); + if (object.rollupDataPoints) { + if (!Array.isArray(object.rollupDataPoints)) + throw TypeError(".google.devicesandservices.health.v4.RollUpDataPointsResponse.rollupDataPoints: array expected"); + message.rollupDataPoints = []; + for (var i = 0; i < object.rollupDataPoints.length; ++i) { + if (typeof object.rollupDataPoints[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.RollUpDataPointsResponse.rollupDataPoints: object expected"); + message.rollupDataPoints[i] = $root.google.devicesandservices.health.v4.RollupDataPoint.fromObject(object.rollupDataPoints[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a RollUpDataPointsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.RollUpDataPointsResponse} message RollUpDataPointsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RollUpDataPointsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rollupDataPoints = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.rollupDataPoints && message.rollupDataPoints.length) { + object.rollupDataPoints = []; + for (var j = 0; j < message.rollupDataPoints.length; ++j) + object.rollupDataPoints[j] = $root.google.devicesandservices.health.v4.RollupDataPoint.toObject(message.rollupDataPoints[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this RollUpDataPointsResponse to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @instance + * @returns {Object.} JSON object + */ + RollUpDataPointsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RollUpDataPointsResponse + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RollUpDataPointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.RollUpDataPointsResponse"; + }; + + return RollUpDataPointsResponse; + })(); + + v4.DailyRollUpDataPointsRequest = (function() { + + /** + * Properties of a DailyRollUpDataPointsRequest. + * @memberof google.devicesandservices.health.v4 + * @interface IDailyRollUpDataPointsRequest + * @property {string|null} [parent] DailyRollUpDataPointsRequest parent + * @property {google.devicesandservices.health.v4.ICivilTimeInterval|null} [range] DailyRollUpDataPointsRequest range + * @property {number|null} [windowSizeDays] DailyRollUpDataPointsRequest windowSizeDays + * @property {number|null} [pageSize] DailyRollUpDataPointsRequest pageSize + * @property {string|null} [pageToken] DailyRollUpDataPointsRequest pageToken + * @property {string|null} [dataSourceFamily] DailyRollUpDataPointsRequest dataSourceFamily + */ + + /** + * Constructs a new DailyRollUpDataPointsRequest. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a DailyRollUpDataPointsRequest. + * @implements IDailyRollUpDataPointsRequest + * @constructor + * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest=} [properties] Properties to set + */ + function DailyRollUpDataPointsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DailyRollUpDataPointsRequest parent. + * @member {string} parent + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @instance + */ + DailyRollUpDataPointsRequest.prototype.parent = ""; + + /** + * DailyRollUpDataPointsRequest range. + * @member {google.devicesandservices.health.v4.ICivilTimeInterval|null|undefined} range + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @instance + */ + DailyRollUpDataPointsRequest.prototype.range = null; + + /** + * DailyRollUpDataPointsRequest windowSizeDays. + * @member {number} windowSizeDays + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @instance + */ + DailyRollUpDataPointsRequest.prototype.windowSizeDays = 0; + + /** + * DailyRollUpDataPointsRequest pageSize. + * @member {number} pageSize + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @instance + */ + DailyRollUpDataPointsRequest.prototype.pageSize = 0; + + /** + * DailyRollUpDataPointsRequest pageToken. + * @member {string} pageToken + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @instance + */ + DailyRollUpDataPointsRequest.prototype.pageToken = ""; + + /** + * DailyRollUpDataPointsRequest dataSourceFamily. + * @member {string} dataSourceFamily + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @instance + */ + DailyRollUpDataPointsRequest.prototype.dataSourceFamily = ""; + + /** + * Creates a new DailyRollUpDataPointsRequest instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsRequest} DailyRollUpDataPointsRequest instance + */ + DailyRollUpDataPointsRequest.create = function create(properties) { + return new DailyRollUpDataPointsRequest(properties); + }; + + /** + * Encodes the specified DailyRollUpDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsRequest.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest} message DailyRollUpDataPointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DailyRollUpDataPointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + $root.google.devicesandservices.health.v4.CivilTimeInterval.encode(message.range, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.windowSizeDays != null && Object.hasOwnProperty.call(message, "windowSizeDays")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.windowSizeDays); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.dataSourceFamily != null && Object.hasOwnProperty.call(message, "dataSourceFamily")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.dataSourceFamily); + return writer; + }; + + /** + * Encodes the specified DailyRollUpDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest} message DailyRollUpDataPointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DailyRollUpDataPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DailyRollUpDataPointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsRequest} DailyRollUpDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DailyRollUpDataPointsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.range = $root.google.devicesandservices.health.v4.CivilTimeInterval.decode(reader, reader.uint32()); + break; + } + case 3: { + message.windowSizeDays = reader.int32(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 7: { + message.dataSourceFamily = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DailyRollUpDataPointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsRequest} DailyRollUpDataPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DailyRollUpDataPointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DailyRollUpDataPointsRequest message. + * @function verify + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DailyRollUpDataPointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.range != null && message.hasOwnProperty("range")) { + var error = $root.google.devicesandservices.health.v4.CivilTimeInterval.verify(message.range); + if (error) + return "range." + error; + } + if (message.windowSizeDays != null && message.hasOwnProperty("windowSizeDays")) + if (!$util.isInteger(message.windowSizeDays)) + return "windowSizeDays: integer expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.dataSourceFamily != null && message.hasOwnProperty("dataSourceFamily")) + if (!$util.isString(message.dataSourceFamily)) + return "dataSourceFamily: string expected"; + return null; + }; + + /** + * Creates a DailyRollUpDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsRequest} DailyRollUpDataPointsRequest + */ + DailyRollUpDataPointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest) + return object; + var message = new $root.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollUpDataPointsRequest.range: object expected"); + message.range = $root.google.devicesandservices.health.v4.CivilTimeInterval.fromObject(object.range); + } + if (object.windowSizeDays != null) + message.windowSizeDays = object.windowSizeDays | 0; + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.dataSourceFamily != null) + message.dataSourceFamily = String(object.dataSourceFamily); + return message; + }; + + /** + * Creates a plain object from a DailyRollUpDataPointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @static + * @param {google.devicesandservices.health.v4.DailyRollUpDataPointsRequest} message DailyRollUpDataPointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DailyRollUpDataPointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.range = null; + object.windowSizeDays = 0; + object.pageSize = 0; + object.pageToken = ""; + object.dataSourceFamily = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.range != null && message.hasOwnProperty("range")) + object.range = $root.google.devicesandservices.health.v4.CivilTimeInterval.toObject(message.range, options); + if (message.windowSizeDays != null && message.hasOwnProperty("windowSizeDays")) + object.windowSizeDays = message.windowSizeDays; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.dataSourceFamily != null && message.hasOwnProperty("dataSourceFamily")) + object.dataSourceFamily = message.dataSourceFamily; + return object; + }; + + /** + * Converts this DailyRollUpDataPointsRequest to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @instance + * @returns {Object.} JSON object + */ + DailyRollUpDataPointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DailyRollUpDataPointsRequest + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DailyRollUpDataPointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.DailyRollUpDataPointsRequest"; + }; + + return DailyRollUpDataPointsRequest; + })(); + + v4.DailyRollUpDataPointsResponse = (function() { + + /** + * Properties of a DailyRollUpDataPointsResponse. + * @memberof google.devicesandservices.health.v4 + * @interface IDailyRollUpDataPointsResponse + * @property {Array.|null} [rollupDataPoints] DailyRollUpDataPointsResponse rollupDataPoints + */ + + /** + * Constructs a new DailyRollUpDataPointsResponse. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a DailyRollUpDataPointsResponse. + * @implements IDailyRollUpDataPointsResponse + * @constructor + * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse=} [properties] Properties to set + */ + function DailyRollUpDataPointsResponse(properties) { + this.rollupDataPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DailyRollUpDataPointsResponse rollupDataPoints. + * @member {Array.} rollupDataPoints + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse + * @instance + */ + DailyRollUpDataPointsResponse.prototype.rollupDataPoints = $util.emptyArray; + + /** + * Creates a new DailyRollUpDataPointsResponse instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsResponse} DailyRollUpDataPointsResponse instance + */ + DailyRollUpDataPointsResponse.create = function create(properties) { + return new DailyRollUpDataPointsResponse(properties); + }; + + /** + * Encodes the specified DailyRollUpDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsResponse.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse} message DailyRollUpDataPointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DailyRollUpDataPointsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rollupDataPoints != null && message.rollupDataPoints.length) + for (var i = 0; i < message.rollupDataPoints.length; ++i) + $root.google.devicesandservices.health.v4.DailyRollupDataPoint.encode(message.rollupDataPoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DailyRollUpDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse} message DailyRollUpDataPointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DailyRollUpDataPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DailyRollUpDataPointsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsResponse} DailyRollUpDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DailyRollUpDataPointsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rollupDataPoints && message.rollupDataPoints.length)) + message.rollupDataPoints = []; + message.rollupDataPoints.push($root.google.devicesandservices.health.v4.DailyRollupDataPoint.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DailyRollUpDataPointsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsResponse} DailyRollUpDataPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DailyRollUpDataPointsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DailyRollUpDataPointsResponse message. + * @function verify + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DailyRollUpDataPointsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rollupDataPoints != null && message.hasOwnProperty("rollupDataPoints")) { + if (!Array.isArray(message.rollupDataPoints)) + return "rollupDataPoints: array expected"; + for (var i = 0; i < message.rollupDataPoints.length; ++i) { + var error = $root.google.devicesandservices.health.v4.DailyRollupDataPoint.verify(message.rollupDataPoints[i]); + if (error) + return "rollupDataPoints." + error; + } + } + return null; + }; + + /** + * Creates a DailyRollUpDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsResponse} DailyRollUpDataPointsResponse + */ + DailyRollUpDataPointsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse) + return object; + var message = new $root.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse(); + if (object.rollupDataPoints) { + if (!Array.isArray(object.rollupDataPoints)) + throw TypeError(".google.devicesandservices.health.v4.DailyRollUpDataPointsResponse.rollupDataPoints: array expected"); + message.rollupDataPoints = []; + for (var i = 0; i < object.rollupDataPoints.length; ++i) { + if (typeof object.rollupDataPoints[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.DailyRollUpDataPointsResponse.rollupDataPoints: object expected"); + message.rollupDataPoints[i] = $root.google.devicesandservices.health.v4.DailyRollupDataPoint.fromObject(object.rollupDataPoints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DailyRollUpDataPointsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse + * @static + * @param {google.devicesandservices.health.v4.DailyRollUpDataPointsResponse} message DailyRollUpDataPointsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DailyRollUpDataPointsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rollupDataPoints = []; + if (message.rollupDataPoints && message.rollupDataPoints.length) { + object.rollupDataPoints = []; + for (var j = 0; j < message.rollupDataPoints.length; ++j) + object.rollupDataPoints[j] = $root.google.devicesandservices.health.v4.DailyRollupDataPoint.toObject(message.rollupDataPoints[j], options); + } + return object; + }; + + /** + * Converts this DailyRollUpDataPointsResponse to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse + * @instance + * @returns {Object.} JSON object + */ + DailyRollUpDataPointsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DailyRollUpDataPointsResponse + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DailyRollUpDataPointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.DailyRollUpDataPointsResponse"; + }; + + return DailyRollUpDataPointsResponse; + })(); + + v4.DataType = (function() { + + /** + * Properties of a DataType. + * @memberof google.devicesandservices.health.v4 + * @interface IDataType + * @property {string|null} [name] DataType name + */ + + /** + * Constructs a new DataType. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a DataType. + * @implements IDataType + * @constructor + * @param {google.devicesandservices.health.v4.IDataType=} [properties] Properties to set + */ + function DataType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataType name. + * @member {string} name + * @memberof google.devicesandservices.health.v4.DataType + * @instance + */ + DataType.prototype.name = ""; + + /** + * Creates a new DataType instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.DataType + * @static + * @param {google.devicesandservices.health.v4.IDataType=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DataType} DataType instance + */ + DataType.create = function create(properties) { + return new DataType(properties); + }; + + /** + * Encodes the specified DataType message. Does not implicitly {@link google.devicesandservices.health.v4.DataType.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.DataType + * @static + * @param {google.devicesandservices.health.v4.IDataType} message DataType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DataType message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.DataType + * @static + * @param {google.devicesandservices.health.v4.IDataType} message DataType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataType message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.DataType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.DataType} DataType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataType.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DataType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.DataType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.DataType} DataType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataType message. + * @function verify + * @memberof google.devicesandservices.health.v4.DataType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DataType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.DataType + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.DataType} DataType + */ + DataType.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DataType) + return object; + var message = new $root.google.devicesandservices.health.v4.DataType(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DataType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.DataType + * @static + * @param {google.devicesandservices.health.v4.DataType} message DataType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DataType to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.DataType + * @instance + * @returns {Object.} JSON object + */ + DataType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataType + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.DataType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.DataType"; + }; + + return DataType; + })(); + + v4.ExportExerciseTcxRequest = (function() { + + /** + * Properties of an ExportExerciseTcxRequest. + * @memberof google.devicesandservices.health.v4 + * @interface IExportExerciseTcxRequest + * @property {string|null} [name] ExportExerciseTcxRequest name + * @property {boolean|null} [partialData] ExportExerciseTcxRequest partialData + */ + + /** + * Constructs a new ExportExerciseTcxRequest. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents an ExportExerciseTcxRequest. + * @implements IExportExerciseTcxRequest + * @constructor + * @param {google.devicesandservices.health.v4.IExportExerciseTcxRequest=} [properties] Properties to set + */ + function ExportExerciseTcxRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportExerciseTcxRequest name. + * @member {string} name + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @instance + */ + ExportExerciseTcxRequest.prototype.name = ""; + + /** + * ExportExerciseTcxRequest partialData. + * @member {boolean} partialData + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @instance + */ + ExportExerciseTcxRequest.prototype.partialData = false; + + /** + * Creates a new ExportExerciseTcxRequest instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @static + * @param {google.devicesandservices.health.v4.IExportExerciseTcxRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ExportExerciseTcxRequest} ExportExerciseTcxRequest instance + */ + ExportExerciseTcxRequest.create = function create(properties) { + return new ExportExerciseTcxRequest(properties); + }; + + /** + * Encodes the specified ExportExerciseTcxRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxRequest.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @static + * @param {google.devicesandservices.health.v4.IExportExerciseTcxRequest} message ExportExerciseTcxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportExerciseTcxRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.partialData != null && Object.hasOwnProperty.call(message, "partialData")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.partialData); + return writer; + }; + + /** + * Encodes the specified ExportExerciseTcxRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @static + * @param {google.devicesandservices.health.v4.IExportExerciseTcxRequest} message ExportExerciseTcxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportExerciseTcxRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportExerciseTcxRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.ExportExerciseTcxRequest} ExportExerciseTcxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportExerciseTcxRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ExportExerciseTcxRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.partialData = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportExerciseTcxRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.ExportExerciseTcxRequest} ExportExerciseTcxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportExerciseTcxRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportExerciseTcxRequest message. + * @function verify + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportExerciseTcxRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.partialData != null && message.hasOwnProperty("partialData")) + if (typeof message.partialData !== "boolean") + return "partialData: boolean expected"; + return null; + }; + + /** + * Creates an ExportExerciseTcxRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.ExportExerciseTcxRequest} ExportExerciseTcxRequest + */ + ExportExerciseTcxRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ExportExerciseTcxRequest) + return object; + var message = new $root.google.devicesandservices.health.v4.ExportExerciseTcxRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.partialData != null) + message.partialData = Boolean(object.partialData); + return message; + }; + + /** + * Creates a plain object from an ExportExerciseTcxRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @static + * @param {google.devicesandservices.health.v4.ExportExerciseTcxRequest} message ExportExerciseTcxRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportExerciseTcxRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.partialData = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.partialData != null && message.hasOwnProperty("partialData")) + object.partialData = message.partialData; + return object; + }; + + /** + * Converts this ExportExerciseTcxRequest to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @instance + * @returns {Object.} JSON object + */ + ExportExerciseTcxRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportExerciseTcxRequest + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportExerciseTcxRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.ExportExerciseTcxRequest"; + }; + + return ExportExerciseTcxRequest; + })(); + + v4.ExportExerciseTcxResponse = (function() { + + /** + * Properties of an ExportExerciseTcxResponse. + * @memberof google.devicesandservices.health.v4 + * @interface IExportExerciseTcxResponse + * @property {string|null} [tcxData] ExportExerciseTcxResponse tcxData + */ + + /** + * Constructs a new ExportExerciseTcxResponse. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents an ExportExerciseTcxResponse. + * @implements IExportExerciseTcxResponse + * @constructor + * @param {google.devicesandservices.health.v4.IExportExerciseTcxResponse=} [properties] Properties to set + */ + function ExportExerciseTcxResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportExerciseTcxResponse tcxData. + * @member {string} tcxData + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @instance + */ + ExportExerciseTcxResponse.prototype.tcxData = ""; + + /** + * Creates a new ExportExerciseTcxResponse instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @static + * @param {google.devicesandservices.health.v4.IExportExerciseTcxResponse=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ExportExerciseTcxResponse} ExportExerciseTcxResponse instance + */ + ExportExerciseTcxResponse.create = function create(properties) { + return new ExportExerciseTcxResponse(properties); + }; + + /** + * Encodes the specified ExportExerciseTcxResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxResponse.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @static + * @param {google.devicesandservices.health.v4.IExportExerciseTcxResponse} message ExportExerciseTcxResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportExerciseTcxResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tcxData != null && Object.hasOwnProperty.call(message, "tcxData")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tcxData); + return writer; + }; + + /** + * Encodes the specified ExportExerciseTcxResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @static + * @param {google.devicesandservices.health.v4.IExportExerciseTcxResponse} message ExportExerciseTcxResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportExerciseTcxResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportExerciseTcxResponse message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.ExportExerciseTcxResponse} ExportExerciseTcxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportExerciseTcxResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ExportExerciseTcxResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.tcxData = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportExerciseTcxResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.ExportExerciseTcxResponse} ExportExerciseTcxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportExerciseTcxResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportExerciseTcxResponse message. + * @function verify + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportExerciseTcxResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tcxData != null && message.hasOwnProperty("tcxData")) + if (!$util.isString(message.tcxData)) + return "tcxData: string expected"; + return null; + }; + + /** + * Creates an ExportExerciseTcxResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.ExportExerciseTcxResponse} ExportExerciseTcxResponse + */ + ExportExerciseTcxResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ExportExerciseTcxResponse) + return object; + var message = new $root.google.devicesandservices.health.v4.ExportExerciseTcxResponse(); + if (object.tcxData != null) + message.tcxData = String(object.tcxData); + return message; + }; + + /** + * Creates a plain object from an ExportExerciseTcxResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @static + * @param {google.devicesandservices.health.v4.ExportExerciseTcxResponse} message ExportExerciseTcxResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportExerciseTcxResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.tcxData = ""; + if (message.tcxData != null && message.hasOwnProperty("tcxData")) + object.tcxData = message.tcxData; + return object; + }; + + /** + * Converts this ExportExerciseTcxResponse to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @instance + * @returns {Object.} JSON object + */ + ExportExerciseTcxResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportExerciseTcxResponse + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportExerciseTcxResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.ExportExerciseTcxResponse"; + }; + + return ExportExerciseTcxResponse; + })(); + + v4.DataSource = (function() { + + /** + * Properties of a DataSource. + * @memberof google.devicesandservices.health.v4 + * @interface IDataSource + * @property {google.devicesandservices.health.v4.DataSource.RecordingMethod|null} [recordingMethod] DataSource recordingMethod + * @property {google.devicesandservices.health.v4.DataSource.IDevice|null} [device] DataSource device + * @property {google.devicesandservices.health.v4.DataSource.IApplication|null} [application] DataSource application + * @property {google.devicesandservices.health.v4.DataSource.Platform|null} [platform] DataSource platform + */ + + /** + * Constructs a new DataSource. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a DataSource. + * @implements IDataSource + * @constructor + * @param {google.devicesandservices.health.v4.IDataSource=} [properties] Properties to set + */ + function DataSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSource recordingMethod. + * @member {google.devicesandservices.health.v4.DataSource.RecordingMethod} recordingMethod + * @memberof google.devicesandservices.health.v4.DataSource + * @instance + */ + DataSource.prototype.recordingMethod = 0; + + /** + * DataSource device. + * @member {google.devicesandservices.health.v4.DataSource.IDevice|null|undefined} device + * @memberof google.devicesandservices.health.v4.DataSource + * @instance + */ + DataSource.prototype.device = null; + + /** + * DataSource application. + * @member {google.devicesandservices.health.v4.DataSource.IApplication|null|undefined} application + * @memberof google.devicesandservices.health.v4.DataSource + * @instance + */ + DataSource.prototype.application = null; + + /** + * DataSource platform. + * @member {google.devicesandservices.health.v4.DataSource.Platform} platform + * @memberof google.devicesandservices.health.v4.DataSource + * @instance + */ + DataSource.prototype.platform = 0; + + /** + * Creates a new DataSource instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.DataSource + * @static + * @param {google.devicesandservices.health.v4.IDataSource=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DataSource} DataSource instance + */ + DataSource.create = function create(properties) { + return new DataSource(properties); + }; + + /** + * Encodes the specified DataSource message. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.DataSource + * @static + * @param {google.devicesandservices.health.v4.IDataSource} message DataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordingMethod != null && Object.hasOwnProperty.call(message, "recordingMethod")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.recordingMethod); + if (message.device != null && Object.hasOwnProperty.call(message, "device")) + $root.google.devicesandservices.health.v4.DataSource.Device.encode(message.device, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.application != null && Object.hasOwnProperty.call(message, "application")) + $root.google.devicesandservices.health.v4.DataSource.Application.encode(message.application, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.platform != null && Object.hasOwnProperty.call(message, "platform")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.platform); + return writer; + }; + + /** + * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.DataSource + * @static + * @param {google.devicesandservices.health.v4.IDataSource} message DataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSource message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.DataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.DataSource} DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DataSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.recordingMethod = reader.int32(); + break; + } + case 2: { + message.device = $root.google.devicesandservices.health.v4.DataSource.Device.decode(reader, reader.uint32()); + break; + } + case 3: { + message.application = $root.google.devicesandservices.health.v4.DataSource.Application.decode(reader, reader.uint32()); + break; + } + case 4: { + message.platform = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.DataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.DataSource} DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSource message. + * @function verify + * @memberof google.devicesandservices.health.v4.DataSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recordingMethod != null && message.hasOwnProperty("recordingMethod")) + switch (message.recordingMethod) { + default: + return "recordingMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.device != null && message.hasOwnProperty("device")) { + var error = $root.google.devicesandservices.health.v4.DataSource.Device.verify(message.device); + if (error) + return "device." + error; + } + if (message.application != null && message.hasOwnProperty("application")) { + var error = $root.google.devicesandservices.health.v4.DataSource.Application.verify(message.application); + if (error) + return "application." + error; + } + if (message.platform != null && message.hasOwnProperty("platform")) + switch (message.platform) { + default: + return "platform: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + return null; + }; + + /** + * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.DataSource + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.DataSource} DataSource + */ + DataSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DataSource) + return object; + var message = new $root.google.devicesandservices.health.v4.DataSource(); + switch (object.recordingMethod) { + default: + if (typeof object.recordingMethod === "number") { + message.recordingMethod = object.recordingMethod; + break; + } + break; + case "RECORDING_METHOD_UNSPECIFIED": + case 0: + message.recordingMethod = 0; + break; + case "MANUAL": + case 1: + message.recordingMethod = 1; + break; + case "PASSIVELY_MEASURED": + case 2: + message.recordingMethod = 2; + break; + case "DERIVED": + case 3: + message.recordingMethod = 3; + break; + case "ACTIVELY_MEASURED": + case 4: + message.recordingMethod = 4; + break; + case "UNKNOWN": + case 5: + message.recordingMethod = 5; + break; } - if (object.timeInHeartRateZone != null) { - if (typeof object.timeInHeartRateZone !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.timeInHeartRateZone: object expected"); - message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.fromObject(object.timeInHeartRateZone); + if (object.device != null) { + if (typeof object.device !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataSource.device: object expected"); + message.device = $root.google.devicesandservices.health.v4.DataSource.Device.fromObject(object.device); } - if (object.activeMinutes != null) { - if (typeof object.activeMinutes !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.activeMinutes: object expected"); - message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutes.fromObject(object.activeMinutes); + if (object.application != null) { + if (typeof object.application !== "object") + throw TypeError(".google.devicesandservices.health.v4.DataSource.application: object expected"); + message.application = $root.google.devicesandservices.health.v4.DataSource.Application.fromObject(object.application); } - if (object.respiratoryRateSleepSummary != null) { - if (typeof object.respiratoryRateSleepSummary !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.respiratoryRateSleepSummary: object expected"); - message.respiratoryRateSleepSummary = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.fromObject(object.respiratoryRateSleepSummary); + switch (object.platform) { + default: + if (typeof object.platform === "number") { + message.platform = object.platform; + break; + } + break; + case "PLATFORM_UNSPECIFIED": + case 0: + message.platform = 0; + break; + case "FITBIT": + case 1: + message.platform = 1; + break; + case "HEALTH_CONNECT": + case 2: + message.platform = 2; + break; + case "HEALTH_KIT": + case 3: + message.platform = 3; + break; + case "FIT": + case 4: + message.platform = 4; + break; + case "FITBIT_WEB_API": + case 5: + message.platform = 5; + break; + case "NEST": + case 6: + message.platform = 6; + break; + case "GOOGLE_WEB_API": + case 7: + message.platform = 7; + break; + case "GOOGLE_PARTNER_INTEGRATION": + case 8: + message.platform = 8; + break; } - if (object.dailyRespiratoryRate != null) { - if (typeof object.dailyRespiratoryRate !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.dailyRespiratoryRate: object expected"); - message.dailyRespiratoryRate = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.fromObject(object.dailyRespiratoryRate); + return message; + }; + + /** + * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.DataSource + * @static + * @param {google.devicesandservices.health.v4.DataSource} message DataSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.recordingMethod = options.enums === String ? "RECORDING_METHOD_UNSPECIFIED" : 0; + object.device = null; + object.application = null; + object.platform = options.enums === String ? "PLATFORM_UNSPECIFIED" : 0; } - if (object.swimLengthsData != null) { - if (typeof object.swimLengthsData !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.swimLengthsData: object expected"); - message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsData.fromObject(object.swimLengthsData); + if (message.recordingMethod != null && message.hasOwnProperty("recordingMethod")) + object.recordingMethod = options.enums === String ? $root.google.devicesandservices.health.v4.DataSource.RecordingMethod[message.recordingMethod] === undefined ? message.recordingMethod : $root.google.devicesandservices.health.v4.DataSource.RecordingMethod[message.recordingMethod] : message.recordingMethod; + if (message.device != null && message.hasOwnProperty("device")) + object.device = $root.google.devicesandservices.health.v4.DataSource.Device.toObject(message.device, options); + if (message.application != null && message.hasOwnProperty("application")) + object.application = $root.google.devicesandservices.health.v4.DataSource.Application.toObject(message.application, options); + if (message.platform != null && message.hasOwnProperty("platform")) + object.platform = options.enums === String ? $root.google.devicesandservices.health.v4.DataSource.Platform[message.platform] === undefined ? message.platform : $root.google.devicesandservices.health.v4.DataSource.Platform[message.platform] : message.platform; + return object; + }; + + /** + * Converts this DataSource to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.DataSource + * @instance + * @returns {Object.} JSON object + */ + DataSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSource + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.DataSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.height: object expected"); - message.height = $root.google.devicesandservices.health.v4.Height.fromObject(object.height); + return typeUrlPrefix + "/google.devicesandservices.health.v4.DataSource"; + }; + + DataSource.Device = (function() { + + /** + * Properties of a Device. + * @memberof google.devicesandservices.health.v4.DataSource + * @interface IDevice + * @property {google.devicesandservices.health.v4.DataSource.Device.FormFactor|null} [formFactor] Device formFactor + * @property {string|null} [manufacturer] Device manufacturer + * @property {string|null} [displayName] Device displayName + */ + + /** + * Constructs a new Device. + * @memberof google.devicesandservices.health.v4.DataSource + * @classdesc Represents a Device. + * @implements IDevice + * @constructor + * @param {google.devicesandservices.health.v4.DataSource.IDevice=} [properties] Properties to set + */ + function Device(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (object.basalEnergyBurned != null) { - if (typeof object.basalEnergyBurned !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconciledDataPoint.basalEnergyBurned: object expected"); - message.basalEnergyBurned = $root.google.devicesandservices.health.v4.BasalEnergyBurned.fromObject(object.basalEnergyBurned); + + /** + * Device formFactor. + * @member {google.devicesandservices.health.v4.DataSource.Device.FormFactor} formFactor + * @memberof google.devicesandservices.health.v4.DataSource.Device + * @instance + */ + Device.prototype.formFactor = 0; + + /** + * Device manufacturer. + * @member {string} manufacturer + * @memberof google.devicesandservices.health.v4.DataSource.Device + * @instance + */ + Device.prototype.manufacturer = ""; + + /** + * Device displayName. + * @member {string} displayName + * @memberof google.devicesandservices.health.v4.DataSource.Device + * @instance + */ + Device.prototype.displayName = ""; + + /** + * Creates a new Device instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.DataSource.Device + * @static + * @param {google.devicesandservices.health.v4.DataSource.IDevice=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DataSource.Device} Device instance + */ + Device.create = function create(properties) { + return new Device(properties); + }; + + /** + * Encodes the specified Device message. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Device.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.DataSource.Device + * @static + * @param {google.devicesandservices.health.v4.DataSource.IDevice} message Device message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Device.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.formFactor != null && Object.hasOwnProperty.call(message, "formFactor")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.formFactor); + if (message.manufacturer != null && Object.hasOwnProperty.call(message, "manufacturer")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.manufacturer); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified Device message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Device.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.DataSource.Device + * @static + * @param {google.devicesandservices.health.v4.DataSource.IDevice} message Device message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Device.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Device message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.DataSource.Device + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.DataSource.Device} Device + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Device.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DataSource.Device(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.formFactor = reader.int32(); + break; + } + case 2: { + message.manufacturer = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Device message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.DataSource.Device + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.DataSource.Device} Device + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Device.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Device message. + * @function verify + * @memberof google.devicesandservices.health.v4.DataSource.Device + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Device.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.formFactor != null && message.hasOwnProperty("formFactor")) + switch (message.formFactor) { + default: + return "formFactor: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.manufacturer != null && message.hasOwnProperty("manufacturer")) + if (!$util.isString(message.manufacturer)) + return "manufacturer: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a Device message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.DataSource.Device + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.DataSource.Device} Device + */ + Device.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DataSource.Device) + return object; + var message = new $root.google.devicesandservices.health.v4.DataSource.Device(); + switch (object.formFactor) { + default: + if (typeof object.formFactor === "number") { + message.formFactor = object.formFactor; + break; + } + break; + case "FORM_FACTOR_UNSPECIFIED": + case 0: + message.formFactor = 0; + break; + case "FITNESS_BAND": + case 1: + message.formFactor = 1; + break; + case "WATCH": + case 2: + message.formFactor = 2; + break; + case "PHONE": + case 3: + message.formFactor = 3; + break; + case "RING": + case 4: + message.formFactor = 4; + break; + case "CHEST_STRAP": + case 5: + message.formFactor = 5; + break; + case "SCALE": + case 6: + message.formFactor = 6; + break; + case "TABLET": + case 7: + message.formFactor = 7; + break; + case "HEAD_MOUNTED": + case 8: + message.formFactor = 8; + break; + case "SMART_DISPLAY": + case 9: + message.formFactor = 9; + break; + } + if (object.manufacturer != null) + message.manufacturer = String(object.manufacturer); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a Device message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.DataSource.Device + * @static + * @param {google.devicesandservices.health.v4.DataSource.Device} message Device + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Device.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.formFactor = options.enums === String ? "FORM_FACTOR_UNSPECIFIED" : 0; + object.manufacturer = ""; + object.displayName = ""; + } + if (message.formFactor != null && message.hasOwnProperty("formFactor")) + object.formFactor = options.enums === String ? $root.google.devicesandservices.health.v4.DataSource.Device.FormFactor[message.formFactor] === undefined ? message.formFactor : $root.google.devicesandservices.health.v4.DataSource.Device.FormFactor[message.formFactor] : message.formFactor; + if (message.manufacturer != null && message.hasOwnProperty("manufacturer")) + object.manufacturer = message.manufacturer; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this Device to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.DataSource.Device + * @instance + * @returns {Object.} JSON object + */ + Device.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Device + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.DataSource.Device + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Device.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.DataSource.Device"; + }; + + /** + * FormFactor enum. + * @name google.devicesandservices.health.v4.DataSource.Device.FormFactor + * @enum {number} + * @property {number} FORM_FACTOR_UNSPECIFIED=0 FORM_FACTOR_UNSPECIFIED value + * @property {number} FITNESS_BAND=1 FITNESS_BAND value + * @property {number} WATCH=2 WATCH value + * @property {number} PHONE=3 PHONE value + * @property {number} RING=4 RING value + * @property {number} CHEST_STRAP=5 CHEST_STRAP value + * @property {number} SCALE=6 SCALE value + * @property {number} TABLET=7 TABLET value + * @property {number} HEAD_MOUNTED=8 HEAD_MOUNTED value + * @property {number} SMART_DISPLAY=9 SMART_DISPLAY value + */ + Device.FormFactor = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORM_FACTOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "FITNESS_BAND"] = 1; + values[valuesById[2] = "WATCH"] = 2; + values[valuesById[3] = "PHONE"] = 3; + values[valuesById[4] = "RING"] = 4; + values[valuesById[5] = "CHEST_STRAP"] = 5; + values[valuesById[6] = "SCALE"] = 6; + values[valuesById[7] = "TABLET"] = 7; + values[valuesById[8] = "HEAD_MOUNTED"] = 8; + values[valuesById[9] = "SMART_DISPLAY"] = 9; + return values; + })(); + + return Device; + })(); + + DataSource.Application = (function() { + + /** + * Properties of an Application. + * @memberof google.devicesandservices.health.v4.DataSource + * @interface IApplication + * @property {string|null} [packageName] Application packageName + * @property {string|null} [webClientId] Application webClientId + * @property {string|null} [googleWebClientId] Application googleWebClientId + */ + + /** + * Constructs a new Application. + * @memberof google.devicesandservices.health.v4.DataSource + * @classdesc Represents an Application. + * @implements IApplication + * @constructor + * @param {google.devicesandservices.health.v4.DataSource.IApplication=} [properties] Properties to set + */ + function Application(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (object.dataPointName != null) - message.dataPointName = String(object.dataPointName); - return message; - }; - /** - * Creates a plain object from a ReconciledDataPoint message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @static - * @param {google.devicesandservices.health.v4.ReconciledDataPoint} message ReconciledDataPoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReconciledDataPoint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.dataPointName = ""; - if (message.dataPointName != null && message.hasOwnProperty("dataPointName")) - object.dataPointName = message.dataPointName; - if (message.steps != null && message.hasOwnProperty("steps")) { - object.steps = $root.google.devicesandservices.health.v4.Steps.toObject(message.steps, options); - if (options.oneofs) - object.data = "steps"; - } - if (message.floors != null && message.hasOwnProperty("floors")) { - object.floors = $root.google.devicesandservices.health.v4.Floors.toObject(message.floors, options); - if (options.oneofs) - object.data = "floors"; - } - if (message.heartRate != null && message.hasOwnProperty("heartRate")) { - object.heartRate = $root.google.devicesandservices.health.v4.HeartRate.toObject(message.heartRate, options); - if (options.oneofs) - object.data = "heartRate"; - } - if (message.sleep != null && message.hasOwnProperty("sleep")) { - object.sleep = $root.google.devicesandservices.health.v4.Sleep.toObject(message.sleep, options); - if (options.oneofs) - object.data = "sleep"; - } - if (message.dailyRestingHeartRate != null && message.hasOwnProperty("dailyRestingHeartRate")) { - object.dailyRestingHeartRate = $root.google.devicesandservices.health.v4.DailyRestingHeartRate.toObject(message.dailyRestingHeartRate, options); - if (options.oneofs) - object.data = "dailyRestingHeartRate"; - } - if (message.dailyHeartRateVariability != null && message.hasOwnProperty("dailyHeartRateVariability")) { - object.dailyHeartRateVariability = $root.google.devicesandservices.health.v4.DailyHeartRateVariability.toObject(message.dailyHeartRateVariability, options); - if (options.oneofs) - object.data = "dailyHeartRateVariability"; - } - if (message.exercise != null && message.hasOwnProperty("exercise")) { - object.exercise = $root.google.devicesandservices.health.v4.Exercise.toObject(message.exercise, options); - if (options.oneofs) - object.data = "exercise"; - } - if (message.weight != null && message.hasOwnProperty("weight")) { - object.weight = $root.google.devicesandservices.health.v4.Weight.toObject(message.weight, options); - if (options.oneofs) - object.data = "weight"; - } - if (message.altitude != null && message.hasOwnProperty("altitude")) { - object.altitude = $root.google.devicesandservices.health.v4.Altitude.toObject(message.altitude, options); - if (options.oneofs) - object.data = "altitude"; - } - if (message.distance != null && message.hasOwnProperty("distance")) { - object.distance = $root.google.devicesandservices.health.v4.Distance.toObject(message.distance, options); - if (options.oneofs) - object.data = "distance"; - } - if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { - object.bodyFat = $root.google.devicesandservices.health.v4.BodyFat.toObject(message.bodyFat, options); - if (options.oneofs) - object.data = "bodyFat"; - } - if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { - object.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutes.toObject(message.activeZoneMinutes, options); - if (options.oneofs) - object.data = "activeZoneMinutes"; - } - if (message.heartRateVariability != null && message.hasOwnProperty("heartRateVariability")) { - object.heartRateVariability = $root.google.devicesandservices.health.v4.HeartRateVariability.toObject(message.heartRateVariability, options); - if (options.oneofs) - object.data = "heartRateVariability"; - } - if (message.dailySleepTemperatureDerivations != null && message.hasOwnProperty("dailySleepTemperatureDerivations")) { - object.dailySleepTemperatureDerivations = $root.google.devicesandservices.health.v4.DailySleepTemperatureDerivations.toObject(message.dailySleepTemperatureDerivations, options); - if (options.oneofs) - object.data = "dailySleepTemperatureDerivations"; - } - if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { - object.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriod.toObject(message.sedentaryPeriod, options); - if (options.oneofs) - object.data = "sedentaryPeriod"; - } - if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { - object.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2Max.toObject(message.runVo2Max, options); - if (options.oneofs) - object.data = "runVo2Max"; - } - if (message.oxygenSaturation != null && message.hasOwnProperty("oxygenSaturation")) { - object.oxygenSaturation = $root.google.devicesandservices.health.v4.OxygenSaturation.toObject(message.oxygenSaturation, options); - if (options.oneofs) - object.data = "oxygenSaturation"; - } - if (message.dailyOxygenSaturation != null && message.hasOwnProperty("dailyOxygenSaturation")) { - object.dailyOxygenSaturation = $root.google.devicesandservices.health.v4.DailyOxygenSaturation.toObject(message.dailyOxygenSaturation, options); - if (options.oneofs) - object.data = "dailyOxygenSaturation"; - } - if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { - object.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevel.toObject(message.activityLevel, options); - if (options.oneofs) - object.data = "activityLevel"; - } - if (message.vo2Max != null && message.hasOwnProperty("vo2Max")) { - object.vo2Max = $root.google.devicesandservices.health.v4.VO2Max.toObject(message.vo2Max, options); - if (options.oneofs) - object.data = "vo2Max"; - } - if (message.dailyVo2Max != null && message.hasOwnProperty("dailyVo2Max")) { - object.dailyVo2Max = $root.google.devicesandservices.health.v4.DailyVO2Max.toObject(message.dailyVo2Max, options); - if (options.oneofs) - object.data = "dailyVo2Max"; - } - if (message.dailyHeartRateZones != null && message.hasOwnProperty("dailyHeartRateZones")) { - object.dailyHeartRateZones = $root.google.devicesandservices.health.v4.DailyHeartRateZones.toObject(message.dailyHeartRateZones, options); - if (options.oneofs) - object.data = "dailyHeartRateZones"; - } - if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { - object.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLog.toObject(message.hydrationLog, options); - if (options.oneofs) - object.data = "hydrationLog"; - } - if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { - object.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZone.toObject(message.timeInHeartRateZone, options); - if (options.oneofs) - object.data = "timeInHeartRateZone"; - } - if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { - object.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutes.toObject(message.activeMinutes, options); - if (options.oneofs) - object.data = "activeMinutes"; - } - if (message.respiratoryRateSleepSummary != null && message.hasOwnProperty("respiratoryRateSleepSummary")) { - object.respiratoryRateSleepSummary = $root.google.devicesandservices.health.v4.RespiratoryRateSleepSummary.toObject(message.respiratoryRateSleepSummary, options); - if (options.oneofs) - object.data = "respiratoryRateSleepSummary"; - } - if (message.dailyRespiratoryRate != null && message.hasOwnProperty("dailyRespiratoryRate")) { - object.dailyRespiratoryRate = $root.google.devicesandservices.health.v4.DailyRespiratoryRate.toObject(message.dailyRespiratoryRate, options); - if (options.oneofs) - object.data = "dailyRespiratoryRate"; - } - if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { - object.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsData.toObject(message.swimLengthsData, options); - if (options.oneofs) - object.data = "swimLengthsData"; - } - if (message.height != null && message.hasOwnProperty("height")) { - object.height = $root.google.devicesandservices.health.v4.Height.toObject(message.height, options); - if (options.oneofs) - object.data = "height"; - } - if (message.basalEnergyBurned != null && message.hasOwnProperty("basalEnergyBurned")) { - object.basalEnergyBurned = $root.google.devicesandservices.health.v4.BasalEnergyBurned.toObject(message.basalEnergyBurned, options); - if (options.oneofs) - object.data = "basalEnergyBurned"; - } - return object; - }; + /** + * Application packageName. + * @member {string} packageName + * @memberof google.devicesandservices.health.v4.DataSource.Application + * @instance + */ + Application.prototype.packageName = ""; - /** - * Converts this ReconciledDataPoint to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @instance - * @returns {Object.} JSON object - */ - ReconciledDataPoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Application webClientId. + * @member {string} webClientId + * @memberof google.devicesandservices.health.v4.DataSource.Application + * @instance + */ + Application.prototype.webClientId = ""; - /** - * Gets the default type url for ReconciledDataPoint - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.ReconciledDataPoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReconciledDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.ReconciledDataPoint"; - }; + /** + * Application googleWebClientId. + * @member {string} googleWebClientId + * @memberof google.devicesandservices.health.v4.DataSource.Application + * @instance + */ + Application.prototype.googleWebClientId = ""; - return ReconciledDataPoint; - })(); + /** + * Creates a new Application instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.DataSource.Application + * @static + * @param {google.devicesandservices.health.v4.DataSource.IApplication=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DataSource.Application} Application instance + */ + Application.create = function create(properties) { + return new Application(properties); + }; - v4.RollupDataPoint = (function() { + /** + * Encodes the specified Application message. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Application.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.DataSource.Application + * @static + * @param {google.devicesandservices.health.v4.DataSource.IApplication} message Application message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Application.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.packageName != null && Object.hasOwnProperty.call(message, "packageName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.packageName); + if (message.webClientId != null && Object.hasOwnProperty.call(message, "webClientId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.webClientId); + if (message.googleWebClientId != null && Object.hasOwnProperty.call(message, "googleWebClientId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.googleWebClientId); + return writer; + }; - /** - * Properties of a RollupDataPoint. - * @memberof google.devicesandservices.health.v4 - * @interface IRollupDataPoint - * @property {google.devicesandservices.health.v4.IStepsRollupValue|null} [steps] RollupDataPoint steps - * @property {google.devicesandservices.health.v4.IFloorsRollupValue|null} [floors] RollupDataPoint floors - * @property {google.devicesandservices.health.v4.IHeartRateRollupValue|null} [heartRate] RollupDataPoint heartRate - * @property {google.devicesandservices.health.v4.IWeightRollupValue|null} [weight] RollupDataPoint weight - * @property {google.devicesandservices.health.v4.IAltitudeRollupValue|null} [altitude] RollupDataPoint altitude - * @property {google.devicesandservices.health.v4.IDistanceRollupValue|null} [distance] RollupDataPoint distance - * @property {google.devicesandservices.health.v4.IBodyFatRollupValue|null} [bodyFat] RollupDataPoint bodyFat - * @property {google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null} [totalCalories] RollupDataPoint totalCalories - * @property {google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null} [activeZoneMinutes] RollupDataPoint activeZoneMinutes - * @property {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null} [sedentaryPeriod] RollupDataPoint sedentaryPeriod - * @property {google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null} [runVo2Max] RollupDataPoint runVo2Max - * @property {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null} [caloriesInHeartRateZone] RollupDataPoint caloriesInHeartRateZone - * @property {google.devicesandservices.health.v4.IActivityLevelRollupValue|null} [activityLevel] RollupDataPoint activityLevel - * @property {google.devicesandservices.health.v4.IHydrationLogRollupValue|null} [hydrationLog] RollupDataPoint hydrationLog - * @property {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null} [timeInHeartRateZone] RollupDataPoint timeInHeartRateZone - * @property {google.devicesandservices.health.v4.IActiveMinutesRollupValue|null} [activeMinutes] RollupDataPoint activeMinutes - * @property {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null} [swimLengthsData] RollupDataPoint swimLengthsData - * @property {google.protobuf.ITimestamp|null} [startTime] RollupDataPoint startTime - * @property {google.protobuf.ITimestamp|null} [endTime] RollupDataPoint endTime - */ + /** + * Encodes the specified Application message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Application.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.DataSource.Application + * @static + * @param {google.devicesandservices.health.v4.DataSource.IApplication} message Application message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Application.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new RollupDataPoint. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a RollupDataPoint. - * @implements IRollupDataPoint - * @constructor - * @param {google.devicesandservices.health.v4.IRollupDataPoint=} [properties] Properties to set - */ - function RollupDataPoint(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes an Application message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.DataSource.Application + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.DataSource.Application} Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Application.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DataSource.Application(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.packageName = reader.string(); + break; + } + case 2: { + message.webClientId = reader.string(); + break; + } + case 3: { + message.googleWebClientId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * RollupDataPoint steps. - * @member {google.devicesandservices.health.v4.IStepsRollupValue|null|undefined} steps - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance - */ - RollupDataPoint.prototype.steps = null; + /** + * Decodes an Application message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.DataSource.Application + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.DataSource.Application} Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Application.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * RollupDataPoint floors. - * @member {google.devicesandservices.health.v4.IFloorsRollupValue|null|undefined} floors - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance - */ - RollupDataPoint.prototype.floors = null; + /** + * Verifies an Application message. + * @function verify + * @memberof google.devicesandservices.health.v4.DataSource.Application + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Application.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.packageName != null && message.hasOwnProperty("packageName")) + if (!$util.isString(message.packageName)) + return "packageName: string expected"; + if (message.webClientId != null && message.hasOwnProperty("webClientId")) + if (!$util.isString(message.webClientId)) + return "webClientId: string expected"; + if (message.googleWebClientId != null && message.hasOwnProperty("googleWebClientId")) + if (!$util.isString(message.googleWebClientId)) + return "googleWebClientId: string expected"; + return null; + }; - /** - * RollupDataPoint heartRate. - * @member {google.devicesandservices.health.v4.IHeartRateRollupValue|null|undefined} heartRate - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance - */ - RollupDataPoint.prototype.heartRate = null; + /** + * Creates an Application message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.DataSource.Application + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.DataSource.Application} Application + */ + Application.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DataSource.Application) + return object; + var message = new $root.google.devicesandservices.health.v4.DataSource.Application(); + if (object.packageName != null) + message.packageName = String(object.packageName); + if (object.webClientId != null) + message.webClientId = String(object.webClientId); + if (object.googleWebClientId != null) + message.googleWebClientId = String(object.googleWebClientId); + return message; + }; - /** - * RollupDataPoint weight. - * @member {google.devicesandservices.health.v4.IWeightRollupValue|null|undefined} weight - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance - */ - RollupDataPoint.prototype.weight = null; + /** + * Creates a plain object from an Application message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.DataSource.Application + * @static + * @param {google.devicesandservices.health.v4.DataSource.Application} message Application + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Application.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.packageName = ""; + object.webClientId = ""; + object.googleWebClientId = ""; + } + if (message.packageName != null && message.hasOwnProperty("packageName")) + object.packageName = message.packageName; + if (message.webClientId != null && message.hasOwnProperty("webClientId")) + object.webClientId = message.webClientId; + if (message.googleWebClientId != null && message.hasOwnProperty("googleWebClientId")) + object.googleWebClientId = message.googleWebClientId; + return object; + }; - /** - * RollupDataPoint altitude. - * @member {google.devicesandservices.health.v4.IAltitudeRollupValue|null|undefined} altitude - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance - */ - RollupDataPoint.prototype.altitude = null; + /** + * Converts this Application to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.DataSource.Application + * @instance + * @returns {Object.} JSON object + */ + Application.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Application + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.DataSource.Application + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Application.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.DataSource.Application"; + }; + + return Application; + })(); /** - * RollupDataPoint distance. - * @member {google.devicesandservices.health.v4.IDistanceRollupValue|null|undefined} distance - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance + * RecordingMethod enum. + * @name google.devicesandservices.health.v4.DataSource.RecordingMethod + * @enum {number} + * @property {number} RECORDING_METHOD_UNSPECIFIED=0 RECORDING_METHOD_UNSPECIFIED value + * @property {number} MANUAL=1 MANUAL value + * @property {number} PASSIVELY_MEASURED=2 PASSIVELY_MEASURED value + * @property {number} DERIVED=3 DERIVED value + * @property {number} ACTIVELY_MEASURED=4 ACTIVELY_MEASURED value + * @property {number} UNKNOWN=5 UNKNOWN value */ - RollupDataPoint.prototype.distance = null; + DataSource.RecordingMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECORDING_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "MANUAL"] = 1; + values[valuesById[2] = "PASSIVELY_MEASURED"] = 2; + values[valuesById[3] = "DERIVED"] = 3; + values[valuesById[4] = "ACTIVELY_MEASURED"] = 4; + values[valuesById[5] = "UNKNOWN"] = 5; + return values; + })(); /** - * RollupDataPoint bodyFat. - * @member {google.devicesandservices.health.v4.IBodyFatRollupValue|null|undefined} bodyFat - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance + * Platform enum. + * @name google.devicesandservices.health.v4.DataSource.Platform + * @enum {number} + * @property {number} PLATFORM_UNSPECIFIED=0 PLATFORM_UNSPECIFIED value + * @property {number} FITBIT=1 FITBIT value + * @property {number} HEALTH_CONNECT=2 HEALTH_CONNECT value + * @property {number} HEALTH_KIT=3 HEALTH_KIT value + * @property {number} FIT=4 FIT value + * @property {number} FITBIT_WEB_API=5 FITBIT_WEB_API value + * @property {number} NEST=6 NEST value + * @property {number} GOOGLE_WEB_API=7 GOOGLE_WEB_API value + * @property {number} GOOGLE_PARTNER_INTEGRATION=8 GOOGLE_PARTNER_INTEGRATION value */ - RollupDataPoint.prototype.bodyFat = null; + DataSource.Platform = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PLATFORM_UNSPECIFIED"] = 0; + values[valuesById[1] = "FITBIT"] = 1; + values[valuesById[2] = "HEALTH_CONNECT"] = 2; + values[valuesById[3] = "HEALTH_KIT"] = 3; + values[valuesById[4] = "FIT"] = 4; + values[valuesById[5] = "FITBIT_WEB_API"] = 5; + values[valuesById[6] = "NEST"] = 6; + values[valuesById[7] = "GOOGLE_WEB_API"] = 7; + values[valuesById[8] = "GOOGLE_PARTNER_INTEGRATION"] = 8; + return values; + })(); - /** - * RollupDataPoint totalCalories. - * @member {google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null|undefined} totalCalories - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance - */ - RollupDataPoint.prototype.totalCalories = null; + return DataSource; + })(); - /** - * RollupDataPoint activeZoneMinutes. - * @member {google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null|undefined} activeZoneMinutes - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance - */ - RollupDataPoint.prototype.activeZoneMinutes = null; + v4.DataSubscriptionService = (function() { /** - * RollupDataPoint sedentaryPeriod. - * @member {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null|undefined} sedentaryPeriod - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance + * Constructs a new DataSubscriptionService service. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a DataSubscriptionService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - RollupDataPoint.prototype.sedentaryPeriod = null; + function DataSubscriptionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * RollupDataPoint runVo2Max. - * @member {google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null|undefined} runVo2Max - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance - */ - RollupDataPoint.prototype.runVo2Max = null; + (DataSubscriptionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DataSubscriptionService; /** - * RollupDataPoint caloriesInHeartRateZone. - * @member {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null|undefined} caloriesInHeartRateZone - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance + * Creates new DataSubscriptionService service using the specified rpc implementation. + * @function create + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {DataSubscriptionService} RPC service. Useful where requests and/or responses are streamed. */ - RollupDataPoint.prototype.caloriesInHeartRateZone = null; + DataSubscriptionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * RollupDataPoint activityLevel. - * @member {google.devicesandservices.health.v4.IActivityLevelRollupValue|null|undefined} activityLevel - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|createSubscriber}. + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @typedef CreateSubscriberCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - RollupDataPoint.prototype.activityLevel = null; /** - * RollupDataPoint hydrationLog. - * @member {google.devicesandservices.health.v4.IHydrationLogRollupValue|null|undefined} hydrationLog - * @memberof google.devicesandservices.health.v4.RollupDataPoint + * Calls CreateSubscriber. + * @function createSubscriber + * @memberof google.devicesandservices.health.v4.DataSubscriptionService * @instance + * @param {google.devicesandservices.health.v4.ICreateSubscriberRequest} request CreateSubscriberRequest message or plain object + * @param {google.devicesandservices.health.v4.DataSubscriptionService.CreateSubscriberCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - RollupDataPoint.prototype.hydrationLog = null; + Object.defineProperty(DataSubscriptionService.prototype.createSubscriber = function createSubscriber(request, callback) { + return this.rpcCall(createSubscriber, $root.google.devicesandservices.health.v4.CreateSubscriberRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSubscriber" }); /** - * RollupDataPoint timeInHeartRateZone. - * @member {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null|undefined} timeInHeartRateZone - * @memberof google.devicesandservices.health.v4.RollupDataPoint + * Calls CreateSubscriber. + * @function createSubscriber + * @memberof google.devicesandservices.health.v4.DataSubscriptionService * @instance + * @param {google.devicesandservices.health.v4.ICreateSubscriberRequest} request CreateSubscriberRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RollupDataPoint.prototype.timeInHeartRateZone = null; /** - * RollupDataPoint activeMinutes. - * @member {google.devicesandservices.health.v4.IActiveMinutesRollupValue|null|undefined} activeMinutes - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|listSubscribers}. + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @typedef ListSubscribersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.ListSubscribersResponse} [response] ListSubscribersResponse */ - RollupDataPoint.prototype.activeMinutes = null; /** - * RollupDataPoint swimLengthsData. - * @member {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null|undefined} swimLengthsData - * @memberof google.devicesandservices.health.v4.RollupDataPoint + * Calls ListSubscribers. + * @function listSubscribers + * @memberof google.devicesandservices.health.v4.DataSubscriptionService * @instance + * @param {google.devicesandservices.health.v4.IListSubscribersRequest} request ListSubscribersRequest message or plain object + * @param {google.devicesandservices.health.v4.DataSubscriptionService.ListSubscribersCallback} callback Node-style callback called with the error, if any, and ListSubscribersResponse + * @returns {undefined} + * @variation 1 */ - RollupDataPoint.prototype.swimLengthsData = null; + Object.defineProperty(DataSubscriptionService.prototype.listSubscribers = function listSubscribers(request, callback) { + return this.rpcCall(listSubscribers, $root.google.devicesandservices.health.v4.ListSubscribersRequest, $root.google.devicesandservices.health.v4.ListSubscribersResponse, request, callback); + }, "name", { value: "ListSubscribers" }); /** - * RollupDataPoint startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.devicesandservices.health.v4.RollupDataPoint + * Calls ListSubscribers. + * @function listSubscribers + * @memberof google.devicesandservices.health.v4.DataSubscriptionService * @instance + * @param {google.devicesandservices.health.v4.IListSubscribersRequest} request ListSubscribersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RollupDataPoint.prototype.startTime = null; /** - * RollupDataPoint endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @instance + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|updateSubscriber}. + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @typedef UpdateSubscriberCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - RollupDataPoint.prototype.endTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; /** - * RollupDataPoint value. - * @member {"steps"|"floors"|"heartRate"|"weight"|"altitude"|"distance"|"bodyFat"|"totalCalories"|"activeZoneMinutes"|"sedentaryPeriod"|"runVo2Max"|"caloriesInHeartRateZone"|"activityLevel"|"hydrationLog"|"timeInHeartRateZone"|"activeMinutes"|"swimLengthsData"|undefined} value - * @memberof google.devicesandservices.health.v4.RollupDataPoint + * Calls UpdateSubscriber. + * @function updateSubscriber + * @memberof google.devicesandservices.health.v4.DataSubscriptionService * @instance + * @param {google.devicesandservices.health.v4.IUpdateSubscriberRequest} request UpdateSubscriberRequest message or plain object + * @param {google.devicesandservices.health.v4.DataSubscriptionService.UpdateSubscriberCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - Object.defineProperty(RollupDataPoint.prototype, "value", { - get: $util.oneOfGetter($oneOfFields = ["steps", "floors", "heartRate", "weight", "altitude", "distance", "bodyFat", "totalCalories", "activeZoneMinutes", "sedentaryPeriod", "runVo2Max", "caloriesInHeartRateZone", "activityLevel", "hydrationLog", "timeInHeartRateZone", "activeMinutes", "swimLengthsData"]), - set: $util.oneOfSetter($oneOfFields) - }); + Object.defineProperty(DataSubscriptionService.prototype.updateSubscriber = function updateSubscriber(request, callback) { + return this.rpcCall(updateSubscriber, $root.google.devicesandservices.health.v4.UpdateSubscriberRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateSubscriber" }); /** - * Creates a new RollupDataPoint instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @static - * @param {google.devicesandservices.health.v4.IRollupDataPoint=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.RollupDataPoint} RollupDataPoint instance + * Calls UpdateSubscriber. + * @function updateSubscriber + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @instance + * @param {google.devicesandservices.health.v4.IUpdateSubscriberRequest} request UpdateSubscriberRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RollupDataPoint.create = function create(properties) { - return new RollupDataPoint(properties); - }; /** - * Encodes the specified RollupDataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.RollupDataPoint.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @static - * @param {google.devicesandservices.health.v4.IRollupDataPoint} message RollupDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|deleteSubscriber}. + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @typedef DeleteSubscriberCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - RollupDataPoint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.steps != null && Object.hasOwnProperty.call(message, "steps")) - $root.google.devicesandservices.health.v4.StepsRollupValue.encode(message.steps, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.floors != null && Object.hasOwnProperty.call(message, "floors")) - $root.google.devicesandservices.health.v4.FloorsRollupValue.encode(message.floors, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.heartRate != null && Object.hasOwnProperty.call(message, "heartRate")) - $root.google.devicesandservices.health.v4.HeartRateRollupValue.encode(message.heartRate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - $root.google.devicesandservices.health.v4.WeightRollupValue.encode(message.weight, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.altitude != null && Object.hasOwnProperty.call(message, "altitude")) - $root.google.devicesandservices.health.v4.AltitudeRollupValue.encode(message.altitude, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) - $root.google.devicesandservices.health.v4.DistanceRollupValue.encode(message.distance, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.bodyFat != null && Object.hasOwnProperty.call(message, "bodyFat")) - $root.google.devicesandservices.health.v4.BodyFatRollupValue.encode(message.bodyFat, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.totalCalories != null && Object.hasOwnProperty.call(message, "totalCalories")) - $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.encode(message.totalCalories, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.activeZoneMinutes != null && Object.hasOwnProperty.call(message, "activeZoneMinutes")) - $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.encode(message.activeZoneMinutes, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.sedentaryPeriod != null && Object.hasOwnProperty.call(message, "sedentaryPeriod")) - $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.encode(message.sedentaryPeriod, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.runVo2Max != null && Object.hasOwnProperty.call(message, "runVo2Max")) - $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.encode(message.runVo2Max, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.caloriesInHeartRateZone != null && Object.hasOwnProperty.call(message, "caloriesInHeartRateZone")) - $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.encode(message.caloriesInHeartRateZone, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.activityLevel != null && Object.hasOwnProperty.call(message, "activityLevel")) - $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.encode(message.activityLevel, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.hydrationLog != null && Object.hasOwnProperty.call(message, "hydrationLog")) - $root.google.devicesandservices.health.v4.HydrationLogRollupValue.encode(message.hydrationLog, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.timeInHeartRateZone != null && Object.hasOwnProperty.call(message, "timeInHeartRateZone")) - $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.encode(message.timeInHeartRateZone, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.activeMinutes != null && Object.hasOwnProperty.call(message, "activeMinutes")) - $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.encode(message.activeMinutes, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.swimLengthsData != null && Object.hasOwnProperty.call(message, "swimLengthsData")) - $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.encode(message.swimLengthsData, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - return writer; - }; /** - * Encodes the specified RollupDataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RollupDataPoint.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @static - * @param {google.devicesandservices.health.v4.IRollupDataPoint} message RollupDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DeleteSubscriber. + * @function deleteSubscriber + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @instance + * @param {google.devicesandservices.health.v4.IDeleteSubscriberRequest} request DeleteSubscriberRequest message or plain object + * @param {google.devicesandservices.health.v4.DataSubscriptionService.DeleteSubscriberCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - RollupDataPoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(DataSubscriptionService.prototype.deleteSubscriber = function deleteSubscriber(request, callback) { + return this.rpcCall(deleteSubscriber, $root.google.devicesandservices.health.v4.DeleteSubscriberRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteSubscriber" }); /** - * Decodes a RollupDataPoint message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.RollupDataPoint} RollupDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls DeleteSubscriber. + * @function deleteSubscriber + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @instance + * @param {google.devicesandservices.health.v4.IDeleteSubscriberRequest} request DeleteSubscriberRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RollupDataPoint.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.RollupDataPoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.steps = $root.google.devicesandservices.health.v4.StepsRollupValue.decode(reader, reader.uint32()); - break; - } - case 6: { - message.floors = $root.google.devicesandservices.health.v4.FloorsRollupValue.decode(reader, reader.uint32()); - break; - } - case 7: { - message.heartRate = $root.google.devicesandservices.health.v4.HeartRateRollupValue.decode(reader, reader.uint32()); - break; - } - case 8: { - message.weight = $root.google.devicesandservices.health.v4.WeightRollupValue.decode(reader, reader.uint32()); - break; - } - case 9: { - message.altitude = $root.google.devicesandservices.health.v4.AltitudeRollupValue.decode(reader, reader.uint32()); - break; - } - case 10: { - message.distance = $root.google.devicesandservices.health.v4.DistanceRollupValue.decode(reader, reader.uint32()); - break; - } - case 11: { - message.bodyFat = $root.google.devicesandservices.health.v4.BodyFatRollupValue.decode(reader, reader.uint32()); - break; - } - case 12: { - message.totalCalories = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.decode(reader, reader.uint32()); - break; - } - case 13: { - message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.decode(reader, reader.uint32()); - break; - } - case 15: { - message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.decode(reader, reader.uint32()); - break; - } - case 16: { - message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.decode(reader, reader.uint32()); - break; - } - case 17: { - message.caloriesInHeartRateZone = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.decode(reader, reader.uint32()); - break; - } - case 18: { - message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.decode(reader, reader.uint32()); - break; - } - case 20: { - message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.decode(reader, reader.uint32()); - break; - } - case 21: { - message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.decode(reader, reader.uint32()); - break; - } - case 22: { - message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.decode(reader, reader.uint32()); - break; - } - case 23: { - message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.decode(reader, reader.uint32()); - break; - } - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a RollupDataPoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.RollupDataPoint} RollupDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|createSubscription}. + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @typedef CreateSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.Subscription} [response] Subscription */ - RollupDataPoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a RollupDataPoint message. - * @function verify - * @memberof google.devicesandservices.health.v4.RollupDataPoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RollupDataPoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.steps != null && message.hasOwnProperty("steps")) { - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.StepsRollupValue.verify(message.steps); - if (error) - return "steps." + error; - } - } - if (message.floors != null && message.hasOwnProperty("floors")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.FloorsRollupValue.verify(message.floors); - if (error) - return "floors." + error; - } - } - if (message.heartRate != null && message.hasOwnProperty("heartRate")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.HeartRateRollupValue.verify(message.heartRate); - if (error) - return "heartRate." + error; - } - } - if (message.weight != null && message.hasOwnProperty("weight")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.WeightRollupValue.verify(message.weight); - if (error) - return "weight." + error; - } - } - if (message.altitude != null && message.hasOwnProperty("altitude")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.AltitudeRollupValue.verify(message.altitude); - if (error) - return "altitude." + error; - } - } - if (message.distance != null && message.hasOwnProperty("distance")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.DistanceRollupValue.verify(message.distance); - if (error) - return "distance." + error; - } - } - if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.BodyFatRollupValue.verify(message.bodyFat); - if (error) - return "bodyFat." + error; - } - } - if (message.totalCalories != null && message.hasOwnProperty("totalCalories")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.verify(message.totalCalories); - if (error) - return "totalCalories." + error; - } - } - if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.verify(message.activeZoneMinutes); - if (error) - return "activeZoneMinutes." + error; - } - } - if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.verify(message.sedentaryPeriod); - if (error) - return "sedentaryPeriod." + error; - } - } - if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.verify(message.runVo2Max); - if (error) - return "runVo2Max." + error; - } - } - if (message.caloriesInHeartRateZone != null && message.hasOwnProperty("caloriesInHeartRateZone")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.verify(message.caloriesInHeartRateZone); - if (error) - return "caloriesInHeartRateZone." + error; - } - } - if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.verify(message.activityLevel); - if (error) - return "activityLevel." + error; - } - } - if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.verify(message.hydrationLog); - if (error) - return "hydrationLog." + error; - } - } - if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.verify(message.timeInHeartRateZone); - if (error) - return "timeInHeartRateZone." + error; - } - } - if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.verify(message.activeMinutes); - if (error) - return "activeMinutes." + error; - } - } - if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.verify(message.swimLengthsData); - if (error) - return "swimLengthsData." + error; + /** + * Calls CreateSubscription. + * @function createSubscription + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @instance + * @param {google.devicesandservices.health.v4.ICreateSubscriptionRequest} request CreateSubscriptionRequest message or plain object + * @param {google.devicesandservices.health.v4.DataSubscriptionService.CreateSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataSubscriptionService.prototype.createSubscription = function createSubscription(request, callback) { + return this.rpcCall(createSubscription, $root.google.devicesandservices.health.v4.CreateSubscriptionRequest, $root.google.devicesandservices.health.v4.Subscription, request, callback); + }, "name", { value: "CreateSubscription" }); + + /** + * Calls CreateSubscription. + * @function createSubscription + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @instance + * @param {google.devicesandservices.health.v4.ICreateSubscriptionRequest} request CreateSubscriptionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|listSubscriptions}. + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @typedef ListSubscriptionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.ListSubscriptionsResponse} [response] ListSubscriptionsResponse + */ + + /** + * Calls ListSubscriptions. + * @function listSubscriptions + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @instance + * @param {google.devicesandservices.health.v4.IListSubscriptionsRequest} request ListSubscriptionsRequest message or plain object + * @param {google.devicesandservices.health.v4.DataSubscriptionService.ListSubscriptionsCallback} callback Node-style callback called with the error, if any, and ListSubscriptionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataSubscriptionService.prototype.listSubscriptions = function listSubscriptions(request, callback) { + return this.rpcCall(listSubscriptions, $root.google.devicesandservices.health.v4.ListSubscriptionsRequest, $root.google.devicesandservices.health.v4.ListSubscriptionsResponse, request, callback); + }, "name", { value: "ListSubscriptions" }); + + /** + * Calls ListSubscriptions. + * @function listSubscriptions + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @instance + * @param {google.devicesandservices.health.v4.IListSubscriptionsRequest} request ListSubscriptionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|updateSubscription}. + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @typedef UpdateSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.Subscription} [response] Subscription + */ + + /** + * Calls UpdateSubscription. + * @function updateSubscription + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @instance + * @param {google.devicesandservices.health.v4.IUpdateSubscriptionRequest} request UpdateSubscriptionRequest message or plain object + * @param {google.devicesandservices.health.v4.DataSubscriptionService.UpdateSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataSubscriptionService.prototype.updateSubscription = function updateSubscription(request, callback) { + return this.rpcCall(updateSubscription, $root.google.devicesandservices.health.v4.UpdateSubscriptionRequest, $root.google.devicesandservices.health.v4.Subscription, request, callback); + }, "name", { value: "UpdateSubscription" }); + + /** + * Calls UpdateSubscription. + * @function updateSubscription + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @instance + * @param {google.devicesandservices.health.v4.IUpdateSubscriptionRequest} request UpdateSubscriptionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devicesandservices.health.v4.DataSubscriptionService|deleteSubscription}. + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @typedef DeleteSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSubscription. + * @function deleteSubscription + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @instance + * @param {google.devicesandservices.health.v4.IDeleteSubscriptionRequest} request DeleteSubscriptionRequest message or plain object + * @param {google.devicesandservices.health.v4.DataSubscriptionService.DeleteSubscriptionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataSubscriptionService.prototype.deleteSubscription = function deleteSubscription(request, callback) { + return this.rpcCall(deleteSubscription, $root.google.devicesandservices.health.v4.DeleteSubscriptionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSubscription" }); + + /** + * Calls DeleteSubscription. + * @function deleteSubscription + * @memberof google.devicesandservices.health.v4.DataSubscriptionService + * @instance + * @param {google.devicesandservices.health.v4.IDeleteSubscriptionRequest} request DeleteSubscriptionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DataSubscriptionService; + })(); + + v4.CreateSubscriberRequest = (function() { + + /** + * Properties of a CreateSubscriberRequest. + * @memberof google.devicesandservices.health.v4 + * @interface ICreateSubscriberRequest + * @property {string|null} [parent] CreateSubscriberRequest parent + * @property {google.devicesandservices.health.v4.ICreateSubscriberPayload|null} [subscriber] CreateSubscriberRequest subscriber + * @property {string|null} [subscriberId] CreateSubscriberRequest subscriberId + */ + + /** + * Constructs a new CreateSubscriberRequest. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a CreateSubscriberRequest. + * @implements ICreateSubscriberRequest + * @constructor + * @param {google.devicesandservices.health.v4.ICreateSubscriberRequest=} [properties] Properties to set + */ + function CreateSubscriberRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSubscriberRequest parent. + * @member {string} parent + * @memberof google.devicesandservices.health.v4.CreateSubscriberRequest + * @instance + */ + CreateSubscriberRequest.prototype.parent = ""; + + /** + * CreateSubscriberRequest subscriber. + * @member {google.devicesandservices.health.v4.ICreateSubscriberPayload|null|undefined} subscriber + * @memberof google.devicesandservices.health.v4.CreateSubscriberRequest + * @instance + */ + CreateSubscriberRequest.prototype.subscriber = null; + + /** + * CreateSubscriberRequest subscriberId. + * @member {string} subscriberId + * @memberof google.devicesandservices.health.v4.CreateSubscriberRequest + * @instance + */ + CreateSubscriberRequest.prototype.subscriberId = ""; + + /** + * Creates a new CreateSubscriberRequest instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.CreateSubscriberRequest + * @static + * @param {google.devicesandservices.health.v4.ICreateSubscriberRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.CreateSubscriberRequest} CreateSubscriberRequest instance + */ + CreateSubscriberRequest.create = function create(properties) { + return new CreateSubscriberRequest(properties); + }; + + /** + * Encodes the specified CreateSubscriberRequest message. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriberRequest.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.CreateSubscriberRequest + * @static + * @param {google.devicesandservices.health.v4.ICreateSubscriberRequest} message CreateSubscriberRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSubscriberRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.subscriber != null && Object.hasOwnProperty.call(message, "subscriber")) + $root.google.devicesandservices.health.v4.CreateSubscriberPayload.encode(message.subscriber, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.subscriberId != null && Object.hasOwnProperty.call(message, "subscriberId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.subscriberId); + return writer; + }; + + /** + * Encodes the specified CreateSubscriberRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriberRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.CreateSubscriberRequest + * @static + * @param {google.devicesandservices.health.v4.ICreateSubscriberRequest} message CreateSubscriberRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSubscriberRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSubscriberRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.CreateSubscriberRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.CreateSubscriberRequest} CreateSubscriberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSubscriberRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CreateSubscriberRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.subscriber = $root.google.devicesandservices.health.v4.CreateSubscriberPayload.decode(reader, reader.uint32()); + break; + } + case 3: { + message.subscriberId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; } } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); + return message; + }; + + /** + * Decodes a CreateSubscriberRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.CreateSubscriberRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.CreateSubscriberRequest} CreateSubscriberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSubscriberRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSubscriberRequest message. + * @function verify + * @memberof google.devicesandservices.health.v4.CreateSubscriberRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSubscriberRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.subscriber != null && message.hasOwnProperty("subscriber")) { + var error = $root.google.devicesandservices.health.v4.CreateSubscriberPayload.verify(message.subscriber); if (error) - return "endTime." + error; + return "subscriber." + error; } + if (message.subscriberId != null && message.hasOwnProperty("subscriberId")) + if (!$util.isString(message.subscriberId)) + return "subscriberId: string expected"; return null; }; /** - * Creates a RollupDataPoint message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSubscriberRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @memberof google.devicesandservices.health.v4.CreateSubscriberRequest * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.RollupDataPoint} RollupDataPoint + * @returns {google.devicesandservices.health.v4.CreateSubscriberRequest} CreateSubscriberRequest */ - RollupDataPoint.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.RollupDataPoint) + CreateSubscriberRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.CreateSubscriberRequest) return object; - var message = new $root.google.devicesandservices.health.v4.RollupDataPoint(); - if (object.steps != null) { - if (typeof object.steps !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.steps: object expected"); - message.steps = $root.google.devicesandservices.health.v4.StepsRollupValue.fromObject(object.steps); - } - if (object.floors != null) { - if (typeof object.floors !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.floors: object expected"); - message.floors = $root.google.devicesandservices.health.v4.FloorsRollupValue.fromObject(object.floors); - } - if (object.heartRate != null) { - if (typeof object.heartRate !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.heartRate: object expected"); - message.heartRate = $root.google.devicesandservices.health.v4.HeartRateRollupValue.fromObject(object.heartRate); - } - if (object.weight != null) { - if (typeof object.weight !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.weight: object expected"); - message.weight = $root.google.devicesandservices.health.v4.WeightRollupValue.fromObject(object.weight); - } - if (object.altitude != null) { - if (typeof object.altitude !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.altitude: object expected"); - message.altitude = $root.google.devicesandservices.health.v4.AltitudeRollupValue.fromObject(object.altitude); - } - if (object.distance != null) { - if (typeof object.distance !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.distance: object expected"); - message.distance = $root.google.devicesandservices.health.v4.DistanceRollupValue.fromObject(object.distance); - } - if (object.bodyFat != null) { - if (typeof object.bodyFat !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.bodyFat: object expected"); - message.bodyFat = $root.google.devicesandservices.health.v4.BodyFatRollupValue.fromObject(object.bodyFat); - } - if (object.totalCalories != null) { - if (typeof object.totalCalories !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.totalCalories: object expected"); - message.totalCalories = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.fromObject(object.totalCalories); - } - if (object.activeZoneMinutes != null) { - if (typeof object.activeZoneMinutes !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.activeZoneMinutes: object expected"); - message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.fromObject(object.activeZoneMinutes); - } - if (object.sedentaryPeriod != null) { - if (typeof object.sedentaryPeriod !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.sedentaryPeriod: object expected"); - message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.fromObject(object.sedentaryPeriod); - } - if (object.runVo2Max != null) { - if (typeof object.runVo2Max !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.runVo2Max: object expected"); - message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.fromObject(object.runVo2Max); - } - if (object.caloriesInHeartRateZone != null) { - if (typeof object.caloriesInHeartRateZone !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.caloriesInHeartRateZone: object expected"); - message.caloriesInHeartRateZone = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.fromObject(object.caloriesInHeartRateZone); - } - if (object.activityLevel != null) { - if (typeof object.activityLevel !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.activityLevel: object expected"); - message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.fromObject(object.activityLevel); - } - if (object.hydrationLog != null) { - if (typeof object.hydrationLog !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.hydrationLog: object expected"); - message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.fromObject(object.hydrationLog); - } - if (object.timeInHeartRateZone != null) { - if (typeof object.timeInHeartRateZone !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.timeInHeartRateZone: object expected"); - message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.fromObject(object.timeInHeartRateZone); - } - if (object.activeMinutes != null) { - if (typeof object.activeMinutes !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.activeMinutes: object expected"); - message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.fromObject(object.activeMinutes); - } - if (object.swimLengthsData != null) { - if (typeof object.swimLengthsData !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.swimLengthsData: object expected"); - message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.fromObject(object.swimLengthsData); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollupDataPoint.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + var message = new $root.google.devicesandservices.health.v4.CreateSubscriberRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.subscriber != null) { + if (typeof object.subscriber !== "object") + throw TypeError(".google.devicesandservices.health.v4.CreateSubscriberRequest.subscriber: object expected"); + message.subscriber = $root.google.devicesandservices.health.v4.CreateSubscriberPayload.fromObject(object.subscriber); } + if (object.subscriberId != null) + message.subscriberId = String(object.subscriberId); return message; }; /** - * Creates a plain object from a RollupDataPoint message. Also converts values to other types if specified. + * Creates a plain object from a CreateSubscriberRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @memberof google.devicesandservices.health.v4.CreateSubscriberRequest * @static - * @param {google.devicesandservices.health.v4.RollupDataPoint} message RollupDataPoint + * @param {google.devicesandservices.health.v4.CreateSubscriberRequest} message CreateSubscriberRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RollupDataPoint.toObject = function toObject(message, options) { + CreateSubscriberRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.startTime = null; - object.endTime = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.steps != null && message.hasOwnProperty("steps")) { - object.steps = $root.google.devicesandservices.health.v4.StepsRollupValue.toObject(message.steps, options); - if (options.oneofs) - object.value = "steps"; - } - if (message.floors != null && message.hasOwnProperty("floors")) { - object.floors = $root.google.devicesandservices.health.v4.FloorsRollupValue.toObject(message.floors, options); - if (options.oneofs) - object.value = "floors"; - } - if (message.heartRate != null && message.hasOwnProperty("heartRate")) { - object.heartRate = $root.google.devicesandservices.health.v4.HeartRateRollupValue.toObject(message.heartRate, options); - if (options.oneofs) - object.value = "heartRate"; - } - if (message.weight != null && message.hasOwnProperty("weight")) { - object.weight = $root.google.devicesandservices.health.v4.WeightRollupValue.toObject(message.weight, options); - if (options.oneofs) - object.value = "weight"; - } - if (message.altitude != null && message.hasOwnProperty("altitude")) { - object.altitude = $root.google.devicesandservices.health.v4.AltitudeRollupValue.toObject(message.altitude, options); - if (options.oneofs) - object.value = "altitude"; - } - if (message.distance != null && message.hasOwnProperty("distance")) { - object.distance = $root.google.devicesandservices.health.v4.DistanceRollupValue.toObject(message.distance, options); - if (options.oneofs) - object.value = "distance"; - } - if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { - object.bodyFat = $root.google.devicesandservices.health.v4.BodyFatRollupValue.toObject(message.bodyFat, options); - if (options.oneofs) - object.value = "bodyFat"; - } - if (message.totalCalories != null && message.hasOwnProperty("totalCalories")) { - object.totalCalories = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.toObject(message.totalCalories, options); - if (options.oneofs) - object.value = "totalCalories"; - } - if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { - object.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.toObject(message.activeZoneMinutes, options); - if (options.oneofs) - object.value = "activeZoneMinutes"; - } - if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { - object.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.toObject(message.sedentaryPeriod, options); - if (options.oneofs) - object.value = "sedentaryPeriod"; - } - if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { - object.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.toObject(message.runVo2Max, options); - if (options.oneofs) - object.value = "runVo2Max"; - } - if (message.caloriesInHeartRateZone != null && message.hasOwnProperty("caloriesInHeartRateZone")) { - object.caloriesInHeartRateZone = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.toObject(message.caloriesInHeartRateZone, options); - if (options.oneofs) - object.value = "caloriesInHeartRateZone"; - } - if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { - object.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.toObject(message.activityLevel, options); - if (options.oneofs) - object.value = "activityLevel"; - } - if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { - object.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.toObject(message.hydrationLog, options); - if (options.oneofs) - object.value = "hydrationLog"; - } - if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { - object.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.toObject(message.timeInHeartRateZone, options); - if (options.oneofs) - object.value = "timeInHeartRateZone"; - } - if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { - object.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.toObject(message.activeMinutes, options); - if (options.oneofs) - object.value = "activeMinutes"; - } - if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { - object.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.toObject(message.swimLengthsData, options); - if (options.oneofs) - object.value = "swimLengthsData"; + object.parent = ""; + object.subscriber = null; + object.subscriberId = ""; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.subscriber != null && message.hasOwnProperty("subscriber")) + object.subscriber = $root.google.devicesandservices.health.v4.CreateSubscriberPayload.toObject(message.subscriber, options); + if (message.subscriberId != null && message.hasOwnProperty("subscriberId")) + object.subscriberId = message.subscriberId; return object; }; /** - * Converts this RollupDataPoint to JSON. + * Converts this CreateSubscriberRequest to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @memberof google.devicesandservices.health.v4.CreateSubscriberRequest * @instance * @returns {Object.} JSON object */ - RollupDataPoint.prototype.toJSON = function toJSON() { + CreateSubscriberRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RollupDataPoint + * Gets the default type url for CreateSubscriberRequest * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.RollupDataPoint + * @memberof google.devicesandservices.health.v4.CreateSubscriberRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RollupDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSubscriberRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.RollupDataPoint"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.CreateSubscriberRequest"; }; - return RollupDataPoint; + return CreateSubscriberRequest; })(); - v4.DailyRollupDataPoint = (function() { + v4.ListSubscribersRequest = (function() { /** - * Properties of a DailyRollupDataPoint. + * Properties of a ListSubscribersRequest. * @memberof google.devicesandservices.health.v4 - * @interface IDailyRollupDataPoint - * @property {google.devicesandservices.health.v4.IStepsRollupValue|null} [steps] DailyRollupDataPoint steps - * @property {google.devicesandservices.health.v4.IFloorsRollupValue|null} [floors] DailyRollupDataPoint floors - * @property {google.devicesandservices.health.v4.IHeartRateRollupValue|null} [heartRate] DailyRollupDataPoint heartRate - * @property {google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue|null} [restingHeartRatePersonalRange] DailyRollupDataPoint restingHeartRatePersonalRange - * @property {google.devicesandservices.health.v4.IHeartRateVariabilityPersonalRangeRollupValue|null} [heartRateVariabilityPersonalRange] DailyRollupDataPoint heartRateVariabilityPersonalRange - * @property {google.devicesandservices.health.v4.IWeightRollupValue|null} [weight] DailyRollupDataPoint weight - * @property {google.devicesandservices.health.v4.IAltitudeRollupValue|null} [altitude] DailyRollupDataPoint altitude - * @property {google.devicesandservices.health.v4.IDistanceRollupValue|null} [distance] DailyRollupDataPoint distance - * @property {google.devicesandservices.health.v4.IBodyFatRollupValue|null} [bodyFat] DailyRollupDataPoint bodyFat - * @property {google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null} [totalCalories] DailyRollupDataPoint totalCalories - * @property {google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null} [activeZoneMinutes] DailyRollupDataPoint activeZoneMinutes - * @property {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null} [sedentaryPeriod] DailyRollupDataPoint sedentaryPeriod - * @property {google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null} [runVo2Max] DailyRollupDataPoint runVo2Max - * @property {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null} [caloriesInHeartRateZone] DailyRollupDataPoint caloriesInHeartRateZone - * @property {google.devicesandservices.health.v4.IActivityLevelRollupValue|null} [activityLevel] DailyRollupDataPoint activityLevel - * @property {google.devicesandservices.health.v4.IHydrationLogRollupValue|null} [hydrationLog] DailyRollupDataPoint hydrationLog - * @property {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null} [timeInHeartRateZone] DailyRollupDataPoint timeInHeartRateZone - * @property {google.devicesandservices.health.v4.IActiveMinutesRollupValue|null} [activeMinutes] DailyRollupDataPoint activeMinutes - * @property {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null} [swimLengthsData] DailyRollupDataPoint swimLengthsData - * @property {google.devicesandservices.health.v4.ICivilDateTime|null} [civilStartTime] DailyRollupDataPoint civilStartTime - * @property {google.devicesandservices.health.v4.ICivilDateTime|null} [civilEndTime] DailyRollupDataPoint civilEndTime + * @interface IListSubscribersRequest + * @property {string|null} [parent] ListSubscribersRequest parent + * @property {number|null} [pageSize] ListSubscribersRequest pageSize + * @property {string|null} [pageToken] ListSubscribersRequest pageToken */ /** - * Constructs a new DailyRollupDataPoint. + * Constructs a new ListSubscribersRequest. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a DailyRollupDataPoint. - * @implements IDailyRollupDataPoint + * @classdesc Represents a ListSubscribersRequest. + * @implements IListSubscribersRequest * @constructor - * @param {google.devicesandservices.health.v4.IDailyRollupDataPoint=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IListSubscribersRequest=} [properties] Properties to set */ - function DailyRollupDataPoint(properties) { + function ListSubscribersRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25716,371 +42456,361 @@ } /** - * DailyRollupDataPoint steps. - * @member {google.devicesandservices.health.v4.IStepsRollupValue|null|undefined} steps - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance - */ - DailyRollupDataPoint.prototype.steps = null; - - /** - * DailyRollupDataPoint floors. - * @member {google.devicesandservices.health.v4.IFloorsRollupValue|null|undefined} floors - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance - */ - DailyRollupDataPoint.prototype.floors = null; - - /** - * DailyRollupDataPoint heartRate. - * @member {google.devicesandservices.health.v4.IHeartRateRollupValue|null|undefined} heartRate - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * ListSubscribersRequest parent. + * @member {string} parent + * @memberof google.devicesandservices.health.v4.ListSubscribersRequest * @instance */ - DailyRollupDataPoint.prototype.heartRate = null; + ListSubscribersRequest.prototype.parent = ""; /** - * DailyRollupDataPoint restingHeartRatePersonalRange. - * @member {google.devicesandservices.health.v4.IRestingHeartRatePersonalRangeRollupValue|null|undefined} restingHeartRatePersonalRange - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * ListSubscribersRequest pageSize. + * @member {number} pageSize + * @memberof google.devicesandservices.health.v4.ListSubscribersRequest * @instance */ - DailyRollupDataPoint.prototype.restingHeartRatePersonalRange = null; + ListSubscribersRequest.prototype.pageSize = 0; /** - * DailyRollupDataPoint heartRateVariabilityPersonalRange. - * @member {google.devicesandservices.health.v4.IHeartRateVariabilityPersonalRangeRollupValue|null|undefined} heartRateVariabilityPersonalRange - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * ListSubscribersRequest pageToken. + * @member {string} pageToken + * @memberof google.devicesandservices.health.v4.ListSubscribersRequest * @instance */ - DailyRollupDataPoint.prototype.heartRateVariabilityPersonalRange = null; + ListSubscribersRequest.prototype.pageToken = ""; /** - * DailyRollupDataPoint weight. - * @member {google.devicesandservices.health.v4.IWeightRollupValue|null|undefined} weight - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance + * Creates a new ListSubscribersRequest instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.ListSubscribersRequest + * @static + * @param {google.devicesandservices.health.v4.IListSubscribersRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ListSubscribersRequest} ListSubscribersRequest instance */ - DailyRollupDataPoint.prototype.weight = null; + ListSubscribersRequest.create = function create(properties) { + return new ListSubscribersRequest(properties); + }; /** - * DailyRollupDataPoint altitude. - * @member {google.devicesandservices.health.v4.IAltitudeRollupValue|null|undefined} altitude - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance + * Encodes the specified ListSubscribersRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscribersRequest.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.ListSubscribersRequest + * @static + * @param {google.devicesandservices.health.v4.IListSubscribersRequest} message ListSubscribersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - DailyRollupDataPoint.prototype.altitude = null; + ListSubscribersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; /** - * DailyRollupDataPoint distance. - * @member {google.devicesandservices.health.v4.IDistanceRollupValue|null|undefined} distance - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance + * Encodes the specified ListSubscribersRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscribersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.ListSubscribersRequest + * @static + * @param {google.devicesandservices.health.v4.IListSubscribersRequest} message ListSubscribersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - DailyRollupDataPoint.prototype.distance = null; + ListSubscribersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * DailyRollupDataPoint bodyFat. - * @member {google.devicesandservices.health.v4.IBodyFatRollupValue|null|undefined} bodyFat - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance + * Decodes a ListSubscribersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.ListSubscribersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.ListSubscribersRequest} ListSubscribersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DailyRollupDataPoint.prototype.bodyFat = null; + ListSubscribersRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ListSubscribersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * DailyRollupDataPoint totalCalories. - * @member {google.devicesandservices.health.v4.ITotalCaloriesRollupValue|null|undefined} totalCalories - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance + * Decodes a ListSubscribersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.ListSubscribersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.ListSubscribersRequest} ListSubscribersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DailyRollupDataPoint.prototype.totalCalories = null; + ListSubscribersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * DailyRollupDataPoint activeZoneMinutes. - * @member {google.devicesandservices.health.v4.IActiveZoneMinutesRollupValue|null|undefined} activeZoneMinutes - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance + * Verifies a ListSubscribersRequest message. + * @function verify + * @memberof google.devicesandservices.health.v4.ListSubscribersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DailyRollupDataPoint.prototype.activeZoneMinutes = null; + ListSubscribersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; /** - * DailyRollupDataPoint sedentaryPeriod. - * @member {google.devicesandservices.health.v4.ISedentaryPeriodRollupValue|null|undefined} sedentaryPeriod - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance + * Creates a ListSubscribersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.ListSubscribersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.ListSubscribersRequest} ListSubscribersRequest */ - DailyRollupDataPoint.prototype.sedentaryPeriod = null; + ListSubscribersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ListSubscribersRequest) + return object; + var message = new $root.google.devicesandservices.health.v4.ListSubscribersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; /** - * DailyRollupDataPoint runVo2Max. - * @member {google.devicesandservices.health.v4.IRunVO2MaxRollupValue|null|undefined} runVo2Max - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance + * Creates a plain object from a ListSubscribersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.ListSubscribersRequest + * @static + * @param {google.devicesandservices.health.v4.ListSubscribersRequest} message ListSubscribersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - DailyRollupDataPoint.prototype.runVo2Max = null; + ListSubscribersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; /** - * DailyRollupDataPoint caloriesInHeartRateZone. - * @member {google.devicesandservices.health.v4.ICaloriesInHeartRateZoneRollupValue|null|undefined} caloriesInHeartRateZone - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * Converts this ListSubscribersRequest to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.ListSubscribersRequest * @instance + * @returns {Object.} JSON object */ - DailyRollupDataPoint.prototype.caloriesInHeartRateZone = null; + ListSubscribersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * DailyRollupDataPoint activityLevel. - * @member {google.devicesandservices.health.v4.IActivityLevelRollupValue|null|undefined} activityLevel - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance + * Gets the default type url for ListSubscribersRequest + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.ListSubscribersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - DailyRollupDataPoint.prototype.activityLevel = null; + ListSubscribersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.ListSubscribersRequest"; + }; - /** - * DailyRollupDataPoint hydrationLog. - * @member {google.devicesandservices.health.v4.IHydrationLogRollupValue|null|undefined} hydrationLog - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance - */ - DailyRollupDataPoint.prototype.hydrationLog = null; + return ListSubscribersRequest; + })(); - /** - * DailyRollupDataPoint timeInHeartRateZone. - * @member {google.devicesandservices.health.v4.ITimeInHeartRateZoneRollupValue|null|undefined} timeInHeartRateZone - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance - */ - DailyRollupDataPoint.prototype.timeInHeartRateZone = null; + v4.ListSubscribersResponse = (function() { /** - * DailyRollupDataPoint activeMinutes. - * @member {google.devicesandservices.health.v4.IActiveMinutesRollupValue|null|undefined} activeMinutes - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance + * Properties of a ListSubscribersResponse. + * @memberof google.devicesandservices.health.v4 + * @interface IListSubscribersResponse + * @property {Array.|null} [subscribers] ListSubscribersResponse subscribers + * @property {string|null} [nextPageToken] ListSubscribersResponse nextPageToken + * @property {number|null} [totalSize] ListSubscribersResponse totalSize */ - DailyRollupDataPoint.prototype.activeMinutes = null; /** - * DailyRollupDataPoint swimLengthsData. - * @member {google.devicesandservices.health.v4.ISwimLengthsDataRollupValue|null|undefined} swimLengthsData - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @instance + * Constructs a new ListSubscribersResponse. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a ListSubscribersResponse. + * @implements IListSubscribersResponse + * @constructor + * @param {google.devicesandservices.health.v4.IListSubscribersResponse=} [properties] Properties to set */ - DailyRollupDataPoint.prototype.swimLengthsData = null; + function ListSubscribersResponse(properties) { + this.subscribers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * DailyRollupDataPoint civilStartTime. - * @member {google.devicesandservices.health.v4.ICivilDateTime|null|undefined} civilStartTime - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * ListSubscribersResponse subscribers. + * @member {Array.} subscribers + * @memberof google.devicesandservices.health.v4.ListSubscribersResponse * @instance */ - DailyRollupDataPoint.prototype.civilStartTime = null; + ListSubscribersResponse.prototype.subscribers = $util.emptyArray; /** - * DailyRollupDataPoint civilEndTime. - * @member {google.devicesandservices.health.v4.ICivilDateTime|null|undefined} civilEndTime - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * ListSubscribersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.devicesandservices.health.v4.ListSubscribersResponse * @instance */ - DailyRollupDataPoint.prototype.civilEndTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ListSubscribersResponse.prototype.nextPageToken = ""; /** - * DailyRollupDataPoint value. - * @member {"steps"|"floors"|"heartRate"|"restingHeartRatePersonalRange"|"heartRateVariabilityPersonalRange"|"weight"|"altitude"|"distance"|"bodyFat"|"totalCalories"|"activeZoneMinutes"|"sedentaryPeriod"|"runVo2Max"|"caloriesInHeartRateZone"|"activityLevel"|"hydrationLog"|"timeInHeartRateZone"|"activeMinutes"|"swimLengthsData"|undefined} value - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * ListSubscribersResponse totalSize. + * @member {number} totalSize + * @memberof google.devicesandservices.health.v4.ListSubscribersResponse * @instance */ - Object.defineProperty(DailyRollupDataPoint.prototype, "value", { - get: $util.oneOfGetter($oneOfFields = ["steps", "floors", "heartRate", "restingHeartRatePersonalRange", "heartRateVariabilityPersonalRange", "weight", "altitude", "distance", "bodyFat", "totalCalories", "activeZoneMinutes", "sedentaryPeriod", "runVo2Max", "caloriesInHeartRateZone", "activityLevel", "hydrationLog", "timeInHeartRateZone", "activeMinutes", "swimLengthsData"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListSubscribersResponse.prototype.totalSize = 0; /** - * Creates a new DailyRollupDataPoint instance using the specified properties. + * Creates a new ListSubscribersResponse instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @memberof google.devicesandservices.health.v4.ListSubscribersResponse * @static - * @param {google.devicesandservices.health.v4.IDailyRollupDataPoint=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.DailyRollupDataPoint} DailyRollupDataPoint instance + * @param {google.devicesandservices.health.v4.IListSubscribersResponse=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ListSubscribersResponse} ListSubscribersResponse instance */ - DailyRollupDataPoint.create = function create(properties) { - return new DailyRollupDataPoint(properties); + ListSubscribersResponse.create = function create(properties) { + return new ListSubscribersResponse(properties); }; /** - * Encodes the specified DailyRollupDataPoint message. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollupDataPoint.verify|verify} messages. + * Encodes the specified ListSubscribersResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscribersResponse.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @memberof google.devicesandservices.health.v4.ListSubscribersResponse * @static - * @param {google.devicesandservices.health.v4.IDailyRollupDataPoint} message DailyRollupDataPoint message or plain object to encode + * @param {google.devicesandservices.health.v4.IListSubscribersResponse} message ListSubscribersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DailyRollupDataPoint.encode = function encode(message, writer) { + ListSubscribersResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.civilStartTime != null && Object.hasOwnProperty.call(message, "civilStartTime")) - $root.google.devicesandservices.health.v4.CivilDateTime.encode(message.civilStartTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.civilEndTime != null && Object.hasOwnProperty.call(message, "civilEndTime")) - $root.google.devicesandservices.health.v4.CivilDateTime.encode(message.civilEndTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.steps != null && Object.hasOwnProperty.call(message, "steps")) - $root.google.devicesandservices.health.v4.StepsRollupValue.encode(message.steps, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.floors != null && Object.hasOwnProperty.call(message, "floors")) - $root.google.devicesandservices.health.v4.FloorsRollupValue.encode(message.floors, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.heartRate != null && Object.hasOwnProperty.call(message, "heartRate")) - $root.google.devicesandservices.health.v4.HeartRateRollupValue.encode(message.heartRate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.restingHeartRatePersonalRange != null && Object.hasOwnProperty.call(message, "restingHeartRatePersonalRange")) - $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.encode(message.restingHeartRatePersonalRange, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.heartRateVariabilityPersonalRange != null && Object.hasOwnProperty.call(message, "heartRateVariabilityPersonalRange")) - $root.google.devicesandservices.health.v4.HeartRateVariabilityPersonalRangeRollupValue.encode(message.heartRateVariabilityPersonalRange, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - $root.google.devicesandservices.health.v4.WeightRollupValue.encode(message.weight, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.altitude != null && Object.hasOwnProperty.call(message, "altitude")) - $root.google.devicesandservices.health.v4.AltitudeRollupValue.encode(message.altitude, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) - $root.google.devicesandservices.health.v4.DistanceRollupValue.encode(message.distance, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.bodyFat != null && Object.hasOwnProperty.call(message, "bodyFat")) - $root.google.devicesandservices.health.v4.BodyFatRollupValue.encode(message.bodyFat, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.totalCalories != null && Object.hasOwnProperty.call(message, "totalCalories")) - $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.encode(message.totalCalories, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.activeZoneMinutes != null && Object.hasOwnProperty.call(message, "activeZoneMinutes")) - $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.encode(message.activeZoneMinutes, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.sedentaryPeriod != null && Object.hasOwnProperty.call(message, "sedentaryPeriod")) - $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.encode(message.sedentaryPeriod, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.runVo2Max != null && Object.hasOwnProperty.call(message, "runVo2Max")) - $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.encode(message.runVo2Max, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.caloriesInHeartRateZone != null && Object.hasOwnProperty.call(message, "caloriesInHeartRateZone")) - $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.encode(message.caloriesInHeartRateZone, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.activityLevel != null && Object.hasOwnProperty.call(message, "activityLevel")) - $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.encode(message.activityLevel, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.hydrationLog != null && Object.hasOwnProperty.call(message, "hydrationLog")) - $root.google.devicesandservices.health.v4.HydrationLogRollupValue.encode(message.hydrationLog, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.timeInHeartRateZone != null && Object.hasOwnProperty.call(message, "timeInHeartRateZone")) - $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.encode(message.timeInHeartRateZone, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.activeMinutes != null && Object.hasOwnProperty.call(message, "activeMinutes")) - $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.encode(message.activeMinutes, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.swimLengthsData != null && Object.hasOwnProperty.call(message, "swimLengthsData")) - $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.encode(message.swimLengthsData, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.subscribers != null && message.subscribers.length) + for (var i = 0; i < message.subscribers.length; ++i) + $root.google.devicesandservices.health.v4.Subscriber.encode(message.subscribers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); return writer; }; /** - * Encodes the specified DailyRollupDataPoint message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollupDataPoint.verify|verify} messages. + * Encodes the specified ListSubscribersResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscribersResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @memberof google.devicesandservices.health.v4.ListSubscribersResponse * @static - * @param {google.devicesandservices.health.v4.IDailyRollupDataPoint} message DailyRollupDataPoint message or plain object to encode + * @param {google.devicesandservices.health.v4.IListSubscribersResponse} message ListSubscribersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DailyRollupDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + ListSubscribersResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DailyRollupDataPoint message from the specified reader or buffer. + * Decodes a ListSubscribersResponse message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @memberof google.devicesandservices.health.v4.ListSubscribersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.DailyRollupDataPoint} DailyRollupDataPoint + * @returns {google.devicesandservices.health.v4.ListSubscribersResponse} ListSubscribersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DailyRollupDataPoint.decode = function decode(reader, length, error) { + ListSubscribersResponse.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DailyRollupDataPoint(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ListSubscribersResponse(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 5: { - message.steps = $root.google.devicesandservices.health.v4.StepsRollupValue.decode(reader, reader.uint32()); - break; - } - case 6: { - message.floors = $root.google.devicesandservices.health.v4.FloorsRollupValue.decode(reader, reader.uint32()); - break; - } - case 7: { - message.heartRate = $root.google.devicesandservices.health.v4.HeartRateRollupValue.decode(reader, reader.uint32()); - break; - } - case 8: { - message.restingHeartRatePersonalRange = $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.decode(reader, reader.uint32()); - break; - } - case 9: { - message.heartRateVariabilityPersonalRange = $root.google.devicesandservices.health.v4.HeartRateVariabilityPersonalRangeRollupValue.decode(reader, reader.uint32()); - break; - } - case 10: { - message.weight = $root.google.devicesandservices.health.v4.WeightRollupValue.decode(reader, reader.uint32()); - break; - } - case 11: { - message.altitude = $root.google.devicesandservices.health.v4.AltitudeRollupValue.decode(reader, reader.uint32()); - break; - } - case 12: { - message.distance = $root.google.devicesandservices.health.v4.DistanceRollupValue.decode(reader, reader.uint32()); - break; - } - case 13: { - message.bodyFat = $root.google.devicesandservices.health.v4.BodyFatRollupValue.decode(reader, reader.uint32()); - break; - } - case 14: { - message.totalCalories = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.decode(reader, reader.uint32()); - break; - } - case 15: { - message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.decode(reader, reader.uint32()); - break; - } - case 17: { - message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.decode(reader, reader.uint32()); - break; - } - case 18: { - message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.decode(reader, reader.uint32()); - break; - } - case 19: { - message.caloriesInHeartRateZone = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.decode(reader, reader.uint32()); - break; - } - case 20: { - message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.decode(reader, reader.uint32()); - break; - } - case 22: { - message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.decode(reader, reader.uint32()); - break; - } - case 23: { - message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.decode(reader, reader.uint32()); - break; - } - case 24: { - message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.decode(reader, reader.uint32()); - break; - } - case 25: { - message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.decode(reader, reader.uint32()); - break; - } case 1: { - message.civilStartTime = $root.google.devicesandservices.health.v4.CivilDateTime.decode(reader, reader.uint32()); + if (!(message.subscribers && message.subscribers.length)) + message.subscribers = []; + message.subscribers.push($root.google.devicesandservices.health.v4.Subscriber.decode(reader, reader.uint32())); break; } case 2: { - message.civilEndTime = $root.google.devicesandservices.health.v4.CivilDateTime.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.totalSize = reader.int32(); break; } default: @@ -26092,520 +42822,397 @@ }; /** - * Decodes a DailyRollupDataPoint message from the specified reader or buffer, length delimited. + * Decodes a ListSubscribersResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @memberof google.devicesandservices.health.v4.ListSubscribersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.DailyRollupDataPoint} DailyRollupDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DailyRollupDataPoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DailyRollupDataPoint message. - * @function verify - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DailyRollupDataPoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.steps != null && message.hasOwnProperty("steps")) { - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.StepsRollupValue.verify(message.steps); - if (error) - return "steps." + error; - } - } - if (message.floors != null && message.hasOwnProperty("floors")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.FloorsRollupValue.verify(message.floors); - if (error) - return "floors." + error; - } - } - if (message.heartRate != null && message.hasOwnProperty("heartRate")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.HeartRateRollupValue.verify(message.heartRate); - if (error) - return "heartRate." + error; - } - } - if (message.restingHeartRatePersonalRange != null && message.hasOwnProperty("restingHeartRatePersonalRange")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.verify(message.restingHeartRatePersonalRange); - if (error) - return "restingHeartRatePersonalRange." + error; - } - } - if (message.heartRateVariabilityPersonalRange != null && message.hasOwnProperty("heartRateVariabilityPersonalRange")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.HeartRateVariabilityPersonalRangeRollupValue.verify(message.heartRateVariabilityPersonalRange); - if (error) - return "heartRateVariabilityPersonalRange." + error; - } - } - if (message.weight != null && message.hasOwnProperty("weight")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.WeightRollupValue.verify(message.weight); - if (error) - return "weight." + error; - } - } - if (message.altitude != null && message.hasOwnProperty("altitude")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.AltitudeRollupValue.verify(message.altitude); - if (error) - return "altitude." + error; - } - } - if (message.distance != null && message.hasOwnProperty("distance")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.DistanceRollupValue.verify(message.distance); - if (error) - return "distance." + error; - } - } - if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.BodyFatRollupValue.verify(message.bodyFat); - if (error) - return "bodyFat." + error; - } - } - if (message.totalCalories != null && message.hasOwnProperty("totalCalories")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.verify(message.totalCalories); - if (error) - return "totalCalories." + error; - } - } - if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.verify(message.activeZoneMinutes); - if (error) - return "activeZoneMinutes." + error; - } - } - if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.verify(message.sedentaryPeriod); - if (error) - return "sedentaryPeriod." + error; - } - } - if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.verify(message.runVo2Max); - if (error) - return "runVo2Max." + error; - } - } - if (message.caloriesInHeartRateZone != null && message.hasOwnProperty("caloriesInHeartRateZone")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.verify(message.caloriesInHeartRateZone); - if (error) - return "caloriesInHeartRateZone." + error; - } - } - if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.verify(message.activityLevel); - if (error) - return "activityLevel." + error; - } - } - if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.verify(message.hydrationLog); - if (error) - return "hydrationLog." + error; - } - } - if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.verify(message.timeInHeartRateZone); - if (error) - return "timeInHeartRateZone." + error; - } - } - if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.verify(message.activeMinutes); - if (error) - return "activeMinutes." + error; - } - } - if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.verify(message.swimLengthsData); + * @returns {google.devicesandservices.health.v4.ListSubscribersResponse} ListSubscribersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubscribersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSubscribersResponse message. + * @function verify + * @memberof google.devicesandservices.health.v4.ListSubscribersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSubscribersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscribers != null && message.hasOwnProperty("subscribers")) { + if (!Array.isArray(message.subscribers)) + return "subscribers: array expected"; + for (var i = 0; i < message.subscribers.length; ++i) { + var error = $root.google.devicesandservices.health.v4.Subscriber.verify(message.subscribers[i]); if (error) - return "swimLengthsData." + error; + return "subscribers." + error; } } - if (message.civilStartTime != null && message.hasOwnProperty("civilStartTime")) { - var error = $root.google.devicesandservices.health.v4.CivilDateTime.verify(message.civilStartTime); - if (error) - return "civilStartTime." + error; - } - if (message.civilEndTime != null && message.hasOwnProperty("civilEndTime")) { - var error = $root.google.devicesandservices.health.v4.CivilDateTime.verify(message.civilEndTime); - if (error) - return "civilEndTime." + error; - } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates a DailyRollupDataPoint message from a plain object. Also converts values to their respective internal types. + * Creates a ListSubscribersResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @memberof google.devicesandservices.health.v4.ListSubscribersResponse * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.DailyRollupDataPoint} DailyRollupDataPoint + * @returns {google.devicesandservices.health.v4.ListSubscribersResponse} ListSubscribersResponse */ - DailyRollupDataPoint.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.DailyRollupDataPoint) + ListSubscribersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ListSubscribersResponse) return object; - var message = new $root.google.devicesandservices.health.v4.DailyRollupDataPoint(); - if (object.steps != null) { - if (typeof object.steps !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.steps: object expected"); - message.steps = $root.google.devicesandservices.health.v4.StepsRollupValue.fromObject(object.steps); - } - if (object.floors != null) { - if (typeof object.floors !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.floors: object expected"); - message.floors = $root.google.devicesandservices.health.v4.FloorsRollupValue.fromObject(object.floors); - } - if (object.heartRate != null) { - if (typeof object.heartRate !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.heartRate: object expected"); - message.heartRate = $root.google.devicesandservices.health.v4.HeartRateRollupValue.fromObject(object.heartRate); - } - if (object.restingHeartRatePersonalRange != null) { - if (typeof object.restingHeartRatePersonalRange !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.restingHeartRatePersonalRange: object expected"); - message.restingHeartRatePersonalRange = $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.fromObject(object.restingHeartRatePersonalRange); - } - if (object.heartRateVariabilityPersonalRange != null) { - if (typeof object.heartRateVariabilityPersonalRange !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.heartRateVariabilityPersonalRange: object expected"); - message.heartRateVariabilityPersonalRange = $root.google.devicesandservices.health.v4.HeartRateVariabilityPersonalRangeRollupValue.fromObject(object.heartRateVariabilityPersonalRange); - } - if (object.weight != null) { - if (typeof object.weight !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.weight: object expected"); - message.weight = $root.google.devicesandservices.health.v4.WeightRollupValue.fromObject(object.weight); - } - if (object.altitude != null) { - if (typeof object.altitude !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.altitude: object expected"); - message.altitude = $root.google.devicesandservices.health.v4.AltitudeRollupValue.fromObject(object.altitude); - } - if (object.distance != null) { - if (typeof object.distance !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.distance: object expected"); - message.distance = $root.google.devicesandservices.health.v4.DistanceRollupValue.fromObject(object.distance); - } - if (object.bodyFat != null) { - if (typeof object.bodyFat !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.bodyFat: object expected"); - message.bodyFat = $root.google.devicesandservices.health.v4.BodyFatRollupValue.fromObject(object.bodyFat); - } - if (object.totalCalories != null) { - if (typeof object.totalCalories !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.totalCalories: object expected"); - message.totalCalories = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.fromObject(object.totalCalories); - } - if (object.activeZoneMinutes != null) { - if (typeof object.activeZoneMinutes !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.activeZoneMinutes: object expected"); - message.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.fromObject(object.activeZoneMinutes); - } - if (object.sedentaryPeriod != null) { - if (typeof object.sedentaryPeriod !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.sedentaryPeriod: object expected"); - message.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.fromObject(object.sedentaryPeriod); - } - if (object.runVo2Max != null) { - if (typeof object.runVo2Max !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.runVo2Max: object expected"); - message.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.fromObject(object.runVo2Max); - } - if (object.caloriesInHeartRateZone != null) { - if (typeof object.caloriesInHeartRateZone !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.caloriesInHeartRateZone: object expected"); - message.caloriesInHeartRateZone = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.fromObject(object.caloriesInHeartRateZone); - } - if (object.activityLevel != null) { - if (typeof object.activityLevel !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.activityLevel: object expected"); - message.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.fromObject(object.activityLevel); - } - if (object.hydrationLog != null) { - if (typeof object.hydrationLog !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.hydrationLog: object expected"); - message.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.fromObject(object.hydrationLog); - } - if (object.timeInHeartRateZone != null) { - if (typeof object.timeInHeartRateZone !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.timeInHeartRateZone: object expected"); - message.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.fromObject(object.timeInHeartRateZone); - } - if (object.activeMinutes != null) { - if (typeof object.activeMinutes !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.activeMinutes: object expected"); - message.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.fromObject(object.activeMinutes); - } - if (object.swimLengthsData != null) { - if (typeof object.swimLengthsData !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.swimLengthsData: object expected"); - message.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.fromObject(object.swimLengthsData); - } - if (object.civilStartTime != null) { - if (typeof object.civilStartTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.civilStartTime: object expected"); - message.civilStartTime = $root.google.devicesandservices.health.v4.CivilDateTime.fromObject(object.civilStartTime); - } - if (object.civilEndTime != null) { - if (typeof object.civilEndTime !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollupDataPoint.civilEndTime: object expected"); - message.civilEndTime = $root.google.devicesandservices.health.v4.CivilDateTime.fromObject(object.civilEndTime); + var message = new $root.google.devicesandservices.health.v4.ListSubscribersResponse(); + if (object.subscribers) { + if (!Array.isArray(object.subscribers)) + throw TypeError(".google.devicesandservices.health.v4.ListSubscribersResponse.subscribers: array expected"); + message.subscribers = []; + for (var i = 0; i < object.subscribers.length; ++i) { + if (typeof object.subscribers[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.ListSubscribersResponse.subscribers: object expected"); + message.subscribers[i] = $root.google.devicesandservices.health.v4.Subscriber.fromObject(object.subscribers[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a DailyRollupDataPoint message. Also converts values to other types if specified. + * Creates a plain object from a ListSubscribersResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @memberof google.devicesandservices.health.v4.ListSubscribersResponse * @static - * @param {google.devicesandservices.health.v4.DailyRollupDataPoint} message DailyRollupDataPoint + * @param {google.devicesandservices.health.v4.ListSubscribersResponse} message ListSubscribersResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DailyRollupDataPoint.toObject = function toObject(message, options) { + ListSubscribersResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.subscribers = []; if (options.defaults) { - object.civilStartTime = null; - object.civilEndTime = null; - } - if (message.civilStartTime != null && message.hasOwnProperty("civilStartTime")) - object.civilStartTime = $root.google.devicesandservices.health.v4.CivilDateTime.toObject(message.civilStartTime, options); - if (message.civilEndTime != null && message.hasOwnProperty("civilEndTime")) - object.civilEndTime = $root.google.devicesandservices.health.v4.CivilDateTime.toObject(message.civilEndTime, options); - if (message.steps != null && message.hasOwnProperty("steps")) { - object.steps = $root.google.devicesandservices.health.v4.StepsRollupValue.toObject(message.steps, options); - if (options.oneofs) - object.value = "steps"; - } - if (message.floors != null && message.hasOwnProperty("floors")) { - object.floors = $root.google.devicesandservices.health.v4.FloorsRollupValue.toObject(message.floors, options); - if (options.oneofs) - object.value = "floors"; - } - if (message.heartRate != null && message.hasOwnProperty("heartRate")) { - object.heartRate = $root.google.devicesandservices.health.v4.HeartRateRollupValue.toObject(message.heartRate, options); - if (options.oneofs) - object.value = "heartRate"; - } - if (message.restingHeartRatePersonalRange != null && message.hasOwnProperty("restingHeartRatePersonalRange")) { - object.restingHeartRatePersonalRange = $root.google.devicesandservices.health.v4.RestingHeartRatePersonalRangeRollupValue.toObject(message.restingHeartRatePersonalRange, options); - if (options.oneofs) - object.value = "restingHeartRatePersonalRange"; - } - if (message.heartRateVariabilityPersonalRange != null && message.hasOwnProperty("heartRateVariabilityPersonalRange")) { - object.heartRateVariabilityPersonalRange = $root.google.devicesandservices.health.v4.HeartRateVariabilityPersonalRangeRollupValue.toObject(message.heartRateVariabilityPersonalRange, options); - if (options.oneofs) - object.value = "heartRateVariabilityPersonalRange"; - } - if (message.weight != null && message.hasOwnProperty("weight")) { - object.weight = $root.google.devicesandservices.health.v4.WeightRollupValue.toObject(message.weight, options); - if (options.oneofs) - object.value = "weight"; - } - if (message.altitude != null && message.hasOwnProperty("altitude")) { - object.altitude = $root.google.devicesandservices.health.v4.AltitudeRollupValue.toObject(message.altitude, options); - if (options.oneofs) - object.value = "altitude"; - } - if (message.distance != null && message.hasOwnProperty("distance")) { - object.distance = $root.google.devicesandservices.health.v4.DistanceRollupValue.toObject(message.distance, options); - if (options.oneofs) - object.value = "distance"; - } - if (message.bodyFat != null && message.hasOwnProperty("bodyFat")) { - object.bodyFat = $root.google.devicesandservices.health.v4.BodyFatRollupValue.toObject(message.bodyFat, options); - if (options.oneofs) - object.value = "bodyFat"; - } - if (message.totalCalories != null && message.hasOwnProperty("totalCalories")) { - object.totalCalories = $root.google.devicesandservices.health.v4.TotalCaloriesRollupValue.toObject(message.totalCalories, options); - if (options.oneofs) - object.value = "totalCalories"; - } - if (message.activeZoneMinutes != null && message.hasOwnProperty("activeZoneMinutes")) { - object.activeZoneMinutes = $root.google.devicesandservices.health.v4.ActiveZoneMinutesRollupValue.toObject(message.activeZoneMinutes, options); - if (options.oneofs) - object.value = "activeZoneMinutes"; + object.nextPageToken = ""; + object.totalSize = 0; } - if (message.sedentaryPeriod != null && message.hasOwnProperty("sedentaryPeriod")) { - object.sedentaryPeriod = $root.google.devicesandservices.health.v4.SedentaryPeriodRollupValue.toObject(message.sedentaryPeriod, options); - if (options.oneofs) - object.value = "sedentaryPeriod"; + if (message.subscribers && message.subscribers.length) { + object.subscribers = []; + for (var j = 0; j < message.subscribers.length; ++j) + object.subscribers[j] = $root.google.devicesandservices.health.v4.Subscriber.toObject(message.subscribers[j], options); } - if (message.runVo2Max != null && message.hasOwnProperty("runVo2Max")) { - object.runVo2Max = $root.google.devicesandservices.health.v4.RunVO2MaxRollupValue.toObject(message.runVo2Max, options); - if (options.oneofs) - object.value = "runVo2Max"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListSubscribersResponse to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.ListSubscribersResponse + * @instance + * @returns {Object.} JSON object + */ + ListSubscribersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSubscribersResponse + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.ListSubscribersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSubscribersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (message.caloriesInHeartRateZone != null && message.hasOwnProperty("caloriesInHeartRateZone")) { - object.caloriesInHeartRateZone = $root.google.devicesandservices.health.v4.CaloriesInHeartRateZoneRollupValue.toObject(message.caloriesInHeartRateZone, options); - if (options.oneofs) - object.value = "caloriesInHeartRateZone"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.ListSubscribersResponse"; + }; + + return ListSubscribersResponse; + })(); + + v4.UpdateSubscriberRequest = (function() { + + /** + * Properties of an UpdateSubscriberRequest. + * @memberof google.devicesandservices.health.v4 + * @interface IUpdateSubscriberRequest + * @property {google.devicesandservices.health.v4.ISubscriber|null} [subscriber] UpdateSubscriberRequest subscriber + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSubscriberRequest updateMask + */ + + /** + * Constructs a new UpdateSubscriberRequest. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents an UpdateSubscriberRequest. + * @implements IUpdateSubscriberRequest + * @constructor + * @param {google.devicesandservices.health.v4.IUpdateSubscriberRequest=} [properties] Properties to set + */ + function UpdateSubscriberRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSubscriberRequest subscriber. + * @member {google.devicesandservices.health.v4.ISubscriber|null|undefined} subscriber + * @memberof google.devicesandservices.health.v4.UpdateSubscriberRequest + * @instance + */ + UpdateSubscriberRequest.prototype.subscriber = null; + + /** + * UpdateSubscriberRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.devicesandservices.health.v4.UpdateSubscriberRequest + * @instance + */ + UpdateSubscriberRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSubscriberRequest instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.UpdateSubscriberRequest + * @static + * @param {google.devicesandservices.health.v4.IUpdateSubscriberRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.UpdateSubscriberRequest} UpdateSubscriberRequest instance + */ + UpdateSubscriberRequest.create = function create(properties) { + return new UpdateSubscriberRequest(properties); + }; + + /** + * Encodes the specified UpdateSubscriberRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSubscriberRequest.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.UpdateSubscriberRequest + * @static + * @param {google.devicesandservices.health.v4.IUpdateSubscriberRequest} message UpdateSubscriberRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSubscriberRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscriber != null && Object.hasOwnProperty.call(message, "subscriber")) + $root.google.devicesandservices.health.v4.Subscriber.encode(message.subscriber, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSubscriberRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSubscriberRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.UpdateSubscriberRequest + * @static + * @param {google.devicesandservices.health.v4.IUpdateSubscriberRequest} message UpdateSubscriberRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSubscriberRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSubscriberRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.UpdateSubscriberRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.UpdateSubscriberRequest} UpdateSubscriberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSubscriberRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.UpdateSubscriberRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subscriber = $root.google.devicesandservices.health.v4.Subscriber.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - if (message.activityLevel != null && message.hasOwnProperty("activityLevel")) { - object.activityLevel = $root.google.devicesandservices.health.v4.ActivityLevelRollupValue.toObject(message.activityLevel, options); - if (options.oneofs) - object.value = "activityLevel"; + return message; + }; + + /** + * Decodes an UpdateSubscriberRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.UpdateSubscriberRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.UpdateSubscriberRequest} UpdateSubscriberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSubscriberRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSubscriberRequest message. + * @function verify + * @memberof google.devicesandservices.health.v4.UpdateSubscriberRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSubscriberRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscriber != null && message.hasOwnProperty("subscriber")) { + var error = $root.google.devicesandservices.health.v4.Subscriber.verify(message.subscriber); + if (error) + return "subscriber." + error; } - if (message.hydrationLog != null && message.hasOwnProperty("hydrationLog")) { - object.hydrationLog = $root.google.devicesandservices.health.v4.HydrationLogRollupValue.toObject(message.hydrationLog, options); - if (options.oneofs) - object.value = "hydrationLog"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } - if (message.timeInHeartRateZone != null && message.hasOwnProperty("timeInHeartRateZone")) { - object.timeInHeartRateZone = $root.google.devicesandservices.health.v4.TimeInHeartRateZoneRollupValue.toObject(message.timeInHeartRateZone, options); - if (options.oneofs) - object.value = "timeInHeartRateZone"; + return null; + }; + + /** + * Creates an UpdateSubscriberRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.UpdateSubscriberRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.UpdateSubscriberRequest} UpdateSubscriberRequest + */ + UpdateSubscriberRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.UpdateSubscriberRequest) + return object; + var message = new $root.google.devicesandservices.health.v4.UpdateSubscriberRequest(); + if (object.subscriber != null) { + if (typeof object.subscriber !== "object") + throw TypeError(".google.devicesandservices.health.v4.UpdateSubscriberRequest.subscriber: object expected"); + message.subscriber = $root.google.devicesandservices.health.v4.Subscriber.fromObject(object.subscriber); } - if (message.activeMinutes != null && message.hasOwnProperty("activeMinutes")) { - object.activeMinutes = $root.google.devicesandservices.health.v4.ActiveMinutesRollupValue.toObject(message.activeMinutes, options); - if (options.oneofs) - object.value = "activeMinutes"; + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.devicesandservices.health.v4.UpdateSubscriberRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (message.swimLengthsData != null && message.hasOwnProperty("swimLengthsData")) { - object.swimLengthsData = $root.google.devicesandservices.health.v4.SwimLengthsDataRollupValue.toObject(message.swimLengthsData, options); - if (options.oneofs) - object.value = "swimLengthsData"; + return message; + }; + + /** + * Creates a plain object from an UpdateSubscriberRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.UpdateSubscriberRequest + * @static + * @param {google.devicesandservices.health.v4.UpdateSubscriberRequest} message UpdateSubscriberRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSubscriberRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subscriber = null; + object.updateMask = null; } + if (message.subscriber != null && message.hasOwnProperty("subscriber")) + object.subscriber = $root.google.devicesandservices.health.v4.Subscriber.toObject(message.subscriber, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this DailyRollupDataPoint to JSON. + * Converts this UpdateSubscriberRequest to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @memberof google.devicesandservices.health.v4.UpdateSubscriberRequest * @instance * @returns {Object.} JSON object */ - DailyRollupDataPoint.prototype.toJSON = function toJSON() { + UpdateSubscriberRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DailyRollupDataPoint + * Gets the default type url for UpdateSubscriberRequest * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.DailyRollupDataPoint + * @memberof google.devicesandservices.health.v4.UpdateSubscriberRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DailyRollupDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateSubscriberRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.DailyRollupDataPoint"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.UpdateSubscriberRequest"; }; - return DailyRollupDataPoint; + return UpdateSubscriberRequest; })(); - v4.GetDataPointRequest = (function() { + v4.DeleteSubscriberRequest = (function() { /** - * Properties of a GetDataPointRequest. + * Properties of a DeleteSubscriberRequest. * @memberof google.devicesandservices.health.v4 - * @interface IGetDataPointRequest - * @property {string|null} [name] GetDataPointRequest name + * @interface IDeleteSubscriberRequest + * @property {string|null} [name] DeleteSubscriberRequest name + * @property {boolean|null} [force] DeleteSubscriberRequest force */ /** - * Constructs a new GetDataPointRequest. + * Constructs a new DeleteSubscriberRequest. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a GetDataPointRequest. - * @implements IGetDataPointRequest + * @classdesc Represents a DeleteSubscriberRequest. + * @implements IDeleteSubscriberRequest * @constructor - * @param {google.devicesandservices.health.v4.IGetDataPointRequest=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IDeleteSubscriberRequest=} [properties] Properties to set */ - function GetDataPointRequest(properties) { + function DeleteSubscriberRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -26613,70 +43220,80 @@ } /** - * GetDataPointRequest name. + * DeleteSubscriberRequest name. * @member {string} name - * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberRequest * @instance */ - GetDataPointRequest.prototype.name = ""; + DeleteSubscriberRequest.prototype.name = ""; /** - * Creates a new GetDataPointRequest instance using the specified properties. + * DeleteSubscriberRequest force. + * @member {boolean} force + * @memberof google.devicesandservices.health.v4.DeleteSubscriberRequest + * @instance + */ + DeleteSubscriberRequest.prototype.force = false; + + /** + * Creates a new DeleteSubscriberRequest instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberRequest * @static - * @param {google.devicesandservices.health.v4.IGetDataPointRequest=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.GetDataPointRequest} GetDataPointRequest instance + * @param {google.devicesandservices.health.v4.IDeleteSubscriberRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DeleteSubscriberRequest} DeleteSubscriberRequest instance */ - GetDataPointRequest.create = function create(properties) { - return new GetDataPointRequest(properties); + DeleteSubscriberRequest.create = function create(properties) { + return new DeleteSubscriberRequest(properties); }; /** - * Encodes the specified GetDataPointRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetDataPointRequest.verify|verify} messages. + * Encodes the specified DeleteSubscriberRequest message. Does not implicitly {@link google.devicesandservices.health.v4.DeleteSubscriberRequest.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberRequest * @static - * @param {google.devicesandservices.health.v4.IGetDataPointRequest} message GetDataPointRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IDeleteSubscriberRequest} message DeleteSubscriberRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDataPointRequest.encode = function encode(message, writer) { + DeleteSubscriberRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); return writer; }; /** - * Encodes the specified GetDataPointRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetDataPointRequest.verify|verify} messages. + * Encodes the specified DeleteSubscriberRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DeleteSubscriberRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberRequest * @static - * @param {google.devicesandservices.health.v4.IGetDataPointRequest} message GetDataPointRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IDeleteSubscriberRequest} message DeleteSubscriberRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDataPointRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteSubscriberRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDataPointRequest message from the specified reader or buffer. + * Decodes a DeleteSubscriberRequest message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.GetDataPointRequest} GetDataPointRequest + * @returns {google.devicesandservices.health.v4.DeleteSubscriberRequest} DeleteSubscriberRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDataPointRequest.decode = function decode(reader, length, error) { + DeleteSubscriberRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.GetDataPointRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DeleteSubscriberRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -26686,6 +43303,10 @@ message.name = reader.string(); break; } + case 2: { + message.force = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -26695,125 +43316,133 @@ }; /** - * Decodes a GetDataPointRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteSubscriberRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.GetDataPointRequest} GetDataPointRequest + * @returns {google.devicesandservices.health.v4.DeleteSubscriberRequest} DeleteSubscriberRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDataPointRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteSubscriberRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDataPointRequest message. + * Verifies a DeleteSubscriberRequest message. * @function verify - * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDataPointRequest.verify = function verify(message) { + DeleteSubscriberRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates a GetDataPointRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSubscriberRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberRequest * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.GetDataPointRequest} GetDataPointRequest + * @returns {google.devicesandservices.health.v4.DeleteSubscriberRequest} DeleteSubscriberRequest */ - GetDataPointRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.GetDataPointRequest) + DeleteSubscriberRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DeleteSubscriberRequest) return object; - var message = new $root.google.devicesandservices.health.v4.GetDataPointRequest(); + var message = new $root.google.devicesandservices.health.v4.DeleteSubscriberRequest(); if (object.name != null) message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from a GetDataPointRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteSubscriberRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberRequest * @static - * @param {google.devicesandservices.health.v4.GetDataPointRequest} message GetDataPointRequest + * @param {google.devicesandservices.health.v4.DeleteSubscriberRequest} message DeleteSubscriberRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDataPointRequest.toObject = function toObject(message, options) { + DeleteSubscriberRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.force = false; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; /** - * Converts this GetDataPointRequest to JSON. + * Converts this DeleteSubscriberRequest to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberRequest * @instance * @returns {Object.} JSON object */ - GetDataPointRequest.prototype.toJSON = function toJSON() { + DeleteSubscriberRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetDataPointRequest + * Gets the default type url for DeleteSubscriberRequest * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.GetDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetDataPointRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteSubscriberRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.GetDataPointRequest"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.DeleteSubscriberRequest"; }; - return GetDataPointRequest; + return DeleteSubscriberRequest; })(); - v4.ListDataPointsRequest = (function() { + v4.CreateSubscriptionRequest = (function() { /** - * Properties of a ListDataPointsRequest. + * Properties of a CreateSubscriptionRequest. * @memberof google.devicesandservices.health.v4 - * @interface IListDataPointsRequest - * @property {string|null} [parent] ListDataPointsRequest parent - * @property {number|null} [pageSize] ListDataPointsRequest pageSize - * @property {string|null} [pageToken] ListDataPointsRequest pageToken - * @property {string|null} [filter] ListDataPointsRequest filter + * @interface ICreateSubscriptionRequest + * @property {string|null} [parent] CreateSubscriptionRequest parent + * @property {string|null} [subscriptionId] CreateSubscriptionRequest subscriptionId + * @property {google.devicesandservices.health.v4.ICreateSubscriptionPayload|null} [subscription] CreateSubscriptionRequest subscription */ /** - * Constructs a new ListDataPointsRequest. + * Constructs a new CreateSubscriptionRequest. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a ListDataPointsRequest. - * @implements IListDataPointsRequest + * @classdesc Represents a CreateSubscriptionRequest. + * @implements ICreateSubscriptionRequest * @constructor - * @param {google.devicesandservices.health.v4.IListDataPointsRequest=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.ICreateSubscriptionRequest=} [properties] Properties to set */ - function ListDataPointsRequest(properties) { + function CreateSubscriptionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -26821,100 +43450,90 @@ } /** - * ListDataPointsRequest parent. + * CreateSubscriptionRequest parent. * @member {string} parent - * @memberof google.devicesandservices.health.v4.ListDataPointsRequest - * @instance - */ - ListDataPointsRequest.prototype.parent = ""; - - /** - * ListDataPointsRequest pageSize. - * @member {number} pageSize - * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriptionRequest * @instance */ - ListDataPointsRequest.prototype.pageSize = 0; + CreateSubscriptionRequest.prototype.parent = ""; /** - * ListDataPointsRequest pageToken. - * @member {string} pageToken - * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * CreateSubscriptionRequest subscriptionId. + * @member {string} subscriptionId + * @memberof google.devicesandservices.health.v4.CreateSubscriptionRequest * @instance */ - ListDataPointsRequest.prototype.pageToken = ""; + CreateSubscriptionRequest.prototype.subscriptionId = ""; /** - * ListDataPointsRequest filter. - * @member {string} filter - * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * CreateSubscriptionRequest subscription. + * @member {google.devicesandservices.health.v4.ICreateSubscriptionPayload|null|undefined} subscription + * @memberof google.devicesandservices.health.v4.CreateSubscriptionRequest * @instance */ - ListDataPointsRequest.prototype.filter = ""; + CreateSubscriptionRequest.prototype.subscription = null; /** - * Creates a new ListDataPointsRequest instance using the specified properties. + * Creates a new CreateSubscriptionRequest instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriptionRequest * @static - * @param {google.devicesandservices.health.v4.IListDataPointsRequest=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.ListDataPointsRequest} ListDataPointsRequest instance + * @param {google.devicesandservices.health.v4.ICreateSubscriptionRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.CreateSubscriptionRequest} CreateSubscriptionRequest instance */ - ListDataPointsRequest.create = function create(properties) { - return new ListDataPointsRequest(properties); + CreateSubscriptionRequest.create = function create(properties) { + return new CreateSubscriptionRequest(properties); }; /** - * Encodes the specified ListDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsRequest.verify|verify} messages. + * Encodes the specified CreateSubscriptionRequest message. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriptionRequest.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriptionRequest * @static - * @param {google.devicesandservices.health.v4.IListDataPointsRequest} message ListDataPointsRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.ICreateSubscriptionRequest} message CreateSubscriptionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDataPointsRequest.encode = function encode(message, writer) { + CreateSubscriptionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.subscriptionId != null && Object.hasOwnProperty.call(message, "subscriptionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subscriptionId); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + $root.google.devicesandservices.health.v4.CreateSubscriptionPayload.encode(message.subscription, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsRequest.verify|verify} messages. + * Encodes the specified CreateSubscriptionRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriptionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriptionRequest * @static - * @param {google.devicesandservices.health.v4.IListDataPointsRequest} message ListDataPointsRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.ICreateSubscriptionRequest} message CreateSubscriptionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDataPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListDataPointsRequest message from the specified reader or buffer. + * Decodes a CreateSubscriptionRequest message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriptionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.ListDataPointsRequest} ListDataPointsRequest + * @returns {google.devicesandservices.health.v4.CreateSubscriptionRequest} CreateSubscriptionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListDataPointsRequest.decode = function decode(reader, length, error) { + CreateSubscriptionRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ListDataPointsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CreateSubscriptionRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -26925,15 +43544,11 @@ break; } case 2: { - message.pageSize = reader.int32(); + message.subscriptionId = reader.string(); break; } case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); + message.subscription = $root.google.devicesandservices.health.v4.CreateSubscriptionPayload.decode(reader, reader.uint32()); break; } default: @@ -26945,149 +43560,147 @@ }; /** - * Decodes a ListDataPointsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSubscriptionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriptionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.ListDataPointsRequest} ListDataPointsRequest + * @returns {google.devicesandservices.health.v4.CreateSubscriptionRequest} CreateSubscriptionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListDataPointsRequest.decodeDelimited = function decodeDelimited(reader) { + CreateSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListDataPointsRequest message. + * Verifies a CreateSubscriptionRequest message. * @function verify - * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriptionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListDataPointsRequest.verify = function verify(message) { + CreateSubscriptionRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + if (message.subscriptionId != null && message.hasOwnProperty("subscriptionId")) + if (!$util.isString(message.subscriptionId)) + return "subscriptionId: string expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) { + var error = $root.google.devicesandservices.health.v4.CreateSubscriptionPayload.verify(message.subscription); + if (error) + return "subscription." + error; + } return null; }; /** - * Creates a ListDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriptionRequest * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.ListDataPointsRequest} ListDataPointsRequest + * @returns {google.devicesandservices.health.v4.CreateSubscriptionRequest} CreateSubscriptionRequest */ - ListDataPointsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.ListDataPointsRequest) + CreateSubscriptionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.CreateSubscriptionRequest) return object; - var message = new $root.google.devicesandservices.health.v4.ListDataPointsRequest(); + var message = new $root.google.devicesandservices.health.v4.CreateSubscriptionRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); + if (object.subscriptionId != null) + message.subscriptionId = String(object.subscriptionId); + if (object.subscription != null) { + if (typeof object.subscription !== "object") + throw TypeError(".google.devicesandservices.health.v4.CreateSubscriptionRequest.subscription: object expected"); + message.subscription = $root.google.devicesandservices.health.v4.CreateSubscriptionPayload.fromObject(object.subscription); + } return message; }; /** - * Creates a plain object from a ListDataPointsRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateSubscriptionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriptionRequest * @static - * @param {google.devicesandservices.health.v4.ListDataPointsRequest} message ListDataPointsRequest + * @param {google.devicesandservices.health.v4.CreateSubscriptionRequest} message CreateSubscriptionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListDataPointsRequest.toObject = function toObject(message, options) { + CreateSubscriptionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; + object.subscriptionId = ""; + object.subscription = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; + if (message.subscriptionId != null && message.hasOwnProperty("subscriptionId")) + object.subscriptionId = message.subscriptionId; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = $root.google.devicesandservices.health.v4.CreateSubscriptionPayload.toObject(message.subscription, options); return object; }; /** - * Converts this ListDataPointsRequest to JSON. + * Converts this CreateSubscriptionRequest to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriptionRequest * @instance * @returns {Object.} JSON object */ - ListDataPointsRequest.prototype.toJSON = function toJSON() { + CreateSubscriptionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListDataPointsRequest + * Gets the default type url for CreateSubscriptionRequest * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.ListDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriptionRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListDataPointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.ListDataPointsRequest"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.CreateSubscriptionRequest"; }; - return ListDataPointsRequest; + return CreateSubscriptionRequest; })(); - v4.ListDataPointsResponse = (function() { + v4.ListSubscriptionsRequest = (function() { /** - * Properties of a ListDataPointsResponse. + * Properties of a ListSubscriptionsRequest. * @memberof google.devicesandservices.health.v4 - * @interface IListDataPointsResponse - * @property {Array.|null} [dataPoints] ListDataPointsResponse dataPoints - * @property {string|null} [nextPageToken] ListDataPointsResponse nextPageToken + * @interface IListSubscriptionsRequest + * @property {string|null} [parent] ListSubscriptionsRequest parent + * @property {string|null} [filter] ListSubscriptionsRequest filter + * @property {number|null} [pageSize] ListSubscriptionsRequest pageSize + * @property {string|null} [pageToken] ListSubscriptionsRequest pageToken */ /** - * Constructs a new ListDataPointsResponse. + * Constructs a new ListSubscriptionsRequest. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a ListDataPointsResponse. - * @implements IListDataPointsResponse + * @classdesc Represents a ListSubscriptionsRequest. + * @implements IListSubscriptionsRequest * @constructor - * @param {google.devicesandservices.health.v4.IListDataPointsResponse=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IListSubscriptionsRequest=} [properties] Properties to set */ - function ListDataPointsResponse(properties) { - this.dataPoints = []; + function ListSubscriptionsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27095,94 +43708,119 @@ } /** - * ListDataPointsResponse dataPoints. - * @member {Array.} dataPoints - * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * ListSubscriptionsRequest parent. + * @member {string} parent + * @memberof google.devicesandservices.health.v4.ListSubscriptionsRequest * @instance */ - ListDataPointsResponse.prototype.dataPoints = $util.emptyArray; + ListSubscriptionsRequest.prototype.parent = ""; /** - * ListDataPointsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * ListSubscriptionsRequest filter. + * @member {string} filter + * @memberof google.devicesandservices.health.v4.ListSubscriptionsRequest * @instance */ - ListDataPointsResponse.prototype.nextPageToken = ""; + ListSubscriptionsRequest.prototype.filter = ""; /** - * Creates a new ListDataPointsResponse instance using the specified properties. + * ListSubscriptionsRequest pageSize. + * @member {number} pageSize + * @memberof google.devicesandservices.health.v4.ListSubscriptionsRequest + * @instance + */ + ListSubscriptionsRequest.prototype.pageSize = 0; + + /** + * ListSubscriptionsRequest pageToken. + * @member {string} pageToken + * @memberof google.devicesandservices.health.v4.ListSubscriptionsRequest + * @instance + */ + ListSubscriptionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSubscriptionsRequest instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @memberof google.devicesandservices.health.v4.ListSubscriptionsRequest * @static - * @param {google.devicesandservices.health.v4.IListDataPointsResponse=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.ListDataPointsResponse} ListDataPointsResponse instance + * @param {google.devicesandservices.health.v4.IListSubscriptionsRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ListSubscriptionsRequest} ListSubscriptionsRequest instance */ - ListDataPointsResponse.create = function create(properties) { - return new ListDataPointsResponse(properties); + ListSubscriptionsRequest.create = function create(properties) { + return new ListSubscriptionsRequest(properties); }; /** - * Encodes the specified ListDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsResponse.verify|verify} messages. + * Encodes the specified ListSubscriptionsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscriptionsRequest.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @memberof google.devicesandservices.health.v4.ListSubscriptionsRequest * @static - * @param {google.devicesandservices.health.v4.IListDataPointsResponse} message ListDataPointsResponse message or plain object to encode + * @param {google.devicesandservices.health.v4.IListSubscriptionsRequest} message ListSubscriptionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDataPointsResponse.encode = function encode(message, writer) { + ListSubscriptionsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataPoints != null && message.dataPoints.length) - for (var i = 0; i < message.dataPoints.length; ++i) - $root.google.devicesandservices.health.v4.DataPoint.encode(message.dataPoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); return writer; }; /** - * Encodes the specified ListDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListDataPointsResponse.verify|verify} messages. + * Encodes the specified ListSubscriptionsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscriptionsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @memberof google.devicesandservices.health.v4.ListSubscriptionsRequest * @static - * @param {google.devicesandservices.health.v4.IListDataPointsResponse} message ListDataPointsResponse message or plain object to encode + * @param {google.devicesandservices.health.v4.IListSubscriptionsRequest} message ListSubscriptionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDataPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListSubscriptionsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListDataPointsResponse message from the specified reader or buffer. + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @memberof google.devicesandservices.health.v4.ListSubscriptionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.ListDataPointsResponse} ListDataPointsResponse + * @returns {google.devicesandservices.health.v4.ListSubscriptionsRequest} ListSubscriptionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListDataPointsResponse.decode = function decode(reader, length, error) { + ListSubscriptionsRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ListDataPointsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ListSubscriptionsRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - if (!(message.dataPoints && message.dataPoints.length)) - message.dataPoints = []; - message.dataPoints.push($root.google.devicesandservices.health.v4.DataPoint.decode(reader, reader.uint32())); + message.parent = reader.string(); break; } case 2: { - message.nextPageToken = reader.string(); + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); break; } default: @@ -27194,149 +43832,149 @@ }; /** - * Decodes a ListDataPointsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @memberof google.devicesandservices.health.v4.ListSubscriptionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.ListDataPointsResponse} ListDataPointsResponse + * @returns {google.devicesandservices.health.v4.ListSubscriptionsRequest} ListSubscriptionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListDataPointsResponse.decodeDelimited = function decodeDelimited(reader) { + ListSubscriptionsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListDataPointsResponse message. + * Verifies a ListSubscriptionsRequest message. * @function verify - * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @memberof google.devicesandservices.health.v4.ListSubscriptionsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListDataPointsResponse.verify = function verify(message) { + ListSubscriptionsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { - if (!Array.isArray(message.dataPoints)) - return "dataPoints: array expected"; - for (var i = 0; i < message.dataPoints.length; ++i) { - var error = $root.google.devicesandservices.health.v4.DataPoint.verify(message.dataPoints[i]); - if (error) - return "dataPoints." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a ListDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @memberof google.devicesandservices.health.v4.ListSubscriptionsRequest * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.ListDataPointsResponse} ListDataPointsResponse + * @returns {google.devicesandservices.health.v4.ListSubscriptionsRequest} ListSubscriptionsRequest */ - ListDataPointsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.ListDataPointsResponse) + ListSubscriptionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ListSubscriptionsRequest) return object; - var message = new $root.google.devicesandservices.health.v4.ListDataPointsResponse(); - if (object.dataPoints) { - if (!Array.isArray(object.dataPoints)) - throw TypeError(".google.devicesandservices.health.v4.ListDataPointsResponse.dataPoints: array expected"); - message.dataPoints = []; - for (var i = 0; i < object.dataPoints.length; ++i) { - if (typeof object.dataPoints[i] !== "object") - throw TypeError(".google.devicesandservices.health.v4.ListDataPointsResponse.dataPoints: object expected"); - message.dataPoints[i] = $root.google.devicesandservices.health.v4.DataPoint.fromObject(object.dataPoints[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.devicesandservices.health.v4.ListSubscriptionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a ListDataPointsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListSubscriptionsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @memberof google.devicesandservices.health.v4.ListSubscriptionsRequest * @static - * @param {google.devicesandservices.health.v4.ListDataPointsResponse} message ListDataPointsResponse + * @param {google.devicesandservices.health.v4.ListSubscriptionsRequest} message ListSubscriptionsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListDataPointsResponse.toObject = function toObject(message, options) { + ListSubscriptionsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.dataPoints = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.dataPoints && message.dataPoints.length) { - object.dataPoints = []; - for (var j = 0; j < message.dataPoints.length; ++j) - object.dataPoints[j] = $root.google.devicesandservices.health.v4.DataPoint.toObject(message.dataPoints[j], options); + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this ListDataPointsResponse to JSON. + * Converts this ListSubscriptionsRequest to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @memberof google.devicesandservices.health.v4.ListSubscriptionsRequest * @instance * @returns {Object.} JSON object */ - ListDataPointsResponse.prototype.toJSON = function toJSON() { + ListSubscriptionsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListDataPointsResponse + * Gets the default type url for ListSubscriptionsRequest * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.ListDataPointsResponse + * @memberof google.devicesandservices.health.v4.ListSubscriptionsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListDataPointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSubscriptionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.ListDataPointsResponse"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.ListSubscriptionsRequest"; }; - return ListDataPointsResponse; + return ListSubscriptionsRequest; })(); - v4.CreateDataPointRequest = (function() { + v4.ListSubscriptionsResponse = (function() { /** - * Properties of a CreateDataPointRequest. + * Properties of a ListSubscriptionsResponse. * @memberof google.devicesandservices.health.v4 - * @interface ICreateDataPointRequest - * @property {string|null} [parent] CreateDataPointRequest parent - * @property {google.devicesandservices.health.v4.IDataPoint|null} [dataPoint] CreateDataPointRequest dataPoint + * @interface IListSubscriptionsResponse + * @property {Array.|null} [subscriptions] ListSubscriptionsResponse subscriptions + * @property {string|null} [nextPageToken] ListSubscriptionsResponse nextPageToken */ /** - * Constructs a new CreateDataPointRequest. + * Constructs a new ListSubscriptionsResponse. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a CreateDataPointRequest. - * @implements ICreateDataPointRequest + * @classdesc Represents a ListSubscriptionsResponse. + * @implements IListSubscriptionsResponse * @constructor - * @param {google.devicesandservices.health.v4.ICreateDataPointRequest=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IListSubscriptionsResponse=} [properties] Properties to set */ - function CreateDataPointRequest(properties) { + function ListSubscriptionsResponse(properties) { + this.subscriptions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27344,91 +43982,94 @@ } /** - * CreateDataPointRequest parent. - * @member {string} parent - * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * ListSubscriptionsResponse subscriptions. + * @member {Array.} subscriptions + * @memberof google.devicesandservices.health.v4.ListSubscriptionsResponse * @instance */ - CreateDataPointRequest.prototype.parent = ""; + ListSubscriptionsResponse.prototype.subscriptions = $util.emptyArray; /** - * CreateDataPointRequest dataPoint. - * @member {google.devicesandservices.health.v4.IDataPoint|null|undefined} dataPoint - * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * ListSubscriptionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.devicesandservices.health.v4.ListSubscriptionsResponse * @instance */ - CreateDataPointRequest.prototype.dataPoint = null; + ListSubscriptionsResponse.prototype.nextPageToken = ""; /** - * Creates a new CreateDataPointRequest instance using the specified properties. + * Creates a new ListSubscriptionsResponse instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @memberof google.devicesandservices.health.v4.ListSubscriptionsResponse * @static - * @param {google.devicesandservices.health.v4.ICreateDataPointRequest=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.CreateDataPointRequest} CreateDataPointRequest instance + * @param {google.devicesandservices.health.v4.IListSubscriptionsResponse=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ListSubscriptionsResponse} ListSubscriptionsResponse instance */ - CreateDataPointRequest.create = function create(properties) { - return new CreateDataPointRequest(properties); + ListSubscriptionsResponse.create = function create(properties) { + return new ListSubscriptionsResponse(properties); }; /** - * Encodes the specified CreateDataPointRequest message. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointRequest.verify|verify} messages. + * Encodes the specified ListSubscriptionsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscriptionsResponse.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @memberof google.devicesandservices.health.v4.ListSubscriptionsResponse * @static - * @param {google.devicesandservices.health.v4.ICreateDataPointRequest} message CreateDataPointRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IListSubscriptionsResponse} message ListSubscriptionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateDataPointRequest.encode = function encode(message, writer) { + ListSubscriptionsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.dataPoint != null && Object.hasOwnProperty.call(message, "dataPoint")) - $root.google.devicesandservices.health.v4.DataPoint.encode(message.dataPoint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.subscriptions != null && message.subscriptions.length) + for (var i = 0; i < message.subscriptions.length; ++i) + $root.google.devicesandservices.health.v4.Subscription.encode(message.subscriptions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified CreateDataPointRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointRequest.verify|verify} messages. + * Encodes the specified ListSubscriptionsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListSubscriptionsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @memberof google.devicesandservices.health.v4.ListSubscriptionsResponse * @static - * @param {google.devicesandservices.health.v4.ICreateDataPointRequest} message CreateDataPointRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IListSubscriptionsResponse} message ListSubscriptionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateDataPointRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSubscriptionsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateDataPointRequest message from the specified reader or buffer. + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @memberof google.devicesandservices.health.v4.ListSubscriptionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.CreateDataPointRequest} CreateDataPointRequest + * @returns {google.devicesandservices.health.v4.ListSubscriptionsResponse} ListSubscriptionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateDataPointRequest.decode = function decode(reader, length, error) { + ListSubscriptionsResponse.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CreateDataPointRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ListSubscriptionsResponse(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + if (!(message.subscriptions && message.subscriptions.length)) + message.subscriptions = []; + message.subscriptions.push($root.google.devicesandservices.health.v4.Subscription.decode(reader, reader.uint32())); break; } case 2: { - message.dataPoint = $root.google.devicesandservices.health.v4.DataPoint.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; } default: @@ -27440,135 +44081,149 @@ }; /** - * Decodes a CreateDataPointRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @memberof google.devicesandservices.health.v4.ListSubscriptionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.CreateDataPointRequest} CreateDataPointRequest + * @returns {google.devicesandservices.health.v4.ListSubscriptionsResponse} ListSubscriptionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateDataPointRequest.decodeDelimited = function decodeDelimited(reader) { + ListSubscriptionsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateDataPointRequest message. + * Verifies a ListSubscriptionsResponse message. * @function verify - * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @memberof google.devicesandservices.health.v4.ListSubscriptionsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateDataPointRequest.verify = function verify(message) { + ListSubscriptionsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.dataPoint != null && message.hasOwnProperty("dataPoint")) { - var error = $root.google.devicesandservices.health.v4.DataPoint.verify(message.dataPoint); - if (error) - return "dataPoint." + error; + if (message.subscriptions != null && message.hasOwnProperty("subscriptions")) { + if (!Array.isArray(message.subscriptions)) + return "subscriptions: array expected"; + for (var i = 0; i < message.subscriptions.length; ++i) { + var error = $root.google.devicesandservices.health.v4.Subscription.verify(message.subscriptions[i]); + if (error) + return "subscriptions." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a CreateDataPointRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @memberof google.devicesandservices.health.v4.ListSubscriptionsResponse * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.CreateDataPointRequest} CreateDataPointRequest + * @returns {google.devicesandservices.health.v4.ListSubscriptionsResponse} ListSubscriptionsResponse */ - CreateDataPointRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.CreateDataPointRequest) + ListSubscriptionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ListSubscriptionsResponse) return object; - var message = new $root.google.devicesandservices.health.v4.CreateDataPointRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.dataPoint != null) { - if (typeof object.dataPoint !== "object") - throw TypeError(".google.devicesandservices.health.v4.CreateDataPointRequest.dataPoint: object expected"); - message.dataPoint = $root.google.devicesandservices.health.v4.DataPoint.fromObject(object.dataPoint); + var message = new $root.google.devicesandservices.health.v4.ListSubscriptionsResponse(); + if (object.subscriptions) { + if (!Array.isArray(object.subscriptions)) + throw TypeError(".google.devicesandservices.health.v4.ListSubscriptionsResponse.subscriptions: array expected"); + message.subscriptions = []; + for (var i = 0; i < object.subscriptions.length; ++i) { + if (typeof object.subscriptions[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.ListSubscriptionsResponse.subscriptions: object expected"); + message.subscriptions[i] = $root.google.devicesandservices.health.v4.Subscription.fromObject(object.subscriptions[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a CreateDataPointRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSubscriptionsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @memberof google.devicesandservices.health.v4.ListSubscriptionsResponse * @static - * @param {google.devicesandservices.health.v4.CreateDataPointRequest} message CreateDataPointRequest + * @param {google.devicesandservices.health.v4.ListSubscriptionsResponse} message ListSubscriptionsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateDataPointRequest.toObject = function toObject(message, options) { + ListSubscriptionsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.dataPoint = null; + if (options.arrays || options.defaults) + object.subscriptions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.subscriptions && message.subscriptions.length) { + object.subscriptions = []; + for (var j = 0; j < message.subscriptions.length; ++j) + object.subscriptions[j] = $root.google.devicesandservices.health.v4.Subscription.toObject(message.subscriptions[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.dataPoint != null && message.hasOwnProperty("dataPoint")) - object.dataPoint = $root.google.devicesandservices.health.v4.DataPoint.toObject(message.dataPoint, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this CreateDataPointRequest to JSON. + * Converts this ListSubscriptionsResponse to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @memberof google.devicesandservices.health.v4.ListSubscriptionsResponse * @instance * @returns {Object.} JSON object */ - CreateDataPointRequest.prototype.toJSON = function toJSON() { + ListSubscriptionsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateDataPointRequest + * Gets the default type url for ListSubscriptionsResponse * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.CreateDataPointRequest + * @memberof google.devicesandservices.health.v4.ListSubscriptionsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateDataPointRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSubscriptionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.CreateDataPointRequest"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.ListSubscriptionsResponse"; }; - return CreateDataPointRequest; + return ListSubscriptionsResponse; })(); - v4.CreateDataPointOperationMetadata = (function() { + v4.UpdateSubscriptionRequest = (function() { /** - * Properties of a CreateDataPointOperationMetadata. + * Properties of an UpdateSubscriptionRequest. * @memberof google.devicesandservices.health.v4 - * @interface ICreateDataPointOperationMetadata + * @interface IUpdateSubscriptionRequest + * @property {google.devicesandservices.health.v4.ISubscription|null} [subscription] UpdateSubscriptionRequest subscription + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSubscriptionRequest updateMask */ /** - * Constructs a new CreateDataPointOperationMetadata. + * Constructs a new UpdateSubscriptionRequest. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a CreateDataPointOperationMetadata. - * @implements ICreateDataPointOperationMetadata + * @classdesc Represents an UpdateSubscriptionRequest. + * @implements IUpdateSubscriptionRequest * @constructor - * @param {google.devicesandservices.health.v4.ICreateDataPointOperationMetadata=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IUpdateSubscriptionRequest=} [properties] Properties to set */ - function CreateDataPointOperationMetadata(properties) { + function UpdateSubscriptionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27576,65 +44231,93 @@ } /** - * Creates a new CreateDataPointOperationMetadata instance using the specified properties. + * UpdateSubscriptionRequest subscription. + * @member {google.devicesandservices.health.v4.ISubscription|null|undefined} subscription + * @memberof google.devicesandservices.health.v4.UpdateSubscriptionRequest + * @instance + */ + UpdateSubscriptionRequest.prototype.subscription = null; + + /** + * UpdateSubscriptionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.devicesandservices.health.v4.UpdateSubscriptionRequest + * @instance + */ + UpdateSubscriptionRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSubscriptionRequest instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.UpdateSubscriptionRequest * @static - * @param {google.devicesandservices.health.v4.ICreateDataPointOperationMetadata=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.CreateDataPointOperationMetadata} CreateDataPointOperationMetadata instance + * @param {google.devicesandservices.health.v4.IUpdateSubscriptionRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.UpdateSubscriptionRequest} UpdateSubscriptionRequest instance */ - CreateDataPointOperationMetadata.create = function create(properties) { - return new CreateDataPointOperationMetadata(properties); + UpdateSubscriptionRequest.create = function create(properties) { + return new UpdateSubscriptionRequest(properties); }; /** - * Encodes the specified CreateDataPointOperationMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointOperationMetadata.verify|verify} messages. + * Encodes the specified UpdateSubscriptionRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSubscriptionRequest.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.UpdateSubscriptionRequest * @static - * @param {google.devicesandservices.health.v4.ICreateDataPointOperationMetadata} message CreateDataPointOperationMetadata message or plain object to encode + * @param {google.devicesandservices.health.v4.IUpdateSubscriptionRequest} message UpdateSubscriptionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateDataPointOperationMetadata.encode = function encode(message, writer) { + UpdateSubscriptionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + $root.google.devicesandservices.health.v4.Subscription.encode(message.subscription, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateDataPointOperationMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateDataPointOperationMetadata.verify|verify} messages. + * Encodes the specified UpdateSubscriptionRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSubscriptionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.UpdateSubscriptionRequest * @static - * @param {google.devicesandservices.health.v4.ICreateDataPointOperationMetadata} message CreateDataPointOperationMetadata message or plain object to encode + * @param {google.devicesandservices.health.v4.IUpdateSubscriptionRequest} message UpdateSubscriptionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateDataPointOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateDataPointOperationMetadata message from the specified reader or buffer. + * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.UpdateSubscriptionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.CreateDataPointOperationMetadata} CreateDataPointOperationMetadata + * @returns {google.devicesandservices.health.v4.UpdateSubscriptionRequest} UpdateSubscriptionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateDataPointOperationMetadata.decode = function decode(reader, length, error) { + UpdateSubscriptionRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CreateDataPointOperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.UpdateSubscriptionRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { + case 1: { + message.subscription = $root.google.devicesandservices.health.v4.Subscription.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -27644,109 +44327,141 @@ }; /** - * Decodes a CreateDataPointOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.UpdateSubscriptionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.CreateDataPointOperationMetadata} CreateDataPointOperationMetadata + * @returns {google.devicesandservices.health.v4.UpdateSubscriptionRequest} UpdateSubscriptionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateDataPointOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + UpdateSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateDataPointOperationMetadata message. + * Verifies an UpdateSubscriptionRequest message. * @function verify - * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.UpdateSubscriptionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateDataPointOperationMetadata.verify = function verify(message) { + UpdateSubscriptionRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) { + var error = $root.google.devicesandservices.health.v4.Subscription.verify(message.subscription); + if (error) + return "subscription." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; /** - * Creates a CreateDataPointOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.UpdateSubscriptionRequest * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.CreateDataPointOperationMetadata} CreateDataPointOperationMetadata + * @returns {google.devicesandservices.health.v4.UpdateSubscriptionRequest} UpdateSubscriptionRequest */ - CreateDataPointOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.CreateDataPointOperationMetadata) + UpdateSubscriptionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.UpdateSubscriptionRequest) return object; - return new $root.google.devicesandservices.health.v4.CreateDataPointOperationMetadata(); + var message = new $root.google.devicesandservices.health.v4.UpdateSubscriptionRequest(); + if (object.subscription != null) { + if (typeof object.subscription !== "object") + throw TypeError(".google.devicesandservices.health.v4.UpdateSubscriptionRequest.subscription: object expected"); + message.subscription = $root.google.devicesandservices.health.v4.Subscription.fromObject(object.subscription); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.devicesandservices.health.v4.UpdateSubscriptionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; }; /** - * Creates a plain object from a CreateDataPointOperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSubscriptionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.UpdateSubscriptionRequest * @static - * @param {google.devicesandservices.health.v4.CreateDataPointOperationMetadata} message CreateDataPointOperationMetadata + * @param {google.devicesandservices.health.v4.UpdateSubscriptionRequest} message UpdateSubscriptionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateDataPointOperationMetadata.toObject = function toObject() { - return {}; + UpdateSubscriptionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subscription = null; + object.updateMask = null; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = $root.google.devicesandservices.health.v4.Subscription.toObject(message.subscription, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; }; /** - * Converts this CreateDataPointOperationMetadata to JSON. + * Converts this UpdateSubscriptionRequest to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.UpdateSubscriptionRequest * @instance * @returns {Object.} JSON object */ - CreateDataPointOperationMetadata.prototype.toJSON = function toJSON() { + UpdateSubscriptionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateDataPointOperationMetadata + * Gets the default type url for UpdateSubscriptionRequest * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.CreateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.UpdateSubscriptionRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateDataPointOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.CreateDataPointOperationMetadata"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.UpdateSubscriptionRequest"; }; - return CreateDataPointOperationMetadata; + return UpdateSubscriptionRequest; })(); - v4.UpdateDataPointRequest = (function() { + v4.DeleteSubscriptionRequest = (function() { /** - * Properties of an UpdateDataPointRequest. + * Properties of a DeleteSubscriptionRequest. * @memberof google.devicesandservices.health.v4 - * @interface IUpdateDataPointRequest - * @property {google.devicesandservices.health.v4.IDataPoint|null} [dataPoint] UpdateDataPointRequest dataPoint + * @interface IDeleteSubscriptionRequest + * @property {string|null} [name] DeleteSubscriptionRequest name */ /** - * Constructs a new UpdateDataPointRequest. + * Constructs a new DeleteSubscriptionRequest. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents an UpdateDataPointRequest. - * @implements IUpdateDataPointRequest + * @classdesc Represents a DeleteSubscriptionRequest. + * @implements IDeleteSubscriptionRequest * @constructor - * @param {google.devicesandservices.health.v4.IUpdateDataPointRequest=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IDeleteSubscriptionRequest=} [properties] Properties to set */ - function UpdateDataPointRequest(properties) { + function DeleteSubscriptionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27754,77 +44469,77 @@ } /** - * UpdateDataPointRequest dataPoint. - * @member {google.devicesandservices.health.v4.IDataPoint|null|undefined} dataPoint - * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * DeleteSubscriptionRequest name. + * @member {string} name + * @memberof google.devicesandservices.health.v4.DeleteSubscriptionRequest * @instance */ - UpdateDataPointRequest.prototype.dataPoint = null; + DeleteSubscriptionRequest.prototype.name = ""; /** - * Creates a new UpdateDataPointRequest instance using the specified properties. + * Creates a new DeleteSubscriptionRequest instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriptionRequest * @static - * @param {google.devicesandservices.health.v4.IUpdateDataPointRequest=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.UpdateDataPointRequest} UpdateDataPointRequest instance + * @param {google.devicesandservices.health.v4.IDeleteSubscriptionRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DeleteSubscriptionRequest} DeleteSubscriptionRequest instance */ - UpdateDataPointRequest.create = function create(properties) { - return new UpdateDataPointRequest(properties); + DeleteSubscriptionRequest.create = function create(properties) { + return new DeleteSubscriptionRequest(properties); }; /** - * Encodes the specified UpdateDataPointRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointRequest.verify|verify} messages. + * Encodes the specified DeleteSubscriptionRequest message. Does not implicitly {@link google.devicesandservices.health.v4.DeleteSubscriptionRequest.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriptionRequest * @static - * @param {google.devicesandservices.health.v4.IUpdateDataPointRequest} message UpdateDataPointRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IDeleteSubscriptionRequest} message DeleteSubscriptionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateDataPointRequest.encode = function encode(message, writer) { + DeleteSubscriptionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataPoint != null && Object.hasOwnProperty.call(message, "dataPoint")) - $root.google.devicesandservices.health.v4.DataPoint.encode(message.dataPoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified UpdateDataPointRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointRequest.verify|verify} messages. + * Encodes the specified DeleteSubscriptionRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DeleteSubscriptionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriptionRequest * @static - * @param {google.devicesandservices.health.v4.IUpdateDataPointRequest} message UpdateDataPointRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IDeleteSubscriptionRequest} message DeleteSubscriptionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateDataPointRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateDataPointRequest message from the specified reader or buffer. + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriptionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.UpdateDataPointRequest} UpdateDataPointRequest + * @returns {google.devicesandservices.health.v4.DeleteSubscriptionRequest} DeleteSubscriptionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateDataPointRequest.decode = function decode(reader, length, error) { + DeleteSubscriptionRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.UpdateDataPointRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DeleteSubscriptionRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.dataPoint = $root.google.devicesandservices.health.v4.DataPoint.decode(reader, reader.uint32()); + message.name = reader.string(); break; } default: @@ -27836,126 +44551,129 @@ }; /** - * Decodes an UpdateDataPointRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriptionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.UpdateDataPointRequest} UpdateDataPointRequest + * @returns {google.devicesandservices.health.v4.DeleteSubscriptionRequest} DeleteSubscriptionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateDataPointRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateDataPointRequest message. + * Verifies a DeleteSubscriptionRequest message. * @function verify - * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriptionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateDataPointRequest.verify = function verify(message) { + DeleteSubscriptionRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataPoint != null && message.hasOwnProperty("dataPoint")) { - var error = $root.google.devicesandservices.health.v4.DataPoint.verify(message.dataPoint); - if (error) - return "dataPoint." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an UpdateDataPointRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSubscriptionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriptionRequest * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.UpdateDataPointRequest} UpdateDataPointRequest + * @returns {google.devicesandservices.health.v4.DeleteSubscriptionRequest} DeleteSubscriptionRequest */ - UpdateDataPointRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.UpdateDataPointRequest) + DeleteSubscriptionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DeleteSubscriptionRequest) return object; - var message = new $root.google.devicesandservices.health.v4.UpdateDataPointRequest(); - if (object.dataPoint != null) { - if (typeof object.dataPoint !== "object") - throw TypeError(".google.devicesandservices.health.v4.UpdateDataPointRequest.dataPoint: object expected"); - message.dataPoint = $root.google.devicesandservices.health.v4.DataPoint.fromObject(object.dataPoint); - } + var message = new $root.google.devicesandservices.health.v4.DeleteSubscriptionRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an UpdateDataPointRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteSubscriptionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriptionRequest * @static - * @param {google.devicesandservices.health.v4.UpdateDataPointRequest} message UpdateDataPointRequest + * @param {google.devicesandservices.health.v4.DeleteSubscriptionRequest} message DeleteSubscriptionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateDataPointRequest.toObject = function toObject(message, options) { + DeleteSubscriptionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.dataPoint = null; - if (message.dataPoint != null && message.hasOwnProperty("dataPoint")) - object.dataPoint = $root.google.devicesandservices.health.v4.DataPoint.toObject(message.dataPoint, options); + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this UpdateDataPointRequest to JSON. + * Converts this DeleteSubscriptionRequest to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriptionRequest * @instance * @returns {Object.} JSON object */ - UpdateDataPointRequest.prototype.toJSON = function toJSON() { + DeleteSubscriptionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateDataPointRequest + * Gets the default type url for DeleteSubscriptionRequest * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.UpdateDataPointRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriptionRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateDataPointRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.UpdateDataPointRequest"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.DeleteSubscriptionRequest"; }; - return UpdateDataPointRequest; + return DeleteSubscriptionRequest; })(); - v4.UpdateDataPointOperationMetadata = (function() { + v4.Subscriber = (function() { /** - * Properties of an UpdateDataPointOperationMetadata. + * Properties of a Subscriber. * @memberof google.devicesandservices.health.v4 - * @interface IUpdateDataPointOperationMetadata + * @interface ISubscriber + * @property {string|null} [name] Subscriber name + * @property {string|null} [endpointUri] Subscriber endpointUri + * @property {google.protobuf.ITimestamp|null} [createTime] Subscriber createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Subscriber updateTime + * @property {Array.|null} [subscriberConfigs] Subscriber subscriberConfigs + * @property {google.devicesandservices.health.v4.IEndpointAuthorization|null} [endpointAuthorization] Subscriber endpointAuthorization + * @property {google.devicesandservices.health.v4.Subscriber.State|null} [state] Subscriber state */ /** - * Constructs a new UpdateDataPointOperationMetadata. + * Constructs a new Subscriber. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents an UpdateDataPointOperationMetadata. - * @implements IUpdateDataPointOperationMetadata + * @classdesc Represents a Subscriber. + * @implements ISubscriber * @constructor - * @param {google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.ISubscriber=} [properties] Properties to set */ - function UpdateDataPointOperationMetadata(properties) { + function Subscriber(properties) { + this.subscriberConfigs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27963,65 +44681,166 @@ } /** - * Creates a new UpdateDataPointOperationMetadata instance using the specified properties. + * Subscriber name. + * @member {string} name + * @memberof google.devicesandservices.health.v4.Subscriber + * @instance + */ + Subscriber.prototype.name = ""; + + /** + * Subscriber endpointUri. + * @member {string} endpointUri + * @memberof google.devicesandservices.health.v4.Subscriber + * @instance + */ + Subscriber.prototype.endpointUri = ""; + + /** + * Subscriber createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.devicesandservices.health.v4.Subscriber + * @instance + */ + Subscriber.prototype.createTime = null; + + /** + * Subscriber updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.devicesandservices.health.v4.Subscriber + * @instance + */ + Subscriber.prototype.updateTime = null; + + /** + * Subscriber subscriberConfigs. + * @member {Array.} subscriberConfigs + * @memberof google.devicesandservices.health.v4.Subscriber + * @instance + */ + Subscriber.prototype.subscriberConfigs = $util.emptyArray; + + /** + * Subscriber endpointAuthorization. + * @member {google.devicesandservices.health.v4.IEndpointAuthorization|null|undefined} endpointAuthorization + * @memberof google.devicesandservices.health.v4.Subscriber + * @instance + */ + Subscriber.prototype.endpointAuthorization = null; + + /** + * Subscriber state. + * @member {google.devicesandservices.health.v4.Subscriber.State} state + * @memberof google.devicesandservices.health.v4.Subscriber + * @instance + */ + Subscriber.prototype.state = 0; + + /** + * Creates a new Subscriber instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.Subscriber * @static - * @param {google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.UpdateDataPointOperationMetadata} UpdateDataPointOperationMetadata instance + * @param {google.devicesandservices.health.v4.ISubscriber=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Subscriber} Subscriber instance */ - UpdateDataPointOperationMetadata.create = function create(properties) { - return new UpdateDataPointOperationMetadata(properties); + Subscriber.create = function create(properties) { + return new Subscriber(properties); }; /** - * Encodes the specified UpdateDataPointOperationMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointOperationMetadata.verify|verify} messages. + * Encodes the specified Subscriber message. Does not implicitly {@link google.devicesandservices.health.v4.Subscriber.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.Subscriber * @static - * @param {google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata} message UpdateDataPointOperationMetadata message or plain object to encode + * @param {google.devicesandservices.health.v4.ISubscriber} message Subscriber message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateDataPointOperationMetadata.encode = function encode(message, writer) { + Subscriber.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.endpointUri != null && Object.hasOwnProperty.call(message, "endpointUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.endpointUri); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.subscriberConfigs != null && message.subscriberConfigs.length) + for (var i = 0; i < message.subscriberConfigs.length; ++i) + $root.google.devicesandservices.health.v4.SubscriberConfig.encode(message.subscriberConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.endpointAuthorization != null && Object.hasOwnProperty.call(message, "endpointAuthorization")) + $root.google.devicesandservices.health.v4.EndpointAuthorization.encode(message.endpointAuthorization, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateDataPointOperationMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateDataPointOperationMetadata.verify|verify} messages. + * Encodes the specified Subscriber message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Subscriber.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.Subscriber * @static - * @param {google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata} message UpdateDataPointOperationMetadata message or plain object to encode + * @param {google.devicesandservices.health.v4.ISubscriber} message Subscriber message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateDataPointOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + Subscriber.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateDataPointOperationMetadata message from the specified reader or buffer. + * Decodes a Subscriber message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.Subscriber * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.UpdateDataPointOperationMetadata} UpdateDataPointOperationMetadata + * @returns {google.devicesandservices.health.v4.Subscriber} Subscriber * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateDataPointOperationMetadata.decode = function decode(reader, length, error) { + Subscriber.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.UpdateDataPointOperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Subscriber(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.endpointUri = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.subscriberConfigs && message.subscriberConfigs.length)) + message.subscriberConfigs = []; + message.subscriberConfigs.push($root.google.devicesandservices.health.v4.SubscriberConfig.decode(reader, reader.uint32())); + break; + } + case 7: { + message.endpointAuthorization = $root.google.devicesandservices.health.v4.EndpointAuthorization.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -28031,111 +44850,254 @@ }; /** - * Decodes an UpdateDataPointOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a Subscriber message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.Subscriber * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.UpdateDataPointOperationMetadata} UpdateDataPointOperationMetadata + * @returns {google.devicesandservices.health.v4.Subscriber} Subscriber * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateDataPointOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + Subscriber.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateDataPointOperationMetadata message. + * Verifies a Subscriber message. * @function verify - * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.Subscriber * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateDataPointOperationMetadata.verify = function verify(message) { + Subscriber.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.endpointUri != null && message.hasOwnProperty("endpointUri")) + if (!$util.isString(message.endpointUri)) + return "endpointUri: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.subscriberConfigs != null && message.hasOwnProperty("subscriberConfigs")) { + if (!Array.isArray(message.subscriberConfigs)) + return "subscriberConfigs: array expected"; + for (var i = 0; i < message.subscriberConfigs.length; ++i) { + var error = $root.google.devicesandservices.health.v4.SubscriberConfig.verify(message.subscriberConfigs[i]); + if (error) + return "subscriberConfigs." + error; + } + } + if (message.endpointAuthorization != null && message.hasOwnProperty("endpointAuthorization")) { + var error = $root.google.devicesandservices.health.v4.EndpointAuthorization.verify(message.endpointAuthorization); + if (error) + return "endpointAuthorization." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } return null; }; /** - * Creates an UpdateDataPointOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a Subscriber message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.Subscriber * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.UpdateDataPointOperationMetadata} UpdateDataPointOperationMetadata + * @returns {google.devicesandservices.health.v4.Subscriber} Subscriber */ - UpdateDataPointOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.UpdateDataPointOperationMetadata) + Subscriber.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Subscriber) return object; - return new $root.google.devicesandservices.health.v4.UpdateDataPointOperationMetadata(); + var message = new $root.google.devicesandservices.health.v4.Subscriber(); + if (object.name != null) + message.name = String(object.name); + if (object.endpointUri != null) + message.endpointUri = String(object.endpointUri); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.Subscriber.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.Subscriber.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.subscriberConfigs) { + if (!Array.isArray(object.subscriberConfigs)) + throw TypeError(".google.devicesandservices.health.v4.Subscriber.subscriberConfigs: array expected"); + message.subscriberConfigs = []; + for (var i = 0; i < object.subscriberConfigs.length; ++i) { + if (typeof object.subscriberConfigs[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.Subscriber.subscriberConfigs: object expected"); + message.subscriberConfigs[i] = $root.google.devicesandservices.health.v4.SubscriberConfig.fromObject(object.subscriberConfigs[i]); + } + } + if (object.endpointAuthorization != null) { + if (typeof object.endpointAuthorization !== "object") + throw TypeError(".google.devicesandservices.health.v4.Subscriber.endpointAuthorization: object expected"); + message.endpointAuthorization = $root.google.devicesandservices.health.v4.EndpointAuthorization.fromObject(object.endpointAuthorization); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "UNVERIFIED": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "INACTIVE": + case 3: + message.state = 3; + break; + } + return message; }; /** - * Creates a plain object from an UpdateDataPointOperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a Subscriber message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.Subscriber * @static - * @param {google.devicesandservices.health.v4.UpdateDataPointOperationMetadata} message UpdateDataPointOperationMetadata + * @param {google.devicesandservices.health.v4.Subscriber} message Subscriber * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateDataPointOperationMetadata.toObject = function toObject() { - return {}; + Subscriber.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subscriberConfigs = []; + if (options.defaults) { + object.name = ""; + object.endpointUri = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.endpointAuthorization = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.endpointUri != null && message.hasOwnProperty("endpointUri")) + object.endpointUri = message.endpointUri; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.subscriberConfigs && message.subscriberConfigs.length) { + object.subscriberConfigs = []; + for (var j = 0; j < message.subscriberConfigs.length; ++j) + object.subscriberConfigs[j] = $root.google.devicesandservices.health.v4.SubscriberConfig.toObject(message.subscriberConfigs[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.devicesandservices.health.v4.Subscriber.State[message.state] === undefined ? message.state : $root.google.devicesandservices.health.v4.Subscriber.State[message.state] : message.state; + if (message.endpointAuthorization != null && message.hasOwnProperty("endpointAuthorization")) + object.endpointAuthorization = $root.google.devicesandservices.health.v4.EndpointAuthorization.toObject(message.endpointAuthorization, options); + return object; }; /** - * Converts this UpdateDataPointOperationMetadata to JSON. + * Converts this Subscriber to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.Subscriber * @instance * @returns {Object.} JSON object */ - UpdateDataPointOperationMetadata.prototype.toJSON = function toJSON() { + Subscriber.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateDataPointOperationMetadata + * Gets the default type url for Subscriber * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + * @memberof google.devicesandservices.health.v4.Subscriber * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateDataPointOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Subscriber.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.UpdateDataPointOperationMetadata"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.Subscriber"; }; - return UpdateDataPointOperationMetadata; + /** + * State enum. + * @name google.devicesandservices.health.v4.Subscriber.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} UNVERIFIED=1 UNVERIFIED value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} INACTIVE=3 INACTIVE value + */ + Subscriber.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "INACTIVE"] = 3; + return values; + })(); + + return Subscriber; })(); - v4.BatchDeleteDataPointsRequest = (function() { + v4.Subscription = (function() { /** - * Properties of a BatchDeleteDataPointsRequest. + * Properties of a Subscription. * @memberof google.devicesandservices.health.v4 - * @interface IBatchDeleteDataPointsRequest - * @property {string|null} [parent] BatchDeleteDataPointsRequest parent - * @property {Array.|null} [names] BatchDeleteDataPointsRequest names + * @interface ISubscription + * @property {string|null} [name] Subscription name + * @property {Array.|null} [dataTypes] Subscription dataTypes + * @property {string|null} [user] Subscription user */ /** - * Constructs a new BatchDeleteDataPointsRequest. + * Constructs a new Subscription. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a BatchDeleteDataPointsRequest. - * @implements IBatchDeleteDataPointsRequest + * @classdesc Represents a Subscription. + * @implements ISubscription * @constructor - * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.ISubscription=} [properties] Properties to set */ - function BatchDeleteDataPointsRequest(properties) { - this.names = []; + function Subscription(properties) { + this.dataTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28143,94 +45105,108 @@ } /** - * BatchDeleteDataPointsRequest parent. - * @member {string} parent - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * Subscription name. + * @member {string} name + * @memberof google.devicesandservices.health.v4.Subscription * @instance */ - BatchDeleteDataPointsRequest.prototype.parent = ""; + Subscription.prototype.name = ""; /** - * BatchDeleteDataPointsRequest names. - * @member {Array.} names - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * Subscription dataTypes. + * @member {Array.} dataTypes + * @memberof google.devicesandservices.health.v4.Subscription * @instance */ - BatchDeleteDataPointsRequest.prototype.names = $util.emptyArray; + Subscription.prototype.dataTypes = $util.emptyArray; /** - * Creates a new BatchDeleteDataPointsRequest instance using the specified properties. + * Subscription user. + * @member {string} user + * @memberof google.devicesandservices.health.v4.Subscription + * @instance + */ + Subscription.prototype.user = ""; + + /** + * Creates a new Subscription instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @memberof google.devicesandservices.health.v4.Subscription * @static - * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsRequest} BatchDeleteDataPointsRequest instance + * @param {google.devicesandservices.health.v4.ISubscription=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Subscription} Subscription instance */ - BatchDeleteDataPointsRequest.create = function create(properties) { - return new BatchDeleteDataPointsRequest(properties); + Subscription.create = function create(properties) { + return new Subscription(properties); }; /** - * Encodes the specified BatchDeleteDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsRequest.verify|verify} messages. + * Encodes the specified Subscription message. Does not implicitly {@link google.devicesandservices.health.v4.Subscription.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @memberof google.devicesandservices.health.v4.Subscription * @static - * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest} message BatchDeleteDataPointsRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.ISubscription} message Subscription message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchDeleteDataPointsRequest.encode = function encode(message, writer) { + Subscription.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.names != null && message.names.length) - for (var i = 0; i < message.names.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.names[i]); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.dataTypes != null && message.dataTypes.length) + for (var i = 0; i < message.dataTypes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataTypes[i]); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.user); return writer; }; /** - * Encodes the specified BatchDeleteDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsRequest.verify|verify} messages. + * Encodes the specified Subscription message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Subscription.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @memberof google.devicesandservices.health.v4.Subscription * @static - * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest} message BatchDeleteDataPointsRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.ISubscription} message Subscription message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchDeleteDataPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + Subscription.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchDeleteDataPointsRequest message from the specified reader or buffer. + * Decodes a Subscription message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @memberof google.devicesandservices.health.v4.Subscription * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsRequest} BatchDeleteDataPointsRequest + * @returns {google.devicesandservices.health.v4.Subscription} Subscription * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchDeleteDataPointsRequest.decode = function decode(reader, length, error) { + Subscription.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Subscription(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - if (!(message.names && message.names.length)) - message.names = []; - message.names.push(reader.string()); + if (!(message.dataTypes && message.dataTypes.length)) + message.dataTypes = []; + message.dataTypes.push(reader.string()); + break; + } + case 3: { + message.user = reader.string(); break; } default: @@ -28242,144 +45218,154 @@ }; /** - * Decodes a BatchDeleteDataPointsRequest message from the specified reader or buffer, length delimited. + * Decodes a Subscription message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @memberof google.devicesandservices.health.v4.Subscription * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsRequest} BatchDeleteDataPointsRequest + * @returns {google.devicesandservices.health.v4.Subscription} Subscription * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchDeleteDataPointsRequest.decodeDelimited = function decodeDelimited(reader) { + Subscription.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchDeleteDataPointsRequest message. + * Verifies a Subscription message. * @function verify - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @memberof google.devicesandservices.health.v4.Subscription * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchDeleteDataPointsRequest.verify = function verify(message) { + Subscription.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.names != null && message.hasOwnProperty("names")) { - if (!Array.isArray(message.names)) - return "names: array expected"; - for (var i = 0; i < message.names.length; ++i) - if (!$util.isString(message.names[i])) - return "names: string[] expected"; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.dataTypes != null && message.hasOwnProperty("dataTypes")) { + if (!Array.isArray(message.dataTypes)) + return "dataTypes: array expected"; + for (var i = 0; i < message.dataTypes.length; ++i) + if (!$util.isString(message.dataTypes[i])) + return "dataTypes: string[] expected"; + } + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; return null; }; /** - * Creates a BatchDeleteDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Subscription message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @memberof google.devicesandservices.health.v4.Subscription * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsRequest} BatchDeleteDataPointsRequest + * @returns {google.devicesandservices.health.v4.Subscription} Subscription */ - BatchDeleteDataPointsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest) + Subscription.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Subscription) return object; - var message = new $root.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.names) { - if (!Array.isArray(object.names)) - throw TypeError(".google.devicesandservices.health.v4.BatchDeleteDataPointsRequest.names: array expected"); - message.names = []; - for (var i = 0; i < object.names.length; ++i) - message.names[i] = String(object.names[i]); - } + var message = new $root.google.devicesandservices.health.v4.Subscription(); + if (object.name != null) + message.name = String(object.name); + if (object.dataTypes) { + if (!Array.isArray(object.dataTypes)) + throw TypeError(".google.devicesandservices.health.v4.Subscription.dataTypes: array expected"); + message.dataTypes = []; + for (var i = 0; i < object.dataTypes.length; ++i) + message.dataTypes[i] = String(object.dataTypes[i]); + } + if (object.user != null) + message.user = String(object.user); return message; }; /** - * Creates a plain object from a BatchDeleteDataPointsRequest message. Also converts values to other types if specified. + * Creates a plain object from a Subscription message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @memberof google.devicesandservices.health.v4.Subscription * @static - * @param {google.devicesandservices.health.v4.BatchDeleteDataPointsRequest} message BatchDeleteDataPointsRequest + * @param {google.devicesandservices.health.v4.Subscription} message Subscription * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchDeleteDataPointsRequest.toObject = function toObject(message, options) { + Subscription.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.names = []; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.names && message.names.length) { - object.names = []; - for (var j = 0; j < message.names.length; ++j) - object.names[j] = message.names[j]; + object.dataTypes = []; + if (options.defaults) { + object.name = ""; + object.user = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dataTypes && message.dataTypes.length) { + object.dataTypes = []; + for (var j = 0; j < message.dataTypes.length; ++j) + object.dataTypes[j] = message.dataTypes[j]; } + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; return object; }; /** - * Converts this BatchDeleteDataPointsRequest to JSON. + * Converts this Subscription to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @memberof google.devicesandservices.health.v4.Subscription * @instance * @returns {Object.} JSON object */ - BatchDeleteDataPointsRequest.prototype.toJSON = function toJSON() { + Subscription.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchDeleteDataPointsRequest + * Gets the default type url for Subscription * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsRequest + * @memberof google.devicesandservices.health.v4.Subscription * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchDeleteDataPointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Subscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.BatchDeleteDataPointsRequest"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.Subscription"; }; - return BatchDeleteDataPointsRequest; + return Subscription; })(); - v4.BatchDeleteDataPointsResponse = (function() { + v4.SubscriberConfig = (function() { /** - * Properties of a BatchDeleteDataPointsResponse. + * Properties of a SubscriberConfig. * @memberof google.devicesandservices.health.v4 - * @interface IBatchDeleteDataPointsResponse - * @property {Array.|null} [dataPoints] BatchDeleteDataPointsResponse dataPoints + * @interface ISubscriberConfig + * @property {Array.|null} [dataTypes] SubscriberConfig dataTypes + * @property {google.devicesandservices.health.v4.SubscriberConfig.SubscriptionCreatePolicy|null} [subscriptionCreatePolicy] SubscriberConfig subscriptionCreatePolicy */ /** - * Constructs a new BatchDeleteDataPointsResponse. + * Constructs a new SubscriberConfig. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a BatchDeleteDataPointsResponse. - * @implements IBatchDeleteDataPointsResponse + * @classdesc Represents a SubscriberConfig. + * @implements ISubscriberConfig * @constructor - * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.ISubscriberConfig=} [properties] Properties to set */ - function BatchDeleteDataPointsResponse(properties) { - this.dataPoints = []; + function SubscriberConfig(properties) { + this.dataTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28387,80 +45373,94 @@ } /** - * BatchDeleteDataPointsResponse dataPoints. - * @member {Array.} dataPoints - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * SubscriberConfig dataTypes. + * @member {Array.} dataTypes + * @memberof google.devicesandservices.health.v4.SubscriberConfig * @instance */ - BatchDeleteDataPointsResponse.prototype.dataPoints = $util.emptyArray; + SubscriberConfig.prototype.dataTypes = $util.emptyArray; /** - * Creates a new BatchDeleteDataPointsResponse instance using the specified properties. + * SubscriberConfig subscriptionCreatePolicy. + * @member {google.devicesandservices.health.v4.SubscriberConfig.SubscriptionCreatePolicy} subscriptionCreatePolicy + * @memberof google.devicesandservices.health.v4.SubscriberConfig + * @instance + */ + SubscriberConfig.prototype.subscriptionCreatePolicy = 0; + + /** + * Creates a new SubscriberConfig instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @memberof google.devicesandservices.health.v4.SubscriberConfig * @static - * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsResponse} BatchDeleteDataPointsResponse instance + * @param {google.devicesandservices.health.v4.ISubscriberConfig=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.SubscriberConfig} SubscriberConfig instance */ - BatchDeleteDataPointsResponse.create = function create(properties) { - return new BatchDeleteDataPointsResponse(properties); + SubscriberConfig.create = function create(properties) { + return new SubscriberConfig(properties); }; /** - * Encodes the specified BatchDeleteDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsResponse.verify|verify} messages. + * Encodes the specified SubscriberConfig message. Does not implicitly {@link google.devicesandservices.health.v4.SubscriberConfig.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @memberof google.devicesandservices.health.v4.SubscriberConfig * @static - * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse} message BatchDeleteDataPointsResponse message or plain object to encode + * @param {google.devicesandservices.health.v4.ISubscriberConfig} message SubscriberConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchDeleteDataPointsResponse.encode = function encode(message, writer) { + SubscriberConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataPoints != null && message.dataPoints.length) - for (var i = 0; i < message.dataPoints.length; ++i) - $root.google.devicesandservices.health.v4.DataPoint.encode(message.dataPoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dataTypes != null && message.dataTypes.length) + for (var i = 0; i < message.dataTypes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataTypes[i]); + if (message.subscriptionCreatePolicy != null && Object.hasOwnProperty.call(message, "subscriptionCreatePolicy")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.subscriptionCreatePolicy); return writer; }; /** - * Encodes the specified BatchDeleteDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsResponse.verify|verify} messages. + * Encodes the specified SubscriberConfig message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.SubscriberConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @memberof google.devicesandservices.health.v4.SubscriberConfig * @static - * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse} message BatchDeleteDataPointsResponse message or plain object to encode + * @param {google.devicesandservices.health.v4.ISubscriberConfig} message SubscriberConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchDeleteDataPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { + SubscriberConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchDeleteDataPointsResponse message from the specified reader or buffer. + * Decodes a SubscriberConfig message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @memberof google.devicesandservices.health.v4.SubscriberConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsResponse} BatchDeleteDataPointsResponse + * @returns {google.devicesandservices.health.v4.SubscriberConfig} SubscriberConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchDeleteDataPointsResponse.decode = function decode(reader, length, error) { + SubscriberConfig.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.BatchDeleteDataPointsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.SubscriberConfig(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - if (!(message.dataPoints && message.dataPoints.length)) - message.dataPoints = []; - message.dataPoints.push($root.google.devicesandservices.health.v4.DataPoint.decode(reader, reader.uint32())); + if (!(message.dataTypes && message.dataTypes.length)) + message.dataTypes = []; + message.dataTypes.push(reader.string()); + break; + } + case 2: { + message.subscriptionCreatePolicy = reader.int32(); break; } default: @@ -28472,140 +45472,184 @@ }; /** - * Decodes a BatchDeleteDataPointsResponse message from the specified reader or buffer, length delimited. + * Decodes a SubscriberConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @memberof google.devicesandservices.health.v4.SubscriberConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsResponse} BatchDeleteDataPointsResponse + * @returns {google.devicesandservices.health.v4.SubscriberConfig} SubscriberConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchDeleteDataPointsResponse.decodeDelimited = function decodeDelimited(reader) { + SubscriberConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchDeleteDataPointsResponse message. + * Verifies a SubscriberConfig message. * @function verify - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @memberof google.devicesandservices.health.v4.SubscriberConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchDeleteDataPointsResponse.verify = function verify(message) { + SubscriberConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { - if (!Array.isArray(message.dataPoints)) - return "dataPoints: array expected"; - for (var i = 0; i < message.dataPoints.length; ++i) { - var error = $root.google.devicesandservices.health.v4.DataPoint.verify(message.dataPoints[i]); - if (error) - return "dataPoints." + error; + if (message.dataTypes != null && message.hasOwnProperty("dataTypes")) { + if (!Array.isArray(message.dataTypes)) + return "dataTypes: array expected"; + for (var i = 0; i < message.dataTypes.length; ++i) + if (!$util.isString(message.dataTypes[i])) + return "dataTypes: string[] expected"; + } + if (message.subscriptionCreatePolicy != null && message.hasOwnProperty("subscriptionCreatePolicy")) + switch (message.subscriptionCreatePolicy) { + default: + return "subscriptionCreatePolicy: enum value expected"; + case 0: + case 1: + case 2: + break; } - } return null; }; /** - * Creates a BatchDeleteDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SubscriberConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @memberof google.devicesandservices.health.v4.SubscriberConfig * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsResponse} BatchDeleteDataPointsResponse + * @returns {google.devicesandservices.health.v4.SubscriberConfig} SubscriberConfig */ - BatchDeleteDataPointsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.BatchDeleteDataPointsResponse) + SubscriberConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.SubscriberConfig) return object; - var message = new $root.google.devicesandservices.health.v4.BatchDeleteDataPointsResponse(); - if (object.dataPoints) { - if (!Array.isArray(object.dataPoints)) - throw TypeError(".google.devicesandservices.health.v4.BatchDeleteDataPointsResponse.dataPoints: array expected"); - message.dataPoints = []; - for (var i = 0; i < object.dataPoints.length; ++i) { - if (typeof object.dataPoints[i] !== "object") - throw TypeError(".google.devicesandservices.health.v4.BatchDeleteDataPointsResponse.dataPoints: object expected"); - message.dataPoints[i] = $root.google.devicesandservices.health.v4.DataPoint.fromObject(object.dataPoints[i]); + var message = new $root.google.devicesandservices.health.v4.SubscriberConfig(); + if (object.dataTypes) { + if (!Array.isArray(object.dataTypes)) + throw TypeError(".google.devicesandservices.health.v4.SubscriberConfig.dataTypes: array expected"); + message.dataTypes = []; + for (var i = 0; i < object.dataTypes.length; ++i) + message.dataTypes[i] = String(object.dataTypes[i]); + } + switch (object.subscriptionCreatePolicy) { + default: + if (typeof object.subscriptionCreatePolicy === "number") { + message.subscriptionCreatePolicy = object.subscriptionCreatePolicy; + break; } + break; + case "SUBSCRIPTION_CREATE_POLICY_UNSPECIFIED": + case 0: + message.subscriptionCreatePolicy = 0; + break; + case "AUTOMATIC": + case 1: + message.subscriptionCreatePolicy = 1; + break; + case "MANUAL": + case 2: + message.subscriptionCreatePolicy = 2; + break; } return message; }; /** - * Creates a plain object from a BatchDeleteDataPointsResponse message. Also converts values to other types if specified. + * Creates a plain object from a SubscriberConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @memberof google.devicesandservices.health.v4.SubscriberConfig * @static - * @param {google.devicesandservices.health.v4.BatchDeleteDataPointsResponse} message BatchDeleteDataPointsResponse + * @param {google.devicesandservices.health.v4.SubscriberConfig} message SubscriberConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchDeleteDataPointsResponse.toObject = function toObject(message, options) { + SubscriberConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.dataPoints = []; - if (message.dataPoints && message.dataPoints.length) { - object.dataPoints = []; - for (var j = 0; j < message.dataPoints.length; ++j) - object.dataPoints[j] = $root.google.devicesandservices.health.v4.DataPoint.toObject(message.dataPoints[j], options); - } + object.dataTypes = []; + if (options.defaults) + object.subscriptionCreatePolicy = options.enums === String ? "SUBSCRIPTION_CREATE_POLICY_UNSPECIFIED" : 0; + if (message.dataTypes && message.dataTypes.length) { + object.dataTypes = []; + for (var j = 0; j < message.dataTypes.length; ++j) + object.dataTypes[j] = message.dataTypes[j]; + } + if (message.subscriptionCreatePolicy != null && message.hasOwnProperty("subscriptionCreatePolicy")) + object.subscriptionCreatePolicy = options.enums === String ? $root.google.devicesandservices.health.v4.SubscriberConfig.SubscriptionCreatePolicy[message.subscriptionCreatePolicy] === undefined ? message.subscriptionCreatePolicy : $root.google.devicesandservices.health.v4.SubscriberConfig.SubscriptionCreatePolicy[message.subscriptionCreatePolicy] : message.subscriptionCreatePolicy; return object; }; /** - * Converts this BatchDeleteDataPointsResponse to JSON. + * Converts this SubscriberConfig to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @memberof google.devicesandservices.health.v4.SubscriberConfig * @instance * @returns {Object.} JSON object */ - BatchDeleteDataPointsResponse.prototype.toJSON = function toJSON() { + SubscriberConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchDeleteDataPointsResponse + * Gets the default type url for SubscriberConfig * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsResponse + * @memberof google.devicesandservices.health.v4.SubscriberConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchDeleteDataPointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SubscriberConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.BatchDeleteDataPointsResponse"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.SubscriberConfig"; }; - return BatchDeleteDataPointsResponse; + /** + * SubscriptionCreatePolicy enum. + * @name google.devicesandservices.health.v4.SubscriberConfig.SubscriptionCreatePolicy + * @enum {number} + * @property {number} SUBSCRIPTION_CREATE_POLICY_UNSPECIFIED=0 SUBSCRIPTION_CREATE_POLICY_UNSPECIFIED value + * @property {number} AUTOMATIC=1 AUTOMATIC value + * @property {number} MANUAL=2 MANUAL value + */ + SubscriberConfig.SubscriptionCreatePolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SUBSCRIPTION_CREATE_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTOMATIC"] = 1; + values[valuesById[2] = "MANUAL"] = 2; + return values; + })(); + + return SubscriberConfig; })(); - v4.BatchDeleteDataPointsOperationMetadata = (function() { + v4.EndpointAuthorization = (function() { /** - * Properties of a BatchDeleteDataPointsOperationMetadata. + * Properties of an EndpointAuthorization. * @memberof google.devicesandservices.health.v4 - * @interface IBatchDeleteDataPointsOperationMetadata - * @property {Object.|null} [failedRequests] BatchDeleteDataPointsOperationMetadata failedRequests + * @interface IEndpointAuthorization + * @property {string|null} [secret] EndpointAuthorization secret + * @property {boolean|null} [secretSet] EndpointAuthorization secretSet */ /** - * Constructs a new BatchDeleteDataPointsOperationMetadata. + * Constructs a new EndpointAuthorization. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a BatchDeleteDataPointsOperationMetadata. - * @implements IBatchDeleteDataPointsOperationMetadata + * @classdesc Represents an EndpointAuthorization. + * @implements IEndpointAuthorization * @constructor - * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IEndpointAuthorization=} [properties] Properties to set */ - function BatchDeleteDataPointsOperationMetadata(properties) { - this.failedRequests = {}; + function EndpointAuthorization(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28613,99 +45657,91 @@ } /** - * BatchDeleteDataPointsOperationMetadata failedRequests. - * @member {Object.} failedRequests - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * EndpointAuthorization secret. + * @member {string} secret + * @memberof google.devicesandservices.health.v4.EndpointAuthorization * @instance */ - BatchDeleteDataPointsOperationMetadata.prototype.failedRequests = $util.emptyObject; + EndpointAuthorization.prototype.secret = ""; /** - * Creates a new BatchDeleteDataPointsOperationMetadata instance using the specified properties. + * EndpointAuthorization secretSet. + * @member {boolean} secretSet + * @memberof google.devicesandservices.health.v4.EndpointAuthorization + * @instance + */ + EndpointAuthorization.prototype.secretSet = false; + + /** + * Creates a new EndpointAuthorization instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @memberof google.devicesandservices.health.v4.EndpointAuthorization * @static - * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata} BatchDeleteDataPointsOperationMetadata instance + * @param {google.devicesandservices.health.v4.IEndpointAuthorization=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.EndpointAuthorization} EndpointAuthorization instance */ - BatchDeleteDataPointsOperationMetadata.create = function create(properties) { - return new BatchDeleteDataPointsOperationMetadata(properties); + EndpointAuthorization.create = function create(properties) { + return new EndpointAuthorization(properties); }; /** - * Encodes the specified BatchDeleteDataPointsOperationMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata.verify|verify} messages. + * Encodes the specified EndpointAuthorization message. Does not implicitly {@link google.devicesandservices.health.v4.EndpointAuthorization.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @memberof google.devicesandservices.health.v4.EndpointAuthorization * @static - * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata} message BatchDeleteDataPointsOperationMetadata message or plain object to encode + * @param {google.devicesandservices.health.v4.IEndpointAuthorization} message EndpointAuthorization message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchDeleteDataPointsOperationMetadata.encode = function encode(message, writer) { + EndpointAuthorization.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.failedRequests != null && Object.hasOwnProperty.call(message, "failedRequests")) - for (var keys = Object.keys(message.failedRequests), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); - $root.google.rpc.Status.encode(message.failedRequests[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.secret); + if (message.secretSet != null && Object.hasOwnProperty.call(message, "secretSet")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.secretSet); return writer; }; /** - * Encodes the specified BatchDeleteDataPointsOperationMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata.verify|verify} messages. + * Encodes the specified EndpointAuthorization message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.EndpointAuthorization.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @memberof google.devicesandservices.health.v4.EndpointAuthorization * @static - * @param {google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata} message BatchDeleteDataPointsOperationMetadata message or plain object to encode + * @param {google.devicesandservices.health.v4.IEndpointAuthorization} message EndpointAuthorization message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchDeleteDataPointsOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + EndpointAuthorization.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchDeleteDataPointsOperationMetadata message from the specified reader or buffer. + * Decodes an EndpointAuthorization message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @memberof google.devicesandservices.health.v4.EndpointAuthorization * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata} BatchDeleteDataPointsOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteDataPointsOperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.failedRequests === $util.emptyObject) - message.failedRequests = {}; - var end2 = reader.uint32() + reader.pos; - key = 0; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.int32(); - break; - case 2: - value = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.failedRequests[key] = value; + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.EndpointAuthorization} EndpointAuthorization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointAuthorization.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.EndpointAuthorization(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.secret = reader.string(); + break; + } + case 2: { + message.secretSet = reader.bool(); break; } default: @@ -28717,149 +45753,134 @@ }; /** - * Decodes a BatchDeleteDataPointsOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes an EndpointAuthorization message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @memberof google.devicesandservices.health.v4.EndpointAuthorization * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata} BatchDeleteDataPointsOperationMetadata + * @returns {google.devicesandservices.health.v4.EndpointAuthorization} EndpointAuthorization * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchDeleteDataPointsOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + EndpointAuthorization.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchDeleteDataPointsOperationMetadata message. + * Verifies an EndpointAuthorization message. * @function verify - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @memberof google.devicesandservices.health.v4.EndpointAuthorization * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchDeleteDataPointsOperationMetadata.verify = function verify(message) { + EndpointAuthorization.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.failedRequests != null && message.hasOwnProperty("failedRequests")) { - if (!$util.isObject(message.failedRequests)) - return "failedRequests: object expected"; - var key = Object.keys(message.failedRequests); - for (var i = 0; i < key.length; ++i) { - if (!$util.key32Re.test(key[i])) - return "failedRequests: integer key{k:int32} expected"; - { - var error = $root.google.rpc.Status.verify(message.failedRequests[key[i]]); - if (error) - return "failedRequests." + error; - } - } - } + if (message.secret != null && message.hasOwnProperty("secret")) + if (!$util.isString(message.secret)) + return "secret: string expected"; + if (message.secretSet != null && message.hasOwnProperty("secretSet")) + if (typeof message.secretSet !== "boolean") + return "secretSet: boolean expected"; return null; }; /** - * Creates a BatchDeleteDataPointsOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an EndpointAuthorization message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @memberof google.devicesandservices.health.v4.EndpointAuthorization * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata} BatchDeleteDataPointsOperationMetadata + * @returns {google.devicesandservices.health.v4.EndpointAuthorization} EndpointAuthorization */ - BatchDeleteDataPointsOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata) + EndpointAuthorization.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.EndpointAuthorization) return object; - var message = new $root.google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata(); - if (object.failedRequests) { - if (typeof object.failedRequests !== "object") - throw TypeError(".google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata.failedRequests: object expected"); - message.failedRequests = {}; - for (var keys = Object.keys(object.failedRequests), i = 0; i < keys.length; ++i) { - if (typeof object.failedRequests[keys[i]] !== "object") - throw TypeError(".google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata.failedRequests: object expected"); - message.failedRequests[keys[i]] = $root.google.rpc.Status.fromObject(object.failedRequests[keys[i]]); - } - } + var message = new $root.google.devicesandservices.health.v4.EndpointAuthorization(); + if (object.secret != null) + message.secret = String(object.secret); + if (object.secretSet != null) + message.secretSet = Boolean(object.secretSet); return message; }; /** - * Creates a plain object from a BatchDeleteDataPointsOperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from an EndpointAuthorization message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @memberof google.devicesandservices.health.v4.EndpointAuthorization * @static - * @param {google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata} message BatchDeleteDataPointsOperationMetadata + * @param {google.devicesandservices.health.v4.EndpointAuthorization} message EndpointAuthorization * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchDeleteDataPointsOperationMetadata.toObject = function toObject(message, options) { + EndpointAuthorization.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.failedRequests = {}; - var keys2; - if (message.failedRequests && (keys2 = Object.keys(message.failedRequests)).length) { - object.failedRequests = {}; - for (var j = 0; j < keys2.length; ++j) - object.failedRequests[keys2[j]] = $root.google.rpc.Status.toObject(message.failedRequests[keys2[j]], options); + if (options.defaults) { + object.secret = ""; + object.secretSet = false; } + if (message.secret != null && message.hasOwnProperty("secret")) + object.secret = message.secret; + if (message.secretSet != null && message.hasOwnProperty("secretSet")) + object.secretSet = message.secretSet; return object; }; /** - * Converts this BatchDeleteDataPointsOperationMetadata to JSON. + * Converts this EndpointAuthorization to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @memberof google.devicesandservices.health.v4.EndpointAuthorization * @instance * @returns {Object.} JSON object */ - BatchDeleteDataPointsOperationMetadata.prototype.toJSON = function toJSON() { + EndpointAuthorization.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchDeleteDataPointsOperationMetadata + * Gets the default type url for EndpointAuthorization * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + * @memberof google.devicesandservices.health.v4.EndpointAuthorization * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchDeleteDataPointsOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EndpointAuthorization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.EndpointAuthorization"; }; - return BatchDeleteDataPointsOperationMetadata; + return EndpointAuthorization; })(); - v4.ReconcileDataPointsRequest = (function() { + v4.CreateSubscriberPayload = (function() { /** - * Properties of a ReconcileDataPointsRequest. + * Properties of a CreateSubscriberPayload. * @memberof google.devicesandservices.health.v4 - * @interface IReconcileDataPointsRequest - * @property {string|null} [parent] ReconcileDataPointsRequest parent - * @property {number|null} [pageSize] ReconcileDataPointsRequest pageSize - * @property {string|null} [pageToken] ReconcileDataPointsRequest pageToken - * @property {string|null} [filter] ReconcileDataPointsRequest filter - * @property {string|null} [dataSourceFamily] ReconcileDataPointsRequest dataSourceFamily + * @interface ICreateSubscriberPayload + * @property {string|null} [endpointUri] CreateSubscriberPayload endpointUri + * @property {Array.|null} [subscriberConfigs] CreateSubscriberPayload subscriberConfigs + * @property {google.devicesandservices.health.v4.IEndpointAuthorization|null} [endpointAuthorization] CreateSubscriberPayload endpointAuthorization */ /** - * Constructs a new ReconcileDataPointsRequest. + * Constructs a new CreateSubscriberPayload. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a ReconcileDataPointsRequest. - * @implements IReconcileDataPointsRequest + * @classdesc Represents a CreateSubscriberPayload. + * @implements ICreateSubscriberPayload * @constructor - * @param {google.devicesandservices.health.v4.IReconcileDataPointsRequest=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.ICreateSubscriberPayload=} [properties] Properties to set */ - function ReconcileDataPointsRequest(properties) { + function CreateSubscriberPayload(properties) { + this.subscriberConfigs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28867,133 +45888,108 @@ } /** - * ReconcileDataPointsRequest parent. - * @member {string} parent - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest - * @instance - */ - ReconcileDataPointsRequest.prototype.parent = ""; - - /** - * ReconcileDataPointsRequest pageSize. - * @member {number} pageSize - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest - * @instance - */ - ReconcileDataPointsRequest.prototype.pageSize = 0; - - /** - * ReconcileDataPointsRequest pageToken. - * @member {string} pageToken - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * CreateSubscriberPayload endpointUri. + * @member {string} endpointUri + * @memberof google.devicesandservices.health.v4.CreateSubscriberPayload * @instance */ - ReconcileDataPointsRequest.prototype.pageToken = ""; + CreateSubscriberPayload.prototype.endpointUri = ""; /** - * ReconcileDataPointsRequest filter. - * @member {string} filter - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * CreateSubscriberPayload subscriberConfigs. + * @member {Array.} subscriberConfigs + * @memberof google.devicesandservices.health.v4.CreateSubscriberPayload * @instance */ - ReconcileDataPointsRequest.prototype.filter = ""; + CreateSubscriberPayload.prototype.subscriberConfigs = $util.emptyArray; /** - * ReconcileDataPointsRequest dataSourceFamily. - * @member {string} dataSourceFamily - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * CreateSubscriberPayload endpointAuthorization. + * @member {google.devicesandservices.health.v4.IEndpointAuthorization|null|undefined} endpointAuthorization + * @memberof google.devicesandservices.health.v4.CreateSubscriberPayload * @instance */ - ReconcileDataPointsRequest.prototype.dataSourceFamily = ""; + CreateSubscriberPayload.prototype.endpointAuthorization = null; /** - * Creates a new ReconcileDataPointsRequest instance using the specified properties. + * Creates a new CreateSubscriberPayload instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberPayload * @static - * @param {google.devicesandservices.health.v4.IReconcileDataPointsRequest=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.ReconcileDataPointsRequest} ReconcileDataPointsRequest instance + * @param {google.devicesandservices.health.v4.ICreateSubscriberPayload=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.CreateSubscriberPayload} CreateSubscriberPayload instance */ - ReconcileDataPointsRequest.create = function create(properties) { - return new ReconcileDataPointsRequest(properties); + CreateSubscriberPayload.create = function create(properties) { + return new CreateSubscriberPayload(properties); }; /** - * Encodes the specified ReconcileDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsRequest.verify|verify} messages. + * Encodes the specified CreateSubscriberPayload message. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriberPayload.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberPayload * @static - * @param {google.devicesandservices.health.v4.IReconcileDataPointsRequest} message ReconcileDataPointsRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.ICreateSubscriberPayload} message CreateSubscriberPayload message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReconcileDataPointsRequest.encode = function encode(message, writer) { + CreateSubscriberPayload.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.dataSourceFamily != null && Object.hasOwnProperty.call(message, "dataSourceFamily")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.dataSourceFamily); + if (message.endpointUri != null && Object.hasOwnProperty.call(message, "endpointUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.endpointUri); + if (message.subscriberConfigs != null && message.subscriberConfigs.length) + for (var i = 0; i < message.subscriberConfigs.length; ++i) + $root.google.devicesandservices.health.v4.SubscriberConfig.encode(message.subscriberConfigs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endpointAuthorization != null && Object.hasOwnProperty.call(message, "endpointAuthorization")) + $root.google.devicesandservices.health.v4.EndpointAuthorization.encode(message.endpointAuthorization, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ReconcileDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsRequest.verify|verify} messages. + * Encodes the specified CreateSubscriberPayload message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriberPayload.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberPayload * @static - * @param {google.devicesandservices.health.v4.IReconcileDataPointsRequest} message ReconcileDataPointsRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.ICreateSubscriberPayload} message CreateSubscriberPayload message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReconcileDataPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateSubscriberPayload.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReconcileDataPointsRequest message from the specified reader or buffer. + * Decodes a CreateSubscriberPayload message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberPayload * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.ReconcileDataPointsRequest} ReconcileDataPointsRequest + * @returns {google.devicesandservices.health.v4.CreateSubscriberPayload} CreateSubscriberPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReconcileDataPointsRequest.decode = function decode(reader, length, error) { + CreateSubscriberPayload.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ReconcileDataPointsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CreateSubscriberPayload(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.endpointUri = reader.string(); break; } case 2: { - message.pageSize = reader.int32(); + if (!(message.subscriberConfigs && message.subscriberConfigs.length)) + message.subscriberConfigs = []; + message.subscriberConfigs.push($root.google.devicesandservices.health.v4.SubscriberConfig.decode(reader, reader.uint32())); break; } case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.dataSourceFamily = reader.string(); + message.endpointAuthorization = $root.google.devicesandservices.health.v4.EndpointAuthorization.decode(reader, reader.uint32()); break; } default: @@ -29005,157 +46001,164 @@ }; /** - * Decodes a ReconcileDataPointsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSubscriberPayload message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberPayload * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.ReconcileDataPointsRequest} ReconcileDataPointsRequest + * @returns {google.devicesandservices.health.v4.CreateSubscriberPayload} CreateSubscriberPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReconcileDataPointsRequest.decodeDelimited = function decodeDelimited(reader) { + CreateSubscriberPayload.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReconcileDataPointsRequest message. + * Verifies a CreateSubscriberPayload message. * @function verify - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberPayload * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReconcileDataPointsRequest.verify = function verify(message) { + CreateSubscriberPayload.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.dataSourceFamily != null && message.hasOwnProperty("dataSourceFamily")) - if (!$util.isString(message.dataSourceFamily)) - return "dataSourceFamily: string expected"; + if (message.endpointUri != null && message.hasOwnProperty("endpointUri")) + if (!$util.isString(message.endpointUri)) + return "endpointUri: string expected"; + if (message.subscriberConfigs != null && message.hasOwnProperty("subscriberConfigs")) { + if (!Array.isArray(message.subscriberConfigs)) + return "subscriberConfigs: array expected"; + for (var i = 0; i < message.subscriberConfigs.length; ++i) { + var error = $root.google.devicesandservices.health.v4.SubscriberConfig.verify(message.subscriberConfigs[i]); + if (error) + return "subscriberConfigs." + error; + } + } + if (message.endpointAuthorization != null && message.hasOwnProperty("endpointAuthorization")) { + var error = $root.google.devicesandservices.health.v4.EndpointAuthorization.verify(message.endpointAuthorization); + if (error) + return "endpointAuthorization." + error; + } return null; }; /** - * Creates a ReconcileDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSubscriberPayload message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberPayload * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.ReconcileDataPointsRequest} ReconcileDataPointsRequest + * @returns {google.devicesandservices.health.v4.CreateSubscriberPayload} CreateSubscriberPayload */ - ReconcileDataPointsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.ReconcileDataPointsRequest) + CreateSubscriberPayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.CreateSubscriberPayload) return object; - var message = new $root.google.devicesandservices.health.v4.ReconcileDataPointsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.dataSourceFamily != null) - message.dataSourceFamily = String(object.dataSourceFamily); + var message = new $root.google.devicesandservices.health.v4.CreateSubscriberPayload(); + if (object.endpointUri != null) + message.endpointUri = String(object.endpointUri); + if (object.subscriberConfigs) { + if (!Array.isArray(object.subscriberConfigs)) + throw TypeError(".google.devicesandservices.health.v4.CreateSubscriberPayload.subscriberConfigs: array expected"); + message.subscriberConfigs = []; + for (var i = 0; i < object.subscriberConfigs.length; ++i) { + if (typeof object.subscriberConfigs[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.CreateSubscriberPayload.subscriberConfigs: object expected"); + message.subscriberConfigs[i] = $root.google.devicesandservices.health.v4.SubscriberConfig.fromObject(object.subscriberConfigs[i]); + } + } + if (object.endpointAuthorization != null) { + if (typeof object.endpointAuthorization !== "object") + throw TypeError(".google.devicesandservices.health.v4.CreateSubscriberPayload.endpointAuthorization: object expected"); + message.endpointAuthorization = $root.google.devicesandservices.health.v4.EndpointAuthorization.fromObject(object.endpointAuthorization); + } return message; }; /** - * Creates a plain object from a ReconcileDataPointsRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateSubscriberPayload message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberPayload * @static - * @param {google.devicesandservices.health.v4.ReconcileDataPointsRequest} message ReconcileDataPointsRequest + * @param {google.devicesandservices.health.v4.CreateSubscriberPayload} message CreateSubscriberPayload * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReconcileDataPointsRequest.toObject = function toObject(message, options) { + CreateSubscriberPayload.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.subscriberConfigs = []; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.dataSourceFamily = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.dataSourceFamily != null && message.hasOwnProperty("dataSourceFamily")) - object.dataSourceFamily = message.dataSourceFamily; + object.endpointUri = ""; + object.endpointAuthorization = null; + } + if (message.endpointUri != null && message.hasOwnProperty("endpointUri")) + object.endpointUri = message.endpointUri; + if (message.subscriberConfigs && message.subscriberConfigs.length) { + object.subscriberConfigs = []; + for (var j = 0; j < message.subscriberConfigs.length; ++j) + object.subscriberConfigs[j] = $root.google.devicesandservices.health.v4.SubscriberConfig.toObject(message.subscriberConfigs[j], options); + } + if (message.endpointAuthorization != null && message.hasOwnProperty("endpointAuthorization")) + object.endpointAuthorization = $root.google.devicesandservices.health.v4.EndpointAuthorization.toObject(message.endpointAuthorization, options); return object; }; /** - * Converts this ReconcileDataPointsRequest to JSON. + * Converts this CreateSubscriberPayload to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberPayload * @instance * @returns {Object.} JSON object */ - ReconcileDataPointsRequest.prototype.toJSON = function toJSON() { + CreateSubscriberPayload.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReconcileDataPointsRequest + * Gets the default type url for CreateSubscriberPayload * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberPayload * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReconcileDataPointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSubscriberPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.ReconcileDataPointsRequest"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.CreateSubscriberPayload"; }; - return ReconcileDataPointsRequest; + return CreateSubscriberPayload; })(); - v4.ReconcileDataPointsResponse = (function() { + v4.CreateSubscriptionPayload = (function() { /** - * Properties of a ReconcileDataPointsResponse. + * Properties of a CreateSubscriptionPayload. * @memberof google.devicesandservices.health.v4 - * @interface IReconcileDataPointsResponse - * @property {Array.|null} [dataPoints] ReconcileDataPointsResponse dataPoints - * @property {string|null} [nextPageToken] ReconcileDataPointsResponse nextPageToken + * @interface ICreateSubscriptionPayload + * @property {Array.|null} [dataTypes] CreateSubscriptionPayload dataTypes + * @property {string|null} [user] CreateSubscriptionPayload user */ /** - * Constructs a new ReconcileDataPointsResponse. + * Constructs a new CreateSubscriptionPayload. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a ReconcileDataPointsResponse. - * @implements IReconcileDataPointsResponse + * @classdesc Represents a CreateSubscriptionPayload. + * @implements ICreateSubscriptionPayload * @constructor - * @param {google.devicesandservices.health.v4.IReconcileDataPointsResponse=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.ICreateSubscriptionPayload=} [properties] Properties to set */ - function ReconcileDataPointsResponse(properties) { - this.dataPoints = []; + function CreateSubscriptionPayload(properties) { + this.dataTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29163,94 +46166,94 @@ } /** - * ReconcileDataPointsResponse dataPoints. - * @member {Array.} dataPoints - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * CreateSubscriptionPayload dataTypes. + * @member {Array.} dataTypes + * @memberof google.devicesandservices.health.v4.CreateSubscriptionPayload * @instance */ - ReconcileDataPointsResponse.prototype.dataPoints = $util.emptyArray; + CreateSubscriptionPayload.prototype.dataTypes = $util.emptyArray; /** - * ReconcileDataPointsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * CreateSubscriptionPayload user. + * @member {string} user + * @memberof google.devicesandservices.health.v4.CreateSubscriptionPayload * @instance */ - ReconcileDataPointsResponse.prototype.nextPageToken = ""; + CreateSubscriptionPayload.prototype.user = ""; /** - * Creates a new ReconcileDataPointsResponse instance using the specified properties. + * Creates a new CreateSubscriptionPayload instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @memberof google.devicesandservices.health.v4.CreateSubscriptionPayload * @static - * @param {google.devicesandservices.health.v4.IReconcileDataPointsResponse=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.ReconcileDataPointsResponse} ReconcileDataPointsResponse instance + * @param {google.devicesandservices.health.v4.ICreateSubscriptionPayload=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.CreateSubscriptionPayload} CreateSubscriptionPayload instance */ - ReconcileDataPointsResponse.create = function create(properties) { - return new ReconcileDataPointsResponse(properties); + CreateSubscriptionPayload.create = function create(properties) { + return new CreateSubscriptionPayload(properties); }; /** - * Encodes the specified ReconcileDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsResponse.verify|verify} messages. + * Encodes the specified CreateSubscriptionPayload message. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriptionPayload.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @memberof google.devicesandservices.health.v4.CreateSubscriptionPayload * @static - * @param {google.devicesandservices.health.v4.IReconcileDataPointsResponse} message ReconcileDataPointsResponse message or plain object to encode + * @param {google.devicesandservices.health.v4.ICreateSubscriptionPayload} message CreateSubscriptionPayload message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReconcileDataPointsResponse.encode = function encode(message, writer) { + CreateSubscriptionPayload.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataPoints != null && message.dataPoints.length) - for (var i = 0; i < message.dataPoints.length; ++i) - $root.google.devicesandservices.health.v4.ReconciledDataPoint.encode(message.dataPoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.dataTypes != null && message.dataTypes.length) + for (var i = 0; i < message.dataTypes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataTypes[i]); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.user); return writer; }; /** - * Encodes the specified ReconcileDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ReconcileDataPointsResponse.verify|verify} messages. + * Encodes the specified CreateSubscriptionPayload message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriptionPayload.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @memberof google.devicesandservices.health.v4.CreateSubscriptionPayload * @static - * @param {google.devicesandservices.health.v4.IReconcileDataPointsResponse} message ReconcileDataPointsResponse message or plain object to encode + * @param {google.devicesandservices.health.v4.ICreateSubscriptionPayload} message CreateSubscriptionPayload message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReconcileDataPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateSubscriptionPayload.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReconcileDataPointsResponse message from the specified reader or buffer. + * Decodes a CreateSubscriptionPayload message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @memberof google.devicesandservices.health.v4.CreateSubscriptionPayload * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.ReconcileDataPointsResponse} ReconcileDataPointsResponse + * @returns {google.devicesandservices.health.v4.CreateSubscriptionPayload} CreateSubscriptionPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReconcileDataPointsResponse.decode = function decode(reader, length, error) { + CreateSubscriptionPayload.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ReconcileDataPointsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CreateSubscriptionPayload(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - if (!(message.dataPoints && message.dataPoints.length)) - message.dataPoints = []; - message.dataPoints.push($root.google.devicesandservices.health.v4.ReconciledDataPoint.decode(reader, reader.uint32())); + if (!(message.dataTypes && message.dataTypes.length)) + message.dataTypes = []; + message.dataTypes.push(reader.string()); break; } case 2: { - message.nextPageToken = reader.string(); + message.user = reader.string(); break; } default: @@ -29262,153 +46265,142 @@ }; /** - * Decodes a ReconcileDataPointsResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateSubscriptionPayload message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @memberof google.devicesandservices.health.v4.CreateSubscriptionPayload * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.ReconcileDataPointsResponse} ReconcileDataPointsResponse + * @returns {google.devicesandservices.health.v4.CreateSubscriptionPayload} CreateSubscriptionPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReconcileDataPointsResponse.decodeDelimited = function decodeDelimited(reader) { + CreateSubscriptionPayload.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReconcileDataPointsResponse message. + * Verifies a CreateSubscriptionPayload message. * @function verify - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @memberof google.devicesandservices.health.v4.CreateSubscriptionPayload * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReconcileDataPointsResponse.verify = function verify(message) { + CreateSubscriptionPayload.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { - if (!Array.isArray(message.dataPoints)) - return "dataPoints: array expected"; - for (var i = 0; i < message.dataPoints.length; ++i) { - var error = $root.google.devicesandservices.health.v4.ReconciledDataPoint.verify(message.dataPoints[i]); - if (error) - return "dataPoints." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.dataTypes != null && message.hasOwnProperty("dataTypes")) { + if (!Array.isArray(message.dataTypes)) + return "dataTypes: array expected"; + for (var i = 0; i < message.dataTypes.length; ++i) + if (!$util.isString(message.dataTypes[i])) + return "dataTypes: string[] expected"; + } + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; return null; }; /** - * Creates a ReconcileDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSubscriptionPayload message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @memberof google.devicesandservices.health.v4.CreateSubscriptionPayload * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.ReconcileDataPointsResponse} ReconcileDataPointsResponse + * @returns {google.devicesandservices.health.v4.CreateSubscriptionPayload} CreateSubscriptionPayload */ - ReconcileDataPointsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.ReconcileDataPointsResponse) + CreateSubscriptionPayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.CreateSubscriptionPayload) return object; - var message = new $root.google.devicesandservices.health.v4.ReconcileDataPointsResponse(); - if (object.dataPoints) { - if (!Array.isArray(object.dataPoints)) - throw TypeError(".google.devicesandservices.health.v4.ReconcileDataPointsResponse.dataPoints: array expected"); - message.dataPoints = []; - for (var i = 0; i < object.dataPoints.length; ++i) { - if (typeof object.dataPoints[i] !== "object") - throw TypeError(".google.devicesandservices.health.v4.ReconcileDataPointsResponse.dataPoints: object expected"); - message.dataPoints[i] = $root.google.devicesandservices.health.v4.ReconciledDataPoint.fromObject(object.dataPoints[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.devicesandservices.health.v4.CreateSubscriptionPayload(); + if (object.dataTypes) { + if (!Array.isArray(object.dataTypes)) + throw TypeError(".google.devicesandservices.health.v4.CreateSubscriptionPayload.dataTypes: array expected"); + message.dataTypes = []; + for (var i = 0; i < object.dataTypes.length; ++i) + message.dataTypes[i] = String(object.dataTypes[i]); + } + if (object.user != null) + message.user = String(object.user); return message; }; /** - * Creates a plain object from a ReconcileDataPointsResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateSubscriptionPayload message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @memberof google.devicesandservices.health.v4.CreateSubscriptionPayload * @static - * @param {google.devicesandservices.health.v4.ReconcileDataPointsResponse} message ReconcileDataPointsResponse + * @param {google.devicesandservices.health.v4.CreateSubscriptionPayload} message CreateSubscriptionPayload * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReconcileDataPointsResponse.toObject = function toObject(message, options) { + CreateSubscriptionPayload.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.dataPoints = []; + object.dataTypes = []; if (options.defaults) - object.nextPageToken = ""; - if (message.dataPoints && message.dataPoints.length) { - object.dataPoints = []; - for (var j = 0; j < message.dataPoints.length; ++j) - object.dataPoints[j] = $root.google.devicesandservices.health.v4.ReconciledDataPoint.toObject(message.dataPoints[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + object.user = ""; + if (message.dataTypes && message.dataTypes.length) { + object.dataTypes = []; + for (var j = 0; j < message.dataTypes.length; ++j) + object.dataTypes[j] = message.dataTypes[j]; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; return object; }; /** - * Converts this ReconcileDataPointsResponse to JSON. + * Converts this CreateSubscriptionPayload to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @memberof google.devicesandservices.health.v4.CreateSubscriptionPayload * @instance * @returns {Object.} JSON object */ - ReconcileDataPointsResponse.prototype.toJSON = function toJSON() { + CreateSubscriptionPayload.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReconcileDataPointsResponse + * Gets the default type url for CreateSubscriptionPayload * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.ReconcileDataPointsResponse + * @memberof google.devicesandservices.health.v4.CreateSubscriptionPayload * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReconcileDataPointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSubscriptionPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.ReconcileDataPointsResponse"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.CreateSubscriptionPayload"; }; - return ReconcileDataPointsResponse; + return CreateSubscriptionPayload; })(); - v4.RollUpDataPointsRequest = (function() { + v4.CreateSubscriberMetadata = (function() { /** - * Properties of a RollUpDataPointsRequest. + * Properties of a CreateSubscriberMetadata. * @memberof google.devicesandservices.health.v4 - * @interface IRollUpDataPointsRequest - * @property {string|null} [parent] RollUpDataPointsRequest parent - * @property {google.type.IInterval|null} [range] RollUpDataPointsRequest range - * @property {google.protobuf.IDuration|null} [windowSize] RollUpDataPointsRequest windowSize - * @property {number|null} [pageSize] RollUpDataPointsRequest pageSize - * @property {string|null} [pageToken] RollUpDataPointsRequest pageToken - * @property {string|null} [dataSourceFamily] RollUpDataPointsRequest dataSourceFamily + * @interface ICreateSubscriberMetadata */ /** - * Constructs a new RollUpDataPointsRequest. + * Constructs a new CreateSubscriberMetadata. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a RollUpDataPointsRequest. - * @implements IRollUpDataPointsRequest + * @classdesc Represents a CreateSubscriberMetadata. + * @implements ICreateSubscriberMetadata * @constructor - * @param {google.devicesandservices.health.v4.IRollUpDataPointsRequest=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.ICreateSubscriberMetadata=} [properties] Properties to set */ - function RollUpDataPointsRequest(properties) { + function CreateSubscriberMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29416,149 +46408,65 @@ } /** - * RollUpDataPointsRequest parent. - * @member {string} parent - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest - * @instance - */ - RollUpDataPointsRequest.prototype.parent = ""; - - /** - * RollUpDataPointsRequest range. - * @member {google.type.IInterval|null|undefined} range - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest - * @instance - */ - RollUpDataPointsRequest.prototype.range = null; - - /** - * RollUpDataPointsRequest windowSize. - * @member {google.protobuf.IDuration|null|undefined} windowSize - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest - * @instance - */ - RollUpDataPointsRequest.prototype.windowSize = null; - - /** - * RollUpDataPointsRequest pageSize. - * @member {number} pageSize - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest - * @instance - */ - RollUpDataPointsRequest.prototype.pageSize = 0; - - /** - * RollUpDataPointsRequest pageToken. - * @member {string} pageToken - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest - * @instance - */ - RollUpDataPointsRequest.prototype.pageToken = ""; - - /** - * RollUpDataPointsRequest dataSourceFamily. - * @member {string} dataSourceFamily - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest - * @instance - */ - RollUpDataPointsRequest.prototype.dataSourceFamily = ""; - - /** - * Creates a new RollUpDataPointsRequest instance using the specified properties. + * Creates a new CreateSubscriberMetadata instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberMetadata * @static - * @param {google.devicesandservices.health.v4.IRollUpDataPointsRequest=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.RollUpDataPointsRequest} RollUpDataPointsRequest instance + * @param {google.devicesandservices.health.v4.ICreateSubscriberMetadata=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.CreateSubscriberMetadata} CreateSubscriberMetadata instance */ - RollUpDataPointsRequest.create = function create(properties) { - return new RollUpDataPointsRequest(properties); + CreateSubscriberMetadata.create = function create(properties) { + return new CreateSubscriberMetadata(properties); }; /** - * Encodes the specified RollUpDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsRequest.verify|verify} messages. + * Encodes the specified CreateSubscriberMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriberMetadata.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberMetadata * @static - * @param {google.devicesandservices.health.v4.IRollUpDataPointsRequest} message RollUpDataPointsRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.ICreateSubscriberMetadata} message CreateSubscriberMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RollUpDataPointsRequest.encode = function encode(message, writer) { + CreateSubscriberMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.range != null && Object.hasOwnProperty.call(message, "range")) - $root.google.type.Interval.encode(message.range, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.windowSize != null && Object.hasOwnProperty.call(message, "windowSize")) - $root.google.protobuf.Duration.encode(message.windowSize, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - if (message.dataSourceFamily != null && Object.hasOwnProperty.call(message, "dataSourceFamily")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.dataSourceFamily); return writer; }; /** - * Encodes the specified RollUpDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsRequest.verify|verify} messages. + * Encodes the specified CreateSubscriberMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.CreateSubscriberMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberMetadata * @static - * @param {google.devicesandservices.health.v4.IRollUpDataPointsRequest} message RollUpDataPointsRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.ICreateSubscriberMetadata} message CreateSubscriberMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RollUpDataPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateSubscriberMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RollUpDataPointsRequest message from the specified reader or buffer. + * Decodes a CreateSubscriberMetadata message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.RollUpDataPointsRequest} RollUpDataPointsRequest + * @returns {google.devicesandservices.health.v4.CreateSubscriberMetadata} CreateSubscriberMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RollUpDataPointsRequest.decode = function decode(reader, length, error) { + CreateSubscriberMetadata.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.RollUpDataPointsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.CreateSubscriberMetadata(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.range = $root.google.type.Interval.decode(reader, reader.uint32()); - break; - } - case 3: { - message.windowSize = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - case 5: { - message.pageToken = reader.string(); - break; - } - case 7: { - message.dataSourceFamily = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -29568,175 +46476,108 @@ }; /** - * Decodes a RollUpDataPointsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSubscriberMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.RollUpDataPointsRequest} RollUpDataPointsRequest + * @returns {google.devicesandservices.health.v4.CreateSubscriberMetadata} CreateSubscriberMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RollUpDataPointsRequest.decodeDelimited = function decodeDelimited(reader) { + CreateSubscriberMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RollUpDataPointsRequest message. + * Verifies a CreateSubscriberMetadata message. * @function verify - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RollUpDataPointsRequest.verify = function verify(message) { + CreateSubscriberMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.range != null && message.hasOwnProperty("range")) { - var error = $root.google.type.Interval.verify(message.range); - if (error) - return "range." + error; - } - if (message.windowSize != null && message.hasOwnProperty("windowSize")) { - var error = $root.google.protobuf.Duration.verify(message.windowSize); - if (error) - return "windowSize." + error; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.dataSourceFamily != null && message.hasOwnProperty("dataSourceFamily")) - if (!$util.isString(message.dataSourceFamily)) - return "dataSourceFamily: string expected"; return null; }; /** - * Creates a RollUpDataPointsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.RollUpDataPointsRequest} RollUpDataPointsRequest - */ - RollUpDataPointsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.RollUpDataPointsRequest) - return object; - var message = new $root.google.devicesandservices.health.v4.RollUpDataPointsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.range != null) { - if (typeof object.range !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollUpDataPointsRequest.range: object expected"); - message.range = $root.google.type.Interval.fromObject(object.range); - } - if (object.windowSize != null) { - if (typeof object.windowSize !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollUpDataPointsRequest.windowSize: object expected"); - message.windowSize = $root.google.protobuf.Duration.fromObject(object.windowSize); - } - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.dataSourceFamily != null) - message.dataSourceFamily = String(object.dataSourceFamily); - return message; - }; - - /** - * Creates a plain object from a RollUpDataPointsRequest message. Also converts values to other types if specified. + * Creates a CreateSubscriberMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.CreateSubscriberMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.CreateSubscriberMetadata} CreateSubscriberMetadata + */ + CreateSubscriberMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.CreateSubscriberMetadata) + return object; + return new $root.google.devicesandservices.health.v4.CreateSubscriberMetadata(); + }; + + /** + * Creates a plain object from a CreateSubscriberMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberMetadata * @static - * @param {google.devicesandservices.health.v4.RollUpDataPointsRequest} message RollUpDataPointsRequest + * @param {google.devicesandservices.health.v4.CreateSubscriberMetadata} message CreateSubscriberMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RollUpDataPointsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.range = null; - object.windowSize = null; - object.pageSize = 0; - object.pageToken = ""; - object.dataSourceFamily = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.range != null && message.hasOwnProperty("range")) - object.range = $root.google.type.Interval.toObject(message.range, options); - if (message.windowSize != null && message.hasOwnProperty("windowSize")) - object.windowSize = $root.google.protobuf.Duration.toObject(message.windowSize, options); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.dataSourceFamily != null && message.hasOwnProperty("dataSourceFamily")) - object.dataSourceFamily = message.dataSourceFamily; - return object; + CreateSubscriberMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this RollUpDataPointsRequest to JSON. + * Converts this CreateSubscriberMetadata to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberMetadata * @instance * @returns {Object.} JSON object */ - RollUpDataPointsRequest.prototype.toJSON = function toJSON() { + CreateSubscriberMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RollUpDataPointsRequest + * Gets the default type url for CreateSubscriberMetadata * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.RollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.CreateSubscriberMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RollUpDataPointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSubscriberMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.RollUpDataPointsRequest"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.CreateSubscriberMetadata"; }; - return RollUpDataPointsRequest; + return CreateSubscriberMetadata; })(); - v4.RollUpDataPointsResponse = (function() { + v4.UpdateSubscriberMetadata = (function() { /** - * Properties of a RollUpDataPointsResponse. + * Properties of an UpdateSubscriberMetadata. * @memberof google.devicesandservices.health.v4 - * @interface IRollUpDataPointsResponse - * @property {Array.|null} [rollupDataPoints] RollUpDataPointsResponse rollupDataPoints - * @property {string|null} [nextPageToken] RollUpDataPointsResponse nextPageToken + * @interface IUpdateSubscriberMetadata */ /** - * Constructs a new RollUpDataPointsResponse. + * Constructs a new UpdateSubscriberMetadata. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a RollUpDataPointsResponse. - * @implements IRollUpDataPointsResponse + * @classdesc Represents an UpdateSubscriberMetadata. + * @implements IUpdateSubscriberMetadata * @constructor - * @param {google.devicesandservices.health.v4.IRollUpDataPointsResponse=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IUpdateSubscriberMetadata=} [properties] Properties to set */ - function RollUpDataPointsResponse(properties) { - this.rollupDataPoints = []; + function UpdateSubscriberMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29744,96 +46585,65 @@ } /** - * RollUpDataPointsResponse rollupDataPoints. - * @member {Array.} rollupDataPoints - * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse - * @instance - */ - RollUpDataPointsResponse.prototype.rollupDataPoints = $util.emptyArray; - - /** - * RollUpDataPointsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse - * @instance - */ - RollUpDataPointsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new RollUpDataPointsResponse instance using the specified properties. + * Creates a new UpdateSubscriberMetadata instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @memberof google.devicesandservices.health.v4.UpdateSubscriberMetadata * @static - * @param {google.devicesandservices.health.v4.IRollUpDataPointsResponse=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.RollUpDataPointsResponse} RollUpDataPointsResponse instance + * @param {google.devicesandservices.health.v4.IUpdateSubscriberMetadata=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.UpdateSubscriberMetadata} UpdateSubscriberMetadata instance */ - RollUpDataPointsResponse.create = function create(properties) { - return new RollUpDataPointsResponse(properties); + UpdateSubscriberMetadata.create = function create(properties) { + return new UpdateSubscriberMetadata(properties); }; /** - * Encodes the specified RollUpDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsResponse.verify|verify} messages. + * Encodes the specified UpdateSubscriberMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSubscriberMetadata.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @memberof google.devicesandservices.health.v4.UpdateSubscriberMetadata * @static - * @param {google.devicesandservices.health.v4.IRollUpDataPointsResponse} message RollUpDataPointsResponse message or plain object to encode + * @param {google.devicesandservices.health.v4.IUpdateSubscriberMetadata} message UpdateSubscriberMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RollUpDataPointsResponse.encode = function encode(message, writer) { + UpdateSubscriberMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rollupDataPoints != null && message.rollupDataPoints.length) - for (var i = 0; i < message.rollupDataPoints.length; ++i) - $root.google.devicesandservices.health.v4.RollupDataPoint.encode(message.rollupDataPoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified RollUpDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.RollUpDataPointsResponse.verify|verify} messages. + * Encodes the specified UpdateSubscriberMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSubscriberMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @memberof google.devicesandservices.health.v4.UpdateSubscriberMetadata * @static - * @param {google.devicesandservices.health.v4.IRollUpDataPointsResponse} message RollUpDataPointsResponse message or plain object to encode + * @param {google.devicesandservices.health.v4.IUpdateSubscriberMetadata} message UpdateSubscriberMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RollUpDataPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSubscriberMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RollUpDataPointsResponse message from the specified reader or buffer. + * Decodes an UpdateSubscriberMetadata message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @memberof google.devicesandservices.health.v4.UpdateSubscriberMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.RollUpDataPointsResponse} RollUpDataPointsResponse + * @returns {google.devicesandservices.health.v4.UpdateSubscriberMetadata} UpdateSubscriberMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RollUpDataPointsResponse.decode = function decode(reader, length, error) { + UpdateSubscriberMetadata.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.RollUpDataPointsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.UpdateSubscriberMetadata(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 1: { - if (!(message.rollupDataPoints && message.rollupDataPoints.length)) - message.rollupDataPoints = []; - message.rollupDataPoints.push($root.google.devicesandservices.health.v4.RollupDataPoint.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -29843,153 +46653,108 @@ }; /** - * Decodes a RollUpDataPointsResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateSubscriberMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @memberof google.devicesandservices.health.v4.UpdateSubscriberMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.RollUpDataPointsResponse} RollUpDataPointsResponse + * @returns {google.devicesandservices.health.v4.UpdateSubscriberMetadata} UpdateSubscriberMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RollUpDataPointsResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateSubscriberMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RollUpDataPointsResponse message. + * Verifies an UpdateSubscriberMetadata message. * @function verify - * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @memberof google.devicesandservices.health.v4.UpdateSubscriberMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RollUpDataPointsResponse.verify = function verify(message) { + UpdateSubscriberMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.rollupDataPoints != null && message.hasOwnProperty("rollupDataPoints")) { - if (!Array.isArray(message.rollupDataPoints)) - return "rollupDataPoints: array expected"; - for (var i = 0; i < message.rollupDataPoints.length; ++i) { - var error = $root.google.devicesandservices.health.v4.RollupDataPoint.verify(message.rollupDataPoints[i]); - if (error) - return "rollupDataPoints." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a RollUpDataPointsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSubscriberMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @memberof google.devicesandservices.health.v4.UpdateSubscriberMetadata * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.RollUpDataPointsResponse} RollUpDataPointsResponse + * @returns {google.devicesandservices.health.v4.UpdateSubscriberMetadata} UpdateSubscriberMetadata */ - RollUpDataPointsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.RollUpDataPointsResponse) + UpdateSubscriberMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.UpdateSubscriberMetadata) return object; - var message = new $root.google.devicesandservices.health.v4.RollUpDataPointsResponse(); - if (object.rollupDataPoints) { - if (!Array.isArray(object.rollupDataPoints)) - throw TypeError(".google.devicesandservices.health.v4.RollUpDataPointsResponse.rollupDataPoints: array expected"); - message.rollupDataPoints = []; - for (var i = 0; i < object.rollupDataPoints.length; ++i) { - if (typeof object.rollupDataPoints[i] !== "object") - throw TypeError(".google.devicesandservices.health.v4.RollUpDataPointsResponse.rollupDataPoints: object expected"); - message.rollupDataPoints[i] = $root.google.devicesandservices.health.v4.RollupDataPoint.fromObject(object.rollupDataPoints[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; + return new $root.google.devicesandservices.health.v4.UpdateSubscriberMetadata(); }; /** - * Creates a plain object from a RollUpDataPointsResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSubscriberMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @memberof google.devicesandservices.health.v4.UpdateSubscriberMetadata * @static - * @param {google.devicesandservices.health.v4.RollUpDataPointsResponse} message RollUpDataPointsResponse + * @param {google.devicesandservices.health.v4.UpdateSubscriberMetadata} message UpdateSubscriberMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RollUpDataPointsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rollupDataPoints = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.rollupDataPoints && message.rollupDataPoints.length) { - object.rollupDataPoints = []; - for (var j = 0; j < message.rollupDataPoints.length; ++j) - object.rollupDataPoints[j] = $root.google.devicesandservices.health.v4.RollupDataPoint.toObject(message.rollupDataPoints[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; + UpdateSubscriberMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this RollUpDataPointsResponse to JSON. + * Converts this UpdateSubscriberMetadata to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @memberof google.devicesandservices.health.v4.UpdateSubscriberMetadata * @instance * @returns {Object.} JSON object */ - RollUpDataPointsResponse.prototype.toJSON = function toJSON() { + UpdateSubscriberMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RollUpDataPointsResponse + * Gets the default type url for UpdateSubscriberMetadata * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.RollUpDataPointsResponse + * @memberof google.devicesandservices.health.v4.UpdateSubscriberMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RollUpDataPointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateSubscriberMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.RollUpDataPointsResponse"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.UpdateSubscriberMetadata"; }; - return RollUpDataPointsResponse; + return UpdateSubscriberMetadata; })(); - v4.DailyRollUpDataPointsRequest = (function() { + v4.DeleteSubscriberMetadata = (function() { /** - * Properties of a DailyRollUpDataPointsRequest. + * Properties of a DeleteSubscriberMetadata. * @memberof google.devicesandservices.health.v4 - * @interface IDailyRollUpDataPointsRequest - * @property {string|null} [parent] DailyRollUpDataPointsRequest parent - * @property {google.devicesandservices.health.v4.ICivilTimeInterval|null} [range] DailyRollUpDataPointsRequest range - * @property {number|null} [windowSizeDays] DailyRollUpDataPointsRequest windowSizeDays - * @property {number|null} [pageSize] DailyRollUpDataPointsRequest pageSize - * @property {string|null} [pageToken] DailyRollUpDataPointsRequest pageToken - * @property {string|null} [dataSourceFamily] DailyRollUpDataPointsRequest dataSourceFamily + * @interface IDeleteSubscriberMetadata */ /** - * Constructs a new DailyRollUpDataPointsRequest. + * Constructs a new DeleteSubscriberMetadata. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a DailyRollUpDataPointsRequest. - * @implements IDailyRollUpDataPointsRequest + * @classdesc Represents a DeleteSubscriberMetadata. + * @implements IDeleteSubscriberMetadata * @constructor - * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IDeleteSubscriberMetadata=} [properties] Properties to set */ - function DailyRollUpDataPointsRequest(properties) { + function DeleteSubscriberMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29997,149 +46762,65 @@ } /** - * DailyRollUpDataPointsRequest parent. - * @member {string} parent - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest - * @instance - */ - DailyRollUpDataPointsRequest.prototype.parent = ""; - - /** - * DailyRollUpDataPointsRequest range. - * @member {google.devicesandservices.health.v4.ICivilTimeInterval|null|undefined} range - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest - * @instance - */ - DailyRollUpDataPointsRequest.prototype.range = null; - - /** - * DailyRollUpDataPointsRequest windowSizeDays. - * @member {number} windowSizeDays - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest - * @instance - */ - DailyRollUpDataPointsRequest.prototype.windowSizeDays = 0; - - /** - * DailyRollUpDataPointsRequest pageSize. - * @member {number} pageSize - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest - * @instance - */ - DailyRollUpDataPointsRequest.prototype.pageSize = 0; - - /** - * DailyRollUpDataPointsRequest pageToken. - * @member {string} pageToken - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest - * @instance - */ - DailyRollUpDataPointsRequest.prototype.pageToken = ""; - - /** - * DailyRollUpDataPointsRequest dataSourceFamily. - * @member {string} dataSourceFamily - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest - * @instance - */ - DailyRollUpDataPointsRequest.prototype.dataSourceFamily = ""; - - /** - * Creates a new DailyRollUpDataPointsRequest instance using the specified properties. + * Creates a new DeleteSubscriberMetadata instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberMetadata * @static - * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsRequest} DailyRollUpDataPointsRequest instance + * @param {google.devicesandservices.health.v4.IDeleteSubscriberMetadata=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.DeleteSubscriberMetadata} DeleteSubscriberMetadata instance */ - DailyRollUpDataPointsRequest.create = function create(properties) { - return new DailyRollUpDataPointsRequest(properties); + DeleteSubscriberMetadata.create = function create(properties) { + return new DeleteSubscriberMetadata(properties); }; /** - * Encodes the specified DailyRollUpDataPointsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsRequest.verify|verify} messages. + * Encodes the specified DeleteSubscriberMetadata message. Does not implicitly {@link google.devicesandservices.health.v4.DeleteSubscriberMetadata.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberMetadata * @static - * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest} message DailyRollUpDataPointsRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IDeleteSubscriberMetadata} message DeleteSubscriberMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DailyRollUpDataPointsRequest.encode = function encode(message, writer) { + DeleteSubscriberMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.range != null && Object.hasOwnProperty.call(message, "range")) - $root.google.devicesandservices.health.v4.CivilTimeInterval.encode(message.range, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.windowSizeDays != null && Object.hasOwnProperty.call(message, "windowSizeDays")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.windowSizeDays); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - if (message.dataSourceFamily != null && Object.hasOwnProperty.call(message, "dataSourceFamily")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.dataSourceFamily); return writer; }; /** - * Encodes the specified DailyRollUpDataPointsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsRequest.verify|verify} messages. + * Encodes the specified DeleteSubscriberMetadata message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DeleteSubscriberMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberMetadata * @static - * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest} message DailyRollUpDataPointsRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IDeleteSubscriberMetadata} message DeleteSubscriberMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DailyRollUpDataPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteSubscriberMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DailyRollUpDataPointsRequest message from the specified reader or buffer. + * Decodes a DeleteSubscriberMetadata message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsRequest} DailyRollUpDataPointsRequest + * @returns {google.devicesandservices.health.v4.DeleteSubscriberMetadata} DeleteSubscriberMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DailyRollUpDataPointsRequest.decode = function decode(reader, length, error) { + DeleteSubscriberMetadata.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DeleteSubscriberMetadata(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.range = $root.google.devicesandservices.health.v4.CivilTimeInterval.decode(reader, reader.uint32()); - break; - } - case 3: { - message.windowSizeDays = reader.int32(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - case 5: { - message.pageToken = reader.string(); - break; - } - case 7: { - message.dataSourceFamily = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -30149,394 +46830,408 @@ }; /** - * Decodes a DailyRollUpDataPointsRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteSubscriberMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsRequest} DailyRollUpDataPointsRequest + * @returns {google.devicesandservices.health.v4.DeleteSubscriberMetadata} DeleteSubscriberMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DailyRollUpDataPointsRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteSubscriberMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DailyRollUpDataPointsRequest message. + * Verifies a DeleteSubscriberMetadata message. * @function verify - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DailyRollUpDataPointsRequest.verify = function verify(message) { + DeleteSubscriberMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.range != null && message.hasOwnProperty("range")) { - var error = $root.google.devicesandservices.health.v4.CivilTimeInterval.verify(message.range); - if (error) - return "range." + error; - } - if (message.windowSizeDays != null && message.hasOwnProperty("windowSizeDays")) - if (!$util.isInteger(message.windowSizeDays)) - return "windowSizeDays: integer expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.dataSourceFamily != null && message.hasOwnProperty("dataSourceFamily")) - if (!$util.isString(message.dataSourceFamily)) - return "dataSourceFamily: string expected"; return null; }; /** - * Creates a DailyRollUpDataPointsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSubscriberMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberMetadata * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsRequest} DailyRollUpDataPointsRequest + * @returns {google.devicesandservices.health.v4.DeleteSubscriberMetadata} DeleteSubscriberMetadata */ - DailyRollUpDataPointsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest) + DeleteSubscriberMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.DeleteSubscriberMetadata) return object; - var message = new $root.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.range != null) { - if (typeof object.range !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollUpDataPointsRequest.range: object expected"); - message.range = $root.google.devicesandservices.health.v4.CivilTimeInterval.fromObject(object.range); - } - if (object.windowSizeDays != null) - message.windowSizeDays = object.windowSizeDays | 0; - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.dataSourceFamily != null) - message.dataSourceFamily = String(object.dataSourceFamily); - return message; + return new $root.google.devicesandservices.health.v4.DeleteSubscriberMetadata(); }; /** - * Creates a plain object from a DailyRollUpDataPointsRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteSubscriberMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberMetadata * @static - * @param {google.devicesandservices.health.v4.DailyRollUpDataPointsRequest} message DailyRollUpDataPointsRequest + * @param {google.devicesandservices.health.v4.DeleteSubscriberMetadata} message DeleteSubscriberMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DailyRollUpDataPointsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.range = null; - object.windowSizeDays = 0; - object.pageSize = 0; - object.pageToken = ""; - object.dataSourceFamily = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.range != null && message.hasOwnProperty("range")) - object.range = $root.google.devicesandservices.health.v4.CivilTimeInterval.toObject(message.range, options); - if (message.windowSizeDays != null && message.hasOwnProperty("windowSizeDays")) - object.windowSizeDays = message.windowSizeDays; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.dataSourceFamily != null && message.hasOwnProperty("dataSourceFamily")) - object.dataSourceFamily = message.dataSourceFamily; - return object; + DeleteSubscriberMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this DailyRollUpDataPointsRequest to JSON. + * Converts this DeleteSubscriberMetadata to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest + * @memberof google.devicesandservices.health.v4.DeleteSubscriberMetadata * @instance * @returns {Object.} JSON object */ - DailyRollUpDataPointsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + DeleteSubscriberMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSubscriberMetadata + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.DeleteSubscriberMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSubscriberMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.DeleteSubscriberMetadata"; + }; + + return DeleteSubscriberMetadata; + })(); + + v4.HealthProfileService = (function() { + + /** + * Constructs a new HealthProfileService service. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a HealthProfileService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function HealthProfileService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (HealthProfileService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = HealthProfileService; + + /** + * Creates new HealthProfileService service using the specified rpc implementation. + * @function create + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {HealthProfileService} RPC service. Useful where requests and/or responses are streamed. + */ + HealthProfileService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getProfile}. + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @typedef GetProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.Profile} [response] Profile + */ + + /** + * Calls GetProfile. + * @function getProfile + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @instance + * @param {google.devicesandservices.health.v4.IGetProfileRequest} request GetProfileRequest message or plain object + * @param {google.devicesandservices.health.v4.HealthProfileService.GetProfileCallback} callback Node-style callback called with the error, if any, and Profile + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HealthProfileService.prototype.getProfile = function getProfile(request, callback) { + return this.rpcCall(getProfile, $root.google.devicesandservices.health.v4.GetProfileRequest, $root.google.devicesandservices.health.v4.Profile, request, callback); + }, "name", { value: "GetProfile" }); + + /** + * Calls GetProfile. + * @function getProfile + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @instance + * @param {google.devicesandservices.health.v4.IGetProfileRequest} request GetProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|updateProfile}. + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @typedef UpdateProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.Profile} [response] Profile + */ + + /** + * Calls UpdateProfile. + * @function updateProfile + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @instance + * @param {google.devicesandservices.health.v4.IUpdateProfileRequest} request UpdateProfileRequest message or plain object + * @param {google.devicesandservices.health.v4.HealthProfileService.UpdateProfileCallback} callback Node-style callback called with the error, if any, and Profile + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HealthProfileService.prototype.updateProfile = function updateProfile(request, callback) { + return this.rpcCall(updateProfile, $root.google.devicesandservices.health.v4.UpdateProfileRequest, $root.google.devicesandservices.health.v4.Profile, request, callback); + }, "name", { value: "UpdateProfile" }); + + /** + * Calls UpdateProfile. + * @function updateProfile + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @instance + * @param {google.devicesandservices.health.v4.IUpdateProfileRequest} request UpdateProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getSettings}. + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @typedef GetSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.Settings} [response] Settings + */ + + /** + * Calls GetSettings. + * @function getSettings + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @instance + * @param {google.devicesandservices.health.v4.IGetSettingsRequest} request GetSettingsRequest message or plain object + * @param {google.devicesandservices.health.v4.HealthProfileService.GetSettingsCallback} callback Node-style callback called with the error, if any, and Settings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HealthProfileService.prototype.getSettings = function getSettings(request, callback) { + return this.rpcCall(getSettings, $root.google.devicesandservices.health.v4.GetSettingsRequest, $root.google.devicesandservices.health.v4.Settings, request, callback); + }, "name", { value: "GetSettings" }); + + /** + * Calls GetSettings. + * @function getSettings + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @instance + * @param {google.devicesandservices.health.v4.IGetSettingsRequest} request GetSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ /** - * Gets the default type url for DailyRollUpDataPointsRequest - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|updateSettings}. + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @typedef UpdateSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.Settings} [response] Settings */ - DailyRollUpDataPointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.DailyRollUpDataPointsRequest"; - }; - return DailyRollUpDataPointsRequest; - })(); - - v4.DailyRollUpDataPointsResponse = (function() { + /** + * Calls UpdateSettings. + * @function updateSettings + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @instance + * @param {google.devicesandservices.health.v4.IUpdateSettingsRequest} request UpdateSettingsRequest message or plain object + * @param {google.devicesandservices.health.v4.HealthProfileService.UpdateSettingsCallback} callback Node-style callback called with the error, if any, and Settings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HealthProfileService.prototype.updateSettings = function updateSettings(request, callback) { + return this.rpcCall(updateSettings, $root.google.devicesandservices.health.v4.UpdateSettingsRequest, $root.google.devicesandservices.health.v4.Settings, request, callback); + }, "name", { value: "UpdateSettings" }); /** - * Properties of a DailyRollUpDataPointsResponse. - * @memberof google.devicesandservices.health.v4 - * @interface IDailyRollUpDataPointsResponse - * @property {Array.|null} [rollupDataPoints] DailyRollUpDataPointsResponse rollupDataPoints + * Calls UpdateSettings. + * @function updateSettings + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @instance + * @param {google.devicesandservices.health.v4.IUpdateSettingsRequest} request UpdateSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new DailyRollUpDataPointsResponse. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a DailyRollUpDataPointsResponse. - * @implements IDailyRollUpDataPointsResponse - * @constructor - * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse=} [properties] Properties to set + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getIdentity}. + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @typedef GetIdentityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.Identity} [response] Identity */ - function DailyRollUpDataPointsResponse(properties) { - this.rollupDataPoints = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * DailyRollUpDataPointsResponse rollupDataPoints. - * @member {Array.} rollupDataPoints - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse + * Calls GetIdentity. + * @function getIdentity + * @memberof google.devicesandservices.health.v4.HealthProfileService * @instance + * @param {google.devicesandservices.health.v4.IGetIdentityRequest} request GetIdentityRequest message or plain object + * @param {google.devicesandservices.health.v4.HealthProfileService.GetIdentityCallback} callback Node-style callback called with the error, if any, and Identity + * @returns {undefined} + * @variation 1 */ - DailyRollUpDataPointsResponse.prototype.rollupDataPoints = $util.emptyArray; + Object.defineProperty(HealthProfileService.prototype.getIdentity = function getIdentity(request, callback) { + return this.rpcCall(getIdentity, $root.google.devicesandservices.health.v4.GetIdentityRequest, $root.google.devicesandservices.health.v4.Identity, request, callback); + }, "name", { value: "GetIdentity" }); /** - * Creates a new DailyRollUpDataPointsResponse instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse - * @static - * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsResponse} DailyRollUpDataPointsResponse instance + * Calls GetIdentity. + * @function getIdentity + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @instance + * @param {google.devicesandservices.health.v4.IGetIdentityRequest} request GetIdentityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DailyRollUpDataPointsResponse.create = function create(properties) { - return new DailyRollUpDataPointsResponse(properties); - }; /** - * Encodes the specified DailyRollUpDataPointsResponse message. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsResponse.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse - * @static - * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse} message DailyRollUpDataPointsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getIrnProfile}. + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @typedef GetIrnProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.IrnProfile} [response] IrnProfile */ - DailyRollUpDataPointsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rollupDataPoints != null && message.rollupDataPoints.length) - for (var i = 0; i < message.rollupDataPoints.length; ++i) - $root.google.devicesandservices.health.v4.DailyRollupDataPoint.encode(message.rollupDataPoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; /** - * Encodes the specified DailyRollUpDataPointsResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DailyRollUpDataPointsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse - * @static - * @param {google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse} message DailyRollUpDataPointsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetIrnProfile. + * @function getIrnProfile + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @instance + * @param {google.devicesandservices.health.v4.IGetIrnProfileRequest} request GetIrnProfileRequest message or plain object + * @param {google.devicesandservices.health.v4.HealthProfileService.GetIrnProfileCallback} callback Node-style callback called with the error, if any, and IrnProfile + * @returns {undefined} + * @variation 1 */ - DailyRollUpDataPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(HealthProfileService.prototype.getIrnProfile = function getIrnProfile(request, callback) { + return this.rpcCall(getIrnProfile, $root.google.devicesandservices.health.v4.GetIrnProfileRequest, $root.google.devicesandservices.health.v4.IrnProfile, request, callback); + }, "name", { value: "GetIrnProfile" }); /** - * Decodes a DailyRollUpDataPointsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsResponse} DailyRollUpDataPointsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetIrnProfile. + * @function getIrnProfile + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @instance + * @param {google.devicesandservices.health.v4.IGetIrnProfileRequest} request GetIrnProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DailyRollUpDataPointsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.rollupDataPoints && message.rollupDataPoints.length)) - message.rollupDataPoints = []; - message.rollupDataPoints.push($root.google.devicesandservices.health.v4.DailyRollupDataPoint.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a DailyRollUpDataPointsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsResponse} DailyRollUpDataPointsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getPairedDevice}. + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @typedef GetPairedDeviceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.PairedDevice} [response] PairedDevice */ - DailyRollUpDataPointsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a DailyRollUpDataPointsResponse message. - * @function verify - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls GetPairedDevice. + * @function getPairedDevice + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @instance + * @param {google.devicesandservices.health.v4.IGetPairedDeviceRequest} request GetPairedDeviceRequest message or plain object + * @param {google.devicesandservices.health.v4.HealthProfileService.GetPairedDeviceCallback} callback Node-style callback called with the error, if any, and PairedDevice + * @returns {undefined} + * @variation 1 */ - DailyRollUpDataPointsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rollupDataPoints != null && message.hasOwnProperty("rollupDataPoints")) { - if (!Array.isArray(message.rollupDataPoints)) - return "rollupDataPoints: array expected"; - for (var i = 0; i < message.rollupDataPoints.length; ++i) { - var error = $root.google.devicesandservices.health.v4.DailyRollupDataPoint.verify(message.rollupDataPoints[i]); - if (error) - return "rollupDataPoints." + error; - } - } - return null; - }; + Object.defineProperty(HealthProfileService.prototype.getPairedDevice = function getPairedDevice(request, callback) { + return this.rpcCall(getPairedDevice, $root.google.devicesandservices.health.v4.GetPairedDeviceRequest, $root.google.devicesandservices.health.v4.PairedDevice, request, callback); + }, "name", { value: "GetPairedDevice" }); /** - * Creates a DailyRollUpDataPointsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.DailyRollUpDataPointsResponse} DailyRollUpDataPointsResponse + * Calls GetPairedDevice. + * @function getPairedDevice + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @instance + * @param {google.devicesandservices.health.v4.IGetPairedDeviceRequest} request GetPairedDeviceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DailyRollUpDataPointsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse) - return object; - var message = new $root.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse(); - if (object.rollupDataPoints) { - if (!Array.isArray(object.rollupDataPoints)) - throw TypeError(".google.devicesandservices.health.v4.DailyRollUpDataPointsResponse.rollupDataPoints: array expected"); - message.rollupDataPoints = []; - for (var i = 0; i < object.rollupDataPoints.length; ++i) { - if (typeof object.rollupDataPoints[i] !== "object") - throw TypeError(".google.devicesandservices.health.v4.DailyRollUpDataPointsResponse.rollupDataPoints: object expected"); - message.rollupDataPoints[i] = $root.google.devicesandservices.health.v4.DailyRollupDataPoint.fromObject(object.rollupDataPoints[i]); - } - } - return message; - }; /** - * Creates a plain object from a DailyRollUpDataPointsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse - * @static - * @param {google.devicesandservices.health.v4.DailyRollUpDataPointsResponse} message DailyRollUpDataPointsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|listPairedDevices}. + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @typedef ListPairedDevicesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devicesandservices.health.v4.ListPairedDevicesResponse} [response] ListPairedDevicesResponse */ - DailyRollUpDataPointsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rollupDataPoints = []; - if (message.rollupDataPoints && message.rollupDataPoints.length) { - object.rollupDataPoints = []; - for (var j = 0; j < message.rollupDataPoints.length; ++j) - object.rollupDataPoints[j] = $root.google.devicesandservices.health.v4.DailyRollupDataPoint.toObject(message.rollupDataPoints[j], options); - } - return object; - }; /** - * Converts this DailyRollUpDataPointsResponse to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse + * Calls ListPairedDevices. + * @function listPairedDevices + * @memberof google.devicesandservices.health.v4.HealthProfileService * @instance - * @returns {Object.} JSON object + * @param {google.devicesandservices.health.v4.IListPairedDevicesRequest} request ListPairedDevicesRequest message or plain object + * @param {google.devicesandservices.health.v4.HealthProfileService.ListPairedDevicesCallback} callback Node-style callback called with the error, if any, and ListPairedDevicesResponse + * @returns {undefined} + * @variation 1 */ - DailyRollUpDataPointsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(HealthProfileService.prototype.listPairedDevices = function listPairedDevices(request, callback) { + return this.rpcCall(listPairedDevices, $root.google.devicesandservices.health.v4.ListPairedDevicesRequest, $root.google.devicesandservices.health.v4.ListPairedDevicesResponse, request, callback); + }, "name", { value: "ListPairedDevices" }); /** - * Gets the default type url for DailyRollUpDataPointsResponse - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.DailyRollUpDataPointsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls ListPairedDevices. + * @function listPairedDevices + * @memberof google.devicesandservices.health.v4.HealthProfileService + * @instance + * @param {google.devicesandservices.health.v4.IListPairedDevicesRequest} request ListPairedDevicesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DailyRollUpDataPointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.DailyRollUpDataPointsResponse"; - }; - return DailyRollUpDataPointsResponse; + return HealthProfileService; })(); - v4.DataType = (function() { + v4.User = (function() { /** - * Properties of a DataType. + * Properties of a User. * @memberof google.devicesandservices.health.v4 - * @interface IDataType - * @property {string|null} [name] DataType name + * @interface IUser + * @property {string|null} [name] User name */ /** - * Constructs a new DataType. + * Constructs a new User. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a DataType. - * @implements IDataType + * @classdesc Represents a User. + * @implements IUser * @constructor - * @param {google.devicesandservices.health.v4.IDataType=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IUser=} [properties] Properties to set */ - function DataType(properties) { + function User(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30544,35 +47239,35 @@ } /** - * DataType name. + * User name. * @member {string} name - * @memberof google.devicesandservices.health.v4.DataType + * @memberof google.devicesandservices.health.v4.User * @instance */ - DataType.prototype.name = ""; + User.prototype.name = ""; /** - * Creates a new DataType instance using the specified properties. + * Creates a new User instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.DataType + * @memberof google.devicesandservices.health.v4.User * @static - * @param {google.devicesandservices.health.v4.IDataType=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.DataType} DataType instance + * @param {google.devicesandservices.health.v4.IUser=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.User} User instance */ - DataType.create = function create(properties) { - return new DataType(properties); + User.create = function create(properties) { + return new User(properties); }; /** - * Encodes the specified DataType message. Does not implicitly {@link google.devicesandservices.health.v4.DataType.verify|verify} messages. + * Encodes the specified User message. Does not implicitly {@link google.devicesandservices.health.v4.User.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.DataType + * @memberof google.devicesandservices.health.v4.User * @static - * @param {google.devicesandservices.health.v4.IDataType} message DataType message or plain object to encode + * @param {google.devicesandservices.health.v4.IUser} message User message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataType.encode = function encode(message, writer) { + User.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -30581,33 +47276,33 @@ }; /** - * Encodes the specified DataType message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataType.verify|verify} messages. + * Encodes the specified User message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.User.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.DataType + * @memberof google.devicesandservices.health.v4.User * @static - * @param {google.devicesandservices.health.v4.IDataType} message DataType message or plain object to encode + * @param {google.devicesandservices.health.v4.IUser} message User message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataType.encodeDelimited = function encodeDelimited(message, writer) { + User.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DataType message from the specified reader or buffer. + * Decodes a User message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.DataType + * @memberof google.devicesandservices.health.v4.User * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.DataType} DataType + * @returns {google.devicesandservices.health.v4.User} User * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DataType.decode = function decode(reader, length, error) { + User.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DataType(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.User(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -30626,30 +47321,30 @@ }; /** - * Decodes a DataType message from the specified reader or buffer, length delimited. + * Decodes a User message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.DataType + * @memberof google.devicesandservices.health.v4.User * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.DataType} DataType + * @returns {google.devicesandservices.health.v4.User} User * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DataType.decodeDelimited = function decodeDelimited(reader) { + User.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DataType message. + * Verifies a User message. * @function verify - * @memberof google.devicesandservices.health.v4.DataType + * @memberof google.devicesandservices.health.v4.User * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DataType.verify = function verify(message) { + User.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -30659,32 +47354,32 @@ }; /** - * Creates a DataType message from a plain object. Also converts values to their respective internal types. + * Creates a User message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.DataType + * @memberof google.devicesandservices.health.v4.User * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.DataType} DataType + * @returns {google.devicesandservices.health.v4.User} User */ - DataType.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.DataType) + User.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.User) return object; - var message = new $root.google.devicesandservices.health.v4.DataType(); + var message = new $root.google.devicesandservices.health.v4.User(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a DataType message. Also converts values to other types if specified. + * Creates a plain object from a User message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.DataType + * @memberof google.devicesandservices.health.v4.User * @static - * @param {google.devicesandservices.health.v4.DataType} message DataType + * @param {google.devicesandservices.health.v4.User} message User * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DataType.toObject = function toObject(message, options) { + User.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -30696,53 +47391,58 @@ }; /** - * Converts this DataType to JSON. + * Converts this User to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.DataType + * @memberof google.devicesandservices.health.v4.User * @instance * @returns {Object.} JSON object */ - DataType.prototype.toJSON = function toJSON() { + User.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DataType + * Gets the default type url for User * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.DataType + * @memberof google.devicesandservices.health.v4.User * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DataType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.DataType"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.User"; }; - return DataType; + return User; })(); - v4.ExportExerciseTcxRequest = (function() { + v4.Profile = (function() { /** - * Properties of an ExportExerciseTcxRequest. + * Properties of a Profile. * @memberof google.devicesandservices.health.v4 - * @interface IExportExerciseTcxRequest - * @property {string|null} [name] ExportExerciseTcxRequest name - * @property {boolean|null} [partialData] ExportExerciseTcxRequest partialData + * @interface IProfile + * @property {string|null} [name] Profile name + * @property {number|null} [age] Profile age + * @property {google.type.IDate|null} [membershipStartDate] Profile membershipStartDate + * @property {number|null} [userConfiguredWalkingStrideLengthMm] Profile userConfiguredWalkingStrideLengthMm + * @property {number|null} [userConfiguredRunningStrideLengthMm] Profile userConfiguredRunningStrideLengthMm + * @property {number|null} [autoWalkingStrideLengthMm] Profile autoWalkingStrideLengthMm + * @property {number|null} [autoRunningStrideLengthMm] Profile autoRunningStrideLengthMm */ /** - * Constructs a new ExportExerciseTcxRequest. + * Constructs a new Profile. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents an ExportExerciseTcxRequest. - * @implements IExportExerciseTcxRequest + * @classdesc Represents a Profile. + * @implements IProfile * @constructor - * @param {google.devicesandservices.health.v4.IExportExerciseTcxRequest=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IProfile=} [properties] Properties to set */ - function ExportExerciseTcxRequest(properties) { + function Profile(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30750,80 +47450,157 @@ } /** - * ExportExerciseTcxRequest name. + * Profile name. * @member {string} name - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @memberof google.devicesandservices.health.v4.Profile * @instance */ - ExportExerciseTcxRequest.prototype.name = ""; + Profile.prototype.name = ""; /** - * ExportExerciseTcxRequest partialData. - * @member {boolean} partialData - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * Profile age. + * @member {number} age + * @memberof google.devicesandservices.health.v4.Profile * @instance */ - ExportExerciseTcxRequest.prototype.partialData = false; + Profile.prototype.age = 0; /** - * Creates a new ExportExerciseTcxRequest instance using the specified properties. + * Profile membershipStartDate. + * @member {google.type.IDate|null|undefined} membershipStartDate + * @memberof google.devicesandservices.health.v4.Profile + * @instance + */ + Profile.prototype.membershipStartDate = null; + + /** + * Profile userConfiguredWalkingStrideLengthMm. + * @member {number|null|undefined} userConfiguredWalkingStrideLengthMm + * @memberof google.devicesandservices.health.v4.Profile + * @instance + */ + Profile.prototype.userConfiguredWalkingStrideLengthMm = null; + + /** + * Profile userConfiguredRunningStrideLengthMm. + * @member {number|null|undefined} userConfiguredRunningStrideLengthMm + * @memberof google.devicesandservices.health.v4.Profile + * @instance + */ + Profile.prototype.userConfiguredRunningStrideLengthMm = null; + + /** + * Profile autoWalkingStrideLengthMm. + * @member {number|null|undefined} autoWalkingStrideLengthMm + * @memberof google.devicesandservices.health.v4.Profile + * @instance + */ + Profile.prototype.autoWalkingStrideLengthMm = null; + + /** + * Profile autoRunningStrideLengthMm. + * @member {number|null|undefined} autoRunningStrideLengthMm + * @memberof google.devicesandservices.health.v4.Profile + * @instance + */ + Profile.prototype.autoRunningStrideLengthMm = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Profile.prototype, "_userConfiguredWalkingStrideLengthMm", { + get: $util.oneOfGetter($oneOfFields = ["userConfiguredWalkingStrideLengthMm"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Profile.prototype, "_userConfiguredRunningStrideLengthMm", { + get: $util.oneOfGetter($oneOfFields = ["userConfiguredRunningStrideLengthMm"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Profile.prototype, "_autoWalkingStrideLengthMm", { + get: $util.oneOfGetter($oneOfFields = ["autoWalkingStrideLengthMm"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Profile.prototype, "_autoRunningStrideLengthMm", { + get: $util.oneOfGetter($oneOfFields = ["autoRunningStrideLengthMm"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Profile instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @memberof google.devicesandservices.health.v4.Profile * @static - * @param {google.devicesandservices.health.v4.IExportExerciseTcxRequest=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.ExportExerciseTcxRequest} ExportExerciseTcxRequest instance + * @param {google.devicesandservices.health.v4.IProfile=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Profile} Profile instance */ - ExportExerciseTcxRequest.create = function create(properties) { - return new ExportExerciseTcxRequest(properties); + Profile.create = function create(properties) { + return new Profile(properties); }; /** - * Encodes the specified ExportExerciseTcxRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxRequest.verify|verify} messages. + * Encodes the specified Profile message. Does not implicitly {@link google.devicesandservices.health.v4.Profile.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @memberof google.devicesandservices.health.v4.Profile * @static - * @param {google.devicesandservices.health.v4.IExportExerciseTcxRequest} message ExportExerciseTcxRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IProfile} message Profile message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportExerciseTcxRequest.encode = function encode(message, writer) { + Profile.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.partialData != null && Object.hasOwnProperty.call(message, "partialData")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.partialData); + if (message.age != null && Object.hasOwnProperty.call(message, "age")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.age); + if (message.membershipStartDate != null && Object.hasOwnProperty.call(message, "membershipStartDate")) + $root.google.type.Date.encode(message.membershipStartDate, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.userConfiguredWalkingStrideLengthMm != null && Object.hasOwnProperty.call(message, "userConfiguredWalkingStrideLengthMm")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.userConfiguredWalkingStrideLengthMm); + if (message.userConfiguredRunningStrideLengthMm != null && Object.hasOwnProperty.call(message, "userConfiguredRunningStrideLengthMm")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.userConfiguredRunningStrideLengthMm); + if (message.autoWalkingStrideLengthMm != null && Object.hasOwnProperty.call(message, "autoWalkingStrideLengthMm")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.autoWalkingStrideLengthMm); + if (message.autoRunningStrideLengthMm != null && Object.hasOwnProperty.call(message, "autoRunningStrideLengthMm")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.autoRunningStrideLengthMm); return writer; }; /** - * Encodes the specified ExportExerciseTcxRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxRequest.verify|verify} messages. + * Encodes the specified Profile message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Profile.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @memberof google.devicesandservices.health.v4.Profile * @static - * @param {google.devicesandservices.health.v4.IExportExerciseTcxRequest} message ExportExerciseTcxRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IProfile} message Profile message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportExerciseTcxRequest.encodeDelimited = function encodeDelimited(message, writer) { + Profile.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportExerciseTcxRequest message from the specified reader or buffer. + * Decodes a Profile message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @memberof google.devicesandservices.health.v4.Profile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.ExportExerciseTcxRequest} ExportExerciseTcxRequest + * @returns {google.devicesandservices.health.v4.Profile} Profile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportExerciseTcxRequest.decode = function decode(reader, length, error) { + Profile.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ExportExerciseTcxRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Profile(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -30833,8 +47610,28 @@ message.name = reader.string(); break; } - case 2: { - message.partialData = reader.bool(); + case 6: { + message.age = reader.int32(); + break; + } + case 9: { + message.membershipStartDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 13: { + message.userConfiguredWalkingStrideLengthMm = reader.int32(); + break; + } + case 14: { + message.userConfiguredRunningStrideLengthMm = reader.int32(); + break; + } + case 15: { + message.autoWalkingStrideLengthMm = reader.int32(); + break; + } + case 16: { + message.autoRunningStrideLengthMm = reader.int32(); break; } default: @@ -30846,131 +47643,201 @@ }; /** - * Decodes an ExportExerciseTcxRequest message from the specified reader or buffer, length delimited. + * Decodes a Profile message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @memberof google.devicesandservices.health.v4.Profile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.ExportExerciseTcxRequest} ExportExerciseTcxRequest + * @returns {google.devicesandservices.health.v4.Profile} Profile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportExerciseTcxRequest.decodeDelimited = function decodeDelimited(reader) { + Profile.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportExerciseTcxRequest message. + * Verifies a Profile message. * @function verify - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @memberof google.devicesandservices.health.v4.Profile * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportExerciseTcxRequest.verify = function verify(message) { + Profile.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.partialData != null && message.hasOwnProperty("partialData")) - if (typeof message.partialData !== "boolean") - return "partialData: boolean expected"; + if (message.age != null && message.hasOwnProperty("age")) + if (!$util.isInteger(message.age)) + return "age: integer expected"; + if (message.membershipStartDate != null && message.hasOwnProperty("membershipStartDate")) { + var error = $root.google.type.Date.verify(message.membershipStartDate); + if (error) + return "membershipStartDate." + error; + } + if (message.userConfiguredWalkingStrideLengthMm != null && message.hasOwnProperty("userConfiguredWalkingStrideLengthMm")) { + properties._userConfiguredWalkingStrideLengthMm = 1; + if (!$util.isInteger(message.userConfiguredWalkingStrideLengthMm)) + return "userConfiguredWalkingStrideLengthMm: integer expected"; + } + if (message.userConfiguredRunningStrideLengthMm != null && message.hasOwnProperty("userConfiguredRunningStrideLengthMm")) { + properties._userConfiguredRunningStrideLengthMm = 1; + if (!$util.isInteger(message.userConfiguredRunningStrideLengthMm)) + return "userConfiguredRunningStrideLengthMm: integer expected"; + } + if (message.autoWalkingStrideLengthMm != null && message.hasOwnProperty("autoWalkingStrideLengthMm")) { + properties._autoWalkingStrideLengthMm = 1; + if (!$util.isInteger(message.autoWalkingStrideLengthMm)) + return "autoWalkingStrideLengthMm: integer expected"; + } + if (message.autoRunningStrideLengthMm != null && message.hasOwnProperty("autoRunningStrideLengthMm")) { + properties._autoRunningStrideLengthMm = 1; + if (!$util.isInteger(message.autoRunningStrideLengthMm)) + return "autoRunningStrideLengthMm: integer expected"; + } return null; }; /** - * Creates an ExportExerciseTcxRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Profile message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @memberof google.devicesandservices.health.v4.Profile * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.ExportExerciseTcxRequest} ExportExerciseTcxRequest + * @returns {google.devicesandservices.health.v4.Profile} Profile */ - ExportExerciseTcxRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.ExportExerciseTcxRequest) + Profile.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Profile) return object; - var message = new $root.google.devicesandservices.health.v4.ExportExerciseTcxRequest(); + var message = new $root.google.devicesandservices.health.v4.Profile(); if (object.name != null) message.name = String(object.name); - if (object.partialData != null) - message.partialData = Boolean(object.partialData); + if (object.age != null) + message.age = object.age | 0; + if (object.membershipStartDate != null) { + if (typeof object.membershipStartDate !== "object") + throw TypeError(".google.devicesandservices.health.v4.Profile.membershipStartDate: object expected"); + message.membershipStartDate = $root.google.type.Date.fromObject(object.membershipStartDate); + } + if (object.userConfiguredWalkingStrideLengthMm != null) + message.userConfiguredWalkingStrideLengthMm = object.userConfiguredWalkingStrideLengthMm | 0; + if (object.userConfiguredRunningStrideLengthMm != null) + message.userConfiguredRunningStrideLengthMm = object.userConfiguredRunningStrideLengthMm | 0; + if (object.autoWalkingStrideLengthMm != null) + message.autoWalkingStrideLengthMm = object.autoWalkingStrideLengthMm | 0; + if (object.autoRunningStrideLengthMm != null) + message.autoRunningStrideLengthMm = object.autoRunningStrideLengthMm | 0; return message; }; /** - * Creates a plain object from an ExportExerciseTcxRequest message. Also converts values to other types if specified. + * Creates a plain object from a Profile message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @memberof google.devicesandservices.health.v4.Profile * @static - * @param {google.devicesandservices.health.v4.ExportExerciseTcxRequest} message ExportExerciseTcxRequest + * @param {google.devicesandservices.health.v4.Profile} message Profile * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportExerciseTcxRequest.toObject = function toObject(message, options) { + Profile.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.partialData = false; + object.age = 0; + object.membershipStartDate = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.partialData != null && message.hasOwnProperty("partialData")) - object.partialData = message.partialData; + if (message.age != null && message.hasOwnProperty("age")) + object.age = message.age; + if (message.membershipStartDate != null && message.hasOwnProperty("membershipStartDate")) + object.membershipStartDate = $root.google.type.Date.toObject(message.membershipStartDate, options); + if (message.userConfiguredWalkingStrideLengthMm != null && message.hasOwnProperty("userConfiguredWalkingStrideLengthMm")) { + object.userConfiguredWalkingStrideLengthMm = message.userConfiguredWalkingStrideLengthMm; + if (options.oneofs) + object._userConfiguredWalkingStrideLengthMm = "userConfiguredWalkingStrideLengthMm"; + } + if (message.userConfiguredRunningStrideLengthMm != null && message.hasOwnProperty("userConfiguredRunningStrideLengthMm")) { + object.userConfiguredRunningStrideLengthMm = message.userConfiguredRunningStrideLengthMm; + if (options.oneofs) + object._userConfiguredRunningStrideLengthMm = "userConfiguredRunningStrideLengthMm"; + } + if (message.autoWalkingStrideLengthMm != null && message.hasOwnProperty("autoWalkingStrideLengthMm")) { + object.autoWalkingStrideLengthMm = message.autoWalkingStrideLengthMm; + if (options.oneofs) + object._autoWalkingStrideLengthMm = "autoWalkingStrideLengthMm"; + } + if (message.autoRunningStrideLengthMm != null && message.hasOwnProperty("autoRunningStrideLengthMm")) { + object.autoRunningStrideLengthMm = message.autoRunningStrideLengthMm; + if (options.oneofs) + object._autoRunningStrideLengthMm = "autoRunningStrideLengthMm"; + } return object; }; /** - * Converts this ExportExerciseTcxRequest to JSON. + * Converts this Profile to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @memberof google.devicesandservices.health.v4.Profile * @instance * @returns {Object.} JSON object */ - ExportExerciseTcxRequest.prototype.toJSON = function toJSON() { + Profile.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExportExerciseTcxRequest + * Gets the default type url for Profile * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxRequest + * @memberof google.devicesandservices.health.v4.Profile * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExportExerciseTcxRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Profile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.ExportExerciseTcxRequest"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.Profile"; }; - return ExportExerciseTcxRequest; + return Profile; })(); - v4.ExportExerciseTcxResponse = (function() { + v4.PairedDevice = (function() { /** - * Properties of an ExportExerciseTcxResponse. + * Properties of a PairedDevice. * @memberof google.devicesandservices.health.v4 - * @interface IExportExerciseTcxResponse - * @property {string|null} [tcxData] ExportExerciseTcxResponse tcxData + * @interface IPairedDevice + * @property {string|null} [name] PairedDevice name + * @property {google.devicesandservices.health.v4.PairedDevice.DeviceType|null} [deviceType] PairedDevice deviceType + * @property {string|null} [batteryStatus] PairedDevice batteryStatus + * @property {number|null} [batteryLevel] PairedDevice batteryLevel + * @property {google.protobuf.ITimestamp|null} [lastSyncTime] PairedDevice lastSyncTime + * @property {string|null} [deviceVersion] PairedDevice deviceVersion + * @property {string|null} [macAddress] PairedDevice macAddress + * @property {Array.|null} [features] PairedDevice features */ /** - * Constructs a new ExportExerciseTcxResponse. + * Constructs a new PairedDevice. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents an ExportExerciseTcxResponse. - * @implements IExportExerciseTcxResponse + * @classdesc Represents a PairedDevice. + * @implements IPairedDevice * @constructor - * @param {google.devicesandservices.health.v4.IExportExerciseTcxResponse=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IPairedDevice=} [properties] Properties to set */ - function ExportExerciseTcxResponse(properties) { + function PairedDevice(properties) { + this.features = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30978,77 +47845,178 @@ } /** - * ExportExerciseTcxResponse tcxData. - * @member {string} tcxData - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * PairedDevice name. + * @member {string} name + * @memberof google.devicesandservices.health.v4.PairedDevice * @instance */ - ExportExerciseTcxResponse.prototype.tcxData = ""; + PairedDevice.prototype.name = ""; /** - * Creates a new ExportExerciseTcxResponse instance using the specified properties. + * PairedDevice deviceType. + * @member {google.devicesandservices.health.v4.PairedDevice.DeviceType} deviceType + * @memberof google.devicesandservices.health.v4.PairedDevice + * @instance + */ + PairedDevice.prototype.deviceType = 0; + + /** + * PairedDevice batteryStatus. + * @member {string} batteryStatus + * @memberof google.devicesandservices.health.v4.PairedDevice + * @instance + */ + PairedDevice.prototype.batteryStatus = ""; + + /** + * PairedDevice batteryLevel. + * @member {number} batteryLevel + * @memberof google.devicesandservices.health.v4.PairedDevice + * @instance + */ + PairedDevice.prototype.batteryLevel = 0; + + /** + * PairedDevice lastSyncTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastSyncTime + * @memberof google.devicesandservices.health.v4.PairedDevice + * @instance + */ + PairedDevice.prototype.lastSyncTime = null; + + /** + * PairedDevice deviceVersion. + * @member {string} deviceVersion + * @memberof google.devicesandservices.health.v4.PairedDevice + * @instance + */ + PairedDevice.prototype.deviceVersion = ""; + + /** + * PairedDevice macAddress. + * @member {string} macAddress + * @memberof google.devicesandservices.health.v4.PairedDevice + * @instance + */ + PairedDevice.prototype.macAddress = ""; + + /** + * PairedDevice features. + * @member {Array.} features + * @memberof google.devicesandservices.health.v4.PairedDevice + * @instance + */ + PairedDevice.prototype.features = $util.emptyArray; + + /** + * Creates a new PairedDevice instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @memberof google.devicesandservices.health.v4.PairedDevice * @static - * @param {google.devicesandservices.health.v4.IExportExerciseTcxResponse=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.ExportExerciseTcxResponse} ExportExerciseTcxResponse instance + * @param {google.devicesandservices.health.v4.IPairedDevice=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.PairedDevice} PairedDevice instance */ - ExportExerciseTcxResponse.create = function create(properties) { - return new ExportExerciseTcxResponse(properties); + PairedDevice.create = function create(properties) { + return new PairedDevice(properties); }; /** - * Encodes the specified ExportExerciseTcxResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxResponse.verify|verify} messages. + * Encodes the specified PairedDevice message. Does not implicitly {@link google.devicesandservices.health.v4.PairedDevice.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @memberof google.devicesandservices.health.v4.PairedDevice * @static - * @param {google.devicesandservices.health.v4.IExportExerciseTcxResponse} message ExportExerciseTcxResponse message or plain object to encode + * @param {google.devicesandservices.health.v4.IPairedDevice} message PairedDevice message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportExerciseTcxResponse.encode = function encode(message, writer) { + PairedDevice.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tcxData != null && Object.hasOwnProperty.call(message, "tcxData")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tcxData); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.deviceType != null && Object.hasOwnProperty.call(message, "deviceType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.deviceType); + if (message.batteryStatus != null && Object.hasOwnProperty.call(message, "batteryStatus")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.batteryStatus); + if (message.batteryLevel != null && Object.hasOwnProperty.call(message, "batteryLevel")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.batteryLevel); + if (message.lastSyncTime != null && Object.hasOwnProperty.call(message, "lastSyncTime")) + $root.google.protobuf.Timestamp.encode(message.lastSyncTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.deviceVersion != null && Object.hasOwnProperty.call(message, "deviceVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.deviceVersion); + if (message.macAddress != null && Object.hasOwnProperty.call(message, "macAddress")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.macAddress); + if (message.features != null && message.features.length) + for (var i = 0; i < message.features.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.features[i]); return writer; }; /** - * Encodes the specified ExportExerciseTcxResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ExportExerciseTcxResponse.verify|verify} messages. + * Encodes the specified PairedDevice message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.PairedDevice.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @memberof google.devicesandservices.health.v4.PairedDevice * @static - * @param {google.devicesandservices.health.v4.IExportExerciseTcxResponse} message ExportExerciseTcxResponse message or plain object to encode + * @param {google.devicesandservices.health.v4.IPairedDevice} message PairedDevice message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportExerciseTcxResponse.encodeDelimited = function encodeDelimited(message, writer) { + PairedDevice.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportExerciseTcxResponse message from the specified reader or buffer. + * Decodes a PairedDevice message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @memberof google.devicesandservices.health.v4.PairedDevice * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.ExportExerciseTcxResponse} ExportExerciseTcxResponse + * @returns {google.devicesandservices.health.v4.PairedDevice} PairedDevice * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportExerciseTcxResponse.decode = function decode(reader, length, error) { + PairedDevice.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ExportExerciseTcxResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.PairedDevice(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 2: { - message.tcxData = reader.string(); + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.deviceType = reader.int32(); + break; + } + case 4: { + message.batteryStatus = reader.string(); + break; + } + case 5: { + message.batteryLevel = reader.int32(); + break; + } + case 6: { + message.lastSyncTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.deviceVersion = reader.string(); + break; + } + case 8: { + message.macAddress = reader.string(); + break; + } + case 9: { + if (!(message.features && message.features.length)) + message.features = []; + message.features.push(reader.string()); break; } default: @@ -31060,125 +48028,240 @@ }; /** - * Decodes an ExportExerciseTcxResponse message from the specified reader or buffer, length delimited. + * Decodes a PairedDevice message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @memberof google.devicesandservices.health.v4.PairedDevice * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.ExportExerciseTcxResponse} ExportExerciseTcxResponse + * @returns {google.devicesandservices.health.v4.PairedDevice} PairedDevice * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportExerciseTcxResponse.decodeDelimited = function decodeDelimited(reader) { + PairedDevice.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportExerciseTcxResponse message. + * Verifies a PairedDevice message. * @function verify - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @memberof google.devicesandservices.health.v4.PairedDevice * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportExerciseTcxResponse.verify = function verify(message) { + PairedDevice.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tcxData != null && message.hasOwnProperty("tcxData")) - if (!$util.isString(message.tcxData)) - return "tcxData: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.deviceType != null && message.hasOwnProperty("deviceType")) + switch (message.deviceType) { + default: + return "deviceType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.batteryStatus != null && message.hasOwnProperty("batteryStatus")) + if (!$util.isString(message.batteryStatus)) + return "batteryStatus: string expected"; + if (message.batteryLevel != null && message.hasOwnProperty("batteryLevel")) + if (!$util.isInteger(message.batteryLevel)) + return "batteryLevel: integer expected"; + if (message.lastSyncTime != null && message.hasOwnProperty("lastSyncTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastSyncTime); + if (error) + return "lastSyncTime." + error; + } + if (message.deviceVersion != null && message.hasOwnProperty("deviceVersion")) + if (!$util.isString(message.deviceVersion)) + return "deviceVersion: string expected"; + if (message.macAddress != null && message.hasOwnProperty("macAddress")) + if (!$util.isString(message.macAddress)) + return "macAddress: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) + if (!$util.isString(message.features[i])) + return "features: string[] expected"; + } return null; }; /** - * Creates an ExportExerciseTcxResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PairedDevice message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @memberof google.devicesandservices.health.v4.PairedDevice * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.ExportExerciseTcxResponse} ExportExerciseTcxResponse + * @returns {google.devicesandservices.health.v4.PairedDevice} PairedDevice */ - ExportExerciseTcxResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.ExportExerciseTcxResponse) + PairedDevice.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.PairedDevice) return object; - var message = new $root.google.devicesandservices.health.v4.ExportExerciseTcxResponse(); - if (object.tcxData != null) - message.tcxData = String(object.tcxData); + var message = new $root.google.devicesandservices.health.v4.PairedDevice(); + if (object.name != null) + message.name = String(object.name); + switch (object.deviceType) { + default: + if (typeof object.deviceType === "number") { + message.deviceType = object.deviceType; + break; + } + break; + case "DEVICE_TYPE_UNSPECIFIED": + case 0: + message.deviceType = 0; + break; + case "TRACKER": + case 1: + message.deviceType = 1; + break; + case "SCALE": + case 2: + message.deviceType = 2; + break; + } + if (object.batteryStatus != null) + message.batteryStatus = String(object.batteryStatus); + if (object.batteryLevel != null) + message.batteryLevel = object.batteryLevel | 0; + if (object.lastSyncTime != null) { + if (typeof object.lastSyncTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.PairedDevice.lastSyncTime: object expected"); + message.lastSyncTime = $root.google.protobuf.Timestamp.fromObject(object.lastSyncTime); + } + if (object.deviceVersion != null) + message.deviceVersion = String(object.deviceVersion); + if (object.macAddress != null) + message.macAddress = String(object.macAddress); + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.devicesandservices.health.v4.PairedDevice.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) + message.features[i] = String(object.features[i]); + } return message; }; /** - * Creates a plain object from an ExportExerciseTcxResponse message. Also converts values to other types if specified. + * Creates a plain object from a PairedDevice message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @memberof google.devicesandservices.health.v4.PairedDevice * @static - * @param {google.devicesandservices.health.v4.ExportExerciseTcxResponse} message ExportExerciseTcxResponse + * @param {google.devicesandservices.health.v4.PairedDevice} message PairedDevice * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportExerciseTcxResponse.toObject = function toObject(message, options) { + PairedDevice.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.tcxData = ""; - if (message.tcxData != null && message.hasOwnProperty("tcxData")) - object.tcxData = message.tcxData; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.name = ""; + object.deviceType = options.enums === String ? "DEVICE_TYPE_UNSPECIFIED" : 0; + object.batteryStatus = ""; + object.batteryLevel = 0; + object.lastSyncTime = null; + object.deviceVersion = ""; + object.macAddress = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.deviceType != null && message.hasOwnProperty("deviceType")) + object.deviceType = options.enums === String ? $root.google.devicesandservices.health.v4.PairedDevice.DeviceType[message.deviceType] === undefined ? message.deviceType : $root.google.devicesandservices.health.v4.PairedDevice.DeviceType[message.deviceType] : message.deviceType; + if (message.batteryStatus != null && message.hasOwnProperty("batteryStatus")) + object.batteryStatus = message.batteryStatus; + if (message.batteryLevel != null && message.hasOwnProperty("batteryLevel")) + object.batteryLevel = message.batteryLevel; + if (message.lastSyncTime != null && message.hasOwnProperty("lastSyncTime")) + object.lastSyncTime = $root.google.protobuf.Timestamp.toObject(message.lastSyncTime, options); + if (message.deviceVersion != null && message.hasOwnProperty("deviceVersion")) + object.deviceVersion = message.deviceVersion; + if (message.macAddress != null && message.hasOwnProperty("macAddress")) + object.macAddress = message.macAddress; + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = message.features[j]; + } return object; }; /** - * Converts this ExportExerciseTcxResponse to JSON. + * Converts this PairedDevice to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @memberof google.devicesandservices.health.v4.PairedDevice * @instance * @returns {Object.} JSON object */ - ExportExerciseTcxResponse.prototype.toJSON = function toJSON() { + PairedDevice.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExportExerciseTcxResponse + * Gets the default type url for PairedDevice * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.ExportExerciseTcxResponse + * @memberof google.devicesandservices.health.v4.PairedDevice * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExportExerciseTcxResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PairedDevice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.ExportExerciseTcxResponse"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.PairedDevice"; }; - return ExportExerciseTcxResponse; + /** + * DeviceType enum. + * @name google.devicesandservices.health.v4.PairedDevice.DeviceType + * @enum {number} + * @property {number} DEVICE_TYPE_UNSPECIFIED=0 DEVICE_TYPE_UNSPECIFIED value + * @property {number} TRACKER=1 TRACKER value + * @property {number} SCALE=2 SCALE value + */ + PairedDevice.DeviceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEVICE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRACKER"] = 1; + values[valuesById[2] = "SCALE"] = 2; + return values; + })(); + + return PairedDevice; })(); - v4.DataSource = (function() { + v4.IrnProfile = (function() { /** - * Properties of a DataSource. + * Properties of an IrnProfile. * @memberof google.devicesandservices.health.v4 - * @interface IDataSource - * @property {google.devicesandservices.health.v4.DataSource.RecordingMethod|null} [recordingMethod] DataSource recordingMethod - * @property {google.devicesandservices.health.v4.DataSource.IDevice|null} [device] DataSource device - * @property {google.devicesandservices.health.v4.DataSource.IApplication|null} [application] DataSource application - * @property {google.devicesandservices.health.v4.DataSource.Platform|null} [platform] DataSource platform + * @interface IIrnProfile + * @property {string|null} [name] IrnProfile name + * @property {boolean|null} [onboardingStatus] IrnProfile onboardingStatus + * @property {boolean|null} [enrollmentStatus] IrnProfile enrollmentStatus + * @property {google.protobuf.ITimestamp|null} [updateTime] IrnProfile updateTime */ /** - * Constructs a new DataSource. + * Constructs a new IrnProfile. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a DataSource. - * @implements IDataSource + * @classdesc Represents an IrnProfile. + * @implements IIrnProfile * @constructor - * @param {google.devicesandservices.health.v4.IDataSource=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IIrnProfile=} [properties] Properties to set */ - function DataSource(properties) { + function IrnProfile(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31186,119 +48269,119 @@ } /** - * DataSource recordingMethod. - * @member {google.devicesandservices.health.v4.DataSource.RecordingMethod} recordingMethod - * @memberof google.devicesandservices.health.v4.DataSource + * IrnProfile name. + * @member {string} name + * @memberof google.devicesandservices.health.v4.IrnProfile * @instance */ - DataSource.prototype.recordingMethod = 0; + IrnProfile.prototype.name = ""; /** - * DataSource device. - * @member {google.devicesandservices.health.v4.DataSource.IDevice|null|undefined} device - * @memberof google.devicesandservices.health.v4.DataSource + * IrnProfile onboardingStatus. + * @member {boolean} onboardingStatus + * @memberof google.devicesandservices.health.v4.IrnProfile * @instance */ - DataSource.prototype.device = null; + IrnProfile.prototype.onboardingStatus = false; /** - * DataSource application. - * @member {google.devicesandservices.health.v4.DataSource.IApplication|null|undefined} application - * @memberof google.devicesandservices.health.v4.DataSource + * IrnProfile enrollmentStatus. + * @member {boolean} enrollmentStatus + * @memberof google.devicesandservices.health.v4.IrnProfile * @instance */ - DataSource.prototype.application = null; + IrnProfile.prototype.enrollmentStatus = false; /** - * DataSource platform. - * @member {google.devicesandservices.health.v4.DataSource.Platform} platform - * @memberof google.devicesandservices.health.v4.DataSource + * IrnProfile updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.devicesandservices.health.v4.IrnProfile * @instance */ - DataSource.prototype.platform = 0; + IrnProfile.prototype.updateTime = null; /** - * Creates a new DataSource instance using the specified properties. + * Creates a new IrnProfile instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.DataSource + * @memberof google.devicesandservices.health.v4.IrnProfile * @static - * @param {google.devicesandservices.health.v4.IDataSource=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.DataSource} DataSource instance + * @param {google.devicesandservices.health.v4.IIrnProfile=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.IrnProfile} IrnProfile instance */ - DataSource.create = function create(properties) { - return new DataSource(properties); + IrnProfile.create = function create(properties) { + return new IrnProfile(properties); }; /** - * Encodes the specified DataSource message. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.verify|verify} messages. + * Encodes the specified IrnProfile message. Does not implicitly {@link google.devicesandservices.health.v4.IrnProfile.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.DataSource + * @memberof google.devicesandservices.health.v4.IrnProfile * @static - * @param {google.devicesandservices.health.v4.IDataSource} message DataSource message or plain object to encode + * @param {google.devicesandservices.health.v4.IIrnProfile} message IrnProfile message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataSource.encode = function encode(message, writer) { + IrnProfile.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.recordingMethod != null && Object.hasOwnProperty.call(message, "recordingMethod")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.recordingMethod); - if (message.device != null && Object.hasOwnProperty.call(message, "device")) - $root.google.devicesandservices.health.v4.DataSource.Device.encode(message.device, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.application != null && Object.hasOwnProperty.call(message, "application")) - $root.google.devicesandservices.health.v4.DataSource.Application.encode(message.application, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.platform != null && Object.hasOwnProperty.call(message, "platform")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.platform); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.onboardingStatus != null && Object.hasOwnProperty.call(message, "onboardingStatus")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.onboardingStatus); + if (message.enrollmentStatus != null && Object.hasOwnProperty.call(message, "enrollmentStatus")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enrollmentStatus); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.verify|verify} messages. + * Encodes the specified IrnProfile message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.IrnProfile.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.DataSource + * @memberof google.devicesandservices.health.v4.IrnProfile * @static - * @param {google.devicesandservices.health.v4.IDataSource} message DataSource message or plain object to encode + * @param {google.devicesandservices.health.v4.IIrnProfile} message IrnProfile message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataSource.encodeDelimited = function encodeDelimited(message, writer) { + IrnProfile.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DataSource message from the specified reader or buffer. + * Decodes an IrnProfile message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.DataSource + * @memberof google.devicesandservices.health.v4.IrnProfile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.DataSource} DataSource + * @returns {google.devicesandservices.health.v4.IrnProfile} IrnProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DataSource.decode = function decode(reader, length, error) { + IrnProfile.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DataSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.IrnProfile(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.recordingMethod = reader.int32(); + message.name = reader.string(); break; } case 2: { - message.device = $root.google.devicesandservices.health.v4.DataSource.Device.decode(reader, reader.uint32()); + message.onboardingStatus = reader.bool(); break; } case 3: { - message.application = $root.google.devicesandservices.health.v4.DataSource.Application.decode(reader, reader.uint32()); + message.enrollmentStatus = reader.bool(); break; } case 4: { - message.platform = reader.int32(); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -31310,1099 +48393,1057 @@ }; /** - * Decodes a DataSource message from the specified reader or buffer, length delimited. + * Decodes an IrnProfile message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.DataSource + * @memberof google.devicesandservices.health.v4.IrnProfile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.DataSource} DataSource + * @returns {google.devicesandservices.health.v4.IrnProfile} IrnProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DataSource.decodeDelimited = function decodeDelimited(reader) { + IrnProfile.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DataSource message. + * Verifies an IrnProfile message. * @function verify - * @memberof google.devicesandservices.health.v4.DataSource + * @memberof google.devicesandservices.health.v4.IrnProfile * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DataSource.verify = function verify(message) { + IrnProfile.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.recordingMethod != null && message.hasOwnProperty("recordingMethod")) - switch (message.recordingMethod) { - default: - return "recordingMethod: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.device != null && message.hasOwnProperty("device")) { - var error = $root.google.devicesandservices.health.v4.DataSource.Device.verify(message.device); - if (error) - return "device." + error; - } - if (message.application != null && message.hasOwnProperty("application")) { - var error = $root.google.devicesandservices.health.v4.DataSource.Application.verify(message.application); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.onboardingStatus != null && message.hasOwnProperty("onboardingStatus")) + if (typeof message.onboardingStatus !== "boolean") + return "onboardingStatus: boolean expected"; + if (message.enrollmentStatus != null && message.hasOwnProperty("enrollmentStatus")) + if (typeof message.enrollmentStatus !== "boolean") + return "enrollmentStatus: boolean expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); if (error) - return "application." + error; + return "updateTime." + error; } - if (message.platform != null && message.hasOwnProperty("platform")) - switch (message.platform) { - default: - return "platform: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } return null; }; /** - * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * Creates an IrnProfile message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.DataSource + * @memberof google.devicesandservices.health.v4.IrnProfile * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.DataSource} DataSource + * @returns {google.devicesandservices.health.v4.IrnProfile} IrnProfile */ - DataSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.DataSource) + IrnProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.IrnProfile) return object; - var message = new $root.google.devicesandservices.health.v4.DataSource(); - switch (object.recordingMethod) { - default: - if (typeof object.recordingMethod === "number") { - message.recordingMethod = object.recordingMethod; - break; - } - break; - case "RECORDING_METHOD_UNSPECIFIED": - case 0: - message.recordingMethod = 0; - break; - case "MANUAL": - case 1: - message.recordingMethod = 1; - break; - case "PASSIVELY_MEASURED": - case 2: - message.recordingMethod = 2; - break; - case "DERIVED": - case 3: - message.recordingMethod = 3; - break; - case "ACTIVELY_MEASURED": - case 4: - message.recordingMethod = 4; - break; - case "UNKNOWN": - case 5: - message.recordingMethod = 5; - break; - } - if (object.device != null) { - if (typeof object.device !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataSource.device: object expected"); - message.device = $root.google.devicesandservices.health.v4.DataSource.Device.fromObject(object.device); - } - if (object.application != null) { - if (typeof object.application !== "object") - throw TypeError(".google.devicesandservices.health.v4.DataSource.application: object expected"); - message.application = $root.google.devicesandservices.health.v4.DataSource.Application.fromObject(object.application); - } - switch (object.platform) { - default: - if (typeof object.platform === "number") { - message.platform = object.platform; - break; - } - break; - case "PLATFORM_UNSPECIFIED": - case 0: - message.platform = 0; - break; - case "FITBIT": - case 1: - message.platform = 1; - break; - case "HEALTH_CONNECT": - case 2: - message.platform = 2; - break; - case "HEALTH_KIT": - case 3: - message.platform = 3; - break; - case "FIT": - case 4: - message.platform = 4; - break; - case "FITBIT_WEB_API": - case 5: - message.platform = 5; - break; - case "NEST": - case 6: - message.platform = 6; - break; - case "GOOGLE_WEB_API": - case 7: - message.platform = 7; - break; - case "GOOGLE_PARTNER_INTEGRATION": - case 8: - message.platform = 8; - break; + var message = new $root.google.devicesandservices.health.v4.IrnProfile(); + if (object.name != null) + message.name = String(object.name); + if (object.onboardingStatus != null) + message.onboardingStatus = Boolean(object.onboardingStatus); + if (object.enrollmentStatus != null) + message.enrollmentStatus = Boolean(object.enrollmentStatus); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.devicesandservices.health.v4.IrnProfile.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } return message; }; /** - * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * Creates a plain object from an IrnProfile message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.DataSource + * @memberof google.devicesandservices.health.v4.IrnProfile * @static - * @param {google.devicesandservices.health.v4.DataSource} message DataSource + * @param {google.devicesandservices.health.v4.IrnProfile} message IrnProfile * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DataSource.toObject = function toObject(message, options) { + IrnProfile.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.recordingMethod = options.enums === String ? "RECORDING_METHOD_UNSPECIFIED" : 0; - object.device = null; - object.application = null; - object.platform = options.enums === String ? "PLATFORM_UNSPECIFIED" : 0; + object.name = ""; + object.onboardingStatus = false; + object.enrollmentStatus = false; + object.updateTime = null; } - if (message.recordingMethod != null && message.hasOwnProperty("recordingMethod")) - object.recordingMethod = options.enums === String ? $root.google.devicesandservices.health.v4.DataSource.RecordingMethod[message.recordingMethod] === undefined ? message.recordingMethod : $root.google.devicesandservices.health.v4.DataSource.RecordingMethod[message.recordingMethod] : message.recordingMethod; - if (message.device != null && message.hasOwnProperty("device")) - object.device = $root.google.devicesandservices.health.v4.DataSource.Device.toObject(message.device, options); - if (message.application != null && message.hasOwnProperty("application")) - object.application = $root.google.devicesandservices.health.v4.DataSource.Application.toObject(message.application, options); - if (message.platform != null && message.hasOwnProperty("platform")) - object.platform = options.enums === String ? $root.google.devicesandservices.health.v4.DataSource.Platform[message.platform] === undefined ? message.platform : $root.google.devicesandservices.health.v4.DataSource.Platform[message.platform] : message.platform; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.onboardingStatus != null && message.hasOwnProperty("onboardingStatus")) + object.onboardingStatus = message.onboardingStatus; + if (message.enrollmentStatus != null && message.hasOwnProperty("enrollmentStatus")) + object.enrollmentStatus = message.enrollmentStatus; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** - * Converts this DataSource to JSON. + * Converts this IrnProfile to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.DataSource + * @memberof google.devicesandservices.health.v4.IrnProfile * @instance * @returns {Object.} JSON object */ - DataSource.prototype.toJSON = function toJSON() { + IrnProfile.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DataSource + * Gets the default type url for IrnProfile * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.DataSource + * @memberof google.devicesandservices.health.v4.IrnProfile * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DataSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + IrnProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.DataSource"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.IrnProfile"; }; - DataSource.Device = (function() { - - /** - * Properties of a Device. - * @memberof google.devicesandservices.health.v4.DataSource - * @interface IDevice - * @property {google.devicesandservices.health.v4.DataSource.Device.FormFactor|null} [formFactor] Device formFactor - * @property {string|null} [manufacturer] Device manufacturer - * @property {string|null} [displayName] Device displayName - */ - - /** - * Constructs a new Device. - * @memberof google.devicesandservices.health.v4.DataSource - * @classdesc Represents a Device. - * @implements IDevice - * @constructor - * @param {google.devicesandservices.health.v4.DataSource.IDevice=} [properties] Properties to set - */ - function Device(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Device formFactor. - * @member {google.devicesandservices.health.v4.DataSource.Device.FormFactor} formFactor - * @memberof google.devicesandservices.health.v4.DataSource.Device - * @instance - */ - Device.prototype.formFactor = 0; - - /** - * Device manufacturer. - * @member {string} manufacturer - * @memberof google.devicesandservices.health.v4.DataSource.Device - * @instance - */ - Device.prototype.manufacturer = ""; - - /** - * Device displayName. - * @member {string} displayName - * @memberof google.devicesandservices.health.v4.DataSource.Device - * @instance - */ - Device.prototype.displayName = ""; - - /** - * Creates a new Device instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.DataSource.Device - * @static - * @param {google.devicesandservices.health.v4.DataSource.IDevice=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.DataSource.Device} Device instance - */ - Device.create = function create(properties) { - return new Device(properties); - }; - - /** - * Encodes the specified Device message. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Device.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.DataSource.Device - * @static - * @param {google.devicesandservices.health.v4.DataSource.IDevice} message Device message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Device.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.formFactor != null && Object.hasOwnProperty.call(message, "formFactor")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.formFactor); - if (message.manufacturer != null && Object.hasOwnProperty.call(message, "manufacturer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.manufacturer); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified Device message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Device.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.DataSource.Device - * @static - * @param {google.devicesandservices.health.v4.DataSource.IDevice} message Device message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Device.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Device message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.DataSource.Device - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.DataSource.Device} Device - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Device.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DataSource.Device(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.formFactor = reader.int32(); - break; - } - case 2: { - message.manufacturer = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Device message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.DataSource.Device - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.DataSource.Device} Device - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Device.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Device message. - * @function verify - * @memberof google.devicesandservices.health.v4.DataSource.Device - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Device.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.formFactor != null && message.hasOwnProperty("formFactor")) - switch (message.formFactor) { - default: - return "formFactor: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.manufacturer != null && message.hasOwnProperty("manufacturer")) - if (!$util.isString(message.manufacturer)) - return "manufacturer: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates a Device message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.DataSource.Device - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.DataSource.Device} Device - */ - Device.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.DataSource.Device) - return object; - var message = new $root.google.devicesandservices.health.v4.DataSource.Device(); - switch (object.formFactor) { - default: - if (typeof object.formFactor === "number") { - message.formFactor = object.formFactor; - break; - } - break; - case "FORM_FACTOR_UNSPECIFIED": - case 0: - message.formFactor = 0; - break; - case "FITNESS_BAND": - case 1: - message.formFactor = 1; - break; - case "WATCH": - case 2: - message.formFactor = 2; - break; - case "PHONE": - case 3: - message.formFactor = 3; - break; - case "RING": - case 4: - message.formFactor = 4; - break; - case "CHEST_STRAP": - case 5: - message.formFactor = 5; - break; - case "SCALE": - case 6: - message.formFactor = 6; - break; - case "TABLET": - case 7: - message.formFactor = 7; - break; - case "HEAD_MOUNTED": - case 8: - message.formFactor = 8; - break; - case "SMART_DISPLAY": - case 9: - message.formFactor = 9; - break; - } - if (object.manufacturer != null) - message.manufacturer = String(object.manufacturer); - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from a Device message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.DataSource.Device - * @static - * @param {google.devicesandservices.health.v4.DataSource.Device} message Device - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Device.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.formFactor = options.enums === String ? "FORM_FACTOR_UNSPECIFIED" : 0; - object.manufacturer = ""; - object.displayName = ""; - } - if (message.formFactor != null && message.hasOwnProperty("formFactor")) - object.formFactor = options.enums === String ? $root.google.devicesandservices.health.v4.DataSource.Device.FormFactor[message.formFactor] === undefined ? message.formFactor : $root.google.devicesandservices.health.v4.DataSource.Device.FormFactor[message.formFactor] : message.formFactor; - if (message.manufacturer != null && message.hasOwnProperty("manufacturer")) - object.manufacturer = message.manufacturer; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this Device to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.DataSource.Device - * @instance - * @returns {Object.} JSON object - */ - Device.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Device - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.DataSource.Device - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Device.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.DataSource.Device"; - }; - - /** - * FormFactor enum. - * @name google.devicesandservices.health.v4.DataSource.Device.FormFactor - * @enum {number} - * @property {number} FORM_FACTOR_UNSPECIFIED=0 FORM_FACTOR_UNSPECIFIED value - * @property {number} FITNESS_BAND=1 FITNESS_BAND value - * @property {number} WATCH=2 WATCH value - * @property {number} PHONE=3 PHONE value - * @property {number} RING=4 RING value - * @property {number} CHEST_STRAP=5 CHEST_STRAP value - * @property {number} SCALE=6 SCALE value - * @property {number} TABLET=7 TABLET value - * @property {number} HEAD_MOUNTED=8 HEAD_MOUNTED value - * @property {number} SMART_DISPLAY=9 SMART_DISPLAY value - */ - Device.FormFactor = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FORM_FACTOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "FITNESS_BAND"] = 1; - values[valuesById[2] = "WATCH"] = 2; - values[valuesById[3] = "PHONE"] = 3; - values[valuesById[4] = "RING"] = 4; - values[valuesById[5] = "CHEST_STRAP"] = 5; - values[valuesById[6] = "SCALE"] = 6; - values[valuesById[7] = "TABLET"] = 7; - values[valuesById[8] = "HEAD_MOUNTED"] = 8; - values[valuesById[9] = "SMART_DISPLAY"] = 9; - return values; - })(); + return IrnProfile; + })(); - return Device; - })(); + v4.Settings = (function() { - DataSource.Application = (function() { + /** + * Properties of a Settings. + * @memberof google.devicesandservices.health.v4 + * @interface ISettings + * @property {string|null} [name] Settings name + * @property {boolean|null} [autoStrideEnabled] Settings autoStrideEnabled + * @property {google.devicesandservices.health.v4.Settings.DistanceUnit|null} [distanceUnit] Settings distanceUnit + * @property {google.devicesandservices.health.v4.Settings.GlucoseUnit|null} [glucoseUnit] Settings glucoseUnit + * @property {google.devicesandservices.health.v4.Settings.HeightUnit|null} [heightUnit] Settings heightUnit + * @property {string|null} [languageLocale] Settings languageLocale + * @property {google.protobuf.IDuration|null} [utcOffset] Settings utcOffset + * @property {google.devicesandservices.health.v4.Settings.StrideLengthType|null} [strideLengthWalkingType] Settings strideLengthWalkingType + * @property {google.devicesandservices.health.v4.Settings.StrideLengthType|null} [strideLengthRunningType] Settings strideLengthRunningType + * @property {google.devicesandservices.health.v4.Settings.SwimUnit|null} [swimUnit] Settings swimUnit + * @property {google.devicesandservices.health.v4.Settings.TemperatureUnit|null} [temperatureUnit] Settings temperatureUnit + * @property {string|null} [timeZone] Settings timeZone + * @property {google.devicesandservices.health.v4.Settings.WeightUnit|null} [weightUnit] Settings weightUnit + * @property {google.devicesandservices.health.v4.Settings.WaterUnit|null} [waterUnit] Settings waterUnit + * @property {string|null} [foodLanguageCode] Settings foodLanguageCode + */ - /** - * Properties of an Application. - * @memberof google.devicesandservices.health.v4.DataSource - * @interface IApplication - * @property {string|null} [packageName] Application packageName - * @property {string|null} [webClientId] Application webClientId - * @property {string|null} [googleWebClientId] Application googleWebClientId - */ + /** + * Constructs a new Settings. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a Settings. + * @implements ISettings + * @constructor + * @param {google.devicesandservices.health.v4.ISettings=} [properties] Properties to set + */ + function Settings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new Application. - * @memberof google.devicesandservices.health.v4.DataSource - * @classdesc Represents an Application. - * @implements IApplication - * @constructor - * @param {google.devicesandservices.health.v4.DataSource.IApplication=} [properties] Properties to set - */ - function Application(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Settings name. + * @member {string} name + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.name = ""; - /** - * Application packageName. - * @member {string} packageName - * @memberof google.devicesandservices.health.v4.DataSource.Application - * @instance - */ - Application.prototype.packageName = ""; + /** + * Settings autoStrideEnabled. + * @member {boolean} autoStrideEnabled + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.autoStrideEnabled = false; - /** - * Application webClientId. - * @member {string} webClientId - * @memberof google.devicesandservices.health.v4.DataSource.Application - * @instance - */ - Application.prototype.webClientId = ""; + /** + * Settings distanceUnit. + * @member {google.devicesandservices.health.v4.Settings.DistanceUnit} distanceUnit + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.distanceUnit = 0; - /** - * Application googleWebClientId. - * @member {string} googleWebClientId - * @memberof google.devicesandservices.health.v4.DataSource.Application - * @instance - */ - Application.prototype.googleWebClientId = ""; + /** + * Settings glucoseUnit. + * @member {google.devicesandservices.health.v4.Settings.GlucoseUnit} glucoseUnit + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.glucoseUnit = 0; - /** - * Creates a new Application instance using the specified properties. - * @function create - * @memberof google.devicesandservices.health.v4.DataSource.Application - * @static - * @param {google.devicesandservices.health.v4.DataSource.IApplication=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.DataSource.Application} Application instance - */ - Application.create = function create(properties) { - return new Application(properties); - }; + /** + * Settings heightUnit. + * @member {google.devicesandservices.health.v4.Settings.HeightUnit} heightUnit + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.heightUnit = 0; - /** - * Encodes the specified Application message. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Application.verify|verify} messages. - * @function encode - * @memberof google.devicesandservices.health.v4.DataSource.Application - * @static - * @param {google.devicesandservices.health.v4.DataSource.IApplication} message Application message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Application.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packageName != null && Object.hasOwnProperty.call(message, "packageName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.packageName); - if (message.webClientId != null && Object.hasOwnProperty.call(message, "webClientId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.webClientId); - if (message.googleWebClientId != null && Object.hasOwnProperty.call(message, "googleWebClientId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.googleWebClientId); - return writer; - }; + /** + * Settings languageLocale. + * @member {string} languageLocale + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.languageLocale = ""; - /** - * Encodes the specified Application message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.DataSource.Application.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.DataSource.Application - * @static - * @param {google.devicesandservices.health.v4.DataSource.IApplication} message Application message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Application.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Settings utcOffset. + * @member {google.protobuf.IDuration|null|undefined} utcOffset + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.utcOffset = null; - /** - * Decodes an Application message from the specified reader or buffer. - * @function decode - * @memberof google.devicesandservices.health.v4.DataSource.Application - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.DataSource.Application} Application - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Application.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.DataSource.Application(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.packageName = reader.string(); - break; - } - case 2: { - message.webClientId = reader.string(); - break; - } - case 3: { - message.googleWebClientId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Settings strideLengthWalkingType. + * @member {google.devicesandservices.health.v4.Settings.StrideLengthType} strideLengthWalkingType + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.strideLengthWalkingType = 0; - /** - * Decodes an Application message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.DataSource.Application - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.DataSource.Application} Application - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Application.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Settings strideLengthRunningType. + * @member {google.devicesandservices.health.v4.Settings.StrideLengthType} strideLengthRunningType + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.strideLengthRunningType = 0; - /** - * Verifies an Application message. - * @function verify - * @memberof google.devicesandservices.health.v4.DataSource.Application - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Application.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packageName != null && message.hasOwnProperty("packageName")) - if (!$util.isString(message.packageName)) - return "packageName: string expected"; - if (message.webClientId != null && message.hasOwnProperty("webClientId")) - if (!$util.isString(message.webClientId)) - return "webClientId: string expected"; - if (message.googleWebClientId != null && message.hasOwnProperty("googleWebClientId")) - if (!$util.isString(message.googleWebClientId)) - return "googleWebClientId: string expected"; - return null; - }; + /** + * Settings swimUnit. + * @member {google.devicesandservices.health.v4.Settings.SwimUnit} swimUnit + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.swimUnit = 0; - /** - * Creates an Application message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.devicesandservices.health.v4.DataSource.Application - * @static - * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.DataSource.Application} Application - */ - Application.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.DataSource.Application) - return object; - var message = new $root.google.devicesandservices.health.v4.DataSource.Application(); - if (object.packageName != null) - message.packageName = String(object.packageName); - if (object.webClientId != null) - message.webClientId = String(object.webClientId); - if (object.googleWebClientId != null) - message.googleWebClientId = String(object.googleWebClientId); - return message; - }; + /** + * Settings temperatureUnit. + * @member {google.devicesandservices.health.v4.Settings.TemperatureUnit} temperatureUnit + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.temperatureUnit = 0; - /** - * Creates a plain object from an Application message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devicesandservices.health.v4.DataSource.Application - * @static - * @param {google.devicesandservices.health.v4.DataSource.Application} message Application - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Application.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.packageName = ""; - object.webClientId = ""; - object.googleWebClientId = ""; - } - if (message.packageName != null && message.hasOwnProperty("packageName")) - object.packageName = message.packageName; - if (message.webClientId != null && message.hasOwnProperty("webClientId")) - object.webClientId = message.webClientId; - if (message.googleWebClientId != null && message.hasOwnProperty("googleWebClientId")) - object.googleWebClientId = message.googleWebClientId; - return object; - }; + /** + * Settings timeZone. + * @member {string} timeZone + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.timeZone = ""; - /** - * Converts this Application to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.DataSource.Application - * @instance - * @returns {Object.} JSON object - */ - Application.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Settings weightUnit. + * @member {google.devicesandservices.health.v4.Settings.WeightUnit} weightUnit + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.weightUnit = 0; - /** - * Gets the default type url for Application - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.DataSource.Application - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Application.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.DataSource.Application"; - }; + /** + * Settings waterUnit. + * @member {google.devicesandservices.health.v4.Settings.WaterUnit} waterUnit + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.waterUnit = 0; - return Application; - })(); + /** + * Settings foodLanguageCode. + * @member {string} foodLanguageCode + * @memberof google.devicesandservices.health.v4.Settings + * @instance + */ + Settings.prototype.foodLanguageCode = ""; /** - * RecordingMethod enum. - * @name google.devicesandservices.health.v4.DataSource.RecordingMethod - * @enum {number} - * @property {number} RECORDING_METHOD_UNSPECIFIED=0 RECORDING_METHOD_UNSPECIFIED value - * @property {number} MANUAL=1 MANUAL value - * @property {number} PASSIVELY_MEASURED=2 PASSIVELY_MEASURED value - * @property {number} DERIVED=3 DERIVED value - * @property {number} ACTIVELY_MEASURED=4 ACTIVELY_MEASURED value - * @property {number} UNKNOWN=5 UNKNOWN value + * Creates a new Settings instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.Settings + * @static + * @param {google.devicesandservices.health.v4.ISettings=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Settings} Settings instance */ - DataSource.RecordingMethod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RECORDING_METHOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "MANUAL"] = 1; - values[valuesById[2] = "PASSIVELY_MEASURED"] = 2; - values[valuesById[3] = "DERIVED"] = 3; - values[valuesById[4] = "ACTIVELY_MEASURED"] = 4; - values[valuesById[5] = "UNKNOWN"] = 5; - return values; - })(); + Settings.create = function create(properties) { + return new Settings(properties); + }; /** - * Platform enum. - * @name google.devicesandservices.health.v4.DataSource.Platform - * @enum {number} - * @property {number} PLATFORM_UNSPECIFIED=0 PLATFORM_UNSPECIFIED value - * @property {number} FITBIT=1 FITBIT value - * @property {number} HEALTH_CONNECT=2 HEALTH_CONNECT value - * @property {number} HEALTH_KIT=3 HEALTH_KIT value - * @property {number} FIT=4 FIT value - * @property {number} FITBIT_WEB_API=5 FITBIT_WEB_API value - * @property {number} NEST=6 NEST value - * @property {number} GOOGLE_WEB_API=7 GOOGLE_WEB_API value - * @property {number} GOOGLE_PARTNER_INTEGRATION=8 GOOGLE_PARTNER_INTEGRATION value + * Encodes the specified Settings message. Does not implicitly {@link google.devicesandservices.health.v4.Settings.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.Settings + * @static + * @param {google.devicesandservices.health.v4.ISettings} message Settings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - DataSource.Platform = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PLATFORM_UNSPECIFIED"] = 0; - values[valuesById[1] = "FITBIT"] = 1; - values[valuesById[2] = "HEALTH_CONNECT"] = 2; - values[valuesById[3] = "HEALTH_KIT"] = 3; - values[valuesById[4] = "FIT"] = 4; - values[valuesById[5] = "FITBIT_WEB_API"] = 5; - values[valuesById[6] = "NEST"] = 6; - values[valuesById[7] = "GOOGLE_WEB_API"] = 7; - values[valuesById[8] = "GOOGLE_PARTNER_INTEGRATION"] = 8; - return values; - })(); + Settings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.autoStrideEnabled != null && Object.hasOwnProperty.call(message, "autoStrideEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.autoStrideEnabled); + if (message.distanceUnit != null && Object.hasOwnProperty.call(message, "distanceUnit")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.distanceUnit); + if (message.glucoseUnit != null && Object.hasOwnProperty.call(message, "glucoseUnit")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.glucoseUnit); + if (message.heightUnit != null && Object.hasOwnProperty.call(message, "heightUnit")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.heightUnit); + if (message.languageLocale != null && Object.hasOwnProperty.call(message, "languageLocale")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.languageLocale); + if (message.utcOffset != null && Object.hasOwnProperty.call(message, "utcOffset")) + $root.google.protobuf.Duration.encode(message.utcOffset, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.strideLengthWalkingType != null && Object.hasOwnProperty.call(message, "strideLengthWalkingType")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.strideLengthWalkingType); + if (message.strideLengthRunningType != null && Object.hasOwnProperty.call(message, "strideLengthRunningType")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.strideLengthRunningType); + if (message.swimUnit != null && Object.hasOwnProperty.call(message, "swimUnit")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.swimUnit); + if (message.temperatureUnit != null && Object.hasOwnProperty.call(message, "temperatureUnit")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.temperatureUnit); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.timeZone); + if (message.weightUnit != null && Object.hasOwnProperty.call(message, "weightUnit")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.weightUnit); + if (message.waterUnit != null && Object.hasOwnProperty.call(message, "waterUnit")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.waterUnit); + if (message.foodLanguageCode != null && Object.hasOwnProperty.call(message, "foodLanguageCode")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.foodLanguageCode); + return writer; + }; - return DataSource; - })(); + /** + * Encodes the specified Settings message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Settings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.Settings + * @static + * @param {google.devicesandservices.health.v4.ISettings} message Settings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Settings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - v4.HealthProfileService = (function() { + /** + * Decodes a Settings message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.Settings} Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Settings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Settings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.autoStrideEnabled = reader.bool(); + break; + } + case 5: { + message.distanceUnit = reader.int32(); + break; + } + case 7: { + message.glucoseUnit = reader.int32(); + break; + } + case 8: { + message.heightUnit = reader.int32(); + break; + } + case 9: { + message.languageLocale = reader.string(); + break; + } + case 10: { + message.utcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 13: { + message.strideLengthWalkingType = reader.int32(); + break; + } + case 14: { + message.strideLengthRunningType = reader.int32(); + break; + } + case 15: { + message.swimUnit = reader.int32(); + break; + } + case 16: { + message.temperatureUnit = reader.int32(); + break; + } + case 17: { + message.timeZone = reader.string(); + break; + } + case 18: { + message.weightUnit = reader.int32(); + break; + } + case 19: { + message.waterUnit = reader.int32(); + break; + } + case 20: { + message.foodLanguageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Constructs a new HealthProfileService service. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a HealthProfileService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * Decodes a Settings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.Settings} Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - function HealthProfileService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + Settings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - (HealthProfileService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = HealthProfileService; + /** + * Verifies a Settings message. + * @function verify + * @memberof google.devicesandservices.health.v4.Settings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Settings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.autoStrideEnabled != null && message.hasOwnProperty("autoStrideEnabled")) + if (typeof message.autoStrideEnabled !== "boolean") + return "autoStrideEnabled: boolean expected"; + if (message.distanceUnit != null && message.hasOwnProperty("distanceUnit")) + switch (message.distanceUnit) { + default: + return "distanceUnit: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.glucoseUnit != null && message.hasOwnProperty("glucoseUnit")) + switch (message.glucoseUnit) { + default: + return "glucoseUnit: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.heightUnit != null && message.hasOwnProperty("heightUnit")) + switch (message.heightUnit) { + default: + return "heightUnit: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.languageLocale != null && message.hasOwnProperty("languageLocale")) + if (!$util.isString(message.languageLocale)) + return "languageLocale: string expected"; + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { + var error = $root.google.protobuf.Duration.verify(message.utcOffset); + if (error) + return "utcOffset." + error; + } + if (message.strideLengthWalkingType != null && message.hasOwnProperty("strideLengthWalkingType")) + switch (message.strideLengthWalkingType) { + default: + return "strideLengthWalkingType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.strideLengthRunningType != null && message.hasOwnProperty("strideLengthRunningType")) + switch (message.strideLengthRunningType) { + default: + return "strideLengthRunningType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.swimUnit != null && message.hasOwnProperty("swimUnit")) + switch (message.swimUnit) { + default: + return "swimUnit: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.temperatureUnit != null && message.hasOwnProperty("temperatureUnit")) + switch (message.temperatureUnit) { + default: + return "temperatureUnit: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.weightUnit != null && message.hasOwnProperty("weightUnit")) + switch (message.weightUnit) { + default: + return "weightUnit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.waterUnit != null && message.hasOwnProperty("waterUnit")) + switch (message.waterUnit) { + default: + return "waterUnit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.foodLanguageCode != null && message.hasOwnProperty("foodLanguageCode")) + if (!$util.isString(message.foodLanguageCode)) + return "foodLanguageCode: string expected"; + return null; + }; /** - * Creates new HealthProfileService service using the specified rpc implementation. - * @function create - * @memberof google.devicesandservices.health.v4.HealthProfileService + * Creates a Settings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.Settings * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {HealthProfileService} RPC service. Useful where requests and/or responses are streamed. + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.Settings} Settings */ - HealthProfileService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + Settings.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Settings) + return object; + var message = new $root.google.devicesandservices.health.v4.Settings(); + if (object.name != null) + message.name = String(object.name); + if (object.autoStrideEnabled != null) + message.autoStrideEnabled = Boolean(object.autoStrideEnabled); + switch (object.distanceUnit) { + default: + if (typeof object.distanceUnit === "number") { + message.distanceUnit = object.distanceUnit; + break; + } + break; + case "DISTANCE_UNIT_UNSPECIFIED": + case 0: + message.distanceUnit = 0; + break; + case "DISTANCE_UNIT_MILES": + case 1: + message.distanceUnit = 1; + break; + case "DISTANCE_UNIT_KILOMETERS": + case 2: + message.distanceUnit = 2; + break; + } + switch (object.glucoseUnit) { + default: + if (typeof object.glucoseUnit === "number") { + message.glucoseUnit = object.glucoseUnit; + break; + } + break; + case "GLUCOSE_UNIT_UNSPECIFIED": + case 0: + message.glucoseUnit = 0; + break; + case "GLUCOSE_UNIT_MG_DL": + case 1: + message.glucoseUnit = 1; + break; + case "GLUCOSE_UNIT_MMOL_L": + case 2: + message.glucoseUnit = 2; + break; + } + switch (object.heightUnit) { + default: + if (typeof object.heightUnit === "number") { + message.heightUnit = object.heightUnit; + break; + } + break; + case "HEIGHT_UNIT_UNSPECIFIED": + case 0: + message.heightUnit = 0; + break; + case "HEIGHT_UNIT_INCHES": + case 1: + message.heightUnit = 1; + break; + case "HEIGHT_UNIT_CENTIMETERS": + case 2: + message.heightUnit = 2; + break; + } + if (object.languageLocale != null) + message.languageLocale = String(object.languageLocale); + if (object.utcOffset != null) { + if (typeof object.utcOffset !== "object") + throw TypeError(".google.devicesandservices.health.v4.Settings.utcOffset: object expected"); + message.utcOffset = $root.google.protobuf.Duration.fromObject(object.utcOffset); + } + switch (object.strideLengthWalkingType) { + default: + if (typeof object.strideLengthWalkingType === "number") { + message.strideLengthWalkingType = object.strideLengthWalkingType; + break; + } + break; + case "STRIDE_LENGTH_TYPE_UNSPECIFIED": + case 0: + message.strideLengthWalkingType = 0; + break; + case "STRIDE_LENGTH_TYPE_DEFAULT": + case 1: + message.strideLengthWalkingType = 1; + break; + case "STRIDE_LENGTH_TYPE_MANUAL": + case 2: + message.strideLengthWalkingType = 2; + break; + case "STRIDE_LENGTH_TYPE_AUTO": + case 3: + message.strideLengthWalkingType = 3; + break; + } + switch (object.strideLengthRunningType) { + default: + if (typeof object.strideLengthRunningType === "number") { + message.strideLengthRunningType = object.strideLengthRunningType; + break; + } + break; + case "STRIDE_LENGTH_TYPE_UNSPECIFIED": + case 0: + message.strideLengthRunningType = 0; + break; + case "STRIDE_LENGTH_TYPE_DEFAULT": + case 1: + message.strideLengthRunningType = 1; + break; + case "STRIDE_LENGTH_TYPE_MANUAL": + case 2: + message.strideLengthRunningType = 2; + break; + case "STRIDE_LENGTH_TYPE_AUTO": + case 3: + message.strideLengthRunningType = 3; + break; + } + switch (object.swimUnit) { + default: + if (typeof object.swimUnit === "number") { + message.swimUnit = object.swimUnit; + break; + } + break; + case "SWIM_UNIT_UNSPECIFIED": + case 0: + message.swimUnit = 0; + break; + case "SWIM_UNIT_METERS": + case 1: + message.swimUnit = 1; + break; + case "SWIM_UNIT_YARDS": + case 2: + message.swimUnit = 2; + break; + } + switch (object.temperatureUnit) { + default: + if (typeof object.temperatureUnit === "number") { + message.temperatureUnit = object.temperatureUnit; + break; + } + break; + case "TEMPERATURE_UNIT_UNSPECIFIED": + case 0: + message.temperatureUnit = 0; + break; + case "TEMPERATURE_UNIT_CELSIUS": + case 1: + message.temperatureUnit = 1; + break; + case "TEMPERATURE_UNIT_FAHRENHEIT": + case 2: + message.temperatureUnit = 2; + break; + } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + switch (object.weightUnit) { + default: + if (typeof object.weightUnit === "number") { + message.weightUnit = object.weightUnit; + break; + } + break; + case "WEIGHT_UNIT_UNSPECIFIED": + case 0: + message.weightUnit = 0; + break; + case "WEIGHT_UNIT_POUNDS": + case 1: + message.weightUnit = 1; + break; + case "WEIGHT_UNIT_STONE": + case 2: + message.weightUnit = 2; + break; + case "WEIGHT_UNIT_KILOGRAMS": + case 3: + message.weightUnit = 3; + break; + } + switch (object.waterUnit) { + default: + if (typeof object.waterUnit === "number") { + message.waterUnit = object.waterUnit; + break; + } + break; + case "WATER_UNIT_UNSPECIFIED": + case 0: + message.waterUnit = 0; + break; + case "WATER_UNIT_ML": + case 1: + message.waterUnit = 1; + break; + case "WATER_UNIT_FL_OZ": + case 2: + message.waterUnit = 2; + break; + case "WATER_UNIT_CUP": + case 3: + message.waterUnit = 3; + break; + } + if (object.foodLanguageCode != null) + message.foodLanguageCode = String(object.foodLanguageCode); + return message; }; /** - * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getProfile}. - * @memberof google.devicesandservices.health.v4.HealthProfileService - * @typedef GetProfileCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.devicesandservices.health.v4.Profile} [response] Profile - */ - - /** - * Calls GetProfile. - * @function getProfile - * @memberof google.devicesandservices.health.v4.HealthProfileService - * @instance - * @param {google.devicesandservices.health.v4.IGetProfileRequest} request GetProfileRequest message or plain object - * @param {google.devicesandservices.health.v4.HealthProfileService.GetProfileCallback} callback Node-style callback called with the error, if any, and Profile - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(HealthProfileService.prototype.getProfile = function getProfile(request, callback) { - return this.rpcCall(getProfile, $root.google.devicesandservices.health.v4.GetProfileRequest, $root.google.devicesandservices.health.v4.Profile, request, callback); - }, "name", { value: "GetProfile" }); - - /** - * Calls GetProfile. - * @function getProfile - * @memberof google.devicesandservices.health.v4.HealthProfileService - * @instance - * @param {google.devicesandservices.health.v4.IGetProfileRequest} request GetProfileRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|updateProfile}. - * @memberof google.devicesandservices.health.v4.HealthProfileService - * @typedef UpdateProfileCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.devicesandservices.health.v4.Profile} [response] Profile - */ - - /** - * Calls UpdateProfile. - * @function updateProfile - * @memberof google.devicesandservices.health.v4.HealthProfileService - * @instance - * @param {google.devicesandservices.health.v4.IUpdateProfileRequest} request UpdateProfileRequest message or plain object - * @param {google.devicesandservices.health.v4.HealthProfileService.UpdateProfileCallback} callback Node-style callback called with the error, if any, and Profile - * @returns {undefined} - * @variation 1 + * Creates a plain object from a Settings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.Settings + * @static + * @param {google.devicesandservices.health.v4.Settings} message Settings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(HealthProfileService.prototype.updateProfile = function updateProfile(request, callback) { - return this.rpcCall(updateProfile, $root.google.devicesandservices.health.v4.UpdateProfileRequest, $root.google.devicesandservices.health.v4.Profile, request, callback); - }, "name", { value: "UpdateProfile" }); + Settings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.autoStrideEnabled = false; + object.distanceUnit = options.enums === String ? "DISTANCE_UNIT_UNSPECIFIED" : 0; + object.glucoseUnit = options.enums === String ? "GLUCOSE_UNIT_UNSPECIFIED" : 0; + object.heightUnit = options.enums === String ? "HEIGHT_UNIT_UNSPECIFIED" : 0; + object.languageLocale = ""; + object.utcOffset = null; + object.strideLengthWalkingType = options.enums === String ? "STRIDE_LENGTH_TYPE_UNSPECIFIED" : 0; + object.strideLengthRunningType = options.enums === String ? "STRIDE_LENGTH_TYPE_UNSPECIFIED" : 0; + object.swimUnit = options.enums === String ? "SWIM_UNIT_UNSPECIFIED" : 0; + object.temperatureUnit = options.enums === String ? "TEMPERATURE_UNIT_UNSPECIFIED" : 0; + object.timeZone = ""; + object.weightUnit = options.enums === String ? "WEIGHT_UNIT_UNSPECIFIED" : 0; + object.waterUnit = options.enums === String ? "WATER_UNIT_UNSPECIFIED" : 0; + object.foodLanguageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.autoStrideEnabled != null && message.hasOwnProperty("autoStrideEnabled")) + object.autoStrideEnabled = message.autoStrideEnabled; + if (message.distanceUnit != null && message.hasOwnProperty("distanceUnit")) + object.distanceUnit = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.DistanceUnit[message.distanceUnit] === undefined ? message.distanceUnit : $root.google.devicesandservices.health.v4.Settings.DistanceUnit[message.distanceUnit] : message.distanceUnit; + if (message.glucoseUnit != null && message.hasOwnProperty("glucoseUnit")) + object.glucoseUnit = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.GlucoseUnit[message.glucoseUnit] === undefined ? message.glucoseUnit : $root.google.devicesandservices.health.v4.Settings.GlucoseUnit[message.glucoseUnit] : message.glucoseUnit; + if (message.heightUnit != null && message.hasOwnProperty("heightUnit")) + object.heightUnit = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.HeightUnit[message.heightUnit] === undefined ? message.heightUnit : $root.google.devicesandservices.health.v4.Settings.HeightUnit[message.heightUnit] : message.heightUnit; + if (message.languageLocale != null && message.hasOwnProperty("languageLocale")) + object.languageLocale = message.languageLocale; + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) + object.utcOffset = $root.google.protobuf.Duration.toObject(message.utcOffset, options); + if (message.strideLengthWalkingType != null && message.hasOwnProperty("strideLengthWalkingType")) + object.strideLengthWalkingType = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.StrideLengthType[message.strideLengthWalkingType] === undefined ? message.strideLengthWalkingType : $root.google.devicesandservices.health.v4.Settings.StrideLengthType[message.strideLengthWalkingType] : message.strideLengthWalkingType; + if (message.strideLengthRunningType != null && message.hasOwnProperty("strideLengthRunningType")) + object.strideLengthRunningType = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.StrideLengthType[message.strideLengthRunningType] === undefined ? message.strideLengthRunningType : $root.google.devicesandservices.health.v4.Settings.StrideLengthType[message.strideLengthRunningType] : message.strideLengthRunningType; + if (message.swimUnit != null && message.hasOwnProperty("swimUnit")) + object.swimUnit = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.SwimUnit[message.swimUnit] === undefined ? message.swimUnit : $root.google.devicesandservices.health.v4.Settings.SwimUnit[message.swimUnit] : message.swimUnit; + if (message.temperatureUnit != null && message.hasOwnProperty("temperatureUnit")) + object.temperatureUnit = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.TemperatureUnit[message.temperatureUnit] === undefined ? message.temperatureUnit : $root.google.devicesandservices.health.v4.Settings.TemperatureUnit[message.temperatureUnit] : message.temperatureUnit; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.weightUnit != null && message.hasOwnProperty("weightUnit")) + object.weightUnit = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.WeightUnit[message.weightUnit] === undefined ? message.weightUnit : $root.google.devicesandservices.health.v4.Settings.WeightUnit[message.weightUnit] : message.weightUnit; + if (message.waterUnit != null && message.hasOwnProperty("waterUnit")) + object.waterUnit = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.WaterUnit[message.waterUnit] === undefined ? message.waterUnit : $root.google.devicesandservices.health.v4.Settings.WaterUnit[message.waterUnit] : message.waterUnit; + if (message.foodLanguageCode != null && message.hasOwnProperty("foodLanguageCode")) + object.foodLanguageCode = message.foodLanguageCode; + return object; + }; /** - * Calls UpdateProfile. - * @function updateProfile - * @memberof google.devicesandservices.health.v4.HealthProfileService + * Converts this Settings to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.Settings * @instance - * @param {google.devicesandservices.health.v4.IUpdateProfileRequest} request UpdateProfileRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + Settings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getSettings}. - * @memberof google.devicesandservices.health.v4.HealthProfileService - * @typedef GetSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.devicesandservices.health.v4.Settings} [response] Settings + * Gets the default type url for Settings + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.Settings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + Settings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.Settings"; + }; /** - * Calls GetSettings. - * @function getSettings - * @memberof google.devicesandservices.health.v4.HealthProfileService - * @instance - * @param {google.devicesandservices.health.v4.IGetSettingsRequest} request GetSettingsRequest message or plain object - * @param {google.devicesandservices.health.v4.HealthProfileService.GetSettingsCallback} callback Node-style callback called with the error, if any, and Settings - * @returns {undefined} - * @variation 1 + * DistanceUnit enum. + * @name google.devicesandservices.health.v4.Settings.DistanceUnit + * @enum {number} + * @property {number} DISTANCE_UNIT_UNSPECIFIED=0 DISTANCE_UNIT_UNSPECIFIED value + * @property {number} DISTANCE_UNIT_MILES=1 DISTANCE_UNIT_MILES value + * @property {number} DISTANCE_UNIT_KILOMETERS=2 DISTANCE_UNIT_KILOMETERS value */ - Object.defineProperty(HealthProfileService.prototype.getSettings = function getSettings(request, callback) { - return this.rpcCall(getSettings, $root.google.devicesandservices.health.v4.GetSettingsRequest, $root.google.devicesandservices.health.v4.Settings, request, callback); - }, "name", { value: "GetSettings" }); + Settings.DistanceUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISTANCE_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISTANCE_UNIT_MILES"] = 1; + values[valuesById[2] = "DISTANCE_UNIT_KILOMETERS"] = 2; + return values; + })(); /** - * Calls GetSettings. - * @function getSettings - * @memberof google.devicesandservices.health.v4.HealthProfileService - * @instance - * @param {google.devicesandservices.health.v4.IGetSettingsRequest} request GetSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * GlucoseUnit enum. + * @name google.devicesandservices.health.v4.Settings.GlucoseUnit + * @enum {number} + * @property {number} GLUCOSE_UNIT_UNSPECIFIED=0 GLUCOSE_UNIT_UNSPECIFIED value + * @property {number} GLUCOSE_UNIT_MG_DL=1 GLUCOSE_UNIT_MG_DL value + * @property {number} GLUCOSE_UNIT_MMOL_L=2 GLUCOSE_UNIT_MMOL_L value */ + Settings.GlucoseUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GLUCOSE_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "GLUCOSE_UNIT_MG_DL"] = 1; + values[valuesById[2] = "GLUCOSE_UNIT_MMOL_L"] = 2; + return values; + })(); /** - * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|updateSettings}. - * @memberof google.devicesandservices.health.v4.HealthProfileService - * @typedef UpdateSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.devicesandservices.health.v4.Settings} [response] Settings + * HeightUnit enum. + * @name google.devicesandservices.health.v4.Settings.HeightUnit + * @enum {number} + * @property {number} HEIGHT_UNIT_UNSPECIFIED=0 HEIGHT_UNIT_UNSPECIFIED value + * @property {number} HEIGHT_UNIT_INCHES=1 HEIGHT_UNIT_INCHES value + * @property {number} HEIGHT_UNIT_CENTIMETERS=2 HEIGHT_UNIT_CENTIMETERS value */ + Settings.HeightUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HEIGHT_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "HEIGHT_UNIT_INCHES"] = 1; + values[valuesById[2] = "HEIGHT_UNIT_CENTIMETERS"] = 2; + return values; + })(); /** - * Calls UpdateSettings. - * @function updateSettings - * @memberof google.devicesandservices.health.v4.HealthProfileService - * @instance - * @param {google.devicesandservices.health.v4.IUpdateSettingsRequest} request UpdateSettingsRequest message or plain object - * @param {google.devicesandservices.health.v4.HealthProfileService.UpdateSettingsCallback} callback Node-style callback called with the error, if any, and Settings - * @returns {undefined} - * @variation 1 + * StrideLengthType enum. + * @name google.devicesandservices.health.v4.Settings.StrideLengthType + * @enum {number} + * @property {number} STRIDE_LENGTH_TYPE_UNSPECIFIED=0 STRIDE_LENGTH_TYPE_UNSPECIFIED value + * @property {number} STRIDE_LENGTH_TYPE_DEFAULT=1 STRIDE_LENGTH_TYPE_DEFAULT value + * @property {number} STRIDE_LENGTH_TYPE_MANUAL=2 STRIDE_LENGTH_TYPE_MANUAL value + * @property {number} STRIDE_LENGTH_TYPE_AUTO=3 STRIDE_LENGTH_TYPE_AUTO value */ - Object.defineProperty(HealthProfileService.prototype.updateSettings = function updateSettings(request, callback) { - return this.rpcCall(updateSettings, $root.google.devicesandservices.health.v4.UpdateSettingsRequest, $root.google.devicesandservices.health.v4.Settings, request, callback); - }, "name", { value: "UpdateSettings" }); - - /** - * Calls UpdateSettings. - * @function updateSettings - * @memberof google.devicesandservices.health.v4.HealthProfileService - * @instance - * @param {google.devicesandservices.health.v4.IUpdateSettingsRequest} request UpdateSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + Settings.StrideLengthType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRIDE_LENGTH_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRIDE_LENGTH_TYPE_DEFAULT"] = 1; + values[valuesById[2] = "STRIDE_LENGTH_TYPE_MANUAL"] = 2; + values[valuesById[3] = "STRIDE_LENGTH_TYPE_AUTO"] = 3; + return values; + })(); + + /** + * SwimUnit enum. + * @name google.devicesandservices.health.v4.Settings.SwimUnit + * @enum {number} + * @property {number} SWIM_UNIT_UNSPECIFIED=0 SWIM_UNIT_UNSPECIFIED value + * @property {number} SWIM_UNIT_METERS=1 SWIM_UNIT_METERS value + * @property {number} SWIM_UNIT_YARDS=2 SWIM_UNIT_YARDS value */ + Settings.SwimUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SWIM_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "SWIM_UNIT_METERS"] = 1; + values[valuesById[2] = "SWIM_UNIT_YARDS"] = 2; + return values; + })(); /** - * Callback as used by {@link google.devicesandservices.health.v4.HealthProfileService|getIdentity}. - * @memberof google.devicesandservices.health.v4.HealthProfileService - * @typedef GetIdentityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.devicesandservices.health.v4.Identity} [response] Identity + * TemperatureUnit enum. + * @name google.devicesandservices.health.v4.Settings.TemperatureUnit + * @enum {number} + * @property {number} TEMPERATURE_UNIT_UNSPECIFIED=0 TEMPERATURE_UNIT_UNSPECIFIED value + * @property {number} TEMPERATURE_UNIT_CELSIUS=1 TEMPERATURE_UNIT_CELSIUS value + * @property {number} TEMPERATURE_UNIT_FAHRENHEIT=2 TEMPERATURE_UNIT_FAHRENHEIT value */ + Settings.TemperatureUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TEMPERATURE_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEMPERATURE_UNIT_CELSIUS"] = 1; + values[valuesById[2] = "TEMPERATURE_UNIT_FAHRENHEIT"] = 2; + return values; + })(); /** - * Calls GetIdentity. - * @function getIdentity - * @memberof google.devicesandservices.health.v4.HealthProfileService - * @instance - * @param {google.devicesandservices.health.v4.IGetIdentityRequest} request GetIdentityRequest message or plain object - * @param {google.devicesandservices.health.v4.HealthProfileService.GetIdentityCallback} callback Node-style callback called with the error, if any, and Identity - * @returns {undefined} - * @variation 1 + * WeightUnit enum. + * @name google.devicesandservices.health.v4.Settings.WeightUnit + * @enum {number} + * @property {number} WEIGHT_UNIT_UNSPECIFIED=0 WEIGHT_UNIT_UNSPECIFIED value + * @property {number} WEIGHT_UNIT_POUNDS=1 WEIGHT_UNIT_POUNDS value + * @property {number} WEIGHT_UNIT_STONE=2 WEIGHT_UNIT_STONE value + * @property {number} WEIGHT_UNIT_KILOGRAMS=3 WEIGHT_UNIT_KILOGRAMS value */ - Object.defineProperty(HealthProfileService.prototype.getIdentity = function getIdentity(request, callback) { - return this.rpcCall(getIdentity, $root.google.devicesandservices.health.v4.GetIdentityRequest, $root.google.devicesandservices.health.v4.Identity, request, callback); - }, "name", { value: "GetIdentity" }); + Settings.WeightUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WEIGHT_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "WEIGHT_UNIT_POUNDS"] = 1; + values[valuesById[2] = "WEIGHT_UNIT_STONE"] = 2; + values[valuesById[3] = "WEIGHT_UNIT_KILOGRAMS"] = 3; + return values; + })(); /** - * Calls GetIdentity. - * @function getIdentity - * @memberof google.devicesandservices.health.v4.HealthProfileService - * @instance - * @param {google.devicesandservices.health.v4.IGetIdentityRequest} request GetIdentityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * WaterUnit enum. + * @name google.devicesandservices.health.v4.Settings.WaterUnit + * @enum {number} + * @property {number} WATER_UNIT_UNSPECIFIED=0 WATER_UNIT_UNSPECIFIED value + * @property {number} WATER_UNIT_ML=1 WATER_UNIT_ML value + * @property {number} WATER_UNIT_FL_OZ=2 WATER_UNIT_FL_OZ value + * @property {number} WATER_UNIT_CUP=3 WATER_UNIT_CUP value */ + Settings.WaterUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WATER_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "WATER_UNIT_ML"] = 1; + values[valuesById[2] = "WATER_UNIT_FL_OZ"] = 2; + values[valuesById[3] = "WATER_UNIT_CUP"] = 3; + return values; + })(); - return HealthProfileService; + return Settings; })(); - v4.Profile = (function() { + v4.Identity = (function() { /** - * Properties of a Profile. + * Properties of an Identity. * @memberof google.devicesandservices.health.v4 - * @interface IProfile - * @property {string|null} [name] Profile name - * @property {number|null} [age] Profile age - * @property {google.type.IDate|null} [membershipStartDate] Profile membershipStartDate - * @property {number|null} [userConfiguredWalkingStrideLengthMm] Profile userConfiguredWalkingStrideLengthMm - * @property {number|null} [userConfiguredRunningStrideLengthMm] Profile userConfiguredRunningStrideLengthMm - * @property {number|null} [autoWalkingStrideLengthMm] Profile autoWalkingStrideLengthMm - * @property {number|null} [autoRunningStrideLengthMm] Profile autoRunningStrideLengthMm + * @interface IIdentity + * @property {string|null} [name] Identity name + * @property {string|null} [legacyUserId] Identity legacyUserId + * @property {string|null} [healthUserId] Identity healthUserId */ /** - * Constructs a new Profile. + * Constructs a new Identity. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a Profile. - * @implements IProfile + * @classdesc Represents an Identity. + * @implements IIdentity * @constructor - * @param {google.devicesandservices.health.v4.IProfile=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IIdentity=} [properties] Properties to set */ - function Profile(properties) { + function Identity(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32410,157 +49451,90 @@ } /** - * Profile name. + * Identity name. * @member {string} name - * @memberof google.devicesandservices.health.v4.Profile - * @instance - */ - Profile.prototype.name = ""; - - /** - * Profile age. - * @member {number} age - * @memberof google.devicesandservices.health.v4.Profile - * @instance - */ - Profile.prototype.age = 0; - - /** - * Profile membershipStartDate. - * @member {google.type.IDate|null|undefined} membershipStartDate - * @memberof google.devicesandservices.health.v4.Profile - * @instance - */ - Profile.prototype.membershipStartDate = null; - - /** - * Profile userConfiguredWalkingStrideLengthMm. - * @member {number|null|undefined} userConfiguredWalkingStrideLengthMm - * @memberof google.devicesandservices.health.v4.Profile - * @instance - */ - Profile.prototype.userConfiguredWalkingStrideLengthMm = null; - - /** - * Profile userConfiguredRunningStrideLengthMm. - * @member {number|null|undefined} userConfiguredRunningStrideLengthMm - * @memberof google.devicesandservices.health.v4.Profile + * @memberof google.devicesandservices.health.v4.Identity * @instance */ - Profile.prototype.userConfiguredRunningStrideLengthMm = null; + Identity.prototype.name = ""; /** - * Profile autoWalkingStrideLengthMm. - * @member {number|null|undefined} autoWalkingStrideLengthMm - * @memberof google.devicesandservices.health.v4.Profile + * Identity legacyUserId. + * @member {string} legacyUserId + * @memberof google.devicesandservices.health.v4.Identity * @instance */ - Profile.prototype.autoWalkingStrideLengthMm = null; + Identity.prototype.legacyUserId = ""; /** - * Profile autoRunningStrideLengthMm. - * @member {number|null|undefined} autoRunningStrideLengthMm - * @memberof google.devicesandservices.health.v4.Profile + * Identity healthUserId. + * @member {string} healthUserId + * @memberof google.devicesandservices.health.v4.Identity * @instance */ - Profile.prototype.autoRunningStrideLengthMm = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Profile.prototype, "_userConfiguredWalkingStrideLengthMm", { - get: $util.oneOfGetter($oneOfFields = ["userConfiguredWalkingStrideLengthMm"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Profile.prototype, "_userConfiguredRunningStrideLengthMm", { - get: $util.oneOfGetter($oneOfFields = ["userConfiguredRunningStrideLengthMm"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Profile.prototype, "_autoWalkingStrideLengthMm", { - get: $util.oneOfGetter($oneOfFields = ["autoWalkingStrideLengthMm"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Profile.prototype, "_autoRunningStrideLengthMm", { - get: $util.oneOfGetter($oneOfFields = ["autoRunningStrideLengthMm"]), - set: $util.oneOfSetter($oneOfFields) - }); + Identity.prototype.healthUserId = ""; /** - * Creates a new Profile instance using the specified properties. + * Creates a new Identity instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.Profile + * @memberof google.devicesandservices.health.v4.Identity * @static - * @param {google.devicesandservices.health.v4.IProfile=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.Profile} Profile instance + * @param {google.devicesandservices.health.v4.IIdentity=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.Identity} Identity instance */ - Profile.create = function create(properties) { - return new Profile(properties); + Identity.create = function create(properties) { + return new Identity(properties); }; /** - * Encodes the specified Profile message. Does not implicitly {@link google.devicesandservices.health.v4.Profile.verify|verify} messages. + * Encodes the specified Identity message. Does not implicitly {@link google.devicesandservices.health.v4.Identity.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.Profile + * @memberof google.devicesandservices.health.v4.Identity * @static - * @param {google.devicesandservices.health.v4.IProfile} message Profile message or plain object to encode + * @param {google.devicesandservices.health.v4.IIdentity} message Identity message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Profile.encode = function encode(message, writer) { + Identity.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.age != null && Object.hasOwnProperty.call(message, "age")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.age); - if (message.membershipStartDate != null && Object.hasOwnProperty.call(message, "membershipStartDate")) - $root.google.type.Date.encode(message.membershipStartDate, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.userConfiguredWalkingStrideLengthMm != null && Object.hasOwnProperty.call(message, "userConfiguredWalkingStrideLengthMm")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.userConfiguredWalkingStrideLengthMm); - if (message.userConfiguredRunningStrideLengthMm != null && Object.hasOwnProperty.call(message, "userConfiguredRunningStrideLengthMm")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.userConfiguredRunningStrideLengthMm); - if (message.autoWalkingStrideLengthMm != null && Object.hasOwnProperty.call(message, "autoWalkingStrideLengthMm")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.autoWalkingStrideLengthMm); - if (message.autoRunningStrideLengthMm != null && Object.hasOwnProperty.call(message, "autoRunningStrideLengthMm")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.autoRunningStrideLengthMm); + if (message.legacyUserId != null && Object.hasOwnProperty.call(message, "legacyUserId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.legacyUserId); + if (message.healthUserId != null && Object.hasOwnProperty.call(message, "healthUserId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.healthUserId); return writer; }; /** - * Encodes the specified Profile message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Profile.verify|verify} messages. + * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Identity.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.Profile + * @memberof google.devicesandservices.health.v4.Identity * @static - * @param {google.devicesandservices.health.v4.IProfile} message Profile message or plain object to encode + * @param {google.devicesandservices.health.v4.IIdentity} message Identity message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Profile.encodeDelimited = function encodeDelimited(message, writer) { + Identity.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Profile message from the specified reader or buffer. + * Decodes an Identity message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.Profile + * @memberof google.devicesandservices.health.v4.Identity * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.Profile} Profile + * @returns {google.devicesandservices.health.v4.Identity} Identity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Profile.decode = function decode(reader, length, error) { + Identity.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Profile(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Identity(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -32570,28 +49544,12 @@ message.name = reader.string(); break; } - case 6: { - message.age = reader.int32(); - break; - } - case 9: { - message.membershipStartDate = $root.google.type.Date.decode(reader, reader.uint32()); - break; - } - case 13: { - message.userConfiguredWalkingStrideLengthMm = reader.int32(); - break; - } - case 14: { - message.userConfiguredRunningStrideLengthMm = reader.int32(); - break; - } - case 15: { - message.autoWalkingStrideLengthMm = reader.int32(); + case 2: { + message.legacyUserId = reader.string(); break; } - case 16: { - message.autoRunningStrideLengthMm = reader.int32(); + case 3: { + message.healthUserId = reader.string(); break; } default: @@ -32603,407 +49561,210 @@ }; /** - * Decodes a Profile message from the specified reader or buffer, length delimited. + * Decodes an Identity message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.Profile + * @memberof google.devicesandservices.health.v4.Identity * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.Profile} Profile + * @returns {google.devicesandservices.health.v4.Identity} Identity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Profile.decodeDelimited = function decodeDelimited(reader) { + Identity.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Profile message. + * Verifies an Identity message. * @function verify - * @memberof google.devicesandservices.health.v4.Profile + * @memberof google.devicesandservices.health.v4.Identity * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Profile.verify = function verify(message) { + Identity.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.age != null && message.hasOwnProperty("age")) - if (!$util.isInteger(message.age)) - return "age: integer expected"; - if (message.membershipStartDate != null && message.hasOwnProperty("membershipStartDate")) { - var error = $root.google.type.Date.verify(message.membershipStartDate); - if (error) - return "membershipStartDate." + error; - } - if (message.userConfiguredWalkingStrideLengthMm != null && message.hasOwnProperty("userConfiguredWalkingStrideLengthMm")) { - properties._userConfiguredWalkingStrideLengthMm = 1; - if (!$util.isInteger(message.userConfiguredWalkingStrideLengthMm)) - return "userConfiguredWalkingStrideLengthMm: integer expected"; - } - if (message.userConfiguredRunningStrideLengthMm != null && message.hasOwnProperty("userConfiguredRunningStrideLengthMm")) { - properties._userConfiguredRunningStrideLengthMm = 1; - if (!$util.isInteger(message.userConfiguredRunningStrideLengthMm)) - return "userConfiguredRunningStrideLengthMm: integer expected"; - } - if (message.autoWalkingStrideLengthMm != null && message.hasOwnProperty("autoWalkingStrideLengthMm")) { - properties._autoWalkingStrideLengthMm = 1; - if (!$util.isInteger(message.autoWalkingStrideLengthMm)) - return "autoWalkingStrideLengthMm: integer expected"; - } - if (message.autoRunningStrideLengthMm != null && message.hasOwnProperty("autoRunningStrideLengthMm")) { - properties._autoRunningStrideLengthMm = 1; - if (!$util.isInteger(message.autoRunningStrideLengthMm)) - return "autoRunningStrideLengthMm: integer expected"; - } + if (message.legacyUserId != null && message.hasOwnProperty("legacyUserId")) + if (!$util.isString(message.legacyUserId)) + return "legacyUserId: string expected"; + if (message.healthUserId != null && message.hasOwnProperty("healthUserId")) + if (!$util.isString(message.healthUserId)) + return "healthUserId: string expected"; return null; }; /** - * Creates a Profile message from a plain object. Also converts values to their respective internal types. + * Creates an Identity message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.Profile + * @memberof google.devicesandservices.health.v4.Identity * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.Profile} Profile + * @returns {google.devicesandservices.health.v4.Identity} Identity */ - Profile.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.Profile) + Identity.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.Identity) return object; - var message = new $root.google.devicesandservices.health.v4.Profile(); + var message = new $root.google.devicesandservices.health.v4.Identity(); if (object.name != null) message.name = String(object.name); - if (object.age != null) - message.age = object.age | 0; - if (object.membershipStartDate != null) { - if (typeof object.membershipStartDate !== "object") - throw TypeError(".google.devicesandservices.health.v4.Profile.membershipStartDate: object expected"); - message.membershipStartDate = $root.google.type.Date.fromObject(object.membershipStartDate); - } - if (object.userConfiguredWalkingStrideLengthMm != null) - message.userConfiguredWalkingStrideLengthMm = object.userConfiguredWalkingStrideLengthMm | 0; - if (object.userConfiguredRunningStrideLengthMm != null) - message.userConfiguredRunningStrideLengthMm = object.userConfiguredRunningStrideLengthMm | 0; - if (object.autoWalkingStrideLengthMm != null) - message.autoWalkingStrideLengthMm = object.autoWalkingStrideLengthMm | 0; - if (object.autoRunningStrideLengthMm != null) - message.autoRunningStrideLengthMm = object.autoRunningStrideLengthMm | 0; + if (object.legacyUserId != null) + message.legacyUserId = String(object.legacyUserId); + if (object.healthUserId != null) + message.healthUserId = String(object.healthUserId); return message; }; /** - * Creates a plain object from a Profile message. Also converts values to other types if specified. + * Creates a plain object from an Identity message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.Profile + * @memberof google.devicesandservices.health.v4.Identity * @static - * @param {google.devicesandservices.health.v4.Profile} message Profile + * @param {google.devicesandservices.health.v4.Identity} message Identity * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Profile.toObject = function toObject(message, options) { + Identity.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.age = 0; - object.membershipStartDate = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.age != null && message.hasOwnProperty("age")) - object.age = message.age; - if (message.membershipStartDate != null && message.hasOwnProperty("membershipStartDate")) - object.membershipStartDate = $root.google.type.Date.toObject(message.membershipStartDate, options); - if (message.userConfiguredWalkingStrideLengthMm != null && message.hasOwnProperty("userConfiguredWalkingStrideLengthMm")) { - object.userConfiguredWalkingStrideLengthMm = message.userConfiguredWalkingStrideLengthMm; - if (options.oneofs) - object._userConfiguredWalkingStrideLengthMm = "userConfiguredWalkingStrideLengthMm"; - } - if (message.userConfiguredRunningStrideLengthMm != null && message.hasOwnProperty("userConfiguredRunningStrideLengthMm")) { - object.userConfiguredRunningStrideLengthMm = message.userConfiguredRunningStrideLengthMm; - if (options.oneofs) - object._userConfiguredRunningStrideLengthMm = "userConfiguredRunningStrideLengthMm"; - } - if (message.autoWalkingStrideLengthMm != null && message.hasOwnProperty("autoWalkingStrideLengthMm")) { - object.autoWalkingStrideLengthMm = message.autoWalkingStrideLengthMm; - if (options.oneofs) - object._autoWalkingStrideLengthMm = "autoWalkingStrideLengthMm"; - } - if (message.autoRunningStrideLengthMm != null && message.hasOwnProperty("autoRunningStrideLengthMm")) { - object.autoRunningStrideLengthMm = message.autoRunningStrideLengthMm; - if (options.oneofs) - object._autoRunningStrideLengthMm = "autoRunningStrideLengthMm"; - } - return object; - }; - - /** - * Converts this Profile to JSON. - * @function toJSON - * @memberof google.devicesandservices.health.v4.Profile - * @instance - * @returns {Object.} JSON object - */ - Profile.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Profile - * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.Profile - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Profile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.devicesandservices.health.v4.Profile"; - }; - - return Profile; - })(); - - v4.Settings = (function() { - - /** - * Properties of a Settings. - * @memberof google.devicesandservices.health.v4 - * @interface ISettings - * @property {string|null} [name] Settings name - * @property {boolean|null} [autoStrideEnabled] Settings autoStrideEnabled - * @property {google.devicesandservices.health.v4.Settings.DistanceUnit|null} [distanceUnit] Settings distanceUnit - * @property {google.devicesandservices.health.v4.Settings.GlucoseUnit|null} [glucoseUnit] Settings glucoseUnit - * @property {google.devicesandservices.health.v4.Settings.HeightUnit|null} [heightUnit] Settings heightUnit - * @property {string|null} [languageLocale] Settings languageLocale - * @property {google.protobuf.IDuration|null} [utcOffset] Settings utcOffset - * @property {google.devicesandservices.health.v4.Settings.StrideLengthType|null} [strideLengthWalkingType] Settings strideLengthWalkingType - * @property {google.devicesandservices.health.v4.Settings.StrideLengthType|null} [strideLengthRunningType] Settings strideLengthRunningType - * @property {google.devicesandservices.health.v4.Settings.SwimUnit|null} [swimUnit] Settings swimUnit - * @property {google.devicesandservices.health.v4.Settings.TemperatureUnit|null} [temperatureUnit] Settings temperatureUnit - * @property {string|null} [timeZone] Settings timeZone - * @property {google.devicesandservices.health.v4.Settings.WeightUnit|null} [weightUnit] Settings weightUnit - * @property {google.devicesandservices.health.v4.Settings.WaterUnit|null} [waterUnit] Settings waterUnit - */ - - /** - * Constructs a new Settings. - * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a Settings. - * @implements ISettings - * @constructor - * @param {google.devicesandservices.health.v4.ISettings=} [properties] Properties to set - */ - function Settings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Settings name. - * @member {string} name - * @memberof google.devicesandservices.health.v4.Settings - * @instance - */ - Settings.prototype.name = ""; - - /** - * Settings autoStrideEnabled. - * @member {boolean} autoStrideEnabled - * @memberof google.devicesandservices.health.v4.Settings - * @instance - */ - Settings.prototype.autoStrideEnabled = false; - - /** - * Settings distanceUnit. - * @member {google.devicesandservices.health.v4.Settings.DistanceUnit} distanceUnit - * @memberof google.devicesandservices.health.v4.Settings - * @instance - */ - Settings.prototype.distanceUnit = 0; - - /** - * Settings glucoseUnit. - * @member {google.devicesandservices.health.v4.Settings.GlucoseUnit} glucoseUnit - * @memberof google.devicesandservices.health.v4.Settings - * @instance - */ - Settings.prototype.glucoseUnit = 0; - - /** - * Settings heightUnit. - * @member {google.devicesandservices.health.v4.Settings.HeightUnit} heightUnit - * @memberof google.devicesandservices.health.v4.Settings - * @instance - */ - Settings.prototype.heightUnit = 0; - - /** - * Settings languageLocale. - * @member {string} languageLocale - * @memberof google.devicesandservices.health.v4.Settings - * @instance - */ - Settings.prototype.languageLocale = ""; - - /** - * Settings utcOffset. - * @member {google.protobuf.IDuration|null|undefined} utcOffset - * @memberof google.devicesandservices.health.v4.Settings - * @instance - */ - Settings.prototype.utcOffset = null; + object.legacyUserId = ""; + object.healthUserId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.legacyUserId != null && message.hasOwnProperty("legacyUserId")) + object.legacyUserId = message.legacyUserId; + if (message.healthUserId != null && message.hasOwnProperty("healthUserId")) + object.healthUserId = message.healthUserId; + return object; + }; /** - * Settings strideLengthWalkingType. - * @member {google.devicesandservices.health.v4.Settings.StrideLengthType} strideLengthWalkingType - * @memberof google.devicesandservices.health.v4.Settings + * Converts this Identity to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.Identity * @instance + * @returns {Object.} JSON object */ - Settings.prototype.strideLengthWalkingType = 0; + Identity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Settings strideLengthRunningType. - * @member {google.devicesandservices.health.v4.Settings.StrideLengthType} strideLengthRunningType - * @memberof google.devicesandservices.health.v4.Settings - * @instance + * Gets the default type url for Identity + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.Identity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Settings.prototype.strideLengthRunningType = 0; + Identity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.Identity"; + }; - /** - * Settings swimUnit. - * @member {google.devicesandservices.health.v4.Settings.SwimUnit} swimUnit - * @memberof google.devicesandservices.health.v4.Settings - * @instance - */ - Settings.prototype.swimUnit = 0; + return Identity; + })(); - /** - * Settings temperatureUnit. - * @member {google.devicesandservices.health.v4.Settings.TemperatureUnit} temperatureUnit - * @memberof google.devicesandservices.health.v4.Settings - * @instance - */ - Settings.prototype.temperatureUnit = 0; + v4.GetProfileRequest = (function() { /** - * Settings timeZone. - * @member {string} timeZone - * @memberof google.devicesandservices.health.v4.Settings - * @instance + * Properties of a GetProfileRequest. + * @memberof google.devicesandservices.health.v4 + * @interface IGetProfileRequest + * @property {string|null} [name] GetProfileRequest name */ - Settings.prototype.timeZone = ""; /** - * Settings weightUnit. - * @member {google.devicesandservices.health.v4.Settings.WeightUnit} weightUnit - * @memberof google.devicesandservices.health.v4.Settings - * @instance + * Constructs a new GetProfileRequest. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a GetProfileRequest. + * @implements IGetProfileRequest + * @constructor + * @param {google.devicesandservices.health.v4.IGetProfileRequest=} [properties] Properties to set */ - Settings.prototype.weightUnit = 0; + function GetProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Settings waterUnit. - * @member {google.devicesandservices.health.v4.Settings.WaterUnit} waterUnit - * @memberof google.devicesandservices.health.v4.Settings + * GetProfileRequest name. + * @member {string} name + * @memberof google.devicesandservices.health.v4.GetProfileRequest * @instance */ - Settings.prototype.waterUnit = 0; + GetProfileRequest.prototype.name = ""; /** - * Creates a new Settings instance using the specified properties. + * Creates a new GetProfileRequest instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.Settings + * @memberof google.devicesandservices.health.v4.GetProfileRequest * @static - * @param {google.devicesandservices.health.v4.ISettings=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.Settings} Settings instance + * @param {google.devicesandservices.health.v4.IGetProfileRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.GetProfileRequest} GetProfileRequest instance */ - Settings.create = function create(properties) { - return new Settings(properties); + GetProfileRequest.create = function create(properties) { + return new GetProfileRequest(properties); }; /** - * Encodes the specified Settings message. Does not implicitly {@link google.devicesandservices.health.v4.Settings.verify|verify} messages. + * Encodes the specified GetProfileRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetProfileRequest.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.Settings + * @memberof google.devicesandservices.health.v4.GetProfileRequest * @static - * @param {google.devicesandservices.health.v4.ISettings} message Settings message or plain object to encode + * @param {google.devicesandservices.health.v4.IGetProfileRequest} message GetProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Settings.encode = function encode(message, writer) { + GetProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.autoStrideEnabled != null && Object.hasOwnProperty.call(message, "autoStrideEnabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.autoStrideEnabled); - if (message.distanceUnit != null && Object.hasOwnProperty.call(message, "distanceUnit")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.distanceUnit); - if (message.glucoseUnit != null && Object.hasOwnProperty.call(message, "glucoseUnit")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.glucoseUnit); - if (message.heightUnit != null && Object.hasOwnProperty.call(message, "heightUnit")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.heightUnit); - if (message.languageLocale != null && Object.hasOwnProperty.call(message, "languageLocale")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.languageLocale); - if (message.utcOffset != null && Object.hasOwnProperty.call(message, "utcOffset")) - $root.google.protobuf.Duration.encode(message.utcOffset, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.strideLengthWalkingType != null && Object.hasOwnProperty.call(message, "strideLengthWalkingType")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.strideLengthWalkingType); - if (message.strideLengthRunningType != null && Object.hasOwnProperty.call(message, "strideLengthRunningType")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.strideLengthRunningType); - if (message.swimUnit != null && Object.hasOwnProperty.call(message, "swimUnit")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.swimUnit); - if (message.temperatureUnit != null && Object.hasOwnProperty.call(message, "temperatureUnit")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.temperatureUnit); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.timeZone); - if (message.weightUnit != null && Object.hasOwnProperty.call(message, "weightUnit")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.weightUnit); - if (message.waterUnit != null && Object.hasOwnProperty.call(message, "waterUnit")) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.waterUnit); return writer; }; /** - * Encodes the specified Settings message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Settings.verify|verify} messages. + * Encodes the specified GetProfileRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.Settings + * @memberof google.devicesandservices.health.v4.GetProfileRequest * @static - * @param {google.devicesandservices.health.v4.ISettings} message Settings message or plain object to encode + * @param {google.devicesandservices.health.v4.IGetProfileRequest} message GetProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Settings.encodeDelimited = function encodeDelimited(message, writer) { + GetProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Settings message from the specified reader or buffer. + * Decodes a GetProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.Settings + * @memberof google.devicesandservices.health.v4.GetProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.Settings} Settings + * @returns {google.devicesandservices.health.v4.GetProfileRequest} GetProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Settings.decode = function decode(reader, length, error) { + GetProfileRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Settings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.GetProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -33013,58 +49774,6 @@ message.name = reader.string(); break; } - case 2: { - message.autoStrideEnabled = reader.bool(); - break; - } - case 5: { - message.distanceUnit = reader.int32(); - break; - } - case 7: { - message.glucoseUnit = reader.int32(); - break; - } - case 8: { - message.heightUnit = reader.int32(); - break; - } - case 9: { - message.languageLocale = reader.string(); - break; - } - case 10: { - message.utcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 13: { - message.strideLengthWalkingType = reader.int32(); - break; - } - case 14: { - message.strideLengthRunningType = reader.int32(); - break; - } - case 15: { - message.swimUnit = reader.int32(); - break; - } - case 16: { - message.temperatureUnit = reader.int32(); - break; - } - case 17: { - message.timeZone = reader.string(); - break; - } - case 18: { - message.weightUnit = reader.int32(); - break; - } - case 19: { - message.waterUnit = reader.int32(); - break; - } default: reader.skipType(tag & 7); break; @@ -33074,604 +49783,566 @@ }; /** - * Decodes a Settings message from the specified reader or buffer, length delimited. + * Decodes a GetProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.Settings + * @memberof google.devicesandservices.health.v4.GetProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.Settings} Settings + * @returns {google.devicesandservices.health.v4.GetProfileRequest} GetProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Settings.decodeDelimited = function decodeDelimited(reader) { + GetProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Settings message. + * Verifies a GetProfileRequest message. * @function verify - * @memberof google.devicesandservices.health.v4.Settings + * @memberof google.devicesandservices.health.v4.GetProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Settings.verify = function verify(message) { + GetProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.autoStrideEnabled != null && message.hasOwnProperty("autoStrideEnabled")) - if (typeof message.autoStrideEnabled !== "boolean") - return "autoStrideEnabled: boolean expected"; - if (message.distanceUnit != null && message.hasOwnProperty("distanceUnit")) - switch (message.distanceUnit) { - default: - return "distanceUnit: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.glucoseUnit != null && message.hasOwnProperty("glucoseUnit")) - switch (message.glucoseUnit) { - default: - return "glucoseUnit: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.heightUnit != null && message.hasOwnProperty("heightUnit")) - switch (message.heightUnit) { - default: - return "heightUnit: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.languageLocale != null && message.hasOwnProperty("languageLocale")) - if (!$util.isString(message.languageLocale)) - return "languageLocale: string expected"; - if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { - var error = $root.google.protobuf.Duration.verify(message.utcOffset); - if (error) - return "utcOffset." + error; - } - if (message.strideLengthWalkingType != null && message.hasOwnProperty("strideLengthWalkingType")) - switch (message.strideLengthWalkingType) { - default: - return "strideLengthWalkingType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.strideLengthRunningType != null && message.hasOwnProperty("strideLengthRunningType")) - switch (message.strideLengthRunningType) { - default: - return "strideLengthRunningType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.swimUnit != null && message.hasOwnProperty("swimUnit")) - switch (message.swimUnit) { - default: - return "swimUnit: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.temperatureUnit != null && message.hasOwnProperty("temperatureUnit")) - switch (message.temperatureUnit) { - default: - return "temperatureUnit: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - if (message.weightUnit != null && message.hasOwnProperty("weightUnit")) - switch (message.weightUnit) { - default: - return "weightUnit: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.waterUnit != null && message.hasOwnProperty("waterUnit")) - switch (message.waterUnit) { - default: - return "waterUnit: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } return null; }; /** - * Creates a Settings message from a plain object. Also converts values to their respective internal types. + * Creates a GetProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.Settings + * @memberof google.devicesandservices.health.v4.GetProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.Settings} Settings + * @returns {google.devicesandservices.health.v4.GetProfileRequest} GetProfileRequest */ - Settings.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.Settings) + GetProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.GetProfileRequest) return object; - var message = new $root.google.devicesandservices.health.v4.Settings(); + var message = new $root.google.devicesandservices.health.v4.GetProfileRequest(); if (object.name != null) message.name = String(object.name); - if (object.autoStrideEnabled != null) - message.autoStrideEnabled = Boolean(object.autoStrideEnabled); - switch (object.distanceUnit) { - default: - if (typeof object.distanceUnit === "number") { - message.distanceUnit = object.distanceUnit; - break; - } - break; - case "DISTANCE_UNIT_UNSPECIFIED": - case 0: - message.distanceUnit = 0; - break; - case "DISTANCE_UNIT_MILES": - case 1: - message.distanceUnit = 1; - break; - case "DISTANCE_UNIT_KILOMETERS": - case 2: - message.distanceUnit = 2; - break; - } - switch (object.glucoseUnit) { - default: - if (typeof object.glucoseUnit === "number") { - message.glucoseUnit = object.glucoseUnit; - break; - } - break; - case "GLUCOSE_UNIT_UNSPECIFIED": - case 0: - message.glucoseUnit = 0; - break; - case "GLUCOSE_UNIT_MG_DL": - case 1: - message.glucoseUnit = 1; - break; - case "GLUCOSE_UNIT_MMOL_L": - case 2: - message.glucoseUnit = 2; - break; - } - switch (object.heightUnit) { - default: - if (typeof object.heightUnit === "number") { - message.heightUnit = object.heightUnit; - break; - } - break; - case "HEIGHT_UNIT_UNSPECIFIED": - case 0: - message.heightUnit = 0; - break; - case "HEIGHT_UNIT_INCHES": - case 1: - message.heightUnit = 1; - break; - case "HEIGHT_UNIT_CENTIMETERS": - case 2: - message.heightUnit = 2; - break; - } - if (object.languageLocale != null) - message.languageLocale = String(object.languageLocale); - if (object.utcOffset != null) { - if (typeof object.utcOffset !== "object") - throw TypeError(".google.devicesandservices.health.v4.Settings.utcOffset: object expected"); - message.utcOffset = $root.google.protobuf.Duration.fromObject(object.utcOffset); - } - switch (object.strideLengthWalkingType) { - default: - if (typeof object.strideLengthWalkingType === "number") { - message.strideLengthWalkingType = object.strideLengthWalkingType; - break; - } - break; - case "STRIDE_LENGTH_TYPE_UNSPECIFIED": - case 0: - message.strideLengthWalkingType = 0; - break; - case "STRIDE_LENGTH_TYPE_DEFAULT": - case 1: - message.strideLengthWalkingType = 1; - break; - case "STRIDE_LENGTH_TYPE_MANUAL": - case 2: - message.strideLengthWalkingType = 2; - break; - case "STRIDE_LENGTH_TYPE_AUTO": - case 3: - message.strideLengthWalkingType = 3; - break; - } - switch (object.strideLengthRunningType) { - default: - if (typeof object.strideLengthRunningType === "number") { - message.strideLengthRunningType = object.strideLengthRunningType; - break; - } - break; - case "STRIDE_LENGTH_TYPE_UNSPECIFIED": - case 0: - message.strideLengthRunningType = 0; - break; - case "STRIDE_LENGTH_TYPE_DEFAULT": - case 1: - message.strideLengthRunningType = 1; - break; - case "STRIDE_LENGTH_TYPE_MANUAL": - case 2: - message.strideLengthRunningType = 2; - break; - case "STRIDE_LENGTH_TYPE_AUTO": - case 3: - message.strideLengthRunningType = 3; - break; - } - switch (object.swimUnit) { - default: - if (typeof object.swimUnit === "number") { - message.swimUnit = object.swimUnit; - break; - } - break; - case "SWIM_UNIT_UNSPECIFIED": - case 0: - message.swimUnit = 0; - break; - case "SWIM_UNIT_METERS": - case 1: - message.swimUnit = 1; - break; - case "SWIM_UNIT_YARDS": - case 2: - message.swimUnit = 2; - break; - } - switch (object.temperatureUnit) { - default: - if (typeof object.temperatureUnit === "number") { - message.temperatureUnit = object.temperatureUnit; - break; - } - break; - case "TEMPERATURE_UNIT_UNSPECIFIED": - case 0: - message.temperatureUnit = 0; - break; - case "TEMPERATURE_UNIT_CELSIUS": - case 1: - message.temperatureUnit = 1; - break; - case "TEMPERATURE_UNIT_FAHRENHEIT": - case 2: - message.temperatureUnit = 2; - break; + return message; + }; + + /** + * Creates a plain object from a GetProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.GetProfileRequest + * @static + * @param {google.devicesandservices.health.v4.GetProfileRequest} message GetProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetProfileRequest to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.GetProfileRequest + * @instance + * @returns {Object.} JSON object + */ + GetProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetProfileRequest + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.GetProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - switch (object.weightUnit) { - default: - if (typeof object.weightUnit === "number") { - message.weightUnit = object.weightUnit; + return typeUrlPrefix + "/google.devicesandservices.health.v4.GetProfileRequest"; + }; + + return GetProfileRequest; + })(); + + v4.GetIrnProfileRequest = (function() { + + /** + * Properties of a GetIrnProfileRequest. + * @memberof google.devicesandservices.health.v4 + * @interface IGetIrnProfileRequest + * @property {string|null} [name] GetIrnProfileRequest name + */ + + /** + * Constructs a new GetIrnProfileRequest. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents a GetIrnProfileRequest. + * @implements IGetIrnProfileRequest + * @constructor + * @param {google.devicesandservices.health.v4.IGetIrnProfileRequest=} [properties] Properties to set + */ + function GetIrnProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIrnProfileRequest name. + * @member {string} name + * @memberof google.devicesandservices.health.v4.GetIrnProfileRequest + * @instance + */ + GetIrnProfileRequest.prototype.name = ""; + + /** + * Creates a new GetIrnProfileRequest instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.GetIrnProfileRequest + * @static + * @param {google.devicesandservices.health.v4.IGetIrnProfileRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.GetIrnProfileRequest} GetIrnProfileRequest instance + */ + GetIrnProfileRequest.create = function create(properties) { + return new GetIrnProfileRequest(properties); + }; + + /** + * Encodes the specified GetIrnProfileRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetIrnProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.GetIrnProfileRequest + * @static + * @param {google.devicesandservices.health.v4.IGetIrnProfileRequest} message GetIrnProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIrnProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetIrnProfileRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetIrnProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.GetIrnProfileRequest + * @static + * @param {google.devicesandservices.health.v4.IGetIrnProfileRequest} message GetIrnProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIrnProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIrnProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.GetIrnProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.GetIrnProfileRequest} GetIrnProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIrnProfileRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.GetIrnProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; - } - break; - case "WEIGHT_UNIT_UNSPECIFIED": - case 0: - message.weightUnit = 0; - break; - case "WEIGHT_UNIT_POUNDS": - case 1: - message.weightUnit = 1; - break; - case "WEIGHT_UNIT_STONE": - case 2: - message.weightUnit = 2; - break; - case "WEIGHT_UNIT_KILOGRAMS": - case 3: - message.weightUnit = 3; - break; - } - switch (object.waterUnit) { - default: - if (typeof object.waterUnit === "number") { - message.waterUnit = object.waterUnit; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; } - break; - case "WATER_UNIT_UNSPECIFIED": - case 0: - message.waterUnit = 0; - break; - case "WATER_UNIT_ML": - case 1: - message.waterUnit = 1; - break; - case "WATER_UNIT_FL_OZ": - case 2: - message.waterUnit = 2; - break; - case "WATER_UNIT_CUP": - case 3: - message.waterUnit = 3; - break; } return message; }; /** - * Creates a plain object from a Settings message. Also converts values to other types if specified. + * Decodes a GetIrnProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.GetIrnProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.GetIrnProfileRequest} GetIrnProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIrnProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIrnProfileRequest message. + * @function verify + * @memberof google.devicesandservices.health.v4.GetIrnProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIrnProfileRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetIrnProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.GetIrnProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.GetIrnProfileRequest} GetIrnProfileRequest + */ + GetIrnProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.GetIrnProfileRequest) + return object; + var message = new $root.google.devicesandservices.health.v4.GetIrnProfileRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetIrnProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.Settings + * @memberof google.devicesandservices.health.v4.GetIrnProfileRequest * @static - * @param {google.devicesandservices.health.v4.Settings} message Settings + * @param {google.devicesandservices.health.v4.GetIrnProfileRequest} message GetIrnProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Settings.toObject = function toObject(message, options) { + GetIrnProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.autoStrideEnabled = false; - object.distanceUnit = options.enums === String ? "DISTANCE_UNIT_UNSPECIFIED" : 0; - object.glucoseUnit = options.enums === String ? "GLUCOSE_UNIT_UNSPECIFIED" : 0; - object.heightUnit = options.enums === String ? "HEIGHT_UNIT_UNSPECIFIED" : 0; - object.languageLocale = ""; - object.utcOffset = null; - object.strideLengthWalkingType = options.enums === String ? "STRIDE_LENGTH_TYPE_UNSPECIFIED" : 0; - object.strideLengthRunningType = options.enums === String ? "STRIDE_LENGTH_TYPE_UNSPECIFIED" : 0; - object.swimUnit = options.enums === String ? "SWIM_UNIT_UNSPECIFIED" : 0; - object.temperatureUnit = options.enums === String ? "TEMPERATURE_UNIT_UNSPECIFIED" : 0; - object.timeZone = ""; - object.weightUnit = options.enums === String ? "WEIGHT_UNIT_UNSPECIFIED" : 0; - object.waterUnit = options.enums === String ? "WATER_UNIT_UNSPECIFIED" : 0; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.autoStrideEnabled != null && message.hasOwnProperty("autoStrideEnabled")) - object.autoStrideEnabled = message.autoStrideEnabled; - if (message.distanceUnit != null && message.hasOwnProperty("distanceUnit")) - object.distanceUnit = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.DistanceUnit[message.distanceUnit] === undefined ? message.distanceUnit : $root.google.devicesandservices.health.v4.Settings.DistanceUnit[message.distanceUnit] : message.distanceUnit; - if (message.glucoseUnit != null && message.hasOwnProperty("glucoseUnit")) - object.glucoseUnit = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.GlucoseUnit[message.glucoseUnit] === undefined ? message.glucoseUnit : $root.google.devicesandservices.health.v4.Settings.GlucoseUnit[message.glucoseUnit] : message.glucoseUnit; - if (message.heightUnit != null && message.hasOwnProperty("heightUnit")) - object.heightUnit = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.HeightUnit[message.heightUnit] === undefined ? message.heightUnit : $root.google.devicesandservices.health.v4.Settings.HeightUnit[message.heightUnit] : message.heightUnit; - if (message.languageLocale != null && message.hasOwnProperty("languageLocale")) - object.languageLocale = message.languageLocale; - if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) - object.utcOffset = $root.google.protobuf.Duration.toObject(message.utcOffset, options); - if (message.strideLengthWalkingType != null && message.hasOwnProperty("strideLengthWalkingType")) - object.strideLengthWalkingType = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.StrideLengthType[message.strideLengthWalkingType] === undefined ? message.strideLengthWalkingType : $root.google.devicesandservices.health.v4.Settings.StrideLengthType[message.strideLengthWalkingType] : message.strideLengthWalkingType; - if (message.strideLengthRunningType != null && message.hasOwnProperty("strideLengthRunningType")) - object.strideLengthRunningType = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.StrideLengthType[message.strideLengthRunningType] === undefined ? message.strideLengthRunningType : $root.google.devicesandservices.health.v4.Settings.StrideLengthType[message.strideLengthRunningType] : message.strideLengthRunningType; - if (message.swimUnit != null && message.hasOwnProperty("swimUnit")) - object.swimUnit = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.SwimUnit[message.swimUnit] === undefined ? message.swimUnit : $root.google.devicesandservices.health.v4.Settings.SwimUnit[message.swimUnit] : message.swimUnit; - if (message.temperatureUnit != null && message.hasOwnProperty("temperatureUnit")) - object.temperatureUnit = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.TemperatureUnit[message.temperatureUnit] === undefined ? message.temperatureUnit : $root.google.devicesandservices.health.v4.Settings.TemperatureUnit[message.temperatureUnit] : message.temperatureUnit; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - if (message.weightUnit != null && message.hasOwnProperty("weightUnit")) - object.weightUnit = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.WeightUnit[message.weightUnit] === undefined ? message.weightUnit : $root.google.devicesandservices.health.v4.Settings.WeightUnit[message.weightUnit] : message.weightUnit; - if (message.waterUnit != null && message.hasOwnProperty("waterUnit")) - object.waterUnit = options.enums === String ? $root.google.devicesandservices.health.v4.Settings.WaterUnit[message.waterUnit] === undefined ? message.waterUnit : $root.google.devicesandservices.health.v4.Settings.WaterUnit[message.waterUnit] : message.waterUnit; return object; }; /** - * Converts this Settings to JSON. + * Converts this GetIrnProfileRequest to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.Settings + * @memberof google.devicesandservices.health.v4.GetIrnProfileRequest * @instance * @returns {Object.} JSON object */ - Settings.prototype.toJSON = function toJSON() { + GetIrnProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Settings + * Gets the default type url for GetIrnProfileRequest * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.Settings + * @memberof google.devicesandservices.health.v4.GetIrnProfileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Settings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetIrnProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.Settings"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.GetIrnProfileRequest"; }; + return GetIrnProfileRequest; + })(); + + v4.UpdateProfileRequest = (function() { + /** - * DistanceUnit enum. - * @name google.devicesandservices.health.v4.Settings.DistanceUnit - * @enum {number} - * @property {number} DISTANCE_UNIT_UNSPECIFIED=0 DISTANCE_UNIT_UNSPECIFIED value - * @property {number} DISTANCE_UNIT_MILES=1 DISTANCE_UNIT_MILES value - * @property {number} DISTANCE_UNIT_KILOMETERS=2 DISTANCE_UNIT_KILOMETERS value + * Properties of an UpdateProfileRequest. + * @memberof google.devicesandservices.health.v4 + * @interface IUpdateProfileRequest + * @property {google.devicesandservices.health.v4.IProfile|null} [profile] UpdateProfileRequest profile + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProfileRequest updateMask */ - Settings.DistanceUnit = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DISTANCE_UNIT_UNSPECIFIED"] = 0; - values[valuesById[1] = "DISTANCE_UNIT_MILES"] = 1; - values[valuesById[2] = "DISTANCE_UNIT_KILOMETERS"] = 2; - return values; - })(); /** - * GlucoseUnit enum. - * @name google.devicesandservices.health.v4.Settings.GlucoseUnit - * @enum {number} - * @property {number} GLUCOSE_UNIT_UNSPECIFIED=0 GLUCOSE_UNIT_UNSPECIFIED value - * @property {number} GLUCOSE_UNIT_MG_DL=1 GLUCOSE_UNIT_MG_DL value - * @property {number} GLUCOSE_UNIT_MMOL_L=2 GLUCOSE_UNIT_MMOL_L value + * Constructs a new UpdateProfileRequest. + * @memberof google.devicesandservices.health.v4 + * @classdesc Represents an UpdateProfileRequest. + * @implements IUpdateProfileRequest + * @constructor + * @param {google.devicesandservices.health.v4.IUpdateProfileRequest=} [properties] Properties to set */ - Settings.GlucoseUnit = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "GLUCOSE_UNIT_UNSPECIFIED"] = 0; - values[valuesById[1] = "GLUCOSE_UNIT_MG_DL"] = 1; - values[valuesById[2] = "GLUCOSE_UNIT_MMOL_L"] = 2; - return values; - })(); + function UpdateProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * HeightUnit enum. - * @name google.devicesandservices.health.v4.Settings.HeightUnit - * @enum {number} - * @property {number} HEIGHT_UNIT_UNSPECIFIED=0 HEIGHT_UNIT_UNSPECIFIED value - * @property {number} HEIGHT_UNIT_INCHES=1 HEIGHT_UNIT_INCHES value - * @property {number} HEIGHT_UNIT_CENTIMETERS=2 HEIGHT_UNIT_CENTIMETERS value + * UpdateProfileRequest profile. + * @member {google.devicesandservices.health.v4.IProfile|null|undefined} profile + * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @instance */ - Settings.HeightUnit = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HEIGHT_UNIT_UNSPECIFIED"] = 0; - values[valuesById[1] = "HEIGHT_UNIT_INCHES"] = 1; - values[valuesById[2] = "HEIGHT_UNIT_CENTIMETERS"] = 2; - return values; - })(); + UpdateProfileRequest.prototype.profile = null; /** - * StrideLengthType enum. - * @name google.devicesandservices.health.v4.Settings.StrideLengthType - * @enum {number} - * @property {number} STRIDE_LENGTH_TYPE_UNSPECIFIED=0 STRIDE_LENGTH_TYPE_UNSPECIFIED value - * @property {number} STRIDE_LENGTH_TYPE_DEFAULT=1 STRIDE_LENGTH_TYPE_DEFAULT value - * @property {number} STRIDE_LENGTH_TYPE_MANUAL=2 STRIDE_LENGTH_TYPE_MANUAL value - * @property {number} STRIDE_LENGTH_TYPE_AUTO=3 STRIDE_LENGTH_TYPE_AUTO value + * UpdateProfileRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @instance */ - Settings.StrideLengthType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRIDE_LENGTH_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STRIDE_LENGTH_TYPE_DEFAULT"] = 1; - values[valuesById[2] = "STRIDE_LENGTH_TYPE_MANUAL"] = 2; - values[valuesById[3] = "STRIDE_LENGTH_TYPE_AUTO"] = 3; - return values; - })(); + UpdateProfileRequest.prototype.updateMask = null; /** - * SwimUnit enum. - * @name google.devicesandservices.health.v4.Settings.SwimUnit - * @enum {number} - * @property {number} SWIM_UNIT_UNSPECIFIED=0 SWIM_UNIT_UNSPECIFIED value - * @property {number} SWIM_UNIT_METERS=1 SWIM_UNIT_METERS value - * @property {number} SWIM_UNIT_YARDS=2 SWIM_UNIT_YARDS value + * Creates a new UpdateProfileRequest instance using the specified properties. + * @function create + * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @static + * @param {google.devicesandservices.health.v4.IUpdateProfileRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.UpdateProfileRequest} UpdateProfileRequest instance */ - Settings.SwimUnit = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SWIM_UNIT_UNSPECIFIED"] = 0; - values[valuesById[1] = "SWIM_UNIT_METERS"] = 1; - values[valuesById[2] = "SWIM_UNIT_YARDS"] = 2; - return values; - })(); + UpdateProfileRequest.create = function create(properties) { + return new UpdateProfileRequest(properties); + }; /** - * TemperatureUnit enum. - * @name google.devicesandservices.health.v4.Settings.TemperatureUnit - * @enum {number} - * @property {number} TEMPERATURE_UNIT_UNSPECIFIED=0 TEMPERATURE_UNIT_UNSPECIFIED value - * @property {number} TEMPERATURE_UNIT_CELSIUS=1 TEMPERATURE_UNIT_CELSIUS value - * @property {number} TEMPERATURE_UNIT_FAHRENHEIT=2 TEMPERATURE_UNIT_FAHRENHEIT value + * Encodes the specified UpdateProfileRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @static + * @param {google.devicesandservices.health.v4.IUpdateProfileRequest} message UpdateProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Settings.TemperatureUnit = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TEMPERATURE_UNIT_UNSPECIFIED"] = 0; - values[valuesById[1] = "TEMPERATURE_UNIT_CELSIUS"] = 1; - values[valuesById[2] = "TEMPERATURE_UNIT_FAHRENHEIT"] = 2; - return values; - })(); + UpdateProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.profile != null && Object.hasOwnProperty.call(message, "profile")) + $root.google.devicesandservices.health.v4.Profile.encode(message.profile, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * WeightUnit enum. - * @name google.devicesandservices.health.v4.Settings.WeightUnit - * @enum {number} - * @property {number} WEIGHT_UNIT_UNSPECIFIED=0 WEIGHT_UNIT_UNSPECIFIED value - * @property {number} WEIGHT_UNIT_POUNDS=1 WEIGHT_UNIT_POUNDS value - * @property {number} WEIGHT_UNIT_STONE=2 WEIGHT_UNIT_STONE value - * @property {number} WEIGHT_UNIT_KILOGRAMS=3 WEIGHT_UNIT_KILOGRAMS value + * Encodes the specified UpdateProfileRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @static + * @param {google.devicesandservices.health.v4.IUpdateProfileRequest} message UpdateProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devicesandservices.health.v4.UpdateProfileRequest} UpdateProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProfileRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.UpdateProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.profile = $root.google.devicesandservices.health.v4.Profile.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devicesandservices.health.v4.UpdateProfileRequest} UpdateProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateProfileRequest message. + * @function verify + * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProfileRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.profile != null && message.hasOwnProperty("profile")) { + var error = $root.google.devicesandservices.health.v4.Profile.verify(message.profile); + if (error) + return "profile." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devicesandservices.health.v4.UpdateProfileRequest} UpdateProfileRequest + */ + UpdateProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.UpdateProfileRequest) + return object; + var message = new $root.google.devicesandservices.health.v4.UpdateProfileRequest(); + if (object.profile != null) { + if (typeof object.profile !== "object") + throw TypeError(".google.devicesandservices.health.v4.UpdateProfileRequest.profile: object expected"); + message.profile = $root.google.devicesandservices.health.v4.Profile.fromObject(object.profile); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.devicesandservices.health.v4.UpdateProfileRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @static + * @param {google.devicesandservices.health.v4.UpdateProfileRequest} message UpdateProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.profile = null; + object.updateMask = null; + } + if (message.profile != null && message.hasOwnProperty("profile")) + object.profile = $root.google.devicesandservices.health.v4.Profile.toObject(message.profile, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateProfileRequest to JSON. + * @function toJSON + * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @instance + * @returns {Object.} JSON object */ - Settings.WeightUnit = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "WEIGHT_UNIT_UNSPECIFIED"] = 0; - values[valuesById[1] = "WEIGHT_UNIT_POUNDS"] = 1; - values[valuesById[2] = "WEIGHT_UNIT_STONE"] = 2; - values[valuesById[3] = "WEIGHT_UNIT_KILOGRAMS"] = 3; - return values; - })(); + UpdateProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * WaterUnit enum. - * @name google.devicesandservices.health.v4.Settings.WaterUnit - * @enum {number} - * @property {number} WATER_UNIT_UNSPECIFIED=0 WATER_UNIT_UNSPECIFIED value - * @property {number} WATER_UNIT_ML=1 WATER_UNIT_ML value - * @property {number} WATER_UNIT_FL_OZ=2 WATER_UNIT_FL_OZ value - * @property {number} WATER_UNIT_CUP=3 WATER_UNIT_CUP value + * Gets the default type url for UpdateProfileRequest + * @function getTypeUrl + * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Settings.WaterUnit = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "WATER_UNIT_UNSPECIFIED"] = 0; - values[valuesById[1] = "WATER_UNIT_ML"] = 1; - values[valuesById[2] = "WATER_UNIT_FL_OZ"] = 2; - values[valuesById[3] = "WATER_UNIT_CUP"] = 3; - return values; - })(); + UpdateProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devicesandservices.health.v4.UpdateProfileRequest"; + }; - return Settings; + return UpdateProfileRequest; })(); - v4.Identity = (function() { + v4.GetSettingsRequest = (function() { /** - * Properties of an Identity. + * Properties of a GetSettingsRequest. * @memberof google.devicesandservices.health.v4 - * @interface IIdentity - * @property {string|null} [name] Identity name - * @property {string|null} [legacyUserId] Identity legacyUserId - * @property {string|null} [healthUserId] Identity healthUserId + * @interface IGetSettingsRequest + * @property {string|null} [name] GetSettingsRequest name */ /** - * Constructs a new Identity. + * Constructs a new GetSettingsRequest. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents an Identity. - * @implements IIdentity + * @classdesc Represents a GetSettingsRequest. + * @implements IGetSettingsRequest * @constructor - * @param {google.devicesandservices.health.v4.IIdentity=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IGetSettingsRequest=} [properties] Properties to set */ - function Identity(properties) { + function GetSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33679,90 +50350,70 @@ } /** - * Identity name. + * GetSettingsRequest name. * @member {string} name - * @memberof google.devicesandservices.health.v4.Identity - * @instance - */ - Identity.prototype.name = ""; - - /** - * Identity legacyUserId. - * @member {string} legacyUserId - * @memberof google.devicesandservices.health.v4.Identity - * @instance - */ - Identity.prototype.legacyUserId = ""; - - /** - * Identity healthUserId. - * @member {string} healthUserId - * @memberof google.devicesandservices.health.v4.Identity + * @memberof google.devicesandservices.health.v4.GetSettingsRequest * @instance */ - Identity.prototype.healthUserId = ""; + GetSettingsRequest.prototype.name = ""; /** - * Creates a new Identity instance using the specified properties. + * Creates a new GetSettingsRequest instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.Identity + * @memberof google.devicesandservices.health.v4.GetSettingsRequest * @static - * @param {google.devicesandservices.health.v4.IIdentity=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.Identity} Identity instance + * @param {google.devicesandservices.health.v4.IGetSettingsRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.GetSettingsRequest} GetSettingsRequest instance */ - Identity.create = function create(properties) { - return new Identity(properties); + GetSettingsRequest.create = function create(properties) { + return new GetSettingsRequest(properties); }; /** - * Encodes the specified Identity message. Does not implicitly {@link google.devicesandservices.health.v4.Identity.verify|verify} messages. + * Encodes the specified GetSettingsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetSettingsRequest.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.Identity + * @memberof google.devicesandservices.health.v4.GetSettingsRequest * @static - * @param {google.devicesandservices.health.v4.IIdentity} message Identity message or plain object to encode + * @param {google.devicesandservices.health.v4.IGetSettingsRequest} message GetSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Identity.encode = function encode(message, writer) { + GetSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.legacyUserId != null && Object.hasOwnProperty.call(message, "legacyUserId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.legacyUserId); - if (message.healthUserId != null && Object.hasOwnProperty.call(message, "healthUserId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.healthUserId); return writer; }; /** - * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.Identity.verify|verify} messages. + * Encodes the specified GetSettingsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetSettingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.Identity + * @memberof google.devicesandservices.health.v4.GetSettingsRequest * @static - * @param {google.devicesandservices.health.v4.IIdentity} message Identity message or plain object to encode + * @param {google.devicesandservices.health.v4.IGetSettingsRequest} message GetSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Identity.encodeDelimited = function encodeDelimited(message, writer) { + GetSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Identity message from the specified reader or buffer. + * Decodes a GetSettingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.Identity + * @memberof google.devicesandservices.health.v4.GetSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.Identity} Identity + * @returns {google.devicesandservices.health.v4.GetSettingsRequest} GetSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Identity.decode = function decode(reader, length, error) { + GetSettingsRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.Identity(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.GetSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -33772,14 +50423,6 @@ message.name = reader.string(); break; } - case 2: { - message.legacyUserId = reader.string(); - break; - } - case 3: { - message.healthUserId = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -33789,139 +50432,123 @@ }; /** - * Decodes an Identity message from the specified reader or buffer, length delimited. + * Decodes a GetSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.Identity + * @memberof google.devicesandservices.health.v4.GetSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.Identity} Identity + * @returns {google.devicesandservices.health.v4.GetSettingsRequest} GetSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Identity.decodeDelimited = function decodeDelimited(reader) { + GetSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Identity message. + * Verifies a GetSettingsRequest message. * @function verify - * @memberof google.devicesandservices.health.v4.Identity + * @memberof google.devicesandservices.health.v4.GetSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Identity.verify = function verify(message) { + GetSettingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.legacyUserId != null && message.hasOwnProperty("legacyUserId")) - if (!$util.isString(message.legacyUserId)) - return "legacyUserId: string expected"; - if (message.healthUserId != null && message.hasOwnProperty("healthUserId")) - if (!$util.isString(message.healthUserId)) - return "healthUserId: string expected"; return null; }; /** - * Creates an Identity message from a plain object. Also converts values to their respective internal types. + * Creates a GetSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.Identity + * @memberof google.devicesandservices.health.v4.GetSettingsRequest * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.Identity} Identity + * @returns {google.devicesandservices.health.v4.GetSettingsRequest} GetSettingsRequest */ - Identity.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.Identity) + GetSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.GetSettingsRequest) return object; - var message = new $root.google.devicesandservices.health.v4.Identity(); + var message = new $root.google.devicesandservices.health.v4.GetSettingsRequest(); if (object.name != null) message.name = String(object.name); - if (object.legacyUserId != null) - message.legacyUserId = String(object.legacyUserId); - if (object.healthUserId != null) - message.healthUserId = String(object.healthUserId); return message; }; /** - * Creates a plain object from an Identity message. Also converts values to other types if specified. + * Creates a plain object from a GetSettingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.Identity + * @memberof google.devicesandservices.health.v4.GetSettingsRequest * @static - * @param {google.devicesandservices.health.v4.Identity} message Identity + * @param {google.devicesandservices.health.v4.GetSettingsRequest} message GetSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Identity.toObject = function toObject(message, options) { + GetSettingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.legacyUserId = ""; - object.healthUserId = ""; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.legacyUserId != null && message.hasOwnProperty("legacyUserId")) - object.legacyUserId = message.legacyUserId; - if (message.healthUserId != null && message.hasOwnProperty("healthUserId")) - object.healthUserId = message.healthUserId; return object; }; /** - * Converts this Identity to JSON. + * Converts this GetSettingsRequest to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.Identity + * @memberof google.devicesandservices.health.v4.GetSettingsRequest * @instance * @returns {Object.} JSON object */ - Identity.prototype.toJSON = function toJSON() { + GetSettingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Identity + * Gets the default type url for GetSettingsRequest * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.Identity + * @memberof google.devicesandservices.health.v4.GetSettingsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Identity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.Identity"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.GetSettingsRequest"; }; - return Identity; + return GetSettingsRequest; })(); - v4.GetProfileRequest = (function() { + v4.UpdateSettingsRequest = (function() { /** - * Properties of a GetProfileRequest. + * Properties of an UpdateSettingsRequest. * @memberof google.devicesandservices.health.v4 - * @interface IGetProfileRequest - * @property {string|null} [name] GetProfileRequest name + * @interface IUpdateSettingsRequest + * @property {google.devicesandservices.health.v4.ISettings|null} [settings] UpdateSettingsRequest settings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSettingsRequest updateMask */ /** - * Constructs a new GetProfileRequest. + * Constructs a new UpdateSettingsRequest. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a GetProfileRequest. - * @implements IGetProfileRequest + * @classdesc Represents an UpdateSettingsRequest. + * @implements IUpdateSettingsRequest * @constructor - * @param {google.devicesandservices.health.v4.IGetProfileRequest=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IUpdateSettingsRequest=} [properties] Properties to set */ - function GetProfileRequest(properties) { + function UpdateSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33929,77 +50556,91 @@ } /** - * GetProfileRequest name. - * @member {string} name - * @memberof google.devicesandservices.health.v4.GetProfileRequest + * UpdateSettingsRequest settings. + * @member {google.devicesandservices.health.v4.ISettings|null|undefined} settings + * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest * @instance */ - GetProfileRequest.prototype.name = ""; + UpdateSettingsRequest.prototype.settings = null; /** - * Creates a new GetProfileRequest instance using the specified properties. + * UpdateSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest + * @instance + */ + UpdateSettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSettingsRequest instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.GetProfileRequest + * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest * @static - * @param {google.devicesandservices.health.v4.IGetProfileRequest=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.GetProfileRequest} GetProfileRequest instance + * @param {google.devicesandservices.health.v4.IUpdateSettingsRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.UpdateSettingsRequest} UpdateSettingsRequest instance */ - GetProfileRequest.create = function create(properties) { - return new GetProfileRequest(properties); + UpdateSettingsRequest.create = function create(properties) { + return new UpdateSettingsRequest(properties); }; /** - * Encodes the specified GetProfileRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetProfileRequest.verify|verify} messages. + * Encodes the specified UpdateSettingsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSettingsRequest.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.GetProfileRequest + * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest * @static - * @param {google.devicesandservices.health.v4.IGetProfileRequest} message GetProfileRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IUpdateSettingsRequest} message UpdateSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetProfileRequest.encode = function encode(message, writer) { + UpdateSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) + $root.google.devicesandservices.health.v4.Settings.encode(message.settings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetProfileRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetProfileRequest.verify|verify} messages. + * Encodes the specified UpdateSettingsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSettingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.GetProfileRequest + * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest * @static - * @param {google.devicesandservices.health.v4.IGetProfileRequest} message GetProfileRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IUpdateSettingsRequest} message UpdateSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetProfileRequest message from the specified reader or buffer. + * Decodes an UpdateSettingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.GetProfileRequest + * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.GetProfileRequest} GetProfileRequest + * @returns {google.devicesandservices.health.v4.UpdateSettingsRequest} UpdateSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetProfileRequest.decode = function decode(reader, length, error) { + UpdateSettingsRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.GetProfileRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.UpdateSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.settings = $root.google.devicesandservices.health.v4.Settings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -34011,123 +50652,141 @@ }; /** - * Decodes a GetProfileRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.GetProfileRequest + * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.GetProfileRequest} GetProfileRequest + * @returns {google.devicesandservices.health.v4.UpdateSettingsRequest} UpdateSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetProfileRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetProfileRequest message. + * Verifies an UpdateSettingsRequest message. * @function verify - * @memberof google.devicesandservices.health.v4.GetProfileRequest + * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetProfileRequest.verify = function verify(message) { + UpdateSettingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.settings != null && message.hasOwnProperty("settings")) { + var error = $root.google.devicesandservices.health.v4.Settings.verify(message.settings); + if (error) + return "settings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; /** - * Creates a GetProfileRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.GetProfileRequest + * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.GetProfileRequest} GetProfileRequest + * @returns {google.devicesandservices.health.v4.UpdateSettingsRequest} UpdateSettingsRequest */ - GetProfileRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.GetProfileRequest) + UpdateSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.UpdateSettingsRequest) return object; - var message = new $root.google.devicesandservices.health.v4.GetProfileRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.devicesandservices.health.v4.UpdateSettingsRequest(); + if (object.settings != null) { + if (typeof object.settings !== "object") + throw TypeError(".google.devicesandservices.health.v4.UpdateSettingsRequest.settings: object expected"); + message.settings = $root.google.devicesandservices.health.v4.Settings.fromObject(object.settings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.devicesandservices.health.v4.UpdateSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a GetProfileRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSettingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.GetProfileRequest + * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest * @static - * @param {google.devicesandservices.health.v4.GetProfileRequest} message GetProfileRequest + * @param {google.devicesandservices.health.v4.UpdateSettingsRequest} message UpdateSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetProfileRequest.toObject = function toObject(message, options) { + UpdateSettingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.settings = null; + object.updateMask = null; + } + if (message.settings != null && message.hasOwnProperty("settings")) + object.settings = $root.google.devicesandservices.health.v4.Settings.toObject(message.settings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this GetProfileRequest to JSON. + * Converts this UpdateSettingsRequest to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.GetProfileRequest + * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest * @instance * @returns {Object.} JSON object */ - GetProfileRequest.prototype.toJSON = function toJSON() { + UpdateSettingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetProfileRequest + * Gets the default type url for UpdateSettingsRequest * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.GetProfileRequest + * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.GetProfileRequest"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.UpdateSettingsRequest"; }; - return GetProfileRequest; + return UpdateSettingsRequest; })(); - v4.UpdateProfileRequest = (function() { + v4.GetIdentityRequest = (function() { /** - * Properties of an UpdateProfileRequest. + * Properties of a GetIdentityRequest. * @memberof google.devicesandservices.health.v4 - * @interface IUpdateProfileRequest - * @property {google.devicesandservices.health.v4.IProfile|null} [profile] UpdateProfileRequest profile - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProfileRequest updateMask + * @interface IGetIdentityRequest + * @property {string|null} [name] GetIdentityRequest name */ /** - * Constructs a new UpdateProfileRequest. + * Constructs a new GetIdentityRequest. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents an UpdateProfileRequest. - * @implements IUpdateProfileRequest + * @classdesc Represents a GetIdentityRequest. + * @implements IGetIdentityRequest * @constructor - * @param {google.devicesandservices.health.v4.IUpdateProfileRequest=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IGetIdentityRequest=} [properties] Properties to set */ - function UpdateProfileRequest(properties) { + function GetIdentityRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34135,91 +50794,77 @@ } /** - * UpdateProfileRequest profile. - * @member {google.devicesandservices.health.v4.IProfile|null|undefined} profile - * @memberof google.devicesandservices.health.v4.UpdateProfileRequest - * @instance - */ - UpdateProfileRequest.prototype.profile = null; - - /** - * UpdateProfileRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * GetIdentityRequest name. + * @member {string} name + * @memberof google.devicesandservices.health.v4.GetIdentityRequest * @instance */ - UpdateProfileRequest.prototype.updateMask = null; + GetIdentityRequest.prototype.name = ""; /** - * Creates a new UpdateProfileRequest instance using the specified properties. + * Creates a new GetIdentityRequest instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @memberof google.devicesandservices.health.v4.GetIdentityRequest * @static - * @param {google.devicesandservices.health.v4.IUpdateProfileRequest=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.UpdateProfileRequest} UpdateProfileRequest instance + * @param {google.devicesandservices.health.v4.IGetIdentityRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.GetIdentityRequest} GetIdentityRequest instance */ - UpdateProfileRequest.create = function create(properties) { - return new UpdateProfileRequest(properties); + GetIdentityRequest.create = function create(properties) { + return new GetIdentityRequest(properties); }; /** - * Encodes the specified UpdateProfileRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateProfileRequest.verify|verify} messages. + * Encodes the specified GetIdentityRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetIdentityRequest.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @memberof google.devicesandservices.health.v4.GetIdentityRequest * @static - * @param {google.devicesandservices.health.v4.IUpdateProfileRequest} message UpdateProfileRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IGetIdentityRequest} message GetIdentityRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateProfileRequest.encode = function encode(message, writer) { + GetIdentityRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.profile != null && Object.hasOwnProperty.call(message, "profile")) - $root.google.devicesandservices.health.v4.Profile.encode(message.profile, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified UpdateProfileRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateProfileRequest.verify|verify} messages. + * Encodes the specified GetIdentityRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetIdentityRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @memberof google.devicesandservices.health.v4.GetIdentityRequest * @static - * @param {google.devicesandservices.health.v4.IUpdateProfileRequest} message UpdateProfileRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IGetIdentityRequest} message GetIdentityRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateProfileRequest message from the specified reader or buffer. + * Decodes a GetIdentityRequest message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @memberof google.devicesandservices.health.v4.GetIdentityRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.UpdateProfileRequest} UpdateProfileRequest + * @returns {google.devicesandservices.health.v4.GetIdentityRequest} GetIdentityRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateProfileRequest.decode = function decode(reader, length, error) { + GetIdentityRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.UpdateProfileRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.GetIdentityRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.profile = $root.google.devicesandservices.health.v4.Profile.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.name = reader.string(); break; } default: @@ -34231,141 +50876,122 @@ }; /** - * Decodes an UpdateProfileRequest message from the specified reader or buffer, length delimited. + * Decodes a GetIdentityRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @memberof google.devicesandservices.health.v4.GetIdentityRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.UpdateProfileRequest} UpdateProfileRequest + * @returns {google.devicesandservices.health.v4.GetIdentityRequest} GetIdentityRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateProfileRequest.decodeDelimited = function decodeDelimited(reader) { + GetIdentityRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateProfileRequest message. + * Verifies a GetIdentityRequest message. * @function verify - * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @memberof google.devicesandservices.health.v4.GetIdentityRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateProfileRequest.verify = function verify(message) { + GetIdentityRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.profile != null && message.hasOwnProperty("profile")) { - var error = $root.google.devicesandservices.health.v4.Profile.verify(message.profile); - if (error) - return "profile." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an UpdateProfileRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetIdentityRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @memberof google.devicesandservices.health.v4.GetIdentityRequest * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.UpdateProfileRequest} UpdateProfileRequest + * @returns {google.devicesandservices.health.v4.GetIdentityRequest} GetIdentityRequest */ - UpdateProfileRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.UpdateProfileRequest) + GetIdentityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.GetIdentityRequest) return object; - var message = new $root.google.devicesandservices.health.v4.UpdateProfileRequest(); - if (object.profile != null) { - if (typeof object.profile !== "object") - throw TypeError(".google.devicesandservices.health.v4.UpdateProfileRequest.profile: object expected"); - message.profile = $root.google.devicesandservices.health.v4.Profile.fromObject(object.profile); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.devicesandservices.health.v4.UpdateProfileRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.devicesandservices.health.v4.GetIdentityRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an UpdateProfileRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetIdentityRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @memberof google.devicesandservices.health.v4.GetIdentityRequest * @static - * @param {google.devicesandservices.health.v4.UpdateProfileRequest} message UpdateProfileRequest + * @param {google.devicesandservices.health.v4.GetIdentityRequest} message GetIdentityRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateProfileRequest.toObject = function toObject(message, options) { + GetIdentityRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.profile = null; - object.updateMask = null; - } - if (message.profile != null && message.hasOwnProperty("profile")) - object.profile = $root.google.devicesandservices.health.v4.Profile.toObject(message.profile, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this UpdateProfileRequest to JSON. + * Converts this GetIdentityRequest to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @memberof google.devicesandservices.health.v4.GetIdentityRequest * @instance * @returns {Object.} JSON object */ - UpdateProfileRequest.prototype.toJSON = function toJSON() { + GetIdentityRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateProfileRequest + * Gets the default type url for GetIdentityRequest * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.UpdateProfileRequest + * @memberof google.devicesandservices.health.v4.GetIdentityRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetIdentityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.UpdateProfileRequest"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.GetIdentityRequest"; }; - return UpdateProfileRequest; + return GetIdentityRequest; })(); - v4.GetSettingsRequest = (function() { + v4.GetPairedDeviceRequest = (function() { /** - * Properties of a GetSettingsRequest. + * Properties of a GetPairedDeviceRequest. * @memberof google.devicesandservices.health.v4 - * @interface IGetSettingsRequest - * @property {string|null} [name] GetSettingsRequest name + * @interface IGetPairedDeviceRequest + * @property {string|null} [name] GetPairedDeviceRequest name */ /** - * Constructs a new GetSettingsRequest. + * Constructs a new GetPairedDeviceRequest. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a GetSettingsRequest. - * @implements IGetSettingsRequest + * @classdesc Represents a GetPairedDeviceRequest. + * @implements IGetPairedDeviceRequest * @constructor - * @param {google.devicesandservices.health.v4.IGetSettingsRequest=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IGetPairedDeviceRequest=} [properties] Properties to set */ - function GetSettingsRequest(properties) { + function GetPairedDeviceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34373,35 +50999,35 @@ } /** - * GetSettingsRequest name. + * GetPairedDeviceRequest name. * @member {string} name - * @memberof google.devicesandservices.health.v4.GetSettingsRequest + * @memberof google.devicesandservices.health.v4.GetPairedDeviceRequest * @instance */ - GetSettingsRequest.prototype.name = ""; + GetPairedDeviceRequest.prototype.name = ""; /** - * Creates a new GetSettingsRequest instance using the specified properties. + * Creates a new GetPairedDeviceRequest instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.GetSettingsRequest + * @memberof google.devicesandservices.health.v4.GetPairedDeviceRequest * @static - * @param {google.devicesandservices.health.v4.IGetSettingsRequest=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.GetSettingsRequest} GetSettingsRequest instance + * @param {google.devicesandservices.health.v4.IGetPairedDeviceRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.GetPairedDeviceRequest} GetPairedDeviceRequest instance */ - GetSettingsRequest.create = function create(properties) { - return new GetSettingsRequest(properties); + GetPairedDeviceRequest.create = function create(properties) { + return new GetPairedDeviceRequest(properties); }; /** - * Encodes the specified GetSettingsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetSettingsRequest.verify|verify} messages. + * Encodes the specified GetPairedDeviceRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetPairedDeviceRequest.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.GetSettingsRequest + * @memberof google.devicesandservices.health.v4.GetPairedDeviceRequest * @static - * @param {google.devicesandservices.health.v4.IGetSettingsRequest} message GetSettingsRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IGetPairedDeviceRequest} message GetPairedDeviceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSettingsRequest.encode = function encode(message, writer) { + GetPairedDeviceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -34410,33 +51036,33 @@ }; /** - * Encodes the specified GetSettingsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetSettingsRequest.verify|verify} messages. + * Encodes the specified GetPairedDeviceRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetPairedDeviceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.GetSettingsRequest + * @memberof google.devicesandservices.health.v4.GetPairedDeviceRequest * @static - * @param {google.devicesandservices.health.v4.IGetSettingsRequest} message GetSettingsRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IGetPairedDeviceRequest} message GetPairedDeviceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetPairedDeviceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSettingsRequest message from the specified reader or buffer. + * Decodes a GetPairedDeviceRequest message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.GetSettingsRequest + * @memberof google.devicesandservices.health.v4.GetPairedDeviceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.GetSettingsRequest} GetSettingsRequest + * @returns {google.devicesandservices.health.v4.GetPairedDeviceRequest} GetPairedDeviceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSettingsRequest.decode = function decode(reader, length, error) { + GetPairedDeviceRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.GetSettingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.GetPairedDeviceRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -34455,30 +51081,30 @@ }; /** - * Decodes a GetSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetPairedDeviceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.GetSettingsRequest + * @memberof google.devicesandservices.health.v4.GetPairedDeviceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.GetSettingsRequest} GetSettingsRequest + * @returns {google.devicesandservices.health.v4.GetPairedDeviceRequest} GetPairedDeviceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + GetPairedDeviceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSettingsRequest message. + * Verifies a GetPairedDeviceRequest message. * @function verify - * @memberof google.devicesandservices.health.v4.GetSettingsRequest + * @memberof google.devicesandservices.health.v4.GetPairedDeviceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSettingsRequest.verify = function verify(message) { + GetPairedDeviceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -34488,32 +51114,32 @@ }; /** - * Creates a GetSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetPairedDeviceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.GetSettingsRequest + * @memberof google.devicesandservices.health.v4.GetPairedDeviceRequest * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.GetSettingsRequest} GetSettingsRequest + * @returns {google.devicesandservices.health.v4.GetPairedDeviceRequest} GetPairedDeviceRequest */ - GetSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.GetSettingsRequest) + GetPairedDeviceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.GetPairedDeviceRequest) return object; - var message = new $root.google.devicesandservices.health.v4.GetSettingsRequest(); + var message = new $root.google.devicesandservices.health.v4.GetPairedDeviceRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetSettingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetPairedDeviceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.GetSettingsRequest + * @memberof google.devicesandservices.health.v4.GetPairedDeviceRequest * @static - * @param {google.devicesandservices.health.v4.GetSettingsRequest} message GetSettingsRequest + * @param {google.devicesandservices.health.v4.GetPairedDeviceRequest} message GetPairedDeviceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSettingsRequest.toObject = function toObject(message, options) { + GetPairedDeviceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -34525,53 +51151,54 @@ }; /** - * Converts this GetSettingsRequest to JSON. + * Converts this GetPairedDeviceRequest to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.GetSettingsRequest + * @memberof google.devicesandservices.health.v4.GetPairedDeviceRequest * @instance * @returns {Object.} JSON object */ - GetSettingsRequest.prototype.toJSON = function toJSON() { + GetPairedDeviceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetSettingsRequest + * Gets the default type url for GetPairedDeviceRequest * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.GetSettingsRequest + * @memberof google.devicesandservices.health.v4.GetPairedDeviceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetPairedDeviceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.GetSettingsRequest"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.GetPairedDeviceRequest"; }; - return GetSettingsRequest; + return GetPairedDeviceRequest; })(); - v4.UpdateSettingsRequest = (function() { + v4.ListPairedDevicesRequest = (function() { /** - * Properties of an UpdateSettingsRequest. + * Properties of a ListPairedDevicesRequest. * @memberof google.devicesandservices.health.v4 - * @interface IUpdateSettingsRequest - * @property {google.devicesandservices.health.v4.ISettings|null} [settings] UpdateSettingsRequest settings - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSettingsRequest updateMask + * @interface IListPairedDevicesRequest + * @property {string|null} [parent] ListPairedDevicesRequest parent + * @property {number|null} [pageSize] ListPairedDevicesRequest pageSize + * @property {string|null} [pageToken] ListPairedDevicesRequest pageToken */ /** - * Constructs a new UpdateSettingsRequest. + * Constructs a new ListPairedDevicesRequest. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents an UpdateSettingsRequest. - * @implements IUpdateSettingsRequest + * @classdesc Represents a ListPairedDevicesRequest. + * @implements IListPairedDevicesRequest * @constructor - * @param {google.devicesandservices.health.v4.IUpdateSettingsRequest=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IListPairedDevicesRequest=} [properties] Properties to set */ - function UpdateSettingsRequest(properties) { + function ListPairedDevicesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34579,91 +51206,105 @@ } /** - * UpdateSettingsRequest settings. - * @member {google.devicesandservices.health.v4.ISettings|null|undefined} settings - * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest + * ListPairedDevicesRequest parent. + * @member {string} parent + * @memberof google.devicesandservices.health.v4.ListPairedDevicesRequest * @instance */ - UpdateSettingsRequest.prototype.settings = null; + ListPairedDevicesRequest.prototype.parent = ""; /** - * UpdateSettingsRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest + * ListPairedDevicesRequest pageSize. + * @member {number} pageSize + * @memberof google.devicesandservices.health.v4.ListPairedDevicesRequest * @instance */ - UpdateSettingsRequest.prototype.updateMask = null; + ListPairedDevicesRequest.prototype.pageSize = 0; /** - * Creates a new UpdateSettingsRequest instance using the specified properties. + * ListPairedDevicesRequest pageToken. + * @member {string} pageToken + * @memberof google.devicesandservices.health.v4.ListPairedDevicesRequest + * @instance + */ + ListPairedDevicesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPairedDevicesRequest instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesRequest * @static - * @param {google.devicesandservices.health.v4.IUpdateSettingsRequest=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.UpdateSettingsRequest} UpdateSettingsRequest instance + * @param {google.devicesandservices.health.v4.IListPairedDevicesRequest=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ListPairedDevicesRequest} ListPairedDevicesRequest instance */ - UpdateSettingsRequest.create = function create(properties) { - return new UpdateSettingsRequest(properties); + ListPairedDevicesRequest.create = function create(properties) { + return new ListPairedDevicesRequest(properties); }; /** - * Encodes the specified UpdateSettingsRequest message. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSettingsRequest.verify|verify} messages. + * Encodes the specified ListPairedDevicesRequest message. Does not implicitly {@link google.devicesandservices.health.v4.ListPairedDevicesRequest.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesRequest * @static - * @param {google.devicesandservices.health.v4.IUpdateSettingsRequest} message UpdateSettingsRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IListPairedDevicesRequest} message ListPairedDevicesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSettingsRequest.encode = function encode(message, writer) { + ListPairedDevicesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) - $root.google.devicesandservices.health.v4.Settings.encode(message.settings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified UpdateSettingsRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.UpdateSettingsRequest.verify|verify} messages. + * Encodes the specified ListPairedDevicesRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListPairedDevicesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesRequest * @static - * @param {google.devicesandservices.health.v4.IUpdateSettingsRequest} message UpdateSettingsRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IListPairedDevicesRequest} message ListPairedDevicesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListPairedDevicesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSettingsRequest message from the specified reader or buffer. + * Decodes a ListPairedDevicesRequest message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.UpdateSettingsRequest} UpdateSettingsRequest + * @returns {google.devicesandservices.health.v4.ListPairedDevicesRequest} ListPairedDevicesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSettingsRequest.decode = function decode(reader, length, error) { + ListPairedDevicesRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.UpdateSettingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ListPairedDevicesRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.settings = $root.google.devicesandservices.health.v4.Settings.decode(reader, reader.uint32()); + message.parent = reader.string(); break; } case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); break; } default: @@ -34675,141 +51316,141 @@ }; /** - * Decodes an UpdateSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListPairedDevicesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.UpdateSettingsRequest} UpdateSettingsRequest + * @returns {google.devicesandservices.health.v4.ListPairedDevicesRequest} ListPairedDevicesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + ListPairedDevicesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSettingsRequest message. + * Verifies a ListPairedDevicesRequest message. * @function verify - * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSettingsRequest.verify = function verify(message) { + ListPairedDevicesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.settings != null && message.hasOwnProperty("settings")) { - var error = $root.google.devicesandservices.health.v4.Settings.verify(message.settings); - if (error) - return "settings." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates an UpdateSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListPairedDevicesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesRequest * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.UpdateSettingsRequest} UpdateSettingsRequest + * @returns {google.devicesandservices.health.v4.ListPairedDevicesRequest} ListPairedDevicesRequest */ - UpdateSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.UpdateSettingsRequest) + ListPairedDevicesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ListPairedDevicesRequest) return object; - var message = new $root.google.devicesandservices.health.v4.UpdateSettingsRequest(); - if (object.settings != null) { - if (typeof object.settings !== "object") - throw TypeError(".google.devicesandservices.health.v4.UpdateSettingsRequest.settings: object expected"); - message.settings = $root.google.devicesandservices.health.v4.Settings.fromObject(object.settings); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.devicesandservices.health.v4.UpdateSettingsRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.devicesandservices.health.v4.ListPairedDevicesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from an UpdateSettingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListPairedDevicesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesRequest * @static - * @param {google.devicesandservices.health.v4.UpdateSettingsRequest} message UpdateSettingsRequest + * @param {google.devicesandservices.health.v4.ListPairedDevicesRequest} message ListPairedDevicesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSettingsRequest.toObject = function toObject(message, options) { + ListPairedDevicesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.settings = null; - object.updateMask = null; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.settings != null && message.hasOwnProperty("settings")) - object.settings = $root.google.devicesandservices.health.v4.Settings.toObject(message.settings, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this UpdateSettingsRequest to JSON. + * Converts this ListPairedDevicesRequest to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesRequest * @instance * @returns {Object.} JSON object */ - UpdateSettingsRequest.prototype.toJSON = function toJSON() { + ListPairedDevicesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateSettingsRequest + * Gets the default type url for ListPairedDevicesRequest * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.UpdateSettingsRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListPairedDevicesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.UpdateSettingsRequest"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.ListPairedDevicesRequest"; }; - return UpdateSettingsRequest; + return ListPairedDevicesRequest; })(); - v4.GetIdentityRequest = (function() { + v4.ListPairedDevicesResponse = (function() { /** - * Properties of a GetIdentityRequest. + * Properties of a ListPairedDevicesResponse. * @memberof google.devicesandservices.health.v4 - * @interface IGetIdentityRequest - * @property {string|null} [name] GetIdentityRequest name + * @interface IListPairedDevicesResponse + * @property {Array.|null} [pairedDevices] ListPairedDevicesResponse pairedDevices + * @property {string|null} [nextPageToken] ListPairedDevicesResponse nextPageToken */ /** - * Constructs a new GetIdentityRequest. + * Constructs a new ListPairedDevicesResponse. * @memberof google.devicesandservices.health.v4 - * @classdesc Represents a GetIdentityRequest. - * @implements IGetIdentityRequest + * @classdesc Represents a ListPairedDevicesResponse. + * @implements IListPairedDevicesResponse * @constructor - * @param {google.devicesandservices.health.v4.IGetIdentityRequest=} [properties] Properties to set + * @param {google.devicesandservices.health.v4.IListPairedDevicesResponse=} [properties] Properties to set */ - function GetIdentityRequest(properties) { + function ListPairedDevicesResponse(properties) { + this.pairedDevices = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34817,77 +51458,94 @@ } /** - * GetIdentityRequest name. - * @member {string} name - * @memberof google.devicesandservices.health.v4.GetIdentityRequest + * ListPairedDevicesResponse pairedDevices. + * @member {Array.} pairedDevices + * @memberof google.devicesandservices.health.v4.ListPairedDevicesResponse * @instance */ - GetIdentityRequest.prototype.name = ""; + ListPairedDevicesResponse.prototype.pairedDevices = $util.emptyArray; /** - * Creates a new GetIdentityRequest instance using the specified properties. + * ListPairedDevicesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.devicesandservices.health.v4.ListPairedDevicesResponse + * @instance + */ + ListPairedDevicesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPairedDevicesResponse instance using the specified properties. * @function create - * @memberof google.devicesandservices.health.v4.GetIdentityRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesResponse * @static - * @param {google.devicesandservices.health.v4.IGetIdentityRequest=} [properties] Properties to set - * @returns {google.devicesandservices.health.v4.GetIdentityRequest} GetIdentityRequest instance + * @param {google.devicesandservices.health.v4.IListPairedDevicesResponse=} [properties] Properties to set + * @returns {google.devicesandservices.health.v4.ListPairedDevicesResponse} ListPairedDevicesResponse instance */ - GetIdentityRequest.create = function create(properties) { - return new GetIdentityRequest(properties); + ListPairedDevicesResponse.create = function create(properties) { + return new ListPairedDevicesResponse(properties); }; /** - * Encodes the specified GetIdentityRequest message. Does not implicitly {@link google.devicesandservices.health.v4.GetIdentityRequest.verify|verify} messages. + * Encodes the specified ListPairedDevicesResponse message. Does not implicitly {@link google.devicesandservices.health.v4.ListPairedDevicesResponse.verify|verify} messages. * @function encode - * @memberof google.devicesandservices.health.v4.GetIdentityRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesResponse * @static - * @param {google.devicesandservices.health.v4.IGetIdentityRequest} message GetIdentityRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IListPairedDevicesResponse} message ListPairedDevicesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetIdentityRequest.encode = function encode(message, writer) { + ListPairedDevicesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.pairedDevices != null && message.pairedDevices.length) + for (var i = 0; i < message.pairedDevices.length; ++i) + $root.google.devicesandservices.health.v4.PairedDevice.encode(message.pairedDevices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified GetIdentityRequest message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.GetIdentityRequest.verify|verify} messages. + * Encodes the specified ListPairedDevicesResponse message, length delimited. Does not implicitly {@link google.devicesandservices.health.v4.ListPairedDevicesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.devicesandservices.health.v4.GetIdentityRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesResponse * @static - * @param {google.devicesandservices.health.v4.IGetIdentityRequest} message GetIdentityRequest message or plain object to encode + * @param {google.devicesandservices.health.v4.IListPairedDevicesResponse} message ListPairedDevicesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListPairedDevicesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetIdentityRequest message from the specified reader or buffer. + * Decodes a ListPairedDevicesResponse message from the specified reader or buffer. * @function decode - * @memberof google.devicesandservices.health.v4.GetIdentityRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devicesandservices.health.v4.GetIdentityRequest} GetIdentityRequest + * @returns {google.devicesandservices.health.v4.ListPairedDevicesResponse} ListPairedDevicesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetIdentityRequest.decode = function decode(reader, length, error) { + ListPairedDevicesResponse.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.GetIdentityRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devicesandservices.health.v4.ListPairedDevicesResponse(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.pairedDevices && message.pairedDevices.length)) + message.pairedDevices = []; + message.pairedDevices.push($root.google.devicesandservices.health.v4.PairedDevice.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); break; } default: @@ -34899,102 +51557,128 @@ }; /** - * Decodes a GetIdentityRequest message from the specified reader or buffer, length delimited. + * Decodes a ListPairedDevicesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devicesandservices.health.v4.GetIdentityRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devicesandservices.health.v4.GetIdentityRequest} GetIdentityRequest + * @returns {google.devicesandservices.health.v4.ListPairedDevicesResponse} ListPairedDevicesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetIdentityRequest.decodeDelimited = function decodeDelimited(reader) { + ListPairedDevicesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetIdentityRequest message. + * Verifies a ListPairedDevicesResponse message. * @function verify - * @memberof google.devicesandservices.health.v4.GetIdentityRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetIdentityRequest.verify = function verify(message) { + ListPairedDevicesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.pairedDevices != null && message.hasOwnProperty("pairedDevices")) { + if (!Array.isArray(message.pairedDevices)) + return "pairedDevices: array expected"; + for (var i = 0; i < message.pairedDevices.length; ++i) { + var error = $root.google.devicesandservices.health.v4.PairedDevice.verify(message.pairedDevices[i]); + if (error) + return "pairedDevices." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a GetIdentityRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListPairedDevicesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devicesandservices.health.v4.GetIdentityRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesResponse * @static * @param {Object.} object Plain object - * @returns {google.devicesandservices.health.v4.GetIdentityRequest} GetIdentityRequest + * @returns {google.devicesandservices.health.v4.ListPairedDevicesResponse} ListPairedDevicesResponse */ - GetIdentityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devicesandservices.health.v4.GetIdentityRequest) + ListPairedDevicesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devicesandservices.health.v4.ListPairedDevicesResponse) return object; - var message = new $root.google.devicesandservices.health.v4.GetIdentityRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.devicesandservices.health.v4.ListPairedDevicesResponse(); + if (object.pairedDevices) { + if (!Array.isArray(object.pairedDevices)) + throw TypeError(".google.devicesandservices.health.v4.ListPairedDevicesResponse.pairedDevices: array expected"); + message.pairedDevices = []; + for (var i = 0; i < object.pairedDevices.length; ++i) { + if (typeof object.pairedDevices[i] !== "object") + throw TypeError(".google.devicesandservices.health.v4.ListPairedDevicesResponse.pairedDevices: object expected"); + message.pairedDevices[i] = $root.google.devicesandservices.health.v4.PairedDevice.fromObject(object.pairedDevices[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a GetIdentityRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListPairedDevicesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.devicesandservices.health.v4.GetIdentityRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesResponse * @static - * @param {google.devicesandservices.health.v4.GetIdentityRequest} message GetIdentityRequest + * @param {google.devicesandservices.health.v4.ListPairedDevicesResponse} message ListPairedDevicesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetIdentityRequest.toObject = function toObject(message, options) { + ListPairedDevicesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.pairedDevices = []; if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.nextPageToken = ""; + if (message.pairedDevices && message.pairedDevices.length) { + object.pairedDevices = []; + for (var j = 0; j < message.pairedDevices.length; ++j) + object.pairedDevices[j] = $root.google.devicesandservices.health.v4.PairedDevice.toObject(message.pairedDevices[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this GetIdentityRequest to JSON. + * Converts this ListPairedDevicesResponse to JSON. * @function toJSON - * @memberof google.devicesandservices.health.v4.GetIdentityRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesResponse * @instance * @returns {Object.} JSON object */ - GetIdentityRequest.prototype.toJSON = function toJSON() { + ListPairedDevicesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetIdentityRequest + * Gets the default type url for ListPairedDevicesResponse * @function getTypeUrl - * @memberof google.devicesandservices.health.v4.GetIdentityRequest + * @memberof google.devicesandservices.health.v4.ListPairedDevicesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetIdentityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListPairedDevicesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.devicesandservices.health.v4.GetIdentityRequest"; + return typeUrlPrefix + "/google.devicesandservices.health.v4.ListPairedDevicesResponse"; }; - return GetIdentityRequest; + return ListPairedDevicesResponse; })(); v4.WebhookNotificationCloudLog = (function() { @@ -36918,6 +53602,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -36952,6 +53637,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -36984,6 +53677,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -37035,6 +53730,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -37086,6 +53785,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -37128,6 +53832,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -37146,8 +53855,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -37155,6 +53866,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -38977,6 +55690,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -39002,6 +55716,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -39028,6 +55750,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -39068,6 +55792,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -39108,6 +55836,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -39128,6 +55861,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -39144,10 +55882,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -39177,6 +55919,258 @@ return typeUrlPrefix + "/google.api.PythonSettings"; }; + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + return PythonSettings; })(); @@ -40053,6 +57047,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -40064,6 +57059,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40078,6 +57074,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -40104,6 +57108,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -40134,7 +57141,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -40144,6 +57151,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -40184,6 +57214,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -40204,6 +57242,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -40220,10 +57265,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -40862,6 +57915,251 @@ return values; })(); + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + /** * LaunchStage enum. * @name google.api.LaunchStage @@ -41131,6 +58429,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -41145,6 +58444,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -41169,6 +58469,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -41191,6 +58492,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -41241,6 +58543,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -41362,6 +58672,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -41434,6 +58747,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -41536,6 +58855,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -41590,6 +58916,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -41642,6 +58969,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -41705,6 +59039,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -41770,6 +59108,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -41826,6 +59165,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -41874,6 +59218,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -41979,6 +59324,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -42031,6 +59384,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -42123,6 +59478,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -42236,6 +59595,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -42335,6 +59703,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -42364,6 +59752,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -42409,6 +59798,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -44453,6 +61844,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -44513,6 +61905,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -44550,6 +61950,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -44612,6 +62014,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -44680,6 +62086,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -44729,6 +62144,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -44753,6 +62188,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -44773,6 +62209,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -47091,6 +64529,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference @@ -47211,6 +64650,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -47285,6 +64732,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -47386,6 +64835,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -47521,6 +64974,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -47709,6 +65167,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -47806,6 +65269,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -47838,6 +65302,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -47911,71 +65377,371 @@ return values; })(); - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; + return EditionDefault; })(); - FieldOptions.EditionDefault = (function() { + FieldOptions.FeatureSupport = (function() { /** - * Properties of an EditionDefault. + * Properties of a FeatureSupport. * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved */ /** - * Constructs a new EditionDefault. + * Constructs a new FeatureSupport. * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set */ - function EditionDefault(properties) { + function FeatureSupport(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47983,91 +65749,119 @@ } /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport * @instance */ - EditionDefault.prototype.edition = 0; + FeatureSupport.prototype.editionIntroduced = 0; /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport * @instance */ - EditionDefault.prototype.value = ""; + FeatureSupport.prototype.editionDeprecated = 0; /** - * Creates a new EditionDefault instance using the specified properties. + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); }; /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EditionDefault.encode = function encode(message, writer) { + FeatureSupport.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); return writer; }; /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EditionDefault message from the specified reader or buffer. + * Decodes a FeatureSupport message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EditionDefault.decode = function decode(reader, length, error) { + FeatureSupport.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); + case 1: { + message.editionIntroduced = reader.int32(); break; } case 2: { - message.value = reader.string(); + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); break; } default: @@ -48079,37 +65873,77 @@ }; /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EditionDefault message. + * Verifies a FeatureSupport message. * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EditionDefault.verify = function verify(message) { + FeatureSupport.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { default: - return "edition: enum value expected"; + return "editionIntroduced: enum value expected"; case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: case 998: case 999: case 1000: @@ -48122,132 +65956,251 @@ case 2147483647: break; } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; return null; }; /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { default: - if (typeof object.edition === "number") { - message.edition = object.edition; + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; break; } break; case "EDITION_UNKNOWN": case 0: - message.edition = 0; + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; break; case "EDITION_PROTO2": case 998: - message.edition = 998; + message.editionIntroduced = 998; break; case "EDITION_PROTO3": case 999: - message.edition = 999; + message.editionIntroduced = 999; break; case "EDITION_2023": case 1000: - message.edition = 1000; + message.editionIntroduced = 1000; break; case "EDITION_2024": case 1001: - message.edition = 1001; + message.editionIntroduced = 1001; break; case "EDITION_1_TEST_ONLY": case 1: - message.edition = 1; + message.editionIntroduced = 1; break; case "EDITION_2_TEST_ONLY": case 2: - message.edition = 2; + message.editionIntroduced = 2; break; case "EDITION_99997_TEST_ONLY": case 99997: - message.edition = 99997; + message.editionIntroduced = 99997; break; case "EDITION_99998_TEST_ONLY": case 99998: - message.edition = 99998; + message.editionIntroduced = 99998; break; case "EDITION_99999_TEST_ONLY": case 99999: - message.edition = 99999; + message.editionIntroduced = 99999; break; case "EDITION_MAX": case 2147483647: - message.edition = 2147483647; + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionRemoved = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionRemoved = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionRemoved = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionRemoved = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionRemoved = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionRemoved = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionRemoved = 2147483647; break; } - if (object.value != null) - message.value = String(object.value); return message; }; /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EditionDefault.toObject = function toObject(message, options) { + FeatureSupport.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; return object; }; /** - * Converts this EditionDefault to JSON. + * Converts this FeatureSupport to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @instance * @returns {Object.} JSON object */ - EditionDefault.prototype.toJSON = function toJSON() { + FeatureSupport.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EditionDefault + * Gets the default type url for FeatureSupport * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; }; - return EditionDefault; + return FeatureSupport; })(); return FieldOptions; @@ -48842,6 +66795,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -48885,6 +66839,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -48923,6 +66885,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -48974,6 +66938,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -49026,6 +66994,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -49059,6 +67032,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -49091,6 +67069,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -49098,6 +67077,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -50565,6 +68546,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -50630,6 +68613,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -50666,6 +68665,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -50726,6 +68729,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -50816,6 +68827,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -50955,6 +68986,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -50978,6 +69057,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -50991,6 +69072,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -51118,6 +69203,219 @@ return values; })(); + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + return FeatureSet; })(); @@ -51302,6 +69600,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -51319,6 +69618,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -51367,6 +69667,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -51419,6 +69723,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -51527,7 +69835,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -51554,12 +69863,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -51585,10 +69902,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -51629,8 +69948,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -51673,6 +69996,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -51685,10 +70009,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); if (error) - return "features." + error; + return "fixedFeatures." + error; } return null; }; @@ -51716,6 +70045,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -51757,10 +70090,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -51779,13 +70117,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -53000,6 +71341,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + protobuf.Duration = (function() { /** diff --git a/packages/google-devicesandservices-health/protos/protos.json b/packages/google-devicesandservices-health/protos/protos.json index 2dfb8b5a57f1..b19c8546fcae 100644 --- a/packages/google-devicesandservices-health/protos/protos.json +++ b/packages/google-devicesandservices-health/protos/protos.json @@ -179,6 +179,94 @@ "PEAK": 4 } }, + "FoodAccessLevel": { + "values": { + "FOOD_ACCESS_LEVEL_UNSPECIFIED": 0, + "FOOD_ACCESS_LEVEL_PUBLIC": 1, + "FOOD_ACCESS_LEVEL_PRIVATE": 2 + } + }, + "MealType": { + "values": { + "MEAL_TYPE_UNSPECIFIED": 0, + "BEFORE_BREAKFAST": 1, + "BREAKFAST": 2, + "BEFORE_LUNCH": 3, + "LUNCH": 4, + "BEFORE_DINNER": 5, + "DINNER": 6, + "AFTER_DINNER": 7, + "SNACK": 8, + "ANYTIME": 9 + } + }, + "EnergyUnit": { + "values": { + "ENERGY_UNIT_UNSPECIFIED": 0, + "JOULE": 1, + "KILOJOULE": 2, + "KILOCALORIE": 3, + "SMALL_CALORIE": 4, + "CALORIE": 5 + } + }, + "Nutrient": { + "values": { + "NUTRIENT_UNSPECIFIED": 0, + "BIOTIN": 1, + "CAFFEINE": 2, + "CALCIUM": 3, + "CHLORIDE": 4, + "CARBOHYDRATES": 5, + "CHOLESTEROL": 6, + "CHROMIUM": 7, + "COPPER": 8, + "DIETARY_FIBER": 9, + "FOLIC_ACID": 10, + "IODINE": 11, + "IRON": 12, + "MAGNESIUM": 13, + "MANGANESE": 14, + "MOLYBDENUM": 15, + "MONOUNSATURATED_FAT": 16, + "NIACIN": 17, + "PANTOTHENIC_ACID": 18, + "PHOSPHORUS": 19, + "POLYUNSATURATED_FAT": 20, + "POTASSIUM": 21, + "PROTEIN": 22, + "RIBOFLAVIN": 23, + "SATURATED_FAT": 24, + "SELENIUM": 25, + "SODIUM": 26, + "SUGAR": 27, + "THIAMIN": 28, + "TRANS_FAT": 29, + "UNSATURATED_FAT": 30, + "VITAMIN_A": 31, + "VITAMIN_B12": 32, + "VITAMIN_B6": 33, + "VITAMIN_C": 34, + "VITAMIN_D": 35, + "VITAMIN_E": 36, + "VITAMIN_K": 37, + "ZINC": 38, + "FOLATE": 39 + } + }, + "WeightUnit": { + "values": { + "WEIGHT_UNIT_UNSPECIFIED": 0, + "GRAM": 1, + "KILOGRAM": 2, + "OUNCE": 3, + "POUND": 4, + "STONE": 5, + "MILLIGRAM": 6, + "MICROGRAM": 7, + "NANOGRAM": 8 + } + }, "VolumeUnit": { "values": { "VOLUME_UNIT_UNSPECIFIED": 0, @@ -193,6 +281,13 @@ } }, "ActiveZoneMinutes": { + "oneofs": { + "_activeZoneMinutes": { + "oneof": [ + "activeZoneMinutes" + ] + } + }, "fields": { "interval": { "type": "ObservationTimeInterval", @@ -212,7 +307,8 @@ "type": "int64", "id": 3, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } } }, @@ -228,18 +324,44 @@ } }, "ActiveZoneMinutesRollupValue": { + "oneofs": { + "_sumInCardioHeartZone": { + "oneof": [ + "sumInCardioHeartZone" + ] + }, + "_sumInPeakHeartZone": { + "oneof": [ + "sumInPeakHeartZone" + ] + }, + "_sumInFatBurnHeartZone": { + "oneof": [ + "sumInFatBurnHeartZone" + ] + } + }, "fields": { "sumInCardioHeartZone": { "type": "int64", - "id": 1 + "id": 1, + "options": { + "proto3_optional": true + } }, "sumInPeakHeartZone": { "type": "int64", - "id": 2 + "id": 2, + "options": { + "proto3_optional": true + } }, "sumInFatBurnHeartZone": { "type": "int64", - "id": 3 + "id": 3, + "options": { + "proto3_optional": true + } } } }, @@ -263,6 +385,13 @@ }, "nested": { "ActiveMinutesByActivityLevel": { + "oneofs": { + "_activeMinutes": { + "oneof": [ + "activeMinutes" + ] + } + }, "fields": { "activityLevel": { "type": "ActivityLevel", @@ -275,7 +404,8 @@ "type": "int64", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } } } @@ -300,6 +430,13 @@ }, "nested": { "ActiveMinutesRollupByActivityLevel": { + "oneofs": { + "_activeMinutesSum": { + "oneof": [ + "activeMinutesSum" + ] + } + }, "fields": { "activityLevel": { "type": "ActiveMinutes.ActivityLevel", @@ -307,7 +444,10 @@ }, "activeMinutesSum": { "type": "int64", - "id": 2 + "id": 2, + "options": { + "proto3_optional": true + } } } } @@ -366,6 +506,13 @@ } }, "Altitude": { + "oneofs": { + "_gainMillimeters": { + "oneof": [ + "gainMillimeters" + ] + } + }, "fields": { "interval": { "type": "ObservationTimeInterval", @@ -378,12 +525,20 @@ "type": "int64", "id": 3, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } } } }, "BasalEnergyBurned": { + "oneofs": { + "_kcal": { + "oneof": [ + "kcal" + ] + } + }, "fields": { "interval": { "type": "ObservationTimeInterval", @@ -396,12 +551,20 @@ "type": "double", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } } } }, "BodyFat": { + "oneofs": { + "_percentage": { + "oneof": [ + "percentage" + ] + } + }, "fields": { "sampleTime": { "type": "ObservationSampleTime", @@ -414,16 +577,133 @@ "type": "double", "id": 3, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } } } }, "BodyFatRollupValue": { + "oneofs": { + "_bodyFatPercentageAvg": { + "oneof": [ + "bodyFatPercentageAvg" + ] + } + }, "fields": { "bodyFatPercentageAvg": { "type": "double", - "id": 1 + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "CoreBodyTemperature": { + "oneofs": { + "_temperatureCelsius": { + "oneof": [ + "temperatureCelsius" + ] + } + }, + "fields": { + "sampleTime": { + "type": "ObservationSampleTime", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "temperatureCelsius": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "measurementLocation": { + "type": "MeasurementLocation", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "id": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MeasurementLocation": { + "values": { + "MEASUREMENT_LOCATION_UNSPECIFIED": 0, + "OTHER": 1, + "ARMPIT": 2, + "BODY": 3, + "EAR": 4, + "FINGER": 5, + "GASTRO_INTESTINAL": 6, + "MOUTH": 7, + "RECTUM": 8, + "TOE": 9, + "EAR_DRUM": 10, + "TEMPORAL_ARTERY": 11, + "FOREHEAD": 12, + "URINARY_BLADDER": 13, + "NASAL": 14, + "NASOPHARYNGEAL": 15, + "WRIST": 16, + "VAGINA": 17 + } + } + } + }, + "CoreBodyTemperatureRollupValue": { + "oneofs": { + "_temperatureCelsiusAvg": { + "oneof": [ + "temperatureCelsiusAvg" + ] + }, + "_temperatureCelsiusMax": { + "oneof": [ + "temperatureCelsiusMax" + ] + }, + "_temperatureCelsiusMin": { + "oneof": [ + "temperatureCelsiusMin" + ] + } + }, + "fields": { + "temperatureCelsiusAvg": { + "type": "double", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "temperatureCelsiusMax": { + "type": "double", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "temperatureCelsiusMin": { + "type": "double", + "id": 3, + "options": { + "proto3_optional": true + } } } }, @@ -437,6 +717,13 @@ }, "nested": { "CaloriesInHeartRateZoneValue": { + "oneofs": { + "_kcal": { + "oneof": [ + "kcal" + ] + } + }, "fields": { "heartRateZone": { "type": "HeartRateZoneType", @@ -444,7 +731,10 @@ }, "kcal": { "type": "double", - "id": 2 + "id": 2, + "options": { + "proto3_optional": true + } } } } @@ -470,6 +760,18 @@ }, "nested": { "HeartRateZone": { + "oneofs": { + "_minBeatsPerMinute": { + "oneof": [ + "minBeatsPerMinute" + ] + }, + "_maxBeatsPerMinute": { + "oneof": [ + "maxBeatsPerMinute" + ] + } + }, "fields": { "heartRateZoneType": { "type": "HeartRateZoneType", @@ -482,14 +784,16 @@ "type": "int64", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } }, "maxBeatsPerMinute": { "type": "int64", "id": 3, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } } } @@ -562,6 +866,13 @@ } }, "DailyRespiratoryRate": { + "oneofs": { + "_breathsPerMinute": { + "oneof": [ + "breathsPerMinute" + ] + } + }, "fields": { "date": { "type": "google.type.Date", @@ -574,12 +885,35 @@ "type": "double", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } } } }, "DailyOxygenSaturation": { + "oneofs": { + "_averagePercentage": { + "oneof": [ + "averagePercentage" + ] + }, + "_lowerBoundPercentage": { + "oneof": [ + "lowerBoundPercentage" + ] + }, + "_upperBoundPercentage": { + "oneof": [ + "upperBoundPercentage" + ] + }, + "_standardDeviationPercentage": { + "oneof": [ + "standardDeviationPercentage" + ] + } + }, "fields": { "date": { "type": "google.type.Date", @@ -592,33 +926,44 @@ "type": "double", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } }, "lowerBoundPercentage": { "type": "double", "id": 3, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } }, "upperBoundPercentage": { "type": "double", "id": 4, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } }, "standardDeviationPercentage": { "type": "double", "id": 5, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } } } }, "DailyRestingHeartRate": { + "oneofs": { + "_beatsPerMinute": { + "oneof": [ + "beatsPerMinute" + ] + } + }, "fields": { "date": { "type": "google.type.Date", @@ -631,7 +976,8 @@ "type": "int64", "id": 4, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } }, "dailyRestingHeartRateMetadata": { @@ -666,6 +1012,23 @@ } }, "DailySleepTemperatureDerivations": { + "oneofs": { + "_nightlyTemperatureCelsius": { + "oneof": [ + "nightlyTemperatureCelsius" + ] + }, + "_baselineTemperatureCelsius": { + "oneof": [ + "baselineTemperatureCelsius" + ] + }, + "_relativeNightlyStddev_30dCelsius": { + "oneof": [ + "relativeNightlyStddev_30dCelsius" + ] + } + }, "fields": { "date": { "type": "google.type.Date", @@ -678,26 +1041,41 @@ "type": "double", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } }, "baselineTemperatureCelsius": { "type": "double", "id": 3, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, "relativeNightlyStddev_30dCelsius": { "type": "double", "id": 4, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } } } }, "DailyVO2Max": { + "oneofs": { + "_vo2Max": { + "oneof": [ + "vo2Max" + ] + }, + "_vo2MaxCovariance": { + "oneof": [ + "vo2MaxCovariance" + ] + } + }, "fields": { "date": { "type": "google.type.Date", @@ -710,7 +1088,8 @@ "type": "double", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } }, "estimated": { @@ -731,7 +1110,8 @@ "type": "double", "id": 5, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } } }, @@ -750,6 +1130,13 @@ } }, "Distance": { + "oneofs": { + "_millimeters": { + "oneof": [ + "millimeters" + ] + } + }, "fields": { "interval": { "type": "ObservationTimeInterval", @@ -762,16 +1149,128 @@ "type": "int64", "id": 3, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } } } }, "DistanceRollupValue": { + "oneofs": { + "_millimetersSum": { + "oneof": [ + "millimetersSum" + ] + } + }, "fields": { "millimetersSum": { "type": "int64", - "id": 1 + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "Electrocardiogram": { + "oneofs": { + "_beatsPerMinuteAvg": { + "oneof": [ + "beatsPerMinuteAvg" + ] + }, + "_samplingFrequencyHertz": { + "oneof": [ + "samplingFrequencyHertz" + ] + }, + "_millivoltsScalingFactor": { + "oneof": [ + "millivoltsScalingFactor" + ] + }, + "_leadNumber": { + "oneof": [ + "leadNumber" + ] + } + }, + "fields": { + "interval": { + "type": "SessionTimeInterval", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "beatsPerMinuteAvg": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "resultClassification": { + "type": "ResultClassification", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "waveformSamples": { + "rule": "repeated", + "type": "sint32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "samplingFrequencyHertz": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "millivoltsScalingFactor": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "leadNumber": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "medicalDeviceInfo": { + "type": "MedicalDeviceInfo", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ResultClassification": { + "values": { + "RESULT_CLASSIFICATION_UNSPECIFIED": 0, + "NORMAL_SINUS_RHYTHM": 1, + "ATRIAL_FIBRILLATION": 2, + "INCONCLUSIVE": 3, + "INCONCLUSIVE_HIGH_HEART_RATE": 4, + "INCONCLUSIVE_LOW_HEART_RATE": 5, + "UNREADABLE": 6, + "NOT_ANALYZED": 7 + } } } }, @@ -969,12 +1468,20 @@ } }, "ExerciseMetadata": { + "oneofs": { + "_poolLengthMillimeters": { + "oneof": [ + "poolLengthMillimeters" + ] + } + }, "fields": { "poolLengthMillimeters": { "type": "int64", "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, "hasGps": { @@ -1006,6 +1513,13 @@ } }, "Floors": { + "oneofs": { + "_count": { + "oneof": [ + "count" + ] + } + }, "fields": { "interval": { "type": "ObservationTimeInterval", @@ -1018,28 +1532,56 @@ "type": "int64", "id": 4, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } } } }, "FloorsRollupValue": { + "oneofs": { + "_countSum": { + "oneof": [ + "countSum" + ] + } + }, "fields": { "countSum": { "type": "int64", - "id": 1 + "id": 1, + "options": { + "proto3_optional": true + } } } }, "AltitudeRollupValue": { + "oneofs": { + "_gainMillimetersSum": { + "oneof": [ + "gainMillimetersSum" + ] + } + }, "fields": { "gainMillimetersSum": { "type": "int64", - "id": 1 + "id": 1, + "options": { + "proto3_optional": true + } } } }, "HeartRate": { + "oneofs": { + "_beatsPerMinute": { + "oneof": [ + "beatsPerMinute" + ] + } + }, "fields": { "sampleTime": { "type": "ObservationSampleTime", @@ -1052,7 +1594,8 @@ "type": "int64", "id": 4, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } }, "metadata": { @@ -1147,22 +1690,55 @@ } }, "RunVO2MaxRollupValue": { + "oneofs": { + "_rateMin": { + "oneof": [ + "rateMin" + ] + }, + "_rateMax": { + "oneof": [ + "rateMax" + ] + }, + "_rateAvg": { + "oneof": [ + "rateAvg" + ] + } + }, "fields": { "rateMin": { "type": "double", - "id": 1 + "id": 1, + "options": { + "proto3_optional": true + } }, "rateMax": { "type": "double", - "id": 2 + "id": 2, + "options": { + "proto3_optional": true + } }, "rateAvg": { "type": "double", - "id": 3 + "id": 3, + "options": { + "proto3_optional": true + } } } }, "RunVO2Max": { + "oneofs": { + "_runVo2Max": { + "oneof": [ + "runVo2Max" + ] + } + }, "fields": { "sampleTime": { "type": "ObservationSampleTime", @@ -1175,7 +1751,8 @@ "type": "double", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } } } @@ -1211,6 +1788,13 @@ } }, "Height": { + "oneofs": { + "_heightMillimeters": { + "oneof": [ + "heightMillimeters" + ] + } + }, "fields": { "sampleTime": { "type": "ObservationSampleTime", @@ -1223,12 +1807,25 @@ "type": "int64", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } } } }, "HeartRateVariability": { + "oneofs": { + "_rootMeanSquareOfSuccessiveDifferencesMilliseconds": { + "oneof": [ + "rootMeanSquareOfSuccessiveDifferencesMilliseconds" + ] + }, + "_standardDeviationMilliseconds": { + "oneof": [ + "standardDeviationMilliseconds" + ] + } + }, "fields": { "sampleTime": { "type": "ObservationSampleTime", @@ -1241,25 +1838,35 @@ "type": "double", "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, "standardDeviationMilliseconds": { "type": "double", "id": 3, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } } } }, "VolumeQuantity": { + "oneofs": { + "_milliliters": { + "oneof": [ + "milliliters" + ] + } + }, "fields": { "milliliters": { "type": "double", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } }, "userProvidedUnit": { @@ -1298,12 +1905,20 @@ }, "nested": { "VolumeQuantityRollup": { + "oneofs": { + "_millilitersSum": { + "oneof": [ + "millilitersSum" + ] + } + }, "fields": { "millilitersSum": { "type": "double", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } }, "userProvidedUnitLast": { @@ -1317,27 +1932,156 @@ } } }, - "MetricsSummary": { - "oneofs": { - "_caloriesKcal": { - "oneof": [ - "caloriesKcal" - ] - }, - "_distanceMillimeters": { - "oneof": [ - "distanceMillimeters" - ] + "IrregularRhythmNotification": { + "fields": { + "interval": { + "type": "SessionTimeInterval", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "_steps": { - "oneof": [ - "steps" - ] + "alertWindows": { + "rule": "repeated", + "type": "AlertWindow", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "_averageSpeedMillimetersPerSecond": { - "oneof": [ - "averageSpeedMillimetersPerSecond" - ] + "medicalDeviceInfo": { + "type": "MedicalDeviceInfo", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "HeartBeat": { + "oneofs": { + "_beatsPerMinute": { + "oneof": [ + "beatsPerMinute" + ] + } + }, + "fields": { + "physicalTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "utcOffset": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "civilTime": { + "type": "CivilDateTime", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "beatsPerMinute": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + } + }, + "AlertWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startUtcOffset": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endUtcOffset": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "civilStartTime": { + "type": "CivilDateTime", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "civilEndTime": { + "type": "CivilDateTime", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "positive": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "heartBeats": { + "rule": "repeated", + "type": "HeartBeat", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "MetricsSummary": { + "oneofs": { + "_caloriesKcal": { + "oneof": [ + "caloriesKcal" + ] + }, + "_distanceMillimeters": { + "oneof": [ + "distanceMillimeters" + ] + }, + "_steps": { + "oneof": [ + "steps" + ] + }, + "_averageSpeedMillimetersPerSecond": { + "oneof": [ + "averageSpeedMillimetersPerSecond" + ] }, "_averagePaceSecondsPerMeter": { "oneof": [ @@ -1566,568 +2310,518 @@ } } }, - "OxygenSaturation": { + "WeightQuantity": { + "oneofs": { + "_grams": { + "oneof": [ + "grams" + ] + } + }, "fields": { - "sampleTime": { - "type": "ObservationSampleTime", + "grams": { + "type": "double", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } }, - "percentage": { - "type": "double", + "userProvidedUnit": { + "type": "WeightUnit", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } } } }, - "RestingHeartRatePersonalRangeRollupValue": { + "EnergyQuantity": { "oneofs": { - "_beatsPerMinuteMin": { - "oneof": [ - "beatsPerMinuteMin" - ] - }, - "_beatsPerMinuteMax": { + "_kcal": { "oneof": [ - "beatsPerMinuteMax" + "kcal" ] } }, "fields": { - "beatsPerMinuteMin": { + "kcal": { "type": "double", "id": 1, "options": { + "(google.api.field_behavior)": "REQUIRED", "proto3_optional": true } }, - "beatsPerMinuteMax": { - "type": "double", + "userProvidedUnit": { + "type": "EnergyUnit", "id": 2, "options": { - "proto3_optional": true + "(google.api.field_behavior)": "OPTIONAL" } } } }, - "RespiratoryRateSleepSummary": { + "NutrientQuantity": { "fields": { - "sampleTime": { - "type": "ObservationSampleTime", + "quantity": { + "type": "WeightQuantity", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "deepSleepStats": { - "type": "RespiratoryRateSleepSummaryStatistics", + "nutrient": { + "type": "Nutrient", "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "NutritionLog": { + "fields": { + "interval": { + "type": "SessionTimeInterval", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" } }, - "lightSleepStats": { - "type": "RespiratoryRateSleepSummaryStatistics", + "nutrients": { + "rule": "repeated", + "type": "NutrientQuantity", "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "remSleepStats": { - "type": "RespiratoryRateSleepSummaryStatistics", + "energy": { + "type": "EnergyQuantity", "id": 4, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "fullSleepStats": { - "type": "RespiratoryRateSleepSummaryStatistics", + "energyFromFat": { + "type": "EnergyQuantity", "id": 5, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "totalCarbohydrate": { + "type": "WeightQuantity", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "totalFat": { + "type": "WeightQuantity", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mealType": { + "type": "MealType", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serving": { + "type": "Serving", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "food": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "health.googleapis.com/DataPoint" } + }, + "foodDisplayName": { + "type": "string", + "id": 16 } }, "nested": { - "RespiratoryRateSleepSummaryStatistics": { + "Serving": { + "oneofs": { + "_amount": { + "oneof": [ + "amount" + ] + } + }, "fields": { - "breathsPerMinute": { + "amount": { "type": "double", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "standardDeviation": { - "type": "double", + "foodMeasurementUnit": { + "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "health.googleapis.com/DataPoint" } }, - "signalToNoise": { - "type": "double", + "foodMeasurementUnitDisplayName": { + "type": "string", "id": 3, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OUTPUT_ONLY" } } } } } }, - "Sleep": { + "Food": { "fields": { - "interval": { - "type": "SessionTimeInterval", - "id": 3, + "displayName": { + "type": "string", + "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "type": { - "type": "SleepType", - "id": 4, + "brand": { + "type": "string", + "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "stages": { - "rule": "repeated", - "type": "SleepStage", + "accessLevel": { + "type": "FoodAccessLevel", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", "id": 5, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "outOfBedSegments": { - "rule": "repeated", - "type": "OutOfBedSegment", + "languageCode": { + "type": "string", "id": 6, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "metadata": { - "type": "SleepMetadata", - "id": 8, + "mealType": { + "type": "MealType", + "id": 10, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "summary": { - "type": "SleepSummary", - "id": 9, + "nutrients": { + "rule": "repeated", + "type": "NutrientQuantity", + "id": 12, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 10, + "energyFromFat": { + "type": "EnergyQuantity", + "id": 13, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 11, + "totalCarbohydrate": { + "type": "WeightQuantity", + "id": 14, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "totalFat": { + "type": "WeightQuantity", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "energyMin": { + "type": "EnergyQuantity", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "energyAvg": { + "type": "EnergyQuantity", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "energyMax": { + "type": "EnergyQuantity", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultServing": { + "type": "FoodServing", + "id": 19, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "servings": { + "rule": "repeated", + "type": "FoodServing", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } }, "nested": { - "SleepStage": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "startUtcOffset": { - "type": "google.protobuf.Duration", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "endUtcOffset": { - "type": "google.protobuf.Duration", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "type": { - "type": "SleepStageType", - "id": 7, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "FoodServing": { + "oneofs": { + "_amount": { + "oneof": [ + "amount" + ] } - } - }, - "OutOfBedSegment": { + }, "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", + "amount": { + "type": "double", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "startUtcOffset": { - "type": "google.protobuf.Duration", + "foodMeasurementUnit": { + "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "health.googleapis.com/DataPoint" } }, - "endTime": { - "type": "google.protobuf.Timestamp", + "foodMeasurementUnitDisplayName": { + "type": "string", "id": 3, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "endUtcOffset": { - "type": "google.protobuf.Duration", + "foodMeasurementUnitDisplayNamePlural": { + "type": "string", "id": 4, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "multiplier": { + "type": "double", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } + } + } + }, + "NutritionLogRollupValue": { + "fields": { + "nutrients": { + "rule": "repeated", + "type": "NutrientQuantityRollup", + "id": 1 }, - "SleepMetadata": { + "energy": { + "type": "EnergyQuantityRollup", + "id": 2 + }, + "energyFromFat": { + "type": "EnergyQuantityRollup", + "id": 3 + }, + "totalCarbohydrate": { + "type": "WeightQuantityRollup", + "id": 4 + }, + "totalFat": { + "type": "WeightQuantityRollup", + "id": 5 + } + }, + "nested": { + "WeightQuantityRollup": { + "oneofs": { + "_gramsSum": { + "oneof": [ + "gramsSum" + ] + } + }, "fields": { - "stagesStatus": { - "type": "StagesState", + "gramsSum": { + "type": "double", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } }, - "processed": { - "type": "bool", + "userProvidedUnitLast": { + "type": "WeightUnit", "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nap": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "manuallyEdited": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "externalId": { - "type": "string", - "id": 7, "options": { "(google.api.field_behavior)": "OPTIONAL" } } - }, - "nested": { - "StagesState": { - "values": { - "STAGES_STATE_UNSPECIFIED": 0, - "REJECTED_COVERAGE": 1, - "REJECTED_MAX_GAP": 2, - "REJECTED_START_GAP": 3, - "REJECTED_END_GAP": 4, - "REJECTED_NAP": 5, - "REJECTED_SERVER": 6, - "TIMEOUT": 7, - "SUCCEEDED": 8, - "PROCESSING_INTERNAL_ERROR": 9 - } - } } }, - "SleepSummary": { + "EnergyQuantityRollup": { "oneofs": { - "_minutesInSleepPeriod": { - "oneof": [ - "minutesInSleepPeriod" - ] - }, - "_minutesAfterWakeUp": { - "oneof": [ - "minutesAfterWakeUp" - ] - }, - "_minutesToFallAsleep": { - "oneof": [ - "minutesToFallAsleep" - ] - }, - "_minutesAsleep": { - "oneof": [ - "minutesAsleep" - ] - }, - "_minutesAwake": { + "_kcalSum": { "oneof": [ - "minutesAwake" + "kcalSum" ] } }, "fields": { - "minutesInSleepPeriod": { - "type": "int64", + "kcalSum": { + "type": "double", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.field_behavior)": "REQUIRED", "proto3_optional": true } }, - "minutesAfterWakeUp": { - "type": "int64", + "userProvidedUnitLast": { + "type": "EnergyUnit", "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "minutesToFallAsleep": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true + "(google.api.field_behavior)": "OPTIONAL" } - }, - "minutesAsleep": { - "type": "int64", - "id": 4, + } + } + }, + "NutrientQuantityRollup": { + "fields": { + "quantity": { + "type": "WeightQuantityRollup", + "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true + "(google.api.field_behavior)": "REQUIRED" } }, - "minutesAwake": { - "type": "int64", - "id": 5, + "nutrient": { + "type": "Nutrient", + "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "stagesSummary": { - "rule": "repeated", - "type": "StageSummary", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "StageSummary": { - "fields": { - "type": { - "type": "SleepStageType", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "minutes": { - "type": "int64", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "count": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } + "(google.api.field_behavior)": "REQUIRED" } } } - }, - "SleepType": { - "values": { - "SLEEP_TYPE_UNSPECIFIED": 0, - "CLASSIC": 1, - "STAGES": 2 - } - }, - "SleepStageType": { - "values": { - "SLEEP_STAGE_TYPE_UNSPECIFIED": 0, - "AWAKE": 1, - "LIGHT": 2, - "DEEP": 3, - "REM": 4, - "ASLEEP": 5, - "RESTLESS": 6 - } } } }, - "Steps": { + "OxygenSaturation": { + "oneofs": { + "_percentage": { + "oneof": [ + "percentage" + ] + } + }, "fields": { - "interval": { - "type": "ObservationTimeInterval", - "id": 2, + "sampleTime": { + "type": "ObservationSampleTime", + "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "count": { - "type": "int64", - "id": 4, + "percentage": { + "type": "double", + "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } } } }, - "StepsRollupValue": { - "fields": { - "countSum": { - "type": "int64", - "id": 1 + "RestingHeartRatePersonalRangeRollupValue": { + "oneofs": { + "_beatsPerMinuteMin": { + "oneof": [ + "beatsPerMinuteMin" + ] + }, + "_beatsPerMinuteMax": { + "oneof": [ + "beatsPerMinuteMax" + ] } - } - }, - "SwimLengthsData": { + }, "fields": { - "interval": { - "type": "ObservationTimeInterval", + "beatsPerMinuteMin": { + "type": "double", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "proto3_optional": true } }, - "swimStrokeType": { - "type": "SwimStrokeType", + "beatsPerMinuteMax": { + "type": "double", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "strokeCount": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "SwimStrokeType": { - "values": { - "SWIM_STROKE_TYPE_UNSPECIFIED": 0, - "FREESTYLE": 1, - "BACKSTROKE": 2, - "BREASTSTROKE": 3, - "BUTTERFLY": 4 + "proto3_optional": true } } } }, - "SwimLengthsDataRollupValue": { - "fields": { - "strokeCountSum": { - "type": "int64", - "id": 1 - } - } - }, - "TimeInHeartRateZone": { + "FoodMeasurementUnit": { "fields": { - "interval": { - "type": "ObservationTimeInterval", + "displayName": { + "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "heartRateZoneType": { - "type": "HeartRateZoneType", + "pluralDisplayName": { + "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TimeInHeartRateZoneRollupValue": { - "fields": { - "timeInHeartRateZones": { - "rule": "repeated", - "type": "TimeInHeartRateZoneValue", - "id": 1 - } - }, - "nested": { - "TimeInHeartRateZoneValue": { - "fields": { - "heartRateZone": { - "type": "HeartRateZoneType", - "id": 1 - }, - "duration": { - "type": "google.protobuf.Duration", - "id": 2 - } + "(google.api.field_behavior)": "OPTIONAL" } } } }, - "TotalCaloriesRollupValue": { - "fields": { - "kcalSum": { - "type": "double", - "id": 1 - } - } - }, - "VO2Max": { + "RespiratoryRateSleepSummary": { "fields": { "sampleTime": { "type": "ObservationSampleTime", @@ -2136,294 +2830,1445 @@ "(google.api.field_behavior)": "REQUIRED" } }, - "vo2Max": { - "type": "double", + "deepSleepStats": { + "type": "RespiratoryRateSleepSummaryStatistics", "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "measurementMethod": { - "type": "MeasurementMethod", - "id": 4, "options": { "(google.api.field_behavior)": "OPTIONAL" } - } - }, - "nested": { - "MeasurementMethod": { - "values": { - "MEASUREMENT_METHOD_UNSPECIFIED": 0, - "FITBIT_RUN": 1, - "GOOGLE_DEMOGRAPHIC": 2, - "COOPER_TEST": 3, - "HEART_RATE_RATIO": 4, - "METABOLIC_CART": 5, - "MULTISTAGE_FITNESS_TEST": 6, - "ROCKPORT_FITNESS_TEST": 7, - "MAX_EXERCISE": 8, - "PREDICTION_SUB_MAX_EXERCISE": 9, - "PREDICTION_NON_EXERCISE": 10, - "OTHER": 11 - } - } - } - }, - "Weight": { - "fields": { - "sampleTime": { - "type": "ObservationSampleTime", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } }, - "weightGrams": { - "type": "double", + "lightSleepStats": { + "type": "RespiratoryRateSleepSummaryStatistics", "id": 3, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } }, - "notes": { - "type": "string", + "remSleepStats": { + "type": "RespiratoryRateSleepSummaryStatistics", "id": 4, "options": { "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "WeightRollupValue": { - "fields": { - "weightGramsAvg": { - "type": "double", - "id": 1 - } - } - }, - "SedentaryPeriod": { - "fields": { - "interval": { - "type": "ObservationTimeInterval", - "id": 1, + }, + "fullSleepStats": { + "type": "RespiratoryRateSleepSummaryStatistics", + "id": 5, "options": { "(google.api.field_behavior)": "REQUIRED" } } - } - }, - "SedentaryPeriodRollupValue": { - "fields": { - "durationSum": { - "type": "google.protobuf.Duration", - "id": 1 - } - } - }, - "DataPointsService": { - "options": { - "(google.api.default_host)": "health.googleapis.com", - "(google.api.oauth_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.sleep.readonly" }, - "methods": { - "GetDataPoint": { - "requestType": "GetDataPointRequest", - "responseType": "DataPoint", - "options": { - "(google.api.http).get": "/v4/{name=users/*/dataTypes/*/dataPoints/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v4/{name=users/*/dataTypes/*/dataPoints/*}" - } + "nested": { + "RespiratoryRateSleepSummaryStatistics": { + "oneofs": { + "_breathsPerMinute": { + "oneof": [ + "breathsPerMinute" + ] }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListDataPoints": { - "requestType": "ListDataPointsRequest", - "responseType": "ListDataPointsResponse", - "options": { - "(google.api.http).get": "/v4/{parent=users/*/dataTypes/*}/dataPoints", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v4/{parent=users/*/dataTypes/*}/dataPoints" - } + "_standardDeviation": { + "oneof": [ + "standardDeviation" + ] }, - { - "(google.api.method_signature)": "parent" + "_signalToNoise": { + "oneof": [ + "signalToNoise" + ] } - ] - }, - "CreateDataPoint": { - "requestType": "CreateDataPointRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v4/{parent=users/*/dataTypes/*}/dataPoints", - "(google.api.http).body": "data_point", - "(google.api.method_signature)": "parent,data_point", - "(google.longrunning.operation_info).response_type": "DataPoint", - "(google.longrunning.operation_info).metadata_type": "CreateDataPointOperationMetadata" }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v4/{parent=users/*/dataTypes/*}/dataPoints", - "body": "data_point" + "fields": { + "breathsPerMinute": { + "type": "double", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true } }, - { - "(google.api.method_signature)": "parent,data_point" + "standardDeviation": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } }, - { - "(google.longrunning.operation_info)": { - "response_type": "DataPoint", - "metadata_type": "CreateDataPointOperationMetadata" + "signalToNoise": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } } - ] + } + } + } + }, + "Sleep": { + "fields": { + "interval": { + "type": "SessionTimeInterval", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "UpdateDataPoint": { - "requestType": "UpdateDataPointRequest", - "responseType": "google.longrunning.Operation", + "type": { + "type": "SleepType", + "id": 4, "options": { - "(google.api.http).patch": "/v4/{data_point.name=users/*/dataTypes/*/dataPoints/*}", - "(google.api.http).body": "data_point", - "(google.api.method_signature)": "data_point", - "(google.longrunning.operation_info).response_type": "DataPoint", - "(google.longrunning.operation_info).metadata_type": "UpdateDataPointOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v4/{data_point.name=users/*/dataTypes/*/dataPoints/*}", - "body": "data_point" - } - }, - { - "(google.api.method_signature)": "data_point" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "DataPoint", - "metadata_type": "UpdateDataPointOperationMetadata" - } - } - ] + "(google.api.field_behavior)": "OPTIONAL" + } }, - "BatchDeleteDataPoints": { - "requestType": "BatchDeleteDataPointsRequest", - "responseType": "google.longrunning.Operation", + "stages": { + "rule": "repeated", + "type": "SleepStage", + "id": 5, "options": { - "(google.api.http).post": "/v4/{parent=users/*/dataTypes/*}/dataPoints:batchDelete", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "BatchDeleteDataPointsResponse", - "(google.longrunning.operation_info).metadata_type": "BatchDeleteDataPointsOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v4/{parent=users/*/dataTypes/*}/dataPoints:batchDelete", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BatchDeleteDataPointsResponse", - "metadata_type": "BatchDeleteDataPointsOperationMetadata" - } - } - ] + "(google.api.field_behavior)": "OPTIONAL" + } }, - "ReconcileDataPoints": { - "requestType": "ReconcileDataPointsRequest", - "responseType": "ReconcileDataPointsResponse", + "outOfBedSegments": { + "rule": "repeated", + "type": "OutOfBedSegment", + "id": 6, "options": { - "(google.api.http).get": "/v4/{parent=users/*/dataTypes/*}/dataPoints:reconcile" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v4/{parent=users/*/dataTypes/*}/dataPoints:reconcile" - } - } - ] + "(google.api.field_behavior)": "OPTIONAL" + } }, - "RollUpDataPoints": { - "requestType": "RollUpDataPointsRequest", - "responseType": "RollUpDataPointsResponse", + "metadata": { + "type": "SleepMetadata", + "id": 8, "options": { - "(google.api.http).post": "/v4/{parent=users/*/dataTypes/*}/dataPoints:rollUp", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v4/{parent=users/*/dataTypes/*}/dataPoints:rollUp", - "body": "*" - } - } - ] + "(google.api.field_behavior)": "OPTIONAL" + } }, - "DailyRollUpDataPoints": { - "requestType": "DailyRollUpDataPointsRequest", - "responseType": "DailyRollUpDataPointsResponse", + "summary": { + "type": "SleepSummary", + "id": 9, "options": { - "(google.api.http).post": "/v4/{parent=users/*/dataTypes/*}/dataPoints:dailyRollUp", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v4/{parent=users/*/dataTypes/*}/dataPoints:dailyRollUp", - "body": "*" - } - } - ] + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "ExportExerciseTcx": { - "requestType": "ExportExerciseTcxRequest", - "responseType": "ExportExerciseTcxResponse", + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10, "options": { - "(google.api.http).get": "/v4/{name=users/*/dataTypes/*/dataPoints/*}:exportExerciseTcx", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v4/{name=users/*/dataTypes/*/dataPoints/*}:exportExerciseTcx" - } - }, - { - "(google.api.method_signature)": "name" - } - ] + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } - } - }, - "DataPoint": { - "options": { - "(google.api.resource).type": "health.googleapis.com/DataPoint", - "(google.api.resource).pattern": "users/{user}/dataTypes/{data_type}/dataPoints/{data_point}", - "(google.api.resource).plural": "dataPoints", - "(google.api.resource).singular": "dataPoint" }, - "oneofs": { - "data": { - "oneof": [ - "steps", - "floors", - "heartRate", - "sleep", + "nested": { + "SleepStage": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startUtcOffset": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endUtcOffset": { + "type": "google.protobuf.Duration", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "SleepStageType", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "OutOfBedSegment": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startUtcOffset": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endUtcOffset": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SleepMetadata": { + "fields": { + "stagesStatus": { + "type": "StagesState", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "processed": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nap": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "manuallyEdited": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "externalId": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "StagesState": { + "values": { + "STAGES_STATE_UNSPECIFIED": 0, + "REJECTED_COVERAGE": 1, + "REJECTED_MAX_GAP": 2, + "REJECTED_START_GAP": 3, + "REJECTED_END_GAP": 4, + "REJECTED_NAP": 5, + "REJECTED_SERVER": 6, + "TIMEOUT": 7, + "SUCCEEDED": 8, + "PROCESSING_INTERNAL_ERROR": 9 + } + } + } + }, + "SleepSummary": { + "oneofs": { + "_minutesInSleepPeriod": { + "oneof": [ + "minutesInSleepPeriod" + ] + }, + "_minutesAfterWakeUp": { + "oneof": [ + "minutesAfterWakeUp" + ] + }, + "_minutesToFallAsleep": { + "oneof": [ + "minutesToFallAsleep" + ] + }, + "_minutesAsleep": { + "oneof": [ + "minutesAsleep" + ] + }, + "_minutesAwake": { + "oneof": [ + "minutesAwake" + ] + } + }, + "fields": { + "minutesInSleepPeriod": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "minutesAfterWakeUp": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "minutesToFallAsleep": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "minutesAsleep": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "minutesAwake": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "stagesSummary": { + "rule": "repeated", + "type": "StageSummary", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "StageSummary": { + "oneofs": { + "_minutes": { + "oneof": [ + "minutes" + ] + }, + "_count": { + "oneof": [ + "count" + ] + } + }, + "fields": { + "type": { + "type": "SleepStageType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "minutes": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "count": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + } + } + }, + "SleepType": { + "values": { + "SLEEP_TYPE_UNSPECIFIED": 0, + "CLASSIC": 1, + "STAGES": 2 + } + }, + "SleepStageType": { + "values": { + "SLEEP_STAGE_TYPE_UNSPECIFIED": 0, + "AWAKE": 1, + "LIGHT": 2, + "DEEP": 3, + "REM": 4, + "ASLEEP": 5, + "RESTLESS": 6 + } + } + } + }, + "Steps": { + "oneofs": { + "_count": { + "oneof": [ + "count" + ] + } + }, + "fields": { + "interval": { + "type": "ObservationTimeInterval", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "count": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + } + }, + "StepsRollupValue": { + "oneofs": { + "_countSum": { + "oneof": [ + "countSum" + ] + } + }, + "fields": { + "countSum": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "SwimLengthsData": { + "oneofs": { + "_strokeCount": { + "oneof": [ + "strokeCount" + ] + } + }, + "fields": { + "interval": { + "type": "ObservationTimeInterval", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "swimStrokeType": { + "type": "SwimStrokeType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "strokeCount": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + }, + "nested": { + "SwimStrokeType": { + "values": { + "SWIM_STROKE_TYPE_UNSPECIFIED": 0, + "FREESTYLE": 1, + "BACKSTROKE": 2, + "BREASTSTROKE": 3, + "BUTTERFLY": 4 + } + } + } + }, + "SwimLengthsDataRollupValue": { + "oneofs": { + "_strokeCountSum": { + "oneof": [ + "strokeCountSum" + ] + } + }, + "fields": { + "strokeCountSum": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "TimeInHeartRateZone": { + "fields": { + "interval": { + "type": "ObservationTimeInterval", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "heartRateZoneType": { + "type": "HeartRateZoneType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TimeInHeartRateZoneRollupValue": { + "fields": { + "timeInHeartRateZones": { + "rule": "repeated", + "type": "TimeInHeartRateZoneValue", + "id": 1 + } + }, + "nested": { + "TimeInHeartRateZoneValue": { + "fields": { + "heartRateZone": { + "type": "HeartRateZoneType", + "id": 1 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + } + } + }, + "TotalCaloriesRollupValue": { + "oneofs": { + "_kcalSum": { + "oneof": [ + "kcalSum" + ] + } + }, + "fields": { + "kcalSum": { + "type": "double", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "VO2Max": { + "oneofs": { + "_vo2Max": { + "oneof": [ + "vo2Max" + ] + } + }, + "fields": { + "sampleTime": { + "type": "ObservationSampleTime", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vo2Max": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "measurementMethod": { + "type": "MeasurementMethod", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MeasurementMethod": { + "values": { + "MEASUREMENT_METHOD_UNSPECIFIED": 0, + "FITBIT_RUN": 1, + "GOOGLE_DEMOGRAPHIC": 2, + "COOPER_TEST": 3, + "HEART_RATE_RATIO": 4, + "METABOLIC_CART": 5, + "MULTISTAGE_FITNESS_TEST": 6, + "ROCKPORT_FITNESS_TEST": 7, + "MAX_EXERCISE": 8, + "PREDICTION_SUB_MAX_EXERCISE": 9, + "PREDICTION_NON_EXERCISE": 10, + "OTHER": 11 + } + } + } + }, + "Weight": { + "oneofs": { + "_weightGrams": { + "oneof": [ + "weightGrams" + ] + } + }, + "fields": { + "sampleTime": { + "type": "ObservationSampleTime", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "weightGrams": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "notes": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "WeightRollupValue": { + "oneofs": { + "_weightGramsAvg": { + "oneof": [ + "weightGramsAvg" + ] + } + }, + "fields": { + "weightGramsAvg": { + "type": "double", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "BloodGlucose": { + "oneofs": { + "_bloodGlucoseMilligramsPerDeciliter": { + "oneof": [ + "bloodGlucoseMilligramsPerDeciliter" + ] + } + }, + "fields": { + "sampleTime": { + "type": "ObservationSampleTime", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "bloodGlucoseMilligramsPerDeciliter": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "measurementSource": { + "type": "MeasurementSource", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mealType": { + "type": "MealType", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "measurementTiming": { + "type": "MeasurementTiming", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "specimen": { + "type": "Specimen", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "notes": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MeasurementSource": { + "values": { + "MEASUREMENT_SOURCE_UNSPECIFIED": 0, + "SELF_MONITORING_BLOOD_GLUCOSE": 1, + "CONTINUOUS_GLUCOSE_MONITORING": 2, + "LAB_TEST": 3 + } + }, + "MealType": { + "values": { + "MEAL_TYPE_UNSPECIFIED": 0, + "BREAKFAST": 1, + "LUNCH": 2, + "DINNER": 3, + "SNACK": 4 + } + }, + "MeasurementTiming": { + "values": { + "MEASUREMENT_TIMING_UNSPECIFIED": 0, + "AFTER_MEAL": 1, + "BEFORE_MEAL": 2, + "FASTING": 3, + "GENERAL": 4, + "BEFORE_BED": 5, + "OVER_NIGHT": 6 + } + }, + "Specimen": { + "values": { + "SPECIMEN_UNSPECIFIED": 0, + "CAPILLARY_BLOOD": 1, + "INTERSTITIAL_FLUID": 2, + "PLASMA": 3, + "SERUM": 4, + "TEARS": 5, + "WHOLE_BLOOD": 6 + } + } + } + }, + "BloodGlucoseRollupValue": { + "oneofs": { + "_bloodGlucoseMilligramsPerDeciliterAvg": { + "oneof": [ + "bloodGlucoseMilligramsPerDeciliterAvg" + ] + } + }, + "fields": { + "bloodGlucoseMilligramsPerDeciliterAvg": { + "type": "double", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "SedentaryPeriod": { + "fields": { + "interval": { + "type": "ObservationTimeInterval", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SedentaryPeriodRollupValue": { + "fields": { + "durationSum": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "ActiveEnergyBurned": { + "oneofs": { + "_kcal": { + "oneof": [ + "kcal" + ] + } + }, + "fields": { + "interval": { + "type": "ObservationTimeInterval", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "kcal": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + } + }, + "ActiveEnergyBurnedRollupValue": { + "oneofs": { + "_kcalSum": { + "oneof": [ + "kcalSum" + ] + } + }, + "fields": { + "kcalSum": { + "type": "double", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "MedicalDeviceInfo": { + "fields": { + "algorithmVersion": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "firmwareVersion": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "featureVersion": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deviceModel": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DataPointsService": { + "options": { + "(google.api.default_host)": "health.googleapis.com", + "(google.api.oauth_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.sleep.readonly" + }, + "methods": { + "GetDataPoint": { + "requestType": "GetDataPointRequest", + "responseType": "DataPoint", + "options": { + "(google.api.http).get": "/v4/{name=users/*/dataTypes/*/dataPoints/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{name=users/*/dataTypes/*/dataPoints/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDataPoints": { + "requestType": "ListDataPointsRequest", + "responseType": "ListDataPointsResponse", + "options": { + "(google.api.http).get": "/v4/{parent=users/*/dataTypes/*}/dataPoints", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{parent=users/*/dataTypes/*}/dataPoints" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateDataPoint": { + "requestType": "CreateDataPointRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v4/{parent=users/*/dataTypes/*}/dataPoints", + "(google.api.http).body": "data_point", + "(google.api.method_signature)": "parent,data_point", + "(google.longrunning.operation_info).response_type": "DataPoint", + "(google.longrunning.operation_info).metadata_type": "CreateDataPointOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=users/*/dataTypes/*}/dataPoints", + "body": "data_point" + } + }, + { + "(google.api.method_signature)": "parent,data_point" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DataPoint", + "metadata_type": "CreateDataPointOperationMetadata" + } + } + ] + }, + "UpdateDataPoint": { + "requestType": "UpdateDataPointRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v4/{data_point.name=users/*/dataTypes/*/dataPoints/*}", + "(google.api.http).body": "data_point", + "(google.api.method_signature)": "data_point", + "(google.longrunning.operation_info).response_type": "DataPoint", + "(google.longrunning.operation_info).metadata_type": "UpdateDataPointOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v4/{data_point.name=users/*/dataTypes/*/dataPoints/*}", + "body": "data_point" + } + }, + { + "(google.api.method_signature)": "data_point" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DataPoint", + "metadata_type": "UpdateDataPointOperationMetadata" + } + } + ] + }, + "BatchDeleteDataPoints": { + "requestType": "BatchDeleteDataPointsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v4/{parent=users/*/dataTypes/*}/dataPoints:batchDelete", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "BatchDeleteDataPointsResponse", + "(google.longrunning.operation_info).metadata_type": "BatchDeleteDataPointsOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=users/*/dataTypes/*}/dataPoints:batchDelete", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchDeleteDataPointsResponse", + "metadata_type": "BatchDeleteDataPointsOperationMetadata" + } + } + ] + }, + "ReconcileDataPoints": { + "requestType": "ReconcileDataPointsRequest", + "responseType": "ReconcileDataPointsResponse", + "options": { + "(google.api.http).get": "/v4/{parent=users/*/dataTypes/*}/dataPoints:reconcile" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{parent=users/*/dataTypes/*}/dataPoints:reconcile" + } + } + ] + }, + "RollUpDataPoints": { + "requestType": "RollUpDataPointsRequest", + "responseType": "RollUpDataPointsResponse", + "options": { + "(google.api.http).post": "/v4/{parent=users/*/dataTypes/*}/dataPoints:rollUp", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=users/*/dataTypes/*}/dataPoints:rollUp", + "body": "*" + } + } + ] + }, + "DailyRollUpDataPoints": { + "requestType": "DailyRollUpDataPointsRequest", + "responseType": "DailyRollUpDataPointsResponse", + "options": { + "(google.api.http).post": "/v4/{parent=users/*/dataTypes/*}/dataPoints:dailyRollUp", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=users/*/dataTypes/*}/dataPoints:dailyRollUp", + "body": "*" + } + } + ] + }, + "ExportExerciseTcx": { + "requestType": "ExportExerciseTcxRequest", + "responseType": "ExportExerciseTcxResponse", + "options": { + "(google.api.http).get": "/v4/{name=users/*/dataTypes/*/dataPoints/*}:exportExerciseTcx", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{name=users/*/dataTypes/*/dataPoints/*}:exportExerciseTcx" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "DataPoint": { + "options": { + "(google.api.resource).type": "health.googleapis.com/DataPoint", + "(google.api.resource).pattern": "users/{user}/dataTypes/{data_type}/dataPoints/{data_point}", + "(google.api.resource).plural": "dataPoints", + "(google.api.resource).singular": "dataPoint" + }, + "oneofs": { + "data": { + "oneof": [ + "steps", + "floors", + "heartRate", + "sleep", + "dailyRestingHeartRate", + "dailyHeartRateVariability", + "exercise", + "weight", + "altitude", + "distance", + "bodyFat", + "activeZoneMinutes", + "heartRateVariability", + "dailySleepTemperatureDerivations", + "sedentaryPeriod", + "runVo2Max", + "oxygenSaturation", + "dailyOxygenSaturation", + "activityLevel", + "vo2Max", + "dailyVo2Max", + "nutritionLog", + "irregularRhythmNotification", + "electrocardiogram", + "dailyHeartRateZones", + "hydrationLog", + "food", + "timeInHeartRateZone", + "activeMinutes", + "respiratoryRateSleepSummary", + "dailyRespiratoryRate", + "swimLengthsData", + "height", + "basalEnergyBurned", + "coreBodyTemperature", + "activeEnergyBurned", + "foodMeasurementUnit", + "bloodGlucose" + ] + } + }, + "fields": { + "steps": { + "type": "Steps", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "floors": { + "type": "Floors", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "heartRate": { + "type": "HeartRate", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sleep": { + "type": "Sleep", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dailyRestingHeartRate": { + "type": "DailyRestingHeartRate", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dailyHeartRateVariability": { + "type": "DailyHeartRateVariability", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "exercise": { + "type": "Exercise", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "weight": { + "type": "Weight", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "altitude": { + "type": "Altitude", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "distance": { + "type": "Distance", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bodyFat": { + "type": "BodyFat", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "activeZoneMinutes": { + "type": "ActiveZoneMinutes", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "heartRateVariability": { + "type": "HeartRateVariability", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dailySleepTemperatureDerivations": { + "type": "DailySleepTemperatureDerivations", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sedentaryPeriod": { + "type": "SedentaryPeriod", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "runVo2Max": { + "type": "RunVO2Max", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "oxygenSaturation": { + "type": "OxygenSaturation", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dailyOxygenSaturation": { + "type": "DailyOxygenSaturation", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "activityLevel": { + "type": "ActivityLevel", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "vo2Max": { + "type": "VO2Max", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dailyVo2Max": { + "type": "DailyVO2Max", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nutritionLog": { + "type": "NutritionLog", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "irregularRhythmNotification": { + "type": "IrregularRhythmNotification", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "electrocardiogram": { + "type": "Electrocardiogram", + "id": 31, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dailyHeartRateZones": { + "type": "DailyHeartRateZones", + "id": 32, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hydrationLog": { + "type": "HydrationLog", + "id": 33, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "food": { + "type": "Food", + "id": 34, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeInHeartRateZone": { + "type": "TimeInHeartRateZone", + "id": 35, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "activeMinutes": { + "type": "ActiveMinutes", + "id": 36, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "respiratoryRateSleepSummary": { + "type": "RespiratoryRateSleepSummary", + "id": 37, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dailyRespiratoryRate": { + "type": "DailyRespiratoryRate", + "id": 38, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "swimLengthsData": { + "type": "SwimLengthsData", + "id": 39, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "height": { + "type": "Height", + "id": 40, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "basalEnergyBurned": { + "type": "BasalEnergyBurned", + "id": 41, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "coreBodyTemperature": { + "type": "CoreBodyTemperature", + "id": 42, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "activeEnergyBurned": { + "type": "ActiveEnergyBurned", + "id": 44, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "foodMeasurementUnit": { + "type": "FoodMeasurementUnit", + "id": 45, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bloodGlucose": { + "type": "BloodGlucose", + "id": 46, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "dataSource": { + "type": "DataSource", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ReconciledDataPoint": { + "oneofs": { + "data": { + "oneof": [ + "steps", + "floors", + "heartRate", + "sleep", "dailyRestingHeartRate", "dailyHeartRateVariability", "exercise", @@ -2432,814 +4277,1255 @@ "distance", "bodyFat", "activeZoneMinutes", - "heartRateVariability", - "dailySleepTemperatureDerivations", + "heartRateVariability", + "dailySleepTemperatureDerivations", + "sedentaryPeriod", + "runVo2Max", + "oxygenSaturation", + "dailyOxygenSaturation", + "activityLevel", + "vo2Max", + "dailyVo2Max", + "nutritionLog", + "dailyHeartRateZones", + "hydrationLog", + "timeInHeartRateZone", + "activeMinutes", + "respiratoryRateSleepSummary", + "dailyRespiratoryRate", + "swimLengthsData", + "height", + "basalEnergyBurned", + "coreBodyTemperature", + "activeEnergyBurned", + "bloodGlucose" + ] + } + }, + "fields": { + "steps": { + "type": "Steps", + "id": 4 + }, + "floors": { + "type": "Floors", + "id": 5 + }, + "heartRate": { + "type": "HeartRate", + "id": 6 + }, + "sleep": { + "type": "Sleep", + "id": 8 + }, + "dailyRestingHeartRate": { + "type": "DailyRestingHeartRate", + "id": 9 + }, + "dailyHeartRateVariability": { + "type": "DailyHeartRateVariability", + "id": 10 + }, + "exercise": { + "type": "Exercise", + "id": 11 + }, + "weight": { + "type": "Weight", + "id": 12 + }, + "altitude": { + "type": "Altitude", + "id": 13 + }, + "distance": { + "type": "Distance", + "id": 14 + }, + "bodyFat": { + "type": "BodyFat", + "id": 15 + }, + "activeZoneMinutes": { + "type": "ActiveZoneMinutes", + "id": 17 + }, + "heartRateVariability": { + "type": "HeartRateVariability", + "id": 19 + }, + "dailySleepTemperatureDerivations": { + "type": "DailySleepTemperatureDerivations", + "id": 20 + }, + "sedentaryPeriod": { + "type": "SedentaryPeriod", + "id": 21 + }, + "runVo2Max": { + "type": "RunVO2Max", + "id": 22 + }, + "oxygenSaturation": { + "type": "OxygenSaturation", + "id": 24 + }, + "dailyOxygenSaturation": { + "type": "DailyOxygenSaturation", + "id": 25 + }, + "activityLevel": { + "type": "ActivityLevel", + "id": 26 + }, + "vo2Max": { + "type": "VO2Max", + "id": 27 + }, + "dailyVo2Max": { + "type": "DailyVO2Max", + "id": 28 + }, + "nutritionLog": { + "type": "NutritionLog", + "id": 29 + }, + "dailyHeartRateZones": { + "type": "DailyHeartRateZones", + "id": 32 + }, + "hydrationLog": { + "type": "HydrationLog", + "id": 33 + }, + "timeInHeartRateZone": { + "type": "TimeInHeartRateZone", + "id": 35 + }, + "activeMinutes": { + "type": "ActiveMinutes", + "id": 36 + }, + "respiratoryRateSleepSummary": { + "type": "RespiratoryRateSleepSummary", + "id": 37 + }, + "dailyRespiratoryRate": { + "type": "DailyRespiratoryRate", + "id": 38 + }, + "swimLengthsData": { + "type": "SwimLengthsData", + "id": 39 + }, + "height": { + "type": "Height", + "id": 40 + }, + "basalEnergyBurned": { + "type": "BasalEnergyBurned", + "id": 41 + }, + "coreBodyTemperature": { + "type": "CoreBodyTemperature", + "id": 42 + }, + "activeEnergyBurned": { + "type": "ActiveEnergyBurned", + "id": 44 + }, + "bloodGlucose": { + "type": "BloodGlucose", + "id": 46 + }, + "dataPointName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + } + } + }, + "RollupDataPoint": { + "oneofs": { + "value": { + "oneof": [ + "steps", + "floors", + "heartRate", + "weight", + "altitude", + "distance", + "bodyFat", + "totalCalories", + "activeZoneMinutes", "sedentaryPeriod", "runVo2Max", - "oxygenSaturation", - "dailyOxygenSaturation", + "caloriesInHeartRateZone", "activityLevel", - "vo2Max", - "dailyVo2Max", - "dailyHeartRateZones", + "nutritionLog", "hydrationLog", "timeInHeartRateZone", "activeMinutes", - "respiratoryRateSleepSummary", - "dailyRespiratoryRate", "swimLengthsData", - "height", - "basalEnergyBurned" + "coreBodyTemperature", + "activeEnergyBurned", + "bloodGlucose" ] } }, "fields": { "steps": { - "type": "Steps", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "type": "StepsRollupValue", + "id": 5 + }, + "floors": { + "type": "FloorsRollupValue", + "id": 6 + }, + "heartRate": { + "type": "HeartRateRollupValue", + "id": 7 + }, + "weight": { + "type": "WeightRollupValue", + "id": 8 + }, + "altitude": { + "type": "AltitudeRollupValue", + "id": 9 + }, + "distance": { + "type": "DistanceRollupValue", + "id": 10 + }, + "bodyFat": { + "type": "BodyFatRollupValue", + "id": 11 + }, + "totalCalories": { + "type": "TotalCaloriesRollupValue", + "id": 12 + }, + "activeZoneMinutes": { + "type": "ActiveZoneMinutesRollupValue", + "id": 13 + }, + "sedentaryPeriod": { + "type": "SedentaryPeriodRollupValue", + "id": 15 + }, + "runVo2Max": { + "type": "RunVO2MaxRollupValue", + "id": 16 + }, + "caloriesInHeartRateZone": { + "type": "CaloriesInHeartRateZoneRollupValue", + "id": 17 + }, + "activityLevel": { + "type": "ActivityLevelRollupValue", + "id": 18 + }, + "nutritionLog": { + "type": "NutritionLogRollupValue", + "id": 19 + }, + "hydrationLog": { + "type": "HydrationLogRollupValue", + "id": 20 + }, + "timeInHeartRateZone": { + "type": "TimeInHeartRateZoneRollupValue", + "id": 21 + }, + "activeMinutes": { + "type": "ActiveMinutesRollupValue", + "id": 22 + }, + "swimLengthsData": { + "type": "SwimLengthsDataRollupValue", + "id": 23 + }, + "coreBodyTemperature": { + "type": "CoreBodyTemperatureRollupValue", + "id": 24 + }, + "activeEnergyBurned": { + "type": "ActiveEnergyBurnedRollupValue", + "id": 25 + }, + "bloodGlucose": { + "type": "BloodGlucoseRollupValue", + "id": 26 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "DailyRollupDataPoint": { + "oneofs": { + "value": { + "oneof": [ + "steps", + "floors", + "heartRate", + "restingHeartRatePersonalRange", + "heartRateVariabilityPersonalRange", + "weight", + "altitude", + "distance", + "bodyFat", + "totalCalories", + "activeZoneMinutes", + "sedentaryPeriod", + "runVo2Max", + "caloriesInHeartRateZone", + "activityLevel", + "nutritionLog", + "hydrationLog", + "timeInHeartRateZone", + "activeMinutes", + "swimLengthsData", + "coreBodyTemperature", + "activeEnergyBurned", + "bloodGlucose" + ] + } + }, + "fields": { + "steps": { + "type": "StepsRollupValue", + "id": 5 + }, + "floors": { + "type": "FloorsRollupValue", + "id": 6 + }, + "heartRate": { + "type": "HeartRateRollupValue", + "id": 7 + }, + "restingHeartRatePersonalRange": { + "type": "RestingHeartRatePersonalRangeRollupValue", + "id": 8 + }, + "heartRateVariabilityPersonalRange": { + "type": "HeartRateVariabilityPersonalRangeRollupValue", + "id": 9 + }, + "weight": { + "type": "WeightRollupValue", + "id": 10 + }, + "altitude": { + "type": "AltitudeRollupValue", + "id": 11 + }, + "distance": { + "type": "DistanceRollupValue", + "id": 12 + }, + "bodyFat": { + "type": "BodyFatRollupValue", + "id": 13 + }, + "totalCalories": { + "type": "TotalCaloriesRollupValue", + "id": 14 + }, + "activeZoneMinutes": { + "type": "ActiveZoneMinutesRollupValue", + "id": 15 }, - "floors": { - "type": "Floors", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "sedentaryPeriod": { + "type": "SedentaryPeriodRollupValue", + "id": 17 }, - "heartRate": { - "type": "HeartRate", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "runVo2Max": { + "type": "RunVO2MaxRollupValue", + "id": 18 }, - "sleep": { - "type": "Sleep", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "caloriesInHeartRateZone": { + "type": "CaloriesInHeartRateZoneRollupValue", + "id": 19 }, - "dailyRestingHeartRate": { - "type": "DailyRestingHeartRate", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "activityLevel": { + "type": "ActivityLevelRollupValue", + "id": 20 }, - "dailyHeartRateVariability": { - "type": "DailyHeartRateVariability", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "nutritionLog": { + "type": "NutritionLogRollupValue", + "id": 21 }, - "exercise": { - "type": "Exercise", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "hydrationLog": { + "type": "HydrationLogRollupValue", + "id": 22 }, - "weight": { - "type": "Weight", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "timeInHeartRateZone": { + "type": "TimeInHeartRateZoneRollupValue", + "id": 23 }, - "altitude": { - "type": "Altitude", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "activeMinutes": { + "type": "ActiveMinutesRollupValue", + "id": 24 }, - "distance": { - "type": "Distance", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "swimLengthsData": { + "type": "SwimLengthsDataRollupValue", + "id": 25 }, - "bodyFat": { - "type": "BodyFat", - "id": 15, + "coreBodyTemperature": { + "type": "CoreBodyTemperatureRollupValue", + "id": 26 + }, + "activeEnergyBurned": { + "type": "ActiveEnergyBurnedRollupValue", + "id": 27 + }, + "bloodGlucose": { + "type": "BloodGlucoseRollupValue", + "id": 28 + }, + "civilStartTime": { + "type": "CivilDateTime", + "id": 1 + }, + "civilEndTime": { + "type": "CivilDateTime", + "id": 2 + } + } + }, + "GetDataPointRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "health.googleapis.com/DataPoint" } - }, - "activeZoneMinutes": { - "type": "ActiveZoneMinutes", - "id": 17, + } + } + }, + "ListDataPointsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "health.googleapis.com/DataType" } }, - "heartRateVariability": { - "type": "HeartRateVariability", - "id": 19, + "pageSize": { + "type": "int32", + "id": 2, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "dailySleepTemperatureDerivations": { - "type": "DailySleepTemperatureDerivations", - "id": 20, + "pageToken": { + "type": "string", + "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "sedentaryPeriod": { - "type": "SedentaryPeriod", - "id": 21, + "filter": { + "type": "string", + "id": 4, "options": { "(google.api.field_behavior)": "OPTIONAL" } + } + } + }, + "ListDataPointsResponse": { + "fields": { + "dataPoints": { + "rule": "repeated", + "type": "DataPoint", + "id": 1 }, - "runVo2Max": { - "type": "RunVO2Max", - "id": 22, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateDataPointRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "health.googleapis.com/DataPoint" } }, - "oxygenSaturation": { - "type": "OxygenSaturation", - "id": 24, + "dataPoint": { + "type": "DataPoint", + "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } - }, - "dailyOxygenSaturation": { - "type": "DailyOxygenSaturation", - "id": 25, + } + } + }, + "CreateDataPointOperationMetadata": { + "fields": {} + }, + "UpdateDataPointRequest": { + "fields": { + "dataPoint": { + "type": "DataPoint", + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } - }, - "activityLevel": { - "type": "ActivityLevel", - "id": 26, + } + } + }, + "UpdateDataPointOperationMetadata": { + "fields": {} + }, + "BatchDeleteDataPointsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "health.googleapis.com/DataType" } }, - "vo2Max": { - "type": "VO2Max", - "id": 27, + "names": { + "rule": "repeated", + "type": "string", + "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "health.googleapis.com/DataPoint" } - }, - "dailyVo2Max": { - "type": "DailyVO2Max", - "id": 28, + } + } + }, + "BatchDeleteDataPointsResponse": { + "fields": { + "dataPoints": { + "rule": "repeated", + "type": "DataPoint", + "id": 1 + } + } + }, + "BatchDeleteDataPointsOperationMetadata": { + "fields": { + "failedRequests": { + "keyType": "int32", + "type": "google.rpc.Status", + "id": 1 + } + } + }, + "ReconcileDataPointsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } }, - "dailyHeartRateZones": { - "type": "DailyHeartRateZones", - "id": 32, + "pageSize": { + "type": "int32", + "id": 2, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "hydrationLog": { - "type": "HydrationLog", - "id": 33, + "pageToken": { + "type": "string", + "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "timeInHeartRateZone": { - "type": "TimeInHeartRateZone", - "id": 35, + "filter": { + "type": "string", + "id": 4, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "activeMinutes": { - "type": "ActiveMinutes", - "id": 36, + "dataSourceFamily": { + "type": "string", + "id": 5, "options": { "(google.api.field_behavior)": "OPTIONAL" } + } + } + }, + "ReconcileDataPointsResponse": { + "fields": { + "dataPoints": { + "rule": "repeated", + "type": "ReconciledDataPoint", + "id": 1 }, - "respiratoryRateSleepSummary": { - "type": "RespiratoryRateSleepSummary", - "id": 37, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "RollUpDataPointsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "health.googleapis.com/DataType" } }, - "dailyRespiratoryRate": { - "type": "DailyRespiratoryRate", - "id": 38, + "range": { + "type": "google.type.Interval", + "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } }, - "swimLengthsData": { - "type": "SwimLengthsData", - "id": 39, + "windowSize": { + "type": "google.protobuf.Duration", + "id": 3, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } }, - "height": { - "type": "Height", - "id": 40, + "pageSize": { + "type": "int32", + "id": 4, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "basalEnergyBurned": { - "type": "BasalEnergyBurned", - "id": 41, + "pageToken": { + "type": "string", + "id": 5, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "name": { + "dataSourceFamily": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "dataSource": { - "type": "DataSource", - "id": 3, + "id": 7, "options": { "(google.api.field_behavior)": "OPTIONAL" } } } }, - "ReconciledDataPoint": { - "oneofs": { - "data": { - "oneof": [ - "steps", - "floors", - "heartRate", - "sleep", - "dailyRestingHeartRate", - "dailyHeartRateVariability", - "exercise", - "weight", - "altitude", - "distance", - "bodyFat", - "activeZoneMinutes", - "heartRateVariability", - "dailySleepTemperatureDerivations", - "sedentaryPeriod", - "runVo2Max", - "oxygenSaturation", - "dailyOxygenSaturation", - "activityLevel", - "vo2Max", - "dailyVo2Max", - "dailyHeartRateZones", - "hydrationLog", - "timeInHeartRateZone", - "activeMinutes", - "respiratoryRateSleepSummary", - "dailyRespiratoryRate", - "swimLengthsData", - "height", - "basalEnergyBurned" - ] - } - }, + "RollUpDataPointsResponse": { "fields": { - "steps": { - "type": "Steps", - "id": 4 - }, - "floors": { - "type": "Floors", - "id": 5 - }, - "heartRate": { - "type": "HeartRate", - "id": 6 - }, - "sleep": { - "type": "Sleep", - "id": 8 - }, - "dailyRestingHeartRate": { - "type": "DailyRestingHeartRate", - "id": 9 - }, - "dailyHeartRateVariability": { - "type": "DailyHeartRateVariability", - "id": 10 - }, - "exercise": { - "type": "Exercise", - "id": 11 - }, - "weight": { - "type": "Weight", - "id": 12 - }, - "altitude": { - "type": "Altitude", - "id": 13 - }, - "distance": { - "type": "Distance", - "id": 14 - }, - "bodyFat": { - "type": "BodyFat", - "id": 15 - }, - "activeZoneMinutes": { - "type": "ActiveZoneMinutes", - "id": 17 - }, - "heartRateVariability": { - "type": "HeartRateVariability", - "id": 19 - }, - "dailySleepTemperatureDerivations": { - "type": "DailySleepTemperatureDerivations", - "id": 20 - }, - "sedentaryPeriod": { - "type": "SedentaryPeriod", - "id": 21 - }, - "runVo2Max": { - "type": "RunVO2Max", - "id": 22 - }, - "oxygenSaturation": { - "type": "OxygenSaturation", - "id": 24 - }, - "dailyOxygenSaturation": { - "type": "DailyOxygenSaturation", - "id": 25 - }, - "activityLevel": { - "type": "ActivityLevel", - "id": 26 - }, - "vo2Max": { - "type": "VO2Max", - "id": 27 - }, - "dailyVo2Max": { - "type": "DailyVO2Max", - "id": 28 - }, - "dailyHeartRateZones": { - "type": "DailyHeartRateZones", - "id": 32 - }, - "hydrationLog": { - "type": "HydrationLog", - "id": 33 - }, - "timeInHeartRateZone": { - "type": "TimeInHeartRateZone", - "id": 35 - }, - "activeMinutes": { - "type": "ActiveMinutes", - "id": 36 + "rollupDataPoints": { + "rule": "repeated", + "type": "RollupDataPoint", + "id": 1 }, - "respiratoryRateSleepSummary": { - "type": "RespiratoryRateSleepSummary", - "id": 37 + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DailyRollUpDataPointsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "health.googleapis.com/DataType" + } }, - "dailyRespiratoryRate": { - "type": "DailyRespiratoryRate", - "id": 38 + "range": { + "type": "CivilTimeInterval", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "swimLengthsData": { - "type": "SwimLengthsData", - "id": 39 + "windowSizeDays": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "height": { - "type": "Height", - "id": 40 + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "basalEnergyBurned": { - "type": "BasalEnergyBurned", - "id": 41 + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "dataPointName": { + "dataSourceFamily": { "type": "string", - "id": 1, + "id": 7, "options": { - "(google.api.field_behavior)": "IDENTIFIER" + "(google.api.field_behavior)": "OPTIONAL" } } } }, - "RollupDataPoint": { - "oneofs": { - "value": { - "oneof": [ - "steps", - "floors", - "heartRate", - "weight", - "altitude", - "distance", - "bodyFat", - "totalCalories", - "activeZoneMinutes", - "sedentaryPeriod", - "runVo2Max", - "caloriesInHeartRateZone", - "activityLevel", - "hydrationLog", - "timeInHeartRateZone", - "activeMinutes", - "swimLengthsData" - ] + "DailyRollUpDataPointsResponse": { + "fields": { + "rollupDataPoints": { + "rule": "repeated", + "type": "DailyRollupDataPoint", + "id": 1 } + } + }, + "DataType": { + "options": { + "(google.api.resource).type": "health.googleapis.com/DataType", + "(google.api.resource).pattern": "users/{user}/dataTypes/{data_type}", + "(google.api.resource).plural": "dataTypes", + "(google.api.resource).singular": "dataType" }, "fields": { - "steps": { - "type": "StepsRollupValue", - "id": 5 - }, - "floors": { - "type": "FloorsRollupValue", - "id": 6 - }, - "heartRate": { - "type": "HeartRateRollupValue", - "id": 7 - }, - "weight": { - "type": "WeightRollupValue", - "id": 8 - }, - "altitude": { - "type": "AltitudeRollupValue", - "id": 9 - }, - "distance": { - "type": "DistanceRollupValue", - "id": 10 - }, - "bodyFat": { - "type": "BodyFatRollupValue", - "id": 11 - }, - "totalCalories": { - "type": "TotalCaloriesRollupValue", - "id": 12 - }, - "activeZoneMinutes": { - "type": "ActiveZoneMinutesRollupValue", - "id": 13 - }, - "sedentaryPeriod": { - "type": "SedentaryPeriodRollupValue", - "id": 15 - }, - "runVo2Max": { - "type": "RunVO2MaxRollupValue", - "id": 16 - }, - "caloriesInHeartRateZone": { - "type": "CaloriesInHeartRateZoneRollupValue", - "id": 17 - }, - "activityLevel": { - "type": "ActivityLevelRollupValue", - "id": 18 + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + } + } + }, + "ExportExerciseTcxRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "health.googleapis.com/DataPoint" + } }, - "hydrationLog": { - "type": "HydrationLogRollupValue", - "id": 20 + "partialData": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExportExerciseTcxResponse": { + "fields": { + "tcxData": { + "type": "string", + "id": 2 + } + } + }, + "DataSource": { + "fields": { + "recordingMethod": { + "type": "RecordingMethod", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "timeInHeartRateZone": { - "type": "TimeInHeartRateZoneRollupValue", - "id": 21 + "device": { + "type": "Device", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "activeMinutes": { - "type": "ActiveMinutesRollupValue", - "id": 22 + "application": { + "type": "Application", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "swimLengthsData": { - "type": "SwimLengthsDataRollupValue", - "id": 23 + "platform": { + "type": "Platform", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Device": { + "fields": { + "formFactor": { + "type": "FormFactor", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "manufacturer": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "FormFactor": { + "values": { + "FORM_FACTOR_UNSPECIFIED": 0, + "FITNESS_BAND": 1, + "WATCH": 2, + "PHONE": 3, + "RING": 4, + "CHEST_STRAP": 5, + "SCALE": 6, + "TABLET": 7, + "HEAD_MOUNTED": 8, + "SMART_DISPLAY": 9 + } + } + } }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 + "Application": { + "fields": { + "packageName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "webClientId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "googleWebClientId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 + "RecordingMethod": { + "values": { + "RECORDING_METHOD_UNSPECIFIED": 0, + "MANUAL": 1, + "PASSIVELY_MEASURED": 2, + "DERIVED": 3, + "ACTIVELY_MEASURED": 4, + "UNKNOWN": 5 + } + }, + "Platform": { + "values": { + "PLATFORM_UNSPECIFIED": 0, + "FITBIT": 1, + "HEALTH_CONNECT": 2, + "HEALTH_KIT": 3, + "FIT": 4, + "FITBIT_WEB_API": 5, + "NEST": 6, + "GOOGLE_WEB_API": 7, + "GOOGLE_PARTNER_INTEGRATION": 8 + } } } }, - "DailyRollupDataPoint": { - "oneofs": { - "value": { - "oneof": [ - "steps", - "floors", - "heartRate", - "restingHeartRatePersonalRange", - "heartRateVariabilityPersonalRange", - "weight", - "altitude", - "distance", - "bodyFat", - "totalCalories", - "activeZoneMinutes", - "sedentaryPeriod", - "runVo2Max", - "caloriesInHeartRateZone", - "activityLevel", - "hydrationLog", - "timeInHeartRateZone", - "activeMinutes", - "swimLengthsData" - ] - } + "DataSubscriptionService": { + "options": { + "(google.api.default_host)": "health.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" }, - "fields": { - "steps": { - "type": "StepsRollupValue", - "id": 5 - }, - "floors": { - "type": "FloorsRollupValue", - "id": 6 - }, - "heartRate": { - "type": "HeartRateRollupValue", - "id": 7 - }, - "restingHeartRatePersonalRange": { - "type": "RestingHeartRatePersonalRangeRollupValue", - "id": 8 - }, - "heartRateVariabilityPersonalRange": { - "type": "HeartRateVariabilityPersonalRangeRollupValue", - "id": 9 - }, - "weight": { - "type": "WeightRollupValue", - "id": 10 - }, - "altitude": { - "type": "AltitudeRollupValue", - "id": 11 - }, - "distance": { - "type": "DistanceRollupValue", - "id": 12 - }, - "bodyFat": { - "type": "BodyFatRollupValue", - "id": 13 - }, - "totalCalories": { - "type": "TotalCaloriesRollupValue", - "id": 14 - }, - "activeZoneMinutes": { - "type": "ActiveZoneMinutesRollupValue", - "id": 15 - }, - "sedentaryPeriod": { - "type": "SedentaryPeriodRollupValue", - "id": 17 - }, - "runVo2Max": { - "type": "RunVO2MaxRollupValue", - "id": 18 - }, - "caloriesInHeartRateZone": { - "type": "CaloriesInHeartRateZoneRollupValue", - "id": 19 + "methods": { + "CreateSubscriber": { + "requestType": "CreateSubscriberRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v4/{parent=projects/*}/subscribers", + "(google.api.http).body": "subscriber", + "(google.api.method_signature)": "parent,subscriber,subscriber_id", + "(google.longrunning.operation_info).response_type": "Subscriber", + "(google.longrunning.operation_info).metadata_type": "CreateSubscriberMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=projects/*}/subscribers", + "body": "subscriber" + } + }, + { + "(google.api.method_signature)": "parent,subscriber,subscriber_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Subscriber", + "metadata_type": "CreateSubscriberMetadata" + } + } + ] }, - "activityLevel": { - "type": "ActivityLevelRollupValue", - "id": 20 + "ListSubscribers": { + "requestType": "ListSubscribersRequest", + "responseType": "ListSubscribersResponse", + "options": { + "(google.api.http).get": "/v4/{parent=projects/*}/subscribers", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{parent=projects/*}/subscribers" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, - "hydrationLog": { - "type": "HydrationLogRollupValue", - "id": 22 + "UpdateSubscriber": { + "requestType": "UpdateSubscriberRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v4/{subscriber.name=projects/*/subscribers/*}", + "(google.api.http).body": "subscriber", + "(google.api.method_signature)": "subscriber,update_mask", + "(google.longrunning.operation_info).response_type": "Subscriber", + "(google.longrunning.operation_info).metadata_type": "UpdateSubscriberMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v4/{subscriber.name=projects/*/subscribers/*}", + "body": "subscriber" + } + }, + { + "(google.api.method_signature)": "subscriber,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Subscriber", + "metadata_type": "UpdateSubscriberMetadata" + } + } + ] }, - "timeInHeartRateZone": { - "type": "TimeInHeartRateZoneRollupValue", - "id": 23 + "DeleteSubscriber": { + "requestType": "DeleteSubscriberRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v4/{name=projects/*/subscribers/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteSubscriberMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v4/{name=projects/*/subscribers/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteSubscriberMetadata" + } + } + ] }, - "activeMinutes": { - "type": "ActiveMinutesRollupValue", - "id": 24 + "CreateSubscription": { + "requestType": "CreateSubscriptionRequest", + "responseType": "Subscription", + "options": { + "(google.api.http).post": "/v4/{parent=projects/*/subscribers/*}/subscriptions", + "(google.api.http).body": "subscription", + "(google.api.method_signature)": "parent,subscription,subscription_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=projects/*/subscribers/*}/subscriptions", + "body": "subscription" + } + }, + { + "(google.api.method_signature)": "parent,subscription,subscription_id" + } + ] }, - "swimLengthsData": { - "type": "SwimLengthsDataRollupValue", - "id": 25 + "ListSubscriptions": { + "requestType": "ListSubscriptionsRequest", + "responseType": "ListSubscriptionsResponse", + "options": { + "(google.api.http).get": "/v4/{parent=projects/*/subscribers/*}/subscriptions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{parent=projects/*/subscribers/*}/subscriptions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, - "civilStartTime": { - "type": "CivilDateTime", - "id": 1 + "UpdateSubscription": { + "requestType": "UpdateSubscriptionRequest", + "responseType": "Subscription", + "options": { + "(google.api.http).patch": "/v4/{subscription.name=projects/*/subscribers/*/subscriptions/*}", + "(google.api.http).body": "subscription", + "(google.api.method_signature)": "subscription,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v4/{subscription.name=projects/*/subscribers/*/subscriptions/*}", + "body": "subscription" + } + }, + { + "(google.api.method_signature)": "subscription,update_mask" + } + ] }, - "civilEndTime": { - "type": "CivilDateTime", - "id": 2 + "DeleteSubscription": { + "requestType": "DeleteSubscriptionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v4/{name=projects/*/subscribers/*/subscriptions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v4/{name=projects/*/subscribers/*/subscriptions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] } } }, - "GetDataPointRequest": { + "CreateSubscriberRequest": { "fields": { - "name": { + "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "health.googleapis.com/DataPoint" + "(google.api.resource_reference).child_type": "health.googleapis.com/Subscriber" + } + }, + "subscriber": { + "type": "CreateSubscriberPayload", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "subscriberId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } }, - "ListDataPointsRequest": { + "ListSubscribersRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "health.googleapis.com/DataType" + "(google.api.resource_reference).child_type": "health.googleapis.com/Subscriber" } }, "pageSize": { "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, + "id": 2, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "filter": { + "pageToken": { "type": "string", - "id": 4, + "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } } } }, - "ListDataPointsResponse": { + "ListSubscribersResponse": { "fields": { - "dataPoints": { + "subscribers": { "rule": "repeated", - "type": "DataPoint", + "type": "Subscriber", "id": 1 }, "nextPageToken": { "type": "string", "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 } } }, - "CreateDataPointRequest": { + "UpdateSubscriberRequest": { "fields": { - "parent": { - "type": "string", + "subscriber": { + "type": "Subscriber", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "health.googleapis.com/DataPoint" + "(google.api.field_behavior)": "REQUIRED" } }, - "dataPoint": { - "type": "DataPoint", + "updateMask": { + "type": "google.protobuf.FieldMask", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } } } }, - "CreateDataPointOperationMetadata": { - "fields": {} - }, - "UpdateDataPointRequest": { + "DeleteSubscriberRequest": { "fields": { - "dataPoint": { - "type": "DataPoint", + "name": { + "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "health.googleapis.com/Subscriber" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } }, - "UpdateDataPointOperationMetadata": { - "fields": {} - }, - "BatchDeleteDataPointsRequest": { + "CreateSubscriptionRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "health.googleapis.com/DataType" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "health.googleapis.com/Subscription" } }, - "names": { - "rule": "repeated", + "subscriptionId": { "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "health.googleapis.com/DataPoint" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subscription": { + "type": "CreateSubscriptionPayload", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" } } } }, - "BatchDeleteDataPointsResponse": { - "fields": { - "dataPoints": { - "rule": "repeated", - "type": "DataPoint", - "id": 1 - } - } - }, - "BatchDeleteDataPointsOperationMetadata": { - "fields": { - "failedRequests": { - "keyType": "int32", - "type": "google.rpc.Status", - "id": 1 - } - } - }, - "ReconcileDataPointsRequest": { + "ListSubscriptionsRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "health.googleapis.com/Subscription" } }, - "pageSize": { - "type": "int32", + "filter": { + "type": "string", "id": 2, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "pageToken": { - "type": "string", + "pageSize": { + "type": "int32", "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "filter": { + "pageToken": { "type": "string", "id": 4, "options": { "(google.api.field_behavior)": "OPTIONAL" } - }, - "dataSourceFamily": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } } } }, - "ReconcileDataPointsResponse": { + "ListSubscriptionsResponse": { "fields": { - "dataPoints": { + "subscriptions": { "rule": "repeated", - "type": "ReconciledDataPoint", + "type": "Subscription", "id": 1 }, "nextPageToken": { @@ -3248,128 +5534,112 @@ } } }, - "RollUpDataPointsRequest": { + "UpdateSubscriptionRequest": { "fields": { - "parent": { - "type": "string", + "subscription": { + "type": "Subscription", "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "health.googleapis.com/DataType" - } - }, - "range": { - "type": "google.type.Interval", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "windowSize": { - "type": "google.protobuf.Duration", - "id": 3, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "pageSize": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dataSourceFamily": { - "type": "string", - "id": 7, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, "options": { "(google.api.field_behavior)": "OPTIONAL" } } } }, - "RollUpDataPointsResponse": { + "DeleteSubscriptionRequest": { "fields": { - "rollupDataPoints": { - "rule": "repeated", - "type": "RollupDataPoint", - "id": 1 - }, - "nextPageToken": { + "name": { "type": "string", - "id": 2 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "health.googleapis.com/Subscription" + } } } }, - "DailyRollUpDataPointsRequest": { + "Subscriber": { + "options": { + "(google.api.resource).type": "health.googleapis.com/Subscriber", + "(google.api.resource).pattern": "projects/{project}/subscribers/{subscriber}", + "(google.api.resource).plural": "subscribers", + "(google.api.resource).singular": "subscriber" + }, "fields": { - "parent": { + "name": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "health.googleapis.com/DataType" + "(google.api.field_behavior)": "IDENTIFIER" } }, - "range": { - "type": "CivilTimeInterval", + "endpointUri": { + "type": "string", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "windowSizeDays": { - "type": "int32", + "createTime": { + "type": "google.protobuf.Timestamp", "id": 3, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "pageSize": { - "type": "int32", + "updateTime": { + "type": "google.protobuf.Timestamp", "id": 4, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "pageToken": { - "type": "string", + "subscriberConfigs": { + "rule": "repeated", + "type": "SubscriberConfig", "id": 5, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "dataSourceFamily": { - "type": "string", + "endpointAuthorization": { + "type": "EndpointAuthorization", "id": 7, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" } } - } - }, - "DailyRollUpDataPointsResponse": { - "fields": { - "rollupDataPoints": { - "rule": "repeated", - "type": "DailyRollupDataPoint", - "id": 1 + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "UNVERIFIED": 1, + "ACTIVE": 2, + "INACTIVE": 3 + } } } }, - "DataType": { + "Subscription": { "options": { - "(google.api.resource).type": "health.googleapis.com/DataType", - "(google.api.resource).pattern": "users/{user}/dataTypes/{data_type}", - "(google.api.resource).plural": "dataTypes", - "(google.api.resource).singular": "dataType" + "(google.api.resource).type": "health.googleapis.com/Subscription", + "(google.api.resource).pattern": "projects/{project}/subscribers/{subscriber}/subscriptions/{subscription}", + "(google.api.resource).plural": "subscriptions", + "(google.api.resource).singular": "subscription" }, "fields": { "name": { @@ -3378,163 +5648,133 @@ "options": { "(google.api.field_behavior)": "IDENTIFIER" } + }, + "dataTypes": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "health.googleapis.com/DataType" + } + }, + "user": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "health.googleapis.com/User" + } } } }, - "ExportExerciseTcxRequest": { + "SubscriberConfig": { "fields": { - "name": { + "dataTypes": { + "rule": "repeated", "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "health.googleapis.com/DataPoint" + "(google.api.resource_reference).type": "health.googleapis.com/DataType" } }, - "partialData": { - "type": "bool", + "subscriptionCreatePolicy": { + "type": "SubscriptionCreatePolicy", "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "SubscriptionCreatePolicy": { + "values": { + "SUBSCRIPTION_CREATE_POLICY_UNSPECIFIED": 0, + "AUTOMATIC": 1, + "MANUAL": 2 } } } }, - "ExportExerciseTcxResponse": { + "EndpointAuthorization": { "fields": { - "tcxData": { + "secret": { "type": "string", - "id": 2 + "id": 1, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "secretSet": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, - "DataSource": { + "CreateSubscriberPayload": { "fields": { - "recordingMethod": { - "type": "RecordingMethod", + "endpointUri": { + "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } }, - "device": { - "type": "Device", + "subscriberConfigs": { + "rule": "repeated", + "type": "SubscriberConfig", "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "application": { - "type": "Application", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, - "platform": { - "type": "Platform", - "id": 4, + "endpointAuthorization": { + "type": "EndpointAuthorization", + "id": 3, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED" } } - }, - "nested": { - "Device": { - "fields": { - "formFactor": { - "type": "FormFactor", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "manufacturer": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "displayName": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "FormFactor": { - "values": { - "FORM_FACTOR_UNSPECIFIED": 0, - "FITNESS_BAND": 1, - "WATCH": 2, - "PHONE": 3, - "RING": 4, - "CHEST_STRAP": 5, - "SCALE": 6, - "TABLET": 7, - "HEAD_MOUNTED": 8, - "SMART_DISPLAY": 9 - } - } - } - }, - "Application": { - "fields": { - "packageName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "webClientId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "googleWebClientId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "RecordingMethod": { - "values": { - "RECORDING_METHOD_UNSPECIFIED": 0, - "MANUAL": 1, - "PASSIVELY_MEASURED": 2, - "DERIVED": 3, - "ACTIVELY_MEASURED": 4, - "UNKNOWN": 5 + } + }, + "CreateSubscriptionPayload": { + "fields": { + "dataTypes": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "health.googleapis.com/DataType" } }, - "Platform": { - "values": { - "PLATFORM_UNSPECIFIED": 0, - "FITBIT": 1, - "HEALTH_CONNECT": 2, - "HEALTH_KIT": 3, - "FIT": 4, - "FITBIT_WEB_API": 5, - "NEST": 6, - "GOOGLE_WEB_API": 7, - "GOOGLE_PARTNER_INTEGRATION": 8 + "user": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "health.googleapis.com/User" } } } }, + "CreateSubscriberMetadata": { + "fields": {} + }, + "UpdateSubscriberMetadata": { + "fields": {} + }, + "DeleteSubscriberMetadata": { + "fields": {} + }, "HealthProfileService": { "options": { "(google.api.default_host)": "health.googleapis.com", - "(google.api.oauth_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.profile.readonly,https://www.googleapis.com/auth/googlehealth.settings.readonly,https://www.googleapis.com/auth/googlehealth.sleep.readonly" + "(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" }, "methods": { "GetProfile": { @@ -3630,6 +5870,77 @@ "(google.api.method_signature)": "name" } ] + }, + "GetIrnProfile": { + "requestType": "GetIrnProfileRequest", + "responseType": "IrnProfile", + "options": { + "(google.api.http).get": "/v4/{name=users/*/irnProfile}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{name=users/*/irnProfile}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetPairedDevice": { + "requestType": "GetPairedDeviceRequest", + "responseType": "PairedDevice", + "options": { + "(google.api.http).get": "/v4/{name=users/*/pairedDevices/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{name=users/*/pairedDevices/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPairedDevices": { + "requestType": "ListPairedDevicesRequest", + "responseType": "ListPairedDevicesResponse", + "options": { + "(google.api.http).get": "/v4/{parent=users/*}/pairedDevices", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{parent=users/*}/pairedDevices" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "User": { + "options": { + "(google.api.resource).type": "health.googleapis.com/User", + "(google.api.resource).pattern": "users/{user}", + "(google.api.resource).plural": "users", + "(google.api.resource).singular": "user" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } } } }, @@ -3656,64 +5967,178 @@ "autoWalkingStrideLengthMm" ] }, - "_autoRunningStrideLengthMm": { - "oneof": [ - "autoRunningStrideLengthMm" - ] - } - }, - "fields": { - "name": { + "_autoRunningStrideLengthMm": { + "oneof": [ + "autoRunningStrideLengthMm" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "age": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "membershipStartDate": { + "type": "google.type.Date", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "userConfiguredWalkingStrideLengthMm": { + "type": "int32", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "userConfiguredRunningStrideLengthMm": { + "type": "int32", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "autoWalkingStrideLengthMm": { + "type": "int32", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "autoRunningStrideLengthMm": { + "type": "int32", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "PairedDevice": { + "options": { + "(google.api.resource).type": "health.googleapis.com/PairedDevice", + "(google.api.resource).pattern": "users/{user}/pairedDevices/{paired_device}", + "(google.api.resource).plural": "pairedDevices", + "(google.api.resource).singular": "pairedDevice" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "deviceType": { + "type": "DeviceType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "batteryStatus": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "batteryLevel": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastSyncTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deviceVersion": { "type": "string", - "id": 1, + "id": 7, "options": { - "(google.api.field_behavior)": "IDENTIFIER" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "age": { - "type": "int32", - "id": 6, + "macAddress": { + "type": "string", + "id": 8, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "membershipStartDate": { - "type": "google.type.Date", + "features": { + "rule": "repeated", + "type": "string", "id": 9, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } - }, - "userConfiguredWalkingStrideLengthMm": { - "type": "int32", - "id": 13, + } + }, + "nested": { + "DeviceType": { + "values": { + "DEVICE_TYPE_UNSPECIFIED": 0, + "TRACKER": 1, + "SCALE": 2 + } + } + } + }, + "IrnProfile": { + "options": { + "(google.api.resource).type": "health.googleapis.com/IrnProfile", + "(google.api.resource).pattern": "users/{user}/irnProfile", + "(google.api.resource).plural": "irnProfiles", + "(google.api.resource).singular": "irnProfile" + }, + "fields": { + "name": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true + "(google.api.field_behavior)": "IDENTIFIER" } }, - "userConfiguredRunningStrideLengthMm": { - "type": "int32", - "id": 14, + "onboardingStatus": { + "type": "bool", + "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true + "(google.api.field_behavior)": "REQUIRED" } }, - "autoWalkingStrideLengthMm": { - "type": "int32", - "id": 15, + "enrollmentStatus": { + "type": "bool", + "id": 3, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true + "(google.api.field_behavior)": "REQUIRED" } }, - "autoRunningStrideLengthMm": { - "type": "int32", - "id": 16, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true + "(google.api.field_behavior)": "OUTPUT_ONLY" } } } @@ -3823,6 +6248,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "foodLanguageCode": { + "type": "string", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -3930,6 +6362,18 @@ } } }, + "GetIrnProfileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "health.googleapis.com/IrnProfile" + } + } + } + }, "UpdateProfileRequest": { "fields": { "profile": { @@ -3990,6 +6434,57 @@ } } }, + "GetPairedDeviceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "health.googleapis.com/PairedDevice" + } + } + } + }, + "ListPairedDevicesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "health.googleapis.com/PairedDevice" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListPairedDevicesResponse": { + "fields": { + "pairedDevices": { + "rule": "repeated", + "type": "PairedDevice", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, "WebhookNotificationCloudLog": { "fields": { "httpResponse": { @@ -4013,8 +6508,7 @@ "java_multiple_files": true, "java_outer_classname": "LaunchStageProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "fieldBehavior": { @@ -4237,6 +6731,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -4377,6 +6875,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -4434,6 +6954,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -4495,6 +7020,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "LaunchStage": { "values": { "LAUNCH_STAGE_UNSPECIFIED": 0, @@ -4528,12 +7066,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -4572,6 +7117,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -4660,6 +7210,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -4885,6 +7439,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -4935,7 +7493,14 @@ "type": "ServiceOptions", "id": 3 } - } + }, + "reserved": [ + [ + 4, + 4 + ], + "stream" + ] }, "MethodDescriptorProto": { "edition": "proto2", @@ -5099,6 +7664,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -5234,7 +7800,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -5262,6 +7829,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -5331,6 +7902,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -5419,6 +8010,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -5561,6 +8156,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -5571,6 +8167,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -5581,6 +8178,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -5591,6 +8189,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -5601,7 +8200,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -5611,27 +8211,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -5676,7 +8287,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -5691,6 +8308,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -5718,11 +8362,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -5735,6 +8394,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -5820,6 +8485,14 @@ } } }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, "Duration": { "fields": { "seconds": { @@ -5938,6 +8611,7 @@ "java_multiple_files": true, "java_outer_classname": "OperationsProto", "java_package": "com.google.longrunning", + "objc_class_prefix": "GLRUN", "php_namespace": "Google\\LongRunning" }, "nested": { diff --git a/packages/google-devicesandservices-health/samples/generated/v4/data_points_service.list_data_points.js b/packages/google-devicesandservices-health/samples/generated/v4/data_points_service.list_data_points.js index 6ef809647b8b..dbb0caed44e7 100644 --- a/packages/google-devicesandservices-health/samples/generated/v4/data_points_service.list_data_points.js +++ b/packages/google-devicesandservices-health/samples/generated/v4/data_points_service.list_data_points.js @@ -100,9 +100,8 @@ function main(parent) { * - Date literal expected in ISO 8601 `YYYY-MM-DD` format * - Supported logical operators: `AND` * - Example: - * - `daily_resting_heart_rate.date >= "2024-08-14"` * - `daily_heart_rate_variability.date < "2024-08-15"` - * - Session civil start time (**Excluding Sleep**): + * - Session civil start time (**Excluding Sleep and ECG**): * - Pattern: `{session_data_type}.interval.civil_start_time` * - Supported comparison operators: `>=`, `<` * - Date with optional time literal expected in ISO 8601 @@ -112,6 +111,15 @@ function main(parent) { * - `exercise.interval.civil_start_time >= "2023-11-24" AND * exercise.interval.civil_start_time < "2023-11-25"` * - `exercise.interval.civil_start_time >= "2024-08-14T12:34:56"` + * - Session start time (**ECG specific**): + * - Pattern: `electrocardiogram.interval.start_time` + * - Supported comparison operators: `>=` + * - Timestamp literal expected in RFC-3339 format + * - Example: + * - `electrocardiogram.interval.start_time >= "2024-08-14T12:34:56Z"` + * - Note: Only filtering by start time is supported for ECG. Filtering + * by end time (e.g., `electrocardiogram.interval.end_time`) is not + * supported. * - Session end time (**Sleep specific**): * - Pattern: `sleep.interval.end_time` * - Supported comparison operators: `>=`, `<` diff --git a/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.create_subscriber.js b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.create_subscriber.js new file mode 100644 index 000000000000..9949a5deaeb1 --- /dev/null +++ b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.create_subscriber.js @@ -0,0 +1,76 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, subscriber) { + // [START health_v4_generated_DataSubscriptionService_CreateSubscriber_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this subscriber will be created. + * Format: projects/{project} + * Example: projects/my-project-123 + */ + // const parent = 'abc123' + /** + * Required. The subscriber to create. + */ + // const subscriber = {} + /** + * Optional. The ID to use for the subscriber, which will become the final + * component of the subscriber's resource name. + * This value should be 4-36 characters, and valid characters + * are /[a-z]([a-z0-9-]{2,34}[a-z0-9])/. + */ + // const subscriberId = 'abc123' + + // Imports the Health library + const {DataSubscriptionServiceClient} = require('@google-cloud/health').v4; + + // Instantiates a client + const healthClient = new DataSubscriptionServiceClient(); + + async function callCreateSubscriber() { + // Construct request + const request = { + parent, + subscriber, + }; + + // Run request + const [operation] = await healthClient.createSubscriber(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSubscriber(); + // [END health_v4_generated_DataSubscriptionService_CreateSubscriber_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.create_subscription.js b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.create_subscription.js new file mode 100644 index 000000000000..4e5e5e93d133 --- /dev/null +++ b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.create_subscription.js @@ -0,0 +1,77 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, subscription) { + // [START health_v4_generated_DataSubscriptionService_CreateSubscription_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent subscriber. + * Format: projects/{project}/subscribers/{subscriber} + * The {subscriber} ID is user-settable (4-36 characters, matching + * /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or + * system-generated otherwise. + */ + // const parent = 'abc123' + /** + * Optional. The {subscription_id} is user-settable + * (4-36 chars, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or system-generated + * otherwise. + * If provided, the ID must be unique within the parent subscriber. + */ + // const subscriptionId = 'abc123' + /** + * Required. The subscription to create. + */ + // const subscription = {} + + // Imports the Health library + const {DataSubscriptionServiceClient} = require('@google-cloud/health').v4; + + // Instantiates a client + const healthClient = new DataSubscriptionServiceClient(); + + async function callCreateSubscription() { + // Construct request + const request = { + parent, + subscription, + }; + + // Run request + const response = await healthClient.createSubscription(request); + console.log(response); + } + + callCreateSubscription(); + // [END health_v4_generated_DataSubscriptionService_CreateSubscription_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.delete_subscriber.js b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.delete_subscriber.js new file mode 100644 index 000000000000..567d67d7ac85 --- /dev/null +++ b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.delete_subscriber.js @@ -0,0 +1,73 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START health_v4_generated_DataSubscriptionService_DeleteSubscriber_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the subscriber to delete. + * Format: projects/{project}/subscribers/{subscriber} + * Example: projects/my-project/subscribers/my-subscriber-123 + * The {subscriber} ID is user-settable (4-36 characters, matching + * /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or system-generated if not provided + * during creation. + */ + // const name = 'abc123' + /** + * Optional. If set to true, any child resources (e.g., subscriptions) will + * also be deleted. If false (default) and child resources exist, the request + * will fail. + */ + // const force = true + + // Imports the Health library + const {DataSubscriptionServiceClient} = require('@google-cloud/health').v4; + + // Instantiates a client + const healthClient = new DataSubscriptionServiceClient(); + + async function callDeleteSubscriber() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await healthClient.deleteSubscriber(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteSubscriber(); + // [END health_v4_generated_DataSubscriptionService_DeleteSubscriber_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.delete_subscription.js b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.delete_subscription.js new file mode 100644 index 000000000000..747e5540b5a6 --- /dev/null +++ b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.delete_subscription.js @@ -0,0 +1,71 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START health_v4_generated_DataSubscriptionService_DeleteSubscription_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the subscription to delete. + * Format: + * `projects/{project}/subscribers/{subscriber}/subscriptions/{subscription}` + * Example: + * `projects/my-project/subscribers/my-subscriber-123/subscriptions/my-subscription-456` + * The {subscriber} ID is user-settable (4-36 characters, matching + * /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or + * system-generated otherwise. The {subscription} ID is user-settable (4-36 + * characters, matching + * /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or system-generated if not provided + * during creation. + */ + // const name = 'abc123' + + // Imports the Health library + const {DataSubscriptionServiceClient} = require('@google-cloud/health').v4; + + // Instantiates a client + const healthClient = new DataSubscriptionServiceClient(); + + async function callDeleteSubscription() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await healthClient.deleteSubscription(request); + console.log(response); + } + + callDeleteSubscription(); + // [END health_v4_generated_DataSubscriptionService_DeleteSubscription_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.list_subscribers.js b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.list_subscribers.js new file mode 100644 index 000000000000..db22e3799d77 --- /dev/null +++ b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.list_subscribers.js @@ -0,0 +1,78 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START health_v4_generated_DataSubscriptionService_ListSubscribers_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of subscribers. + * Format: projects/{project} + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of subscribers to return. The service may + * return fewer than this value. If unspecified, at most 50 subscribers will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListSubscribers` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSubscribers` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Health library + const {DataSubscriptionServiceClient} = require('@google-cloud/health').v4; + + // Instantiates a client + const healthClient = new DataSubscriptionServiceClient(); + + async function callListSubscribers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = healthClient.listSubscribersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSubscribers(); + // [END health_v4_generated_DataSubscriptionService_ListSubscribers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.list_subscriptions.js b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.list_subscriptions.js new file mode 100644 index 000000000000..de0859e6ea8e --- /dev/null +++ b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.list_subscriptions.js @@ -0,0 +1,95 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START health_v4_generated_DataSubscriptionService_ListSubscriptions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent subscriber. + * Format: projects/{project}/subscribers/{subscriber} + * The {subscriber} ID is user-settable (4-36 characters, matching + * /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or + * system-generated otherwise. + */ + // const parent = 'abc123' + /** + * Optional. A filter to apply to the list of subscriptions. + * The filter syntax is described in https://google.aip.dev/160. + * The filter can be applied to the following fields: + * - `user` + * - `data_type` + * The `user` identifier (e.g., `user1` in `users/user1`) refers to the public + * `healthUserId` + * Example: user = "users/user1" + * Example: user = "users/user1" OR user = "users/user2" + * Example: user = "users/user1" AND (data_type = "sleep" OR data_type = + * "weight") + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of subscriptions to return. The service may + * return fewer than this value. If unspecified, at most 50 subscriptions will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListSubscriptions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSubscriptions` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Health library + const {DataSubscriptionServiceClient} = require('@google-cloud/health').v4; + + // Instantiates a client + const healthClient = new DataSubscriptionServiceClient(); + + async function callListSubscriptions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = healthClient.listSubscriptionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSubscriptions(); + // [END health_v4_generated_DataSubscriptionService_ListSubscriptions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.update_subscriber.js b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.update_subscriber.js new file mode 100644 index 000000000000..8086cce97ac0 --- /dev/null +++ b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.update_subscriber.js @@ -0,0 +1,75 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(subscriber) { + // [START health_v4_generated_DataSubscriptionService_UpdateSubscriber_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The subscriber resource to update. Its 'name' field is mapped to + * the URI, and the value of the 'name' field should be of the form: + * "projects/{project}/subscribers/{subscriber_id}". + * The remaining fields of the Subscriber object represent the new values + * for the corresponding fields in the existing subscriber resource. + */ + // const subscriber = {} + /** + * Optional. A field mask that specifies which fields of the Subscriber + * message are to be updated. This allows for partial updates. Supported + * fields: + * - endpoint_uri + * - subscriber_configs + * - endpoint_authorization + */ + // const updateMask = {} + + // Imports the Health library + const {DataSubscriptionServiceClient} = require('@google-cloud/health').v4; + + // Instantiates a client + const healthClient = new DataSubscriptionServiceClient(); + + async function callUpdateSubscriber() { + // Construct request + const request = { + subscriber, + }; + + // Run request + const [operation] = await healthClient.updateSubscriber(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateSubscriber(); + // [END health_v4_generated_DataSubscriptionService_UpdateSubscriber_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.update_subscription.js b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.update_subscription.js new file mode 100644 index 000000000000..551e5d19b294 --- /dev/null +++ b/packages/google-devicesandservices-health/samples/generated/v4/data_subscription_service.update_subscription.js @@ -0,0 +1,68 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(subscription) { + // [START health_v4_generated_DataSubscriptionService_UpdateSubscription_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The subscription to update. + * The subscription's `name` field is used to identify the subscription to + * update. Format: + * projects/{project}/subscribers/{subscriber}/subscriptions/{subscription} + */ + // const subscription = {} + /** + * Optional. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Health library + const {DataSubscriptionServiceClient} = require('@google-cloud/health').v4; + + // Instantiates a client + const healthClient = new DataSubscriptionServiceClient(); + + async function callUpdateSubscription() { + // Construct request + const request = { + subscription, + }; + + // Run request + const response = await healthClient.updateSubscription(request); + console.log(response); + } + + callUpdateSubscription(); + // [END health_v4_generated_DataSubscriptionService_UpdateSubscription_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.get_irn_profile.js b/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.get_irn_profile.js new file mode 100644 index 000000000000..8a89ebcc2de3 --- /dev/null +++ b/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.get_irn_profile.js @@ -0,0 +1,67 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START health_v4_generated_HealthProfileService_GetIrnProfile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const name = 'abc123' + + // Imports the Health library + const {HealthProfileServiceClient} = require('@google-cloud/health').v4; + + // Instantiates a client + const healthClient = new HealthProfileServiceClient(); + + async function callGetIrnProfile() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await healthClient.getIrnProfile(request); + console.log(response); + } + + callGetIrnProfile(); + // [END health_v4_generated_HealthProfileService_GetIrnProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.get_paired_device.js b/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.get_paired_device.js new file mode 100644 index 000000000000..1270a01212b3 --- /dev/null +++ b/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.get_paired_device.js @@ -0,0 +1,62 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START health_v4_generated_HealthProfileService_GetPairedDevice_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the device to retrieve. + * Format: users/{user}/devices/{device} + */ + // const name = 'abc123' + + // Imports the Health library + const {HealthProfileServiceClient} = require('@google-cloud/health').v4; + + // Instantiates a client + const healthClient = new HealthProfileServiceClient(); + + async function callGetPairedDevice() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await healthClient.getPairedDevice(request); + console.log(response); + } + + callGetPairedDevice(); + // [END health_v4_generated_HealthProfileService_GetPairedDevice_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.list_paired_devices.js b/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.list_paired_devices.js new file mode 100644 index 000000000000..57e20d90080f --- /dev/null +++ b/packages/google-devicesandservices-health/samples/generated/v4/health_profile_service.list_paired_devices.js @@ -0,0 +1,77 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START health_v4_generated_HealthProfileService_ListPairedDevices_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of devices. + * Format: users/{user} + */ + // const parent = 'abc123' + /** + * 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. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + + // Imports the Health library + const {HealthProfileServiceClient} = require('@google-cloud/health').v4; + + // Instantiates a client + const healthClient = new HealthProfileServiceClient(); + + async function callListPairedDevices() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = healthClient.listPairedDevicesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPairedDevices(); + // [END health_v4_generated_HealthProfileService_ListPairedDevices_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devicesandservices-health/samples/generated/v4/snippet_metadata_google.devicesandservices.health.v4.json b/packages/google-devicesandservices-health/samples/generated/v4/snippet_metadata_google.devicesandservices.health.v4.json index 168500281e25..8a4665550d33 100644 --- a/packages/google-devicesandservices-health/samples/generated/v4/snippet_metadata_google.devicesandservices.health.v4.json +++ b/packages/google-devicesandservices-health/samples/generated/v4/snippet_metadata_google.devicesandservices.health.v4.json @@ -62,7 +62,7 @@ "segments": [ { "start": 25, - "end": 156, + "end": 164, "type": "FULL" } ], @@ -411,7 +411,7 @@ "regionTag": "health_v4_generated_DataPointsService_ExportExerciseTcx_async", "title": "DataPointsService exportExerciseTcx Sample", "origin": "API_DEFINITION", - "description": " Exports exercise data in TCX format. Note: While the Authorization section below states that any one of the listed scopes is accepted, this specific method requires the user to provide both one of the `activity_and_fitness` scopes (`normal` or `readonly`) AND one of the `location` scopes (`normal` or `readonly`) in their access token to succeed.", + "description": " Exports exercise data in TCX format. **IMPORTANT:** HTTP clients must append `?alt=media` to the request URL to download the raw TCX file. Example: `https://health.googleapis.com/v4/users/me/dataTypes/exercise/dataPoints/EXERCISE_ID:exportExerciseTcx?alt=media` Without `alt=media`, the server returns a JSON response (`ExportExerciseTcxResponse`) which is intended primarily for gRPC clients. **Note:** While the Authorization section below states that any one of the listed scopes is accepted, this specific method requires the user to provide both one of the `activity_and_fitness` scopes (`normal` or `readonly`) AND one of the `location` scopes (`normal` or `readonly`) in their access token to succeed.", "canonical": true, "file": "data_points_service.export_exercise_tcx.js", "language": "JAVASCRIPT", @@ -451,6 +451,374 @@ } } }, + { + "regionTag": "health_v4_generated_DataSubscriptionService_CreateSubscriber_async", + "title": "DataPointsService createSubscriber Sample", + "origin": "API_DEFINITION", + "description": " Registers a new subscriber endpoint to receive notifications. A subscriber represents an application or service that wishes to receive data change notifications for users who have granted consent. **Endpoint Verification:** For a subscriber to be successfully created, the provided `endpoint_uri` must be a valid HTTPS endpoint and must pass an automated verification check. The backend will send two HTTP POST requests to the `endpoint_uri`: 1. **Verification with Authorization:** * **Headers:** Includes `Content-Type: application/json` and `Authorization` (with the exact value from `CreateSubscriberPayload.endpoint_authorization.secret`). * **Body:** `{\"type\": \"verification\"}` * **Expected Response:** HTTP `201 Created`. 2. **Verification without Authorization:** * **Headers:** Includes `Content-Type: application/json`. The `Authorization` header is OMITTED. * **Body:** `{\"type\": \"verification\"}` * **Expected Response:** HTTP `401 Unauthorized` or `403 Forbidden`. Both tests must pass for the subscriber creation to succeed. If verification fails, the operation will not be completed and an error will be returned. This process ensures the endpoint is reachable and correctly validates the `Authorization` header.", + "canonical": true, + "file": "data_subscription_service.create_subscriber.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSubscriber", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.CreateSubscriber", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "subscriber", + "type": ".google.devicesandservices.health.v4.CreateSubscriberPayload" + }, + { + "name": "subscriber_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataSubscriptionServiceClient", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionServiceClient" + }, + "method": { + "shortName": "CreateSubscriber", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.CreateSubscriber", + "service": { + "shortName": "DataSubscriptionService", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService" + } + } + } + }, + { + "regionTag": "health_v4_generated_DataSubscriptionService_ListSubscribers_async", + "title": "DataPointsService listSubscribers Sample", + "origin": "API_DEFINITION", + "description": " Lists all subscribers registered within the owned Google Cloud Project.", + "canonical": true, + "file": "data_subscription_service.list_subscribers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSubscribers", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.ListSubscribers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.devicesandservices.health.v4.ListSubscribersResponse", + "client": { + "shortName": "DataSubscriptionServiceClient", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionServiceClient" + }, + "method": { + "shortName": "ListSubscribers", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.ListSubscribers", + "service": { + "shortName": "DataSubscriptionService", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService" + } + } + } + }, + { + "regionTag": "health_v4_generated_DataSubscriptionService_UpdateSubscriber_async", + "title": "DataPointsService updateSubscriber Sample", + "origin": "API_DEFINITION", + "description": " Updates the configuration of an existing subscriber, such as the endpoint URI or the data types it's interested in. **Endpoint Verification:** If the `endpoint_uri` or `endpoint_authorization` field is included in the `update_mask`, the backend will re-verify the endpoint. The verification process is the same as described in `CreateSubscriber`: 1. **Verification with Authorization:** POST to the new or existing `endpoint_uri` with the new or existing `Authorization` secret. Expects HTTP `201 Created`. 2. **Verification without Authorization:** POST to the `endpoint_uri` without the `Authorization` header. Expects HTTP `401 Unauthorized` or `403 Forbidden`. Both tests must pass using the potentially updated values for the subscriber update to succeed. If verification fails, the update will not be applied, and an error will be returned.", + "canonical": true, + "file": "data_subscription_service.update_subscriber.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSubscriber", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.UpdateSubscriber", + "async": true, + "parameters": [ + { + "name": "subscriber", + "type": ".google.devicesandservices.health.v4.Subscriber" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataSubscriptionServiceClient", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionServiceClient" + }, + "method": { + "shortName": "UpdateSubscriber", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.UpdateSubscriber", + "service": { + "shortName": "DataSubscriptionService", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService" + } + } + } + }, + { + "regionTag": "health_v4_generated_DataSubscriptionService_DeleteSubscriber_async", + "title": "DataPointsService deleteSubscriber Sample", + "origin": "API_DEFINITION", + "description": " Deletes a subscriber registration. This will stop all notifications to the subscriber's endpoint.", + "canonical": true, + "file": "data_subscription_service.delete_subscriber.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSubscriber", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.DeleteSubscriber", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataSubscriptionServiceClient", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionServiceClient" + }, + "method": { + "shortName": "DeleteSubscriber", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.DeleteSubscriber", + "service": { + "shortName": "DataSubscriptionService", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService" + } + } + } + }, + { + "regionTag": "health_v4_generated_DataSubscriptionService_CreateSubscription_async", + "title": "DataPointsService createSubscription Sample", + "origin": "API_DEFINITION", + "description": " Creates a subscription for a specific user to a specific subscriber. This method requires the subscriber to have a `SubscriptionCreatePolicy` set to `MANUAL` for the given data types.", + "canonical": true, + "file": "data_subscription_service.create_subscription.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSubscription", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.CreateSubscription", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "subscription_id", + "type": "TYPE_STRING" + }, + { + "name": "subscription", + "type": ".google.devicesandservices.health.v4.CreateSubscriptionPayload" + } + ], + "resultType": ".google.devicesandservices.health.v4.Subscription", + "client": { + "shortName": "DataSubscriptionServiceClient", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionServiceClient" + }, + "method": { + "shortName": "CreateSubscription", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.CreateSubscription", + "service": { + "shortName": "DataSubscriptionService", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService" + } + } + } + }, + { + "regionTag": "health_v4_generated_DataSubscriptionService_ListSubscriptions_async", + "title": "DataPointsService listSubscriptions Sample", + "origin": "API_DEFINITION", + "description": " Lists all active subscriptions for a given subscriber. This can be filtered, for example, by user or data type.", + "canonical": true, + "file": "data_subscription_service.list_subscriptions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSubscriptions", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.ListSubscriptions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.devicesandservices.health.v4.ListSubscriptionsResponse", + "client": { + "shortName": "DataSubscriptionServiceClient", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionServiceClient" + }, + "method": { + "shortName": "ListSubscriptions", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.ListSubscriptions", + "service": { + "shortName": "DataSubscriptionService", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService" + } + } + } + }, + { + "regionTag": "health_v4_generated_DataSubscriptionService_UpdateSubscription_async", + "title": "DataPointsService updateSubscription Sample", + "origin": "API_DEFINITION", + "description": " Updates the data types for an existing user subscription.", + "canonical": true, + "file": "data_subscription_service.update_subscription.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSubscription", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.UpdateSubscription", + "async": true, + "parameters": [ + { + "name": "subscription", + "type": ".google.devicesandservices.health.v4.Subscription" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.devicesandservices.health.v4.Subscription", + "client": { + "shortName": "DataSubscriptionServiceClient", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionServiceClient" + }, + "method": { + "shortName": "UpdateSubscription", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.UpdateSubscription", + "service": { + "shortName": "DataSubscriptionService", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService" + } + } + } + }, + { + "regionTag": "health_v4_generated_DataSubscriptionService_DeleteSubscription_async", + "title": "DataPointsService deleteSubscription Sample", + "origin": "API_DEFINITION", + "description": " Deletes a specific user subscription, stopping notifications for this user to this subscriber.", + "canonical": true, + "file": "data_subscription_service.delete_subscription.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSubscription", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.DeleteSubscription", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataSubscriptionServiceClient", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionServiceClient" + }, + "method": { + "shortName": "DeleteSubscription", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService.DeleteSubscription", + "service": { + "shortName": "DataSubscriptionService", + "fullName": "google.devicesandservices.health.v4.DataSubscriptionService" + } + } + } + }, { "regionTag": "health_v4_generated_HealthProfileService_GetProfile_async", "title": "DataPointsService getProfile Sample", @@ -658,6 +1026,134 @@ } } } + }, + { + "regionTag": "health_v4_generated_HealthProfileService_GetIrnProfile_async", + "title": "DataPointsService getIrnProfile Sample", + "origin": "API_DEFINITION", + "description": " Returns user's IRN Profile details.", + "canonical": true, + "file": "health_profile_service.get_irn_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIrnProfile", + "fullName": "google.devicesandservices.health.v4.HealthProfileService.GetIrnProfile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.devicesandservices.health.v4.IrnProfile", + "client": { + "shortName": "HealthProfileServiceClient", + "fullName": "google.devicesandservices.health.v4.HealthProfileServiceClient" + }, + "method": { + "shortName": "GetIrnProfile", + "fullName": "google.devicesandservices.health.v4.HealthProfileService.GetIrnProfile", + "service": { + "shortName": "HealthProfileService", + "fullName": "google.devicesandservices.health.v4.HealthProfileService" + } + } + } + }, + { + "regionTag": "health_v4_generated_HealthProfileService_GetPairedDevice_async", + "title": "DataPointsService getPairedDevice Sample", + "origin": "API_DEFINITION", + "description": " Returns user's Device.", + "canonical": true, + "file": "health_profile_service.get_paired_device.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPairedDevice", + "fullName": "google.devicesandservices.health.v4.HealthProfileService.GetPairedDevice", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.devicesandservices.health.v4.PairedDevice", + "client": { + "shortName": "HealthProfileServiceClient", + "fullName": "google.devicesandservices.health.v4.HealthProfileServiceClient" + }, + "method": { + "shortName": "GetPairedDevice", + "fullName": "google.devicesandservices.health.v4.HealthProfileService.GetPairedDevice", + "service": { + "shortName": "HealthProfileService", + "fullName": "google.devicesandservices.health.v4.HealthProfileService" + } + } + } + }, + { + "regionTag": "health_v4_generated_HealthProfileService_ListPairedDevices_async", + "title": "DataPointsService listPairedDevices Sample", + "origin": "API_DEFINITION", + "description": " Returns the user's list of paired 1P trackers and smartwatches.", + "canonical": true, + "file": "health_profile_service.list_paired_devices.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPairedDevices", + "fullName": "google.devicesandservices.health.v4.HealthProfileService.ListPairedDevices", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.devicesandservices.health.v4.ListPairedDevicesResponse", + "client": { + "shortName": "HealthProfileServiceClient", + "fullName": "google.devicesandservices.health.v4.HealthProfileServiceClient" + }, + "method": { + "shortName": "ListPairedDevices", + "fullName": "google.devicesandservices.health.v4.HealthProfileService.ListPairedDevices", + "service": { + "shortName": "HealthProfileService", + "fullName": "google.devicesandservices.health.v4.HealthProfileService" + } + } + } } ] } diff --git a/packages/google-devicesandservices-health/src/index.ts b/packages/google-devicesandservices-health/src/index.ts index 971371911107..96eefaf9f95f 100644 --- a/packages/google-devicesandservices-health/src/index.ts +++ b/packages/google-devicesandservices-health/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// 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. @@ -20,10 +20,12 @@ import * as v4 from './v4'; const DataPointsServiceClient = v4.DataPointsServiceClient; type DataPointsServiceClient = v4.DataPointsServiceClient; +const DataSubscriptionServiceClient = v4.DataSubscriptionServiceClient; +type DataSubscriptionServiceClient = v4.DataSubscriptionServiceClient; const HealthProfileServiceClient = v4.HealthProfileServiceClient; type HealthProfileServiceClient = v4.HealthProfileServiceClient; -export {v4, DataPointsServiceClient, HealthProfileServiceClient}; -export default {v4, DataPointsServiceClient, HealthProfileServiceClient}; +export {v4, DataPointsServiceClient, DataSubscriptionServiceClient, HealthProfileServiceClient}; +export default {v4, DataPointsServiceClient, DataSubscriptionServiceClient, HealthProfileServiceClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-devicesandservices-health/src/v4/data_points_service_client.ts b/packages/google-devicesandservices-health/src/v4/data_points_service_client.ts index c42e9b977193..4ac09e9d3636 100644 --- a/packages/google-devicesandservices-health/src/v4/data_points_service_client.ts +++ b/packages/google-devicesandservices-health/src/v4/data_points_service_client.ts @@ -18,11 +18,20 @@ /* global window */ import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import { Transform } from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -45,7 +54,7 @@ export class DataPointsServiceClient { private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; + private _defaults: { [method: string]: gax.CallSettings }; private _universeDomain: string; private _servicePath: string; private _log = logging.log('health'); @@ -58,10 +67,10 @@ export class DataPointsServiceClient { batching: {}, }; warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; + innerApiCalls: { [name: string]: Function }; + pathTemplates: { [name: string]: gax.PathTemplate }; operationsClient: gax.OperationsClient; - dataPointsServiceStub?: Promise<{[name: string]: Function}>; + dataPointsServiceStub?: Promise<{ [name: string]: Function }>; /** * Construct an instance of DataPointsServiceClient. @@ -102,21 +111,42 @@ export class DataPointsServiceClient { * const client = new DataPointsServiceClient({fallback: true}, gax); * ``` */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof DataPointsServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'health.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); // Request numeric enum values if REST transport is used. opts.numericEnums = true; @@ -141,7 +171,7 @@ export class DataPointsServiceClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; @@ -155,10 +185,7 @@ export class DataPointsServiceClient { } // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -180,32 +207,54 @@ export class DataPointsServiceClient { // Create useful helper objects for these. this.pathTemplates = { dataPointPathTemplate: new this._gaxModule.PathTemplate( - 'users/{user}/dataTypes/{data_type}/dataPoints/{data_point}' + 'users/{user}/dataTypes/{data_type}/dataPoints/{data_point}', ), dataTypePathTemplate: new this._gaxModule.PathTemplate( - 'users/{user}/dataTypes/{data_type}' + 'users/{user}/dataTypes/{data_type}', ), identityPathTemplate: new this._gaxModule.PathTemplate( - 'users/{user}/identity' + 'users/{user}/identity', + ), + irnProfilePathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/irnProfile', + ), + pairedDevicePathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/pairedDevices/{paired_device}', ), profilePathTemplate: new this._gaxModule.PathTemplate( - 'users/{user}/profile' + 'users/{user}/profile', ), settingsPathTemplate: new this._gaxModule.PathTemplate( - 'users/{user}/settings' + 'users/{user}/settings', + ), + subscriberPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscribers/{subscriber}', ), + subscriptionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscribers/{subscriber}/subscriptions/{subscription}', + ), + userPathTemplate: new this._gaxModule.PathTemplate('users/{user}'), }; // Some of the methods on this service return "paged" results, // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { - listDataPoints: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataPoints'), - reconcileDataPoints: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataPoints'), - rollUpDataPoints: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'rollupDataPoints') + listDataPoints: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dataPoints', + ), + reconcileDataPoints: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dataPoints', + ), + rollUpDataPoints: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'rollupDataPoints', + ), }; const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); @@ -214,45 +263,63 @@ export class DataPointsServiceClient { // rather than holding a request open. const lroOptions: GrpcClientOptions = { auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = []; } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); const createDataPointResponse = protoFilesRoot.lookup( - '.google.devicesandservices.health.v4.DataPoint') as gax.protobuf.Type; + '.google.devicesandservices.health.v4.DataPoint', + ) as gax.protobuf.Type; const createDataPointMetadata = protoFilesRoot.lookup( - '.google.devicesandservices.health.v4.CreateDataPointOperationMetadata') as gax.protobuf.Type; + '.google.devicesandservices.health.v4.CreateDataPointOperationMetadata', + ) as gax.protobuf.Type; const updateDataPointResponse = protoFilesRoot.lookup( - '.google.devicesandservices.health.v4.DataPoint') as gax.protobuf.Type; + '.google.devicesandservices.health.v4.DataPoint', + ) as gax.protobuf.Type; const updateDataPointMetadata = protoFilesRoot.lookup( - '.google.devicesandservices.health.v4.UpdateDataPointOperationMetadata') as gax.protobuf.Type; + '.google.devicesandservices.health.v4.UpdateDataPointOperationMetadata', + ) as gax.protobuf.Type; const batchDeleteDataPointsResponse = protoFilesRoot.lookup( - '.google.devicesandservices.health.v4.BatchDeleteDataPointsResponse') as gax.protobuf.Type; + '.google.devicesandservices.health.v4.BatchDeleteDataPointsResponse', + ) as gax.protobuf.Type; const batchDeleteDataPointsMetadata = protoFilesRoot.lookup( - '.google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata') as gax.protobuf.Type; + '.google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata', + ) as gax.protobuf.Type; this.descriptors.longrunning = { createDataPoint: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createDataPointResponse.decode.bind(createDataPointResponse), - createDataPointMetadata.decode.bind(createDataPointMetadata)), + createDataPointMetadata.decode.bind(createDataPointMetadata), + ), updateDataPoint: new this._gaxModule.LongrunningDescriptor( this.operationsClient, updateDataPointResponse.decode.bind(updateDataPointResponse), - updateDataPointMetadata.decode.bind(updateDataPointMetadata)), + updateDataPointMetadata.decode.bind(updateDataPointMetadata), + ), batchDeleteDataPoints: new this._gaxModule.LongrunningDescriptor( this.operationsClient, - batchDeleteDataPointsResponse.decode.bind(batchDeleteDataPointsResponse), - batchDeleteDataPointsMetadata.decode.bind(batchDeleteDataPointsMetadata)) + batchDeleteDataPointsResponse.decode.bind( + batchDeleteDataPointsResponse, + ), + batchDeleteDataPointsMetadata.decode.bind( + batchDeleteDataPointsMetadata, + ), + ), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.devicesandservices.health.v4.DataPointsService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.devicesandservices.health.v4.DataPointsService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code @@ -283,28 +350,44 @@ export class DataPointsServiceClient { // Put together the "service stub" for // google.devicesandservices.health.v4.DataPointsService. this.dataPointsServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.devicesandservices.health.v4.DataPointsService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.devicesandservices.health.v4.DataPointsService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.devicesandservices.health.v4.DataPointsService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.devicesandservices.health.v4 + .DataPointsService, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; // Iterate over each of the methods that the service provides // and create an API call method for each. - const dataPointsServiceStubMethods = - ['getDataPoint', 'listDataPoints', 'createDataPoint', 'updateDataPoint', 'batchDeleteDataPoints', 'reconcileDataPoints', 'rollUpDataPoints', 'dailyRollUpDataPoints', 'exportExerciseTcx']; + const dataPointsServiceStubMethods = [ + 'getDataPoint', + 'listDataPoints', + 'createDataPoint', + 'updateDataPoint', + 'batchDeleteDataPoints', + 'reconcileDataPoints', + 'rollUpDataPoints', + 'dailyRollUpDataPoints', + 'exportExerciseTcx', + ]; for (const methodName of dataPointsServiceStubMethods) { const callPromise = this.dataPointsServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { throw err; - }); + }, + ); const descriptor = this.descriptors.page[methodName] || @@ -314,7 +397,7 @@ export class DataPointsServiceClient { callPromise, this._defaults[methodName], descriptor, - this._opts.fallback + this._opts.fallback, ); this.innerApiCalls[methodName] = apiCall; @@ -329,8 +412,14 @@ export class DataPointsServiceClient { * @returns {string} The DNS address for this service. */ static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); } return 'health.googleapis.com'; } @@ -341,8 +430,14 @@ export class DataPointsServiceClient { * @returns {string} The DNS address for this service. */ static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); } return 'health.googleapis.com'; } @@ -377,7 +472,7 @@ export class DataPointsServiceClient { '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.sleep.readonly' + 'https://www.googleapis.com/auth/googlehealth.sleep.readonly', ]; } @@ -387,8 +482,9 @@ export class DataPointsServiceClient { * Return the project ID used by this class. * @returns {Promise} A promise that resolves to string containing the project ID. */ - getProjectId(callback?: Callback): - Promise|void { + getProjectId( + callback?: Callback, + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -399,888 +495,1265 @@ export class DataPointsServiceClient { // ------------------- // -- Service calls -- // ------------------- -/** - * Get a single identifyable data point. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the data point to retrieve. - * - * Format: `users/{user}/dataTypes/{data_type}/dataPoints/{data_point}` - * - * See - * {@link protos.google.devicesandservices.health.v4.DataPoint.name|DataPoint.name} - * for examples and possible values. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.DataPoint|DataPoint}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v4/data_points_service.get_data_point.js - * region_tag:health_v4_generated_DataPointsService_GetDataPoint_async - */ + /** + * Get a single identifyable data point. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the data point to retrieve. + * + * Format: `users/{user}/dataTypes/{data_type}/dataPoints/{data_point}` + * + * See + * {@link protos.google.devicesandservices.health.v4.DataPoint.name|DataPoint.name} + * for examples and possible values. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.DataPoint|DataPoint}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_points_service.get_data_point.js + * region_tag:health_v4_generated_DataPointsService_GetDataPoint_async + */ getDataPoint( - request?: protos.google.devicesandservices.health.v4.IGetDataPointRequest, - options?: CallOptions): - Promise<[ - protos.google.devicesandservices.health.v4.IDataPoint, - protos.google.devicesandservices.health.v4.IGetDataPointRequest|undefined, {}|undefined - ]>; + request?: protos.google.devicesandservices.health.v4.IGetDataPointRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IDataPoint, + ( + | protos.google.devicesandservices.health.v4.IGetDataPointRequest + | undefined + ), + {} | undefined, + ] + >; getDataPoint( - request: protos.google.devicesandservices.health.v4.IGetDataPointRequest, - options: CallOptions, - callback: Callback< - protos.google.devicesandservices.health.v4.IDataPoint, - protos.google.devicesandservices.health.v4.IGetDataPointRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IGetDataPointRequest, + options: CallOptions, + callback: Callback< + protos.google.devicesandservices.health.v4.IDataPoint, + | protos.google.devicesandservices.health.v4.IGetDataPointRequest + | null + | undefined, + {} | null | undefined + >, + ): void; getDataPoint( - request: protos.google.devicesandservices.health.v4.IGetDataPointRequest, - callback: Callback< - protos.google.devicesandservices.health.v4.IDataPoint, - protos.google.devicesandservices.health.v4.IGetDataPointRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IGetDataPointRequest, + callback: Callback< + protos.google.devicesandservices.health.v4.IDataPoint, + | protos.google.devicesandservices.health.v4.IGetDataPointRequest + | null + | undefined, + {} | null | undefined + >, + ): void; getDataPoint( - request?: protos.google.devicesandservices.health.v4.IGetDataPointRequest, - optionsOrCallback?: CallOptions|Callback< + request?: protos.google.devicesandservices.health.v4.IGetDataPointRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.devicesandservices.health.v4.IDataPoint, - protos.google.devicesandservices.health.v4.IGetDataPointRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.devicesandservices.health.v4.IDataPoint, - protos.google.devicesandservices.health.v4.IGetDataPointRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.devicesandservices.health.v4.IDataPoint, - protos.google.devicesandservices.health.v4.IGetDataPointRequest|undefined, {}|undefined - ]>|void { + | protos.google.devicesandservices.health.v4.IGetDataPointRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devicesandservices.health.v4.IDataPoint, + | protos.google.devicesandservices.health.v4.IGetDataPointRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IDataPoint, + ( + | protos.google.devicesandservices.health.v4.IGetDataPointRequest + | undefined + ), + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; }); - this.initialize().catch(err => {throw err}); this._log.info('getDataPoint request %j', request); - const wrappedCallback: Callback< - protos.google.devicesandservices.health.v4.IDataPoint, - protos.google.devicesandservices.health.v4.IGetDataPointRequest|null|undefined, - {}|null|undefined>|undefined = callback + const wrappedCallback: + | Callback< + protos.google.devicesandservices.health.v4.IDataPoint, + | protos.google.devicesandservices.health.v4.IGetDataPointRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback ? (error, response, options, rawResponse) => { this._log.info('getDataPoint response %j', response); callback!(error, response, options, rawResponse); // We verified callback above. } : undefined; - return this.innerApiCalls.getDataPoint(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.devicesandservices.health.v4.IDataPoint, - protos.google.devicesandservices.health.v4.IGetDataPointRequest|undefined, - {}|undefined - ]) => { - this._log.info('getDataPoint response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + return this.innerApiCalls + .getDataPoint(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.devicesandservices.health.v4.IDataPoint, + ( + | protos.google.devicesandservices.health.v4.IGetDataPointRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDataPoint response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); } throw error; }); } -/** - * Roll up data points over civil time intervals for supported data types. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent data type of the Data Point collection. - * - * Format: `users/{user}/dataTypes/{data_type}`, e.g.: - * - * - `users/me/dataTypes/steps` - * - `users/me/dataTypes/distance` - * - * For a list of the supported data types see the [DailyRollupDataPoint - * value][google.devicesandservices.health.v4.DailyRollupDataPoint] - * union field. - * @param {google.devicesandservices.health.v4.CivilTimeInterval} request.range - * Required. Closed-open range of data points that will be rolled up. - * The start time must be aligned with the aggregation window. - * The maximum range for `calories-in-heart-rate-zone`, `heart-rate`, - * `active-minutes` and `total-calories` is 14 days. - * The maximum range for all other data types is 90 days. - * @param {number} [request.windowSizeDays] - * Optional. Aggregation window size, in number of days. Defaults to 1 if not - * specified. - * @param {number} [request.pageSize] - * Optional. The maximum number of data points to return. - * If unspecified, at most 1440 data points will be returned. - * The maximum page size is 10000; values above that will be truncated - * accordingly. - * @param {string} [request.pageToken] - * Optional. The `next_page_token` from a previous request, if any. - * All other request fields need to be the same as in the initial request - * when the page token is specified. - * @param {string} [request.dataSourceFamily] - * Optional. The data source family name to roll up. - * If empty, data points from all available data sources will be rolled up. - * - * 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 - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse|DailyRollUpDataPointsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v4/data_points_service.daily_roll_up_data_points.js - * region_tag:health_v4_generated_DataPointsService_DailyRollUpDataPoints_async - */ + /** + * Roll up data points over civil time intervals for supported data types. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent data type of the Data Point collection. + * + * Format: `users/{user}/dataTypes/{data_type}`, e.g.: + * + * - `users/me/dataTypes/steps` + * - `users/me/dataTypes/distance` + * + * For a list of the supported data types see the [DailyRollupDataPoint + * value][google.devicesandservices.health.v4.DailyRollupDataPoint] + * union field. + * @param {google.devicesandservices.health.v4.CivilTimeInterval} request.range + * Required. Closed-open range of data points that will be rolled up. + * The start time must be aligned with the aggregation window. + * The maximum range for `calories-in-heart-rate-zone`, `heart-rate`, + * `active-minutes` and `total-calories` is 14 days. + * The maximum range for all other data types is 90 days. + * @param {number} [request.windowSizeDays] + * Optional. Aggregation window size, in number of days. Defaults to 1 if not + * specified. + * @param {number} [request.pageSize] + * Optional. The maximum number of data points to return. + * If unspecified, at most 1440 data points will be returned. + * The maximum page size is 10000; values above that will be truncated + * accordingly. + * @param {string} [request.pageToken] + * Optional. The `next_page_token` from a previous request, if any. + * All other request fields need to be the same as in the initial request + * when the page token is specified. + * @param {string} [request.dataSourceFamily] + * Optional. The data source family name to roll up. + * If empty, data points from all available data sources will be rolled up. + * + * 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 + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse|DailyRollUpDataPointsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_points_service.daily_roll_up_data_points.js + * region_tag:health_v4_generated_DataPointsService_DailyRollUpDataPoints_async + */ dailyRollUpDataPoints( - request?: protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest, - options?: CallOptions): - Promise<[ - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest|undefined, {}|undefined - ]>; + request?: protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, + ( + | protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest + | undefined + ), + {} | undefined, + ] + >; dailyRollUpDataPoints( - request: protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest, - options: CallOptions, - callback: Callback< - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest, + options: CallOptions, + callback: Callback< + protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, + | protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; dailyRollUpDataPoints( - request: protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest, - callback: Callback< - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest, + callback: Callback< + protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, + | protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; dailyRollUpDataPoints( - request?: protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest|undefined, {}|undefined - ]>|void { + | protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, + | protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, + ( + | protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest + | undefined + ), + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; }); - this.initialize().catch(err => {throw err}); this._log.info('dailyRollUpDataPoints request %j', request); - const wrappedCallback: Callback< - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest|null|undefined, - {}|null|undefined>|undefined = callback + const wrappedCallback: + | Callback< + protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, + | protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback ? (error, response, options, rawResponse) => { this._log.info('dailyRollUpDataPoints response %j', response); callback!(error, response, options, rawResponse); // We verified callback above. } : undefined; - return this.innerApiCalls.dailyRollUpDataPoints(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, - protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest|undefined, - {}|undefined - ]) => { - this._log.info('dailyRollUpDataPoints response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + return this.innerApiCalls + .dailyRollUpDataPoints(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse, + ( + | protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('dailyRollUpDataPoints response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); } throw error; }); } -/** - * Exports exercise data in TCX format. - * - * - * Note: While the Authorization section below states that any one of the - * listed scopes is accepted, this specific method requires the user to - * provide both one of the `activity_and_fitness` scopes (`normal` or - * `readonly`) AND one of the `location` scopes (`normal` or `readonly`) in - * their access token to succeed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the exercise data point to export. - * - * Format: `users/{user}/dataTypes/exercise/dataPoints/{data_point}` - * Example: `users/me/dataTypes/exercise/dataPoints/2026443605080188808` - * - * The `{user}` is the alias `"me"` currently. Future versions may support - * user IDs. - * The `{data_point}` ID maps to the exercise ID, which is a long integer. - * @param {boolean} [request.partialData] - * Optional. Indicates whether to include the TCX data points when the GPS - * data is not available. If not specified, defaults to `false` and partial - * data will not be included. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.ExportExerciseTcxResponse|ExportExerciseTcxResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v4/data_points_service.export_exercise_tcx.js - * region_tag:health_v4_generated_DataPointsService_ExportExerciseTcx_async - */ + /** + * Exports exercise data in TCX format. + * + * **IMPORTANT:** HTTP clients must append `?alt=media` to the + * request URL to download the raw TCX file. + * + * Example: + * `https://health.googleapis.com/v4/users/me/dataTypes/exercise/dataPoints/EXERCISE_ID:exportExerciseTcx?alt=media` + * + * Without `alt=media`, the server returns a JSON response + * (`ExportExerciseTcxResponse`) + * which is intended primarily for gRPC clients. + * + * **Note:** While the Authorization section below states that any one of the + * listed scopes is accepted, this specific method requires the user to + * provide both one of the `activity_and_fitness` scopes (`normal` or + * `readonly`) AND one of the `location` scopes (`normal` or `readonly`) in + * their access token to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the exercise data point to export. + * + * Format: `users/{user}/dataTypes/exercise/dataPoints/{data_point}` + * Example: `users/me/dataTypes/exercise/dataPoints/2026443605080188808` + * + * The `{user}` is the alias `"me"` currently. Future versions may support + * user IDs. + * The `{data_point}` ID maps to the exercise ID, which is a long integer. + * @param {boolean} [request.partialData] + * Optional. Indicates whether to include the TCX data points when the GPS + * data is not available. If not specified, defaults to `false` and partial + * data will not be included. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.ExportExerciseTcxResponse|ExportExerciseTcxResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_points_service.export_exercise_tcx.js + * region_tag:health_v4_generated_DataPointsService_ExportExerciseTcx_async + */ exportExerciseTcx( - request?: protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest, - options?: CallOptions): - Promise<[ - protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, - protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest|undefined, {}|undefined - ]>; + request?: protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, + ( + | protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest + | undefined + ), + {} | undefined, + ] + >; exportExerciseTcx( - request: protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest, - options: CallOptions, - callback: Callback< - protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, - protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest, + options: CallOptions, + callback: Callback< + protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, + | protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest + | null + | undefined, + {} | null | undefined + >, + ): void; exportExerciseTcx( - request: protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest, - callback: Callback< - protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, - protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest, + callback: Callback< + protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, + | protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest + | null + | undefined, + {} | null | undefined + >, + ): void; exportExerciseTcx( - request?: protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, - protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, - protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, - protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest|undefined, {}|undefined - ]>|void { + | protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, + | protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, + ( + | protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest + | undefined + ), + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; }); - this.initialize().catch(err => {throw err}); this._log.info('exportExerciseTcx request %j', request); - const wrappedCallback: Callback< - protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, - protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest|null|undefined, - {}|null|undefined>|undefined = callback + const wrappedCallback: + | Callback< + protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, + | protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback ? (error, response, options, rawResponse) => { this._log.info('exportExerciseTcx response %j', response); callback!(error, response, options, rawResponse); // We verified callback above. } : undefined; - return this.innerApiCalls.exportExerciseTcx(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, - protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest|undefined, - {}|undefined - ]) => { - this._log.info('exportExerciseTcx response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + return this.innerApiCalls + .exportExerciseTcx(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse, + ( + | protos.google.devicesandservices.health.v4.IExportExerciseTcxRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('exportExerciseTcx response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); } throw error; }); } -/** - * Creates a single identifiable data point. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name where the data point will be created. - * Format: `users/{user}/dataTypes/{data_type}` - * @param {google.devicesandservices.health.v4.DataPoint} request.dataPoint - * Required. The data point to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v4/data_points_service.create_data_point.js - * region_tag:health_v4_generated_DataPointsService_CreateDataPoint_async - */ + /** + * Creates a single identifiable data point. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name where the data point will be created. + * Format: `users/{user}/dataTypes/{data_type}` + * @param {google.devicesandservices.health.v4.DataPoint} request.dataPoint + * Required. The data point to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_points_service.create_data_point.js + * region_tag:health_v4_generated_DataPointsService_CreateDataPoint_async + */ createDataPoint( - request?: protos.google.devicesandservices.health.v4.ICreateDataPointRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request?: protos.google.devicesandservices.health.v4.ICreateDataPointRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.ICreateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; createDataPoint( - request: protos.google.devicesandservices.health.v4.ICreateDataPointRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.ICreateDataPointRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.ICreateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; createDataPoint( - request: protos.google.devicesandservices.health.v4.ICreateDataPointRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.ICreateDataPointRequest, + callback: Callback< + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.ICreateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; createDataPoint( - request?: protos.google.devicesandservices.health.v4.ICreateDataPointRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request?: protos.google.devicesandservices.health.v4.ICreateDataPointRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.ICreateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.ICreateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.ICreateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback + const wrappedCallback: + | Callback< + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.ICreateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback ? (error, response, rawResponse, _) => { this._log.info('createDataPoint response %j', rawResponse); callback!(error, response, rawResponse, _); // We verified callback above. } : undefined; this._log.info('createDataPoint request %j', request); - return this.innerApiCalls.createDataPoint(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createDataPoint response %j', rawResponse); - return [response, rawResponse, _]; - }); + return this.innerApiCalls + .createDataPoint(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.ICreateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createDataPoint response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); } -/** - * Check the status of the long running operation returned by `createDataPoint()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v4/data_points_service.create_data_point.js - * region_tag:health_v4_generated_DataPointsService_CreateDataPoint_async - */ - async checkCreateDataPointProgress(name: string): Promise>{ + /** + * Check the status of the long running operation returned by `createDataPoint()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_points_service.create_data_point.js + * region_tag:health_v4_generated_DataPointsService_CreateDataPoint_async + */ + async checkCreateDataPointProgress( + name: string, + ): Promise< + LROperation< + protos.google.devicesandservices.health.v4.DataPoint, + protos.google.devicesandservices.health.v4.CreateDataPointOperationMetadata + > + > { this._log.info('createDataPoint long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createDataPoint, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createDataPoint, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.devicesandservices.health.v4.DataPoint, + protos.google.devicesandservices.health.v4.CreateDataPointOperationMetadata + >; } -/** - * Updates a single identifiable data point. If a data point with the - * specified `name` is not found, the request will fail. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.devicesandservices.health.v4.DataPoint} request.dataPoint - * Required. The data point to update - * - * The data point's `name` field is used to identify the data point to update. - * - * Format: `users/{user}/dataTypes/{data_type}/dataPoints/{data_point}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v4/data_points_service.update_data_point.js - * region_tag:health_v4_generated_DataPointsService_UpdateDataPoint_async - */ + /** + * Updates a single identifiable data point. If a data point with the + * specified `name` is not found, the request will fail. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.devicesandservices.health.v4.DataPoint} request.dataPoint + * Required. The data point to update + * + * The data point's `name` field is used to identify the data point to update. + * + * Format: `users/{user}/dataTypes/{data_type}/dataPoints/{data_point}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_points_service.update_data_point.js + * region_tag:health_v4_generated_DataPointsService_UpdateDataPoint_async + */ updateDataPoint( - request?: protos.google.devicesandservices.health.v4.IUpdateDataPointRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request?: protos.google.devicesandservices.health.v4.IUpdateDataPointRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; updateDataPoint( - request: protos.google.devicesandservices.health.v4.IUpdateDataPointRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IUpdateDataPointRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; updateDataPoint( - request: protos.google.devicesandservices.health.v4.IUpdateDataPointRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IUpdateDataPointRequest, + callback: Callback< + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; updateDataPoint( - request?: protos.google.devicesandservices.health.v4.IUpdateDataPointRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request?: protos.google.devicesandservices.health.v4.IUpdateDataPointRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'data_point.name': request.dataPoint!.name ?? '', + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'data_point.name': request.dataPoint!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback + const wrappedCallback: + | Callback< + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback ? (error, response, rawResponse, _) => { this._log.info('updateDataPoint response %j', rawResponse); callback!(error, response, rawResponse, _); // We verified callback above. } : undefined; this._log.info('updateDataPoint request %j', request); - return this.innerApiCalls.updateDataPoint(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateDataPoint response %j', rawResponse); - return [response, rawResponse, _]; - }); + return this.innerApiCalls + .updateDataPoint(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateDataPoint response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); } -/** - * Check the status of the long running operation returned by `updateDataPoint()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v4/data_points_service.update_data_point.js - * region_tag:health_v4_generated_DataPointsService_UpdateDataPoint_async - */ - async checkUpdateDataPointProgress(name: string): Promise>{ + /** + * Check the status of the long running operation returned by `updateDataPoint()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_points_service.update_data_point.js + * region_tag:health_v4_generated_DataPointsService_UpdateDataPoint_async + */ + async checkUpdateDataPointProgress( + name: string, + ): Promise< + LROperation< + protos.google.devicesandservices.health.v4.DataPoint, + protos.google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + > + > { this._log.info('updateDataPoint long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateDataPoint, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateDataPoint, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.devicesandservices.health.v4.DataPoint, + protos.google.devicesandservices.health.v4.UpdateDataPointOperationMetadata + >; } -/** - * Delete a batch of identifyable data points. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} [request.parent] - * Optional. Parent (data type) for the Data Point collection - * Format: `users/me/dataTypes/{data_type}`, e.g.: - * - * - `users/me/dataTypes/steps` - * - `users/me/dataTypes/-` - * - * For a list of the supported data types see the - * [DataPoint - * data][google.devicesandservices.health.v4.DataPoint] union - * field. - * - * Deleting data points across multiple data type collections is supported - * following https://aip.dev/159. - * - * If this is set, the parent of all of the data points specified in `names` - * must match this field. - * @param {string[]} request.names - * Required. The names of the DataPoints to delete. - * A maximum of 10000 data points can be deleted in a single request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v4/data_points_service.batch_delete_data_points.js - * region_tag:health_v4_generated_DataPointsService_BatchDeleteDataPoints_async - */ + /** + * Delete a batch of identifyable data points. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.parent] + * Optional. Parent (data type) for the Data Point collection + * Format: `users/me/dataTypes/{data_type}`, e.g.: + * + * - `users/me/dataTypes/steps` + * - `users/me/dataTypes/-` + * + * For a list of the supported data types see the + * [DataPoint + * data][google.devicesandservices.health.v4.DataPoint] union + * field. + * + * Deleting data points across multiple data type collections is supported + * following https://aip.dev/159. + * + * If this is set, the parent of all of the data points specified in `names` + * must match this field. + * @param {string[]} request.names + * Required. The names of the DataPoints to delete. + * A maximum of 10000 data points can be deleted in a single request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_points_service.batch_delete_data_points.js + * region_tag:health_v4_generated_DataPointsService_BatchDeleteDataPoints_async + */ batchDeleteDataPoints( - request?: protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request?: protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse, + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; batchDeleteDataPoints( - request: protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse, + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; batchDeleteDataPoints( - request: protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest, + callback: Callback< + LROperation< + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse, + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; batchDeleteDataPoints( - request?: protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request?: protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse, + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse, + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse, + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback + const wrappedCallback: + | Callback< + LROperation< + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse, + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback ? (error, response, rawResponse, _) => { this._log.info('batchDeleteDataPoints response %j', rawResponse); callback!(error, response, rawResponse, _); // We verified callback above. } : undefined; this._log.info('batchDeleteDataPoints request %j', request); - return this.innerApiCalls.batchDeleteDataPoints(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('batchDeleteDataPoints response %j', rawResponse); - return [response, rawResponse, _]; - }); + return this.innerApiCalls + .batchDeleteDataPoints(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse, + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('batchDeleteDataPoints response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); } -/** - * Check the status of the long running operation returned by `batchDeleteDataPoints()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v4/data_points_service.batch_delete_data_points.js - * region_tag:health_v4_generated_DataPointsService_BatchDeleteDataPoints_async - */ - async checkBatchDeleteDataPointsProgress(name: string): Promise>{ + /** + * Check the status of the long running operation returned by `batchDeleteDataPoints()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_points_service.batch_delete_data_points.js + * region_tag:health_v4_generated_DataPointsService_BatchDeleteDataPoints_async + */ + async checkBatchDeleteDataPointsProgress( + name: string, + ): Promise< + LROperation< + protos.google.devicesandservices.health.v4.BatchDeleteDataPointsResponse, + protos.google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + > + > { this._log.info('batchDeleteDataPoints long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchDeleteDataPoints, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.batchDeleteDataPoints, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.devicesandservices.health.v4.BatchDeleteDataPointsResponse, + protos.google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata + >; } - /** - * Query user health and fitness data points. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent data type of the Data Point collection. - * - * Format: `users/me/dataTypes/{data_type}`, e.g.: - * - * - `users/me/dataTypes/steps` - * - `users/me/dataTypes/weight` - * - * For a list of the supported data types see the [DataPoint - * data][google.devicesandservices.health.v4.DataPoint] union - * field. - * @param {number} [request.pageSize] - * Optional. The maximum number of data points to return. - * If unspecified, at most 1440 data points will be returned. - * The maximum page size is 10000; values above that will be truncated - * accordingly. - * For `exercise` and `sleep` the default page size is 25. - * The maximum page size for `exercise` and `sleep` is 25. - * @param {string} [request.pageToken] - * Optional. The `next_page_token` from a previous request, if any. - * @param {string} [request.filter] - * Optional. Filter expression following https://google.aip.dev/160. - * - * A time range (either physical or civil) can be specified. - * - * The supported filter fields are: - * - * - * - Interval start time: - * - Pattern: `{interval_data_type}.interval.start_time` - * - Supported comparison operators: `>=`, `<` - * - Timestamp literal expected in RFC-3339 format - * - Supported logical operators: `AND` - * - Example: - * - `steps.interval.start_time >= "2023-11-24T00:00:00Z" AND - * steps.interval.start_time < "2023-11-25T00:00:00Z"` - * - `distance.interval.start_time >= "2024-08-14T12:34:56Z"` - * - * - Interval civil start time: - * - Pattern: `{interval_data_type}.interval.civil_start_time` - * - Supported comparison operators: `>=`, `<` - * - Date with optional time literal expected in ISO 8601 - * `YYYY-MM-DD[THH:mm:ss]` format - * - Supported logical operators: `AND` - * - Example: - * - `steps.interval.civil_start_time >= "2023-11-24" AND - * steps.interval.civil_start_time < "2023-11-25"` - * - `distance.interval.civil_start_time >= "2024-08-14T12:34:56"` - * - * - Sample observation physical time: - * - Pattern: `{sample_data_type}.sample_time.physical_time` - * - Supported comparison operators: `>=`, `<` - * - Timestamp literal expected in RFC-3339 format - * - Supported logical operators: `AND` - * - Example: - * - `weight.sample_time.physical_time >= "2023-11-24T00:00:00Z" - * AND weight.sample_time.physical_time < "2023-11-25T00:00:00Z"` - * - `weight.sample_time.physical_time >= - * "2024-08-14T12:34:56Z"` - * - * - Sample observation civil time: - * - Pattern: `{sample_data_type}.sample_time.civil_time` - * - Supported comparison operators: `>=`, `<` - * - Date with optional time literal expected in ISO 8601 - * `YYYY-MM-DD[THH:mm:ss]` format - * - Supported logical operators: `AND` - * - Example: - * - `weight.sample_time.civil_time >= "2023-11-24" AND - * weight.sample_time.civil_time < "2023-11-25"` - * - `weight.sample_time.civil_time >= "2024-08-14T12:34:56"` - * - * - Daily summary date: - * - Pattern: `{daily_summary_data_type}.date` - * - Supported comparison operators: `>=`, `<` - * - Date literal expected in ISO 8601 `YYYY-MM-DD` format - * - Supported logical operators: `AND` - * - Example: - * - `daily_resting_heart_rate.date >= "2024-08-14"` - * - `daily_heart_rate_variability.date < "2024-08-15"` - * - * - * - Session civil start time (**Excluding Sleep**): - * - Pattern: `{session_data_type}.interval.civil_start_time` - * - Supported comparison operators: `>=`, `<` - * - Date with optional time literal expected in ISO 8601 - * `YYYY-MM-DD[THH:mm:ss]` format - * - Supported logical operators: `AND` - * - Example: - * - `exercise.interval.civil_start_time >= "2023-11-24" AND - * exercise.interval.civil_start_time < "2023-11-25"` - * - `exercise.interval.civil_start_time >= "2024-08-14T12:34:56"` - * - * - Session end time (**Sleep specific**): - * - Pattern: `sleep.interval.end_time` - * - Supported comparison operators: `>=`, `<` - * - Timestamp literal expected in RFC-3339 format - * - Supported logical operators: `AND`, `OR` - * - Example: - * - `sleep.interval.end_time >= "2023-11-24T00:00:00Z" AND - * sleep.interval.end_time < "2023-11-25T00:00:00Z"` - * - * - Session civil end time (**Sleep specific**): - * - Pattern: `sleep.interval.civil_end_time` - * - Supported comparison operators: `>=`, `<` - * - Date with optional time literal expected in ISO 8601 - * `YYYY-MM-DD[THH:mm:ss]` format - * - Supported logical operators: `AND`, `OR` - * - Example: - * - `sleep.interval.civil_end_time >= "2023-11-24" AND - * sleep.interval.civil_end_time < "2023-11-25"` - * - * - * Data points in the response will be ordered by the interval start time in - * descending order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.devicesandservices.health.v4.DataPoint|DataPoint}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDataPointsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ + /** + * Query user health and fitness data points. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent data type of the Data Point collection. + * + * Format: `users/me/dataTypes/{data_type}`, e.g.: + * + * - `users/me/dataTypes/steps` + * - `users/me/dataTypes/weight` + * + * For a list of the supported data types see the [DataPoint + * data][google.devicesandservices.health.v4.DataPoint] union + * field. + * @param {number} [request.pageSize] + * Optional. The maximum number of data points to return. + * If unspecified, at most 1440 data points will be returned. + * The maximum page size is 10000; values above that will be truncated + * accordingly. + * For `exercise` and `sleep` the default page size is 25. + * The maximum page size for `exercise` and `sleep` is 25. + * @param {string} [request.pageToken] + * Optional. The `next_page_token` from a previous request, if any. + * @param {string} [request.filter] + * Optional. Filter expression following https://google.aip.dev/160. + * + * A time range (either physical or civil) can be specified. + * + * The supported filter fields are: + * + * + * - Interval start time: + * - Pattern: `{interval_data_type}.interval.start_time` + * - Supported comparison operators: `>=`, `<` + * - Timestamp literal expected in RFC-3339 format + * - Supported logical operators: `AND` + * - Example: + * - `steps.interval.start_time >= "2023-11-24T00:00:00Z" AND + * steps.interval.start_time < "2023-11-25T00:00:00Z"` + * - `distance.interval.start_time >= "2024-08-14T12:34:56Z"` + * + * - Interval civil start time: + * - Pattern: `{interval_data_type}.interval.civil_start_time` + * - Supported comparison operators: `>=`, `<` + * - Date with optional time literal expected in ISO 8601 + * `YYYY-MM-DD[THH:mm:ss]` format + * - Supported logical operators: `AND` + * - Example: + * - `steps.interval.civil_start_time >= "2023-11-24" AND + * steps.interval.civil_start_time < "2023-11-25"` + * - `distance.interval.civil_start_time >= "2024-08-14T12:34:56"` + * + * - Sample observation physical time: + * - Pattern: `{sample_data_type}.sample_time.physical_time` + * - Supported comparison operators: `>=`, `<` + * - Timestamp literal expected in RFC-3339 format + * - Supported logical operators: `AND` + * - Example: + * - `weight.sample_time.physical_time >= "2023-11-24T00:00:00Z" + * AND weight.sample_time.physical_time < "2023-11-25T00:00:00Z"` + * - `weight.sample_time.physical_time >= + * "2024-08-14T12:34:56Z"` + * + * - Sample observation civil time: + * - Pattern: `{sample_data_type}.sample_time.civil_time` + * - Supported comparison operators: `>=`, `<` + * - Date with optional time literal expected in ISO 8601 + * `YYYY-MM-DD[THH:mm:ss]` format + * - Supported logical operators: `AND` + * - Example: + * - `weight.sample_time.civil_time >= "2023-11-24" AND + * weight.sample_time.civil_time < "2023-11-25"` + * - `weight.sample_time.civil_time >= "2024-08-14T12:34:56"` + * + * - Daily summary date: + * - Pattern: `{daily_summary_data_type}.date` + * - Supported comparison operators: `>=`, `<` + * - Date literal expected in ISO 8601 `YYYY-MM-DD` format + * - Supported logical operators: `AND` + * - Example: + * - `daily_heart_rate_variability.date < "2024-08-15"` + * + * + * + * - Session civil start time (**Excluding Sleep and ECG**): + * - Pattern: `{session_data_type}.interval.civil_start_time` + * - Supported comparison operators: `>=`, `<` + * - Date with optional time literal expected in ISO 8601 + * `YYYY-MM-DD[THH:mm:ss]` format + * - Supported logical operators: `AND` + * - Example: + * - `exercise.interval.civil_start_time >= "2023-11-24" AND + * exercise.interval.civil_start_time < "2023-11-25"` + * - `exercise.interval.civil_start_time >= "2024-08-14T12:34:56"` + * + * - Session start time (**ECG specific**): + * - Pattern: `electrocardiogram.interval.start_time` + * - Supported comparison operators: `>=` + * - Timestamp literal expected in RFC-3339 format + * - Example: + * - `electrocardiogram.interval.start_time >= "2024-08-14T12:34:56Z"` + * - Note: Only filtering by start time is supported for ECG. Filtering + * by end time (e.g., `electrocardiogram.interval.end_time`) is not + * supported. + * + * - Session end time (**Sleep specific**): + * - Pattern: `sleep.interval.end_time` + * - Supported comparison operators: `>=`, `<` + * - Timestamp literal expected in RFC-3339 format + * - Supported logical operators: `AND`, `OR` + * - Example: + * - `sleep.interval.end_time >= "2023-11-24T00:00:00Z" AND + * sleep.interval.end_time < "2023-11-25T00:00:00Z"` + * + * - Session civil end time (**Sleep specific**): + * - Pattern: `sleep.interval.civil_end_time` + * - Supported comparison operators: `>=`, `<` + * - Date with optional time literal expected in ISO 8601 + * `YYYY-MM-DD[THH:mm:ss]` format + * - Supported logical operators: `AND`, `OR` + * - Example: + * - `sleep.interval.civil_end_time >= "2023-11-24" AND + * sleep.interval.civil_end_time < "2023-11-25"` + * + * + * Data points in the response will be ordered by the interval start time in + * descending order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.devicesandservices.health.v4.DataPoint|DataPoint}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDataPointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ listDataPoints( - request?: protos.google.devicesandservices.health.v4.IListDataPointsRequest, - options?: CallOptions): - Promise<[ - protos.google.devicesandservices.health.v4.IDataPoint[], - protos.google.devicesandservices.health.v4.IListDataPointsRequest|null, - protos.google.devicesandservices.health.v4.IListDataPointsResponse - ]>; + request?: protos.google.devicesandservices.health.v4.IListDataPointsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IDataPoint[], + protos.google.devicesandservices.health.v4.IListDataPointsRequest | null, + protos.google.devicesandservices.health.v4.IListDataPointsResponse, + ] + >; listDataPoints( - request: protos.google.devicesandservices.health.v4.IListDataPointsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.devicesandservices.health.v4.IListDataPointsRequest, - protos.google.devicesandservices.health.v4.IListDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IDataPoint>): void; + request: protos.google.devicesandservices.health.v4.IListDataPointsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.devicesandservices.health.v4.IListDataPointsRequest, + | protos.google.devicesandservices.health.v4.IListDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IDataPoint + >, + ): void; listDataPoints( - request: protos.google.devicesandservices.health.v4.IListDataPointsRequest, - callback: PaginationCallback< - protos.google.devicesandservices.health.v4.IListDataPointsRequest, - protos.google.devicesandservices.health.v4.IListDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IDataPoint>): void; + request: protos.google.devicesandservices.health.v4.IListDataPointsRequest, + callback: PaginationCallback< + protos.google.devicesandservices.health.v4.IListDataPointsRequest, + | protos.google.devicesandservices.health.v4.IListDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IDataPoint + >, + ): void; listDataPoints( - request?: protos.google.devicesandservices.health.v4.IListDataPointsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.devicesandservices.health.v4.IListDataPointsRequest, - protos.google.devicesandservices.health.v4.IListDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IDataPoint>, - callback?: PaginationCallback< + request?: protos.google.devicesandservices.health.v4.IListDataPointsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< protos.google.devicesandservices.health.v4.IListDataPointsRequest, - protos.google.devicesandservices.health.v4.IListDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IDataPoint>): - Promise<[ - protos.google.devicesandservices.health.v4.IDataPoint[], - protos.google.devicesandservices.health.v4.IListDataPointsRequest|null, - protos.google.devicesandservices.health.v4.IListDataPointsResponse - ]>|void { + | protos.google.devicesandservices.health.v4.IListDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IDataPoint + >, + callback?: PaginationCallback< + protos.google.devicesandservices.health.v4.IListDataPointsRequest, + | protos.google.devicesandservices.health.v4.IListDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IDataPoint + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IDataPoint[], + protos.google.devicesandservices.health.v4.IListDataPointsRequest | null, + protos.google.devicesandservices.health.v4.IListDataPointsResponse, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.devicesandservices.health.v4.IListDataPointsRequest, - protos.google.devicesandservices.health.v4.IListDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IDataPoint>|undefined = callback + const wrappedCallback: + | PaginationCallback< + protos.google.devicesandservices.health.v4.IListDataPointsRequest, + | protos.google.devicesandservices.health.v4.IListDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IDataPoint + > + | undefined = callback ? (error, values, nextPageRequest, rawResponse) => { this._log.info('listDataPoints values %j', values); callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. @@ -1289,440 +1762,489 @@ export class DataPointsServiceClient { this._log.info('listDataPoints request %j', request); return this.innerApiCalls .listDataPoints(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.devicesandservices.health.v4.IDataPoint[], - protos.google.devicesandservices.health.v4.IListDataPointsRequest|null, - protos.google.devicesandservices.health.v4.IListDataPointsResponse - ]) => { - this._log.info('listDataPoints values %j', response); - return [response, input, output]; - }); + ?.then( + ([response, input, output]: [ + protos.google.devicesandservices.health.v4.IDataPoint[], + protos.google.devicesandservices.health.v4.IListDataPointsRequest | null, + protos.google.devicesandservices.health.v4.IListDataPointsResponse, + ]) => { + this._log.info('listDataPoints values %j', response); + return [response, input, output]; + }, + ); } -/** - * Equivalent to `listDataPoints`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent data type of the Data Point collection. - * - * Format: `users/me/dataTypes/{data_type}`, e.g.: - * - * - `users/me/dataTypes/steps` - * - `users/me/dataTypes/weight` - * - * For a list of the supported data types see the [DataPoint - * data][google.devicesandservices.health.v4.DataPoint] union - * field. - * @param {number} [request.pageSize] - * Optional. The maximum number of data points to return. - * If unspecified, at most 1440 data points will be returned. - * The maximum page size is 10000; values above that will be truncated - * accordingly. - * For `exercise` and `sleep` the default page size is 25. - * The maximum page size for `exercise` and `sleep` is 25. - * @param {string} [request.pageToken] - * Optional. The `next_page_token` from a previous request, if any. - * @param {string} [request.filter] - * Optional. Filter expression following https://google.aip.dev/160. - * - * A time range (either physical or civil) can be specified. - * - * The supported filter fields are: - * - * - * - Interval start time: - * - Pattern: `{interval_data_type}.interval.start_time` - * - Supported comparison operators: `>=`, `<` - * - Timestamp literal expected in RFC-3339 format - * - Supported logical operators: `AND` - * - Example: - * - `steps.interval.start_time >= "2023-11-24T00:00:00Z" AND - * steps.interval.start_time < "2023-11-25T00:00:00Z"` - * - `distance.interval.start_time >= "2024-08-14T12:34:56Z"` - * - * - Interval civil start time: - * - Pattern: `{interval_data_type}.interval.civil_start_time` - * - Supported comparison operators: `>=`, `<` - * - Date with optional time literal expected in ISO 8601 - * `YYYY-MM-DD[THH:mm:ss]` format - * - Supported logical operators: `AND` - * - Example: - * - `steps.interval.civil_start_time >= "2023-11-24" AND - * steps.interval.civil_start_time < "2023-11-25"` - * - `distance.interval.civil_start_time >= "2024-08-14T12:34:56"` - * - * - Sample observation physical time: - * - Pattern: `{sample_data_type}.sample_time.physical_time` - * - Supported comparison operators: `>=`, `<` - * - Timestamp literal expected in RFC-3339 format - * - Supported logical operators: `AND` - * - Example: - * - `weight.sample_time.physical_time >= "2023-11-24T00:00:00Z" - * AND weight.sample_time.physical_time < "2023-11-25T00:00:00Z"` - * - `weight.sample_time.physical_time >= - * "2024-08-14T12:34:56Z"` - * - * - Sample observation civil time: - * - Pattern: `{sample_data_type}.sample_time.civil_time` - * - Supported comparison operators: `>=`, `<` - * - Date with optional time literal expected in ISO 8601 - * `YYYY-MM-DD[THH:mm:ss]` format - * - Supported logical operators: `AND` - * - Example: - * - `weight.sample_time.civil_time >= "2023-11-24" AND - * weight.sample_time.civil_time < "2023-11-25"` - * - `weight.sample_time.civil_time >= "2024-08-14T12:34:56"` - * - * - Daily summary date: - * - Pattern: `{daily_summary_data_type}.date` - * - Supported comparison operators: `>=`, `<` - * - Date literal expected in ISO 8601 `YYYY-MM-DD` format - * - Supported logical operators: `AND` - * - Example: - * - `daily_resting_heart_rate.date >= "2024-08-14"` - * - `daily_heart_rate_variability.date < "2024-08-15"` - * - * - * - Session civil start time (**Excluding Sleep**): - * - Pattern: `{session_data_type}.interval.civil_start_time` - * - Supported comparison operators: `>=`, `<` - * - Date with optional time literal expected in ISO 8601 - * `YYYY-MM-DD[THH:mm:ss]` format - * - Supported logical operators: `AND` - * - Example: - * - `exercise.interval.civil_start_time >= "2023-11-24" AND - * exercise.interval.civil_start_time < "2023-11-25"` - * - `exercise.interval.civil_start_time >= "2024-08-14T12:34:56"` - * - * - Session end time (**Sleep specific**): - * - Pattern: `sleep.interval.end_time` - * - Supported comparison operators: `>=`, `<` - * - Timestamp literal expected in RFC-3339 format - * - Supported logical operators: `AND`, `OR` - * - Example: - * - `sleep.interval.end_time >= "2023-11-24T00:00:00Z" AND - * sleep.interval.end_time < "2023-11-25T00:00:00Z"` - * - * - Session civil end time (**Sleep specific**): - * - Pattern: `sleep.interval.civil_end_time` - * - Supported comparison operators: `>=`, `<` - * - Date with optional time literal expected in ISO 8601 - * `YYYY-MM-DD[THH:mm:ss]` format - * - Supported logical operators: `AND`, `OR` - * - Example: - * - `sleep.interval.civil_end_time >= "2023-11-24" AND - * sleep.interval.civil_end_time < "2023-11-25"` - * - * - * Data points in the response will be ordered by the interval start time in - * descending order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.devicesandservices.health.v4.DataPoint|DataPoint} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDataPointsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ + /** + * Equivalent to `listDataPoints`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent data type of the Data Point collection. + * + * Format: `users/me/dataTypes/{data_type}`, e.g.: + * + * - `users/me/dataTypes/steps` + * - `users/me/dataTypes/weight` + * + * For a list of the supported data types see the [DataPoint + * data][google.devicesandservices.health.v4.DataPoint] union + * field. + * @param {number} [request.pageSize] + * Optional. The maximum number of data points to return. + * If unspecified, at most 1440 data points will be returned. + * The maximum page size is 10000; values above that will be truncated + * accordingly. + * For `exercise` and `sleep` the default page size is 25. + * The maximum page size for `exercise` and `sleep` is 25. + * @param {string} [request.pageToken] + * Optional. The `next_page_token` from a previous request, if any. + * @param {string} [request.filter] + * Optional. Filter expression following https://google.aip.dev/160. + * + * A time range (either physical or civil) can be specified. + * + * The supported filter fields are: + * + * + * - Interval start time: + * - Pattern: `{interval_data_type}.interval.start_time` + * - Supported comparison operators: `>=`, `<` + * - Timestamp literal expected in RFC-3339 format + * - Supported logical operators: `AND` + * - Example: + * - `steps.interval.start_time >= "2023-11-24T00:00:00Z" AND + * steps.interval.start_time < "2023-11-25T00:00:00Z"` + * - `distance.interval.start_time >= "2024-08-14T12:34:56Z"` + * + * - Interval civil start time: + * - Pattern: `{interval_data_type}.interval.civil_start_time` + * - Supported comparison operators: `>=`, `<` + * - Date with optional time literal expected in ISO 8601 + * `YYYY-MM-DD[THH:mm:ss]` format + * - Supported logical operators: `AND` + * - Example: + * - `steps.interval.civil_start_time >= "2023-11-24" AND + * steps.interval.civil_start_time < "2023-11-25"` + * - `distance.interval.civil_start_time >= "2024-08-14T12:34:56"` + * + * - Sample observation physical time: + * - Pattern: `{sample_data_type}.sample_time.physical_time` + * - Supported comparison operators: `>=`, `<` + * - Timestamp literal expected in RFC-3339 format + * - Supported logical operators: `AND` + * - Example: + * - `weight.sample_time.physical_time >= "2023-11-24T00:00:00Z" + * AND weight.sample_time.physical_time < "2023-11-25T00:00:00Z"` + * - `weight.sample_time.physical_time >= + * "2024-08-14T12:34:56Z"` + * + * - Sample observation civil time: + * - Pattern: `{sample_data_type}.sample_time.civil_time` + * - Supported comparison operators: `>=`, `<` + * - Date with optional time literal expected in ISO 8601 + * `YYYY-MM-DD[THH:mm:ss]` format + * - Supported logical operators: `AND` + * - Example: + * - `weight.sample_time.civil_time >= "2023-11-24" AND + * weight.sample_time.civil_time < "2023-11-25"` + * - `weight.sample_time.civil_time >= "2024-08-14T12:34:56"` + * + * - Daily summary date: + * - Pattern: `{daily_summary_data_type}.date` + * - Supported comparison operators: `>=`, `<` + * - Date literal expected in ISO 8601 `YYYY-MM-DD` format + * - Supported logical operators: `AND` + * - Example: + * - `daily_heart_rate_variability.date < "2024-08-15"` + * + * + * + * - Session civil start time (**Excluding Sleep and ECG**): + * - Pattern: `{session_data_type}.interval.civil_start_time` + * - Supported comparison operators: `>=`, `<` + * - Date with optional time literal expected in ISO 8601 + * `YYYY-MM-DD[THH:mm:ss]` format + * - Supported logical operators: `AND` + * - Example: + * - `exercise.interval.civil_start_time >= "2023-11-24" AND + * exercise.interval.civil_start_time < "2023-11-25"` + * - `exercise.interval.civil_start_time >= "2024-08-14T12:34:56"` + * + * - Session start time (**ECG specific**): + * - Pattern: `electrocardiogram.interval.start_time` + * - Supported comparison operators: `>=` + * - Timestamp literal expected in RFC-3339 format + * - Example: + * - `electrocardiogram.interval.start_time >= "2024-08-14T12:34:56Z"` + * - Note: Only filtering by start time is supported for ECG. Filtering + * by end time (e.g., `electrocardiogram.interval.end_time`) is not + * supported. + * + * - Session end time (**Sleep specific**): + * - Pattern: `sleep.interval.end_time` + * - Supported comparison operators: `>=`, `<` + * - Timestamp literal expected in RFC-3339 format + * - Supported logical operators: `AND`, `OR` + * - Example: + * - `sleep.interval.end_time >= "2023-11-24T00:00:00Z" AND + * sleep.interval.end_time < "2023-11-25T00:00:00Z"` + * + * - Session civil end time (**Sleep specific**): + * - Pattern: `sleep.interval.civil_end_time` + * - Supported comparison operators: `>=`, `<` + * - Date with optional time literal expected in ISO 8601 + * `YYYY-MM-DD[THH:mm:ss]` format + * - Supported logical operators: `AND`, `OR` + * - Example: + * - `sleep.interval.civil_end_time >= "2023-11-24" AND + * sleep.interval.civil_end_time < "2023-11-25"` + * + * + * Data points in the response will be ordered by the interval start time in + * descending order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.devicesandservices.health.v4.DataPoint|DataPoint} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDataPointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ listDataPointsStream( - request?: protos.google.devicesandservices.health.v4.IListDataPointsRequest, - options?: CallOptions): - Transform{ + request?: protos.google.devicesandservices.health.v4.IListDataPointsRequest, + options?: CallOptions, + ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); const defaultCallSettings = this._defaults['listDataPoints']; const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); + this.initialize().catch((err) => { + throw err; + }); this._log.info('listDataPoints stream %j', request); return this.descriptors.page.listDataPoints.createStream( this.innerApiCalls.listDataPoints as GaxCall, request, - callSettings + callSettings, ); } -/** - * Equivalent to `listDataPoints`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent data type of the Data Point collection. - * - * Format: `users/me/dataTypes/{data_type}`, e.g.: - * - * - `users/me/dataTypes/steps` - * - `users/me/dataTypes/weight` - * - * For a list of the supported data types see the [DataPoint - * data][google.devicesandservices.health.v4.DataPoint] union - * field. - * @param {number} [request.pageSize] - * Optional. The maximum number of data points to return. - * If unspecified, at most 1440 data points will be returned. - * The maximum page size is 10000; values above that will be truncated - * accordingly. - * For `exercise` and `sleep` the default page size is 25. - * The maximum page size for `exercise` and `sleep` is 25. - * @param {string} [request.pageToken] - * Optional. The `next_page_token` from a previous request, if any. - * @param {string} [request.filter] - * Optional. Filter expression following https://google.aip.dev/160. - * - * A time range (either physical or civil) can be specified. - * - * The supported filter fields are: - * - * - * - Interval start time: - * - Pattern: `{interval_data_type}.interval.start_time` - * - Supported comparison operators: `>=`, `<` - * - Timestamp literal expected in RFC-3339 format - * - Supported logical operators: `AND` - * - Example: - * - `steps.interval.start_time >= "2023-11-24T00:00:00Z" AND - * steps.interval.start_time < "2023-11-25T00:00:00Z"` - * - `distance.interval.start_time >= "2024-08-14T12:34:56Z"` - * - * - Interval civil start time: - * - Pattern: `{interval_data_type}.interval.civil_start_time` - * - Supported comparison operators: `>=`, `<` - * - Date with optional time literal expected in ISO 8601 - * `YYYY-MM-DD[THH:mm:ss]` format - * - Supported logical operators: `AND` - * - Example: - * - `steps.interval.civil_start_time >= "2023-11-24" AND - * steps.interval.civil_start_time < "2023-11-25"` - * - `distance.interval.civil_start_time >= "2024-08-14T12:34:56"` - * - * - Sample observation physical time: - * - Pattern: `{sample_data_type}.sample_time.physical_time` - * - Supported comparison operators: `>=`, `<` - * - Timestamp literal expected in RFC-3339 format - * - Supported logical operators: `AND` - * - Example: - * - `weight.sample_time.physical_time >= "2023-11-24T00:00:00Z" - * AND weight.sample_time.physical_time < "2023-11-25T00:00:00Z"` - * - `weight.sample_time.physical_time >= - * "2024-08-14T12:34:56Z"` - * - * - Sample observation civil time: - * - Pattern: `{sample_data_type}.sample_time.civil_time` - * - Supported comparison operators: `>=`, `<` - * - Date with optional time literal expected in ISO 8601 - * `YYYY-MM-DD[THH:mm:ss]` format - * - Supported logical operators: `AND` - * - Example: - * - `weight.sample_time.civil_time >= "2023-11-24" AND - * weight.sample_time.civil_time < "2023-11-25"` - * - `weight.sample_time.civil_time >= "2024-08-14T12:34:56"` - * - * - Daily summary date: - * - Pattern: `{daily_summary_data_type}.date` - * - Supported comparison operators: `>=`, `<` - * - Date literal expected in ISO 8601 `YYYY-MM-DD` format - * - Supported logical operators: `AND` - * - Example: - * - `daily_resting_heart_rate.date >= "2024-08-14"` - * - `daily_heart_rate_variability.date < "2024-08-15"` - * - * - * - Session civil start time (**Excluding Sleep**): - * - Pattern: `{session_data_type}.interval.civil_start_time` - * - Supported comparison operators: `>=`, `<` - * - Date with optional time literal expected in ISO 8601 - * `YYYY-MM-DD[THH:mm:ss]` format - * - Supported logical operators: `AND` - * - Example: - * - `exercise.interval.civil_start_time >= "2023-11-24" AND - * exercise.interval.civil_start_time < "2023-11-25"` - * - `exercise.interval.civil_start_time >= "2024-08-14T12:34:56"` - * - * - Session end time (**Sleep specific**): - * - Pattern: `sleep.interval.end_time` - * - Supported comparison operators: `>=`, `<` - * - Timestamp literal expected in RFC-3339 format - * - Supported logical operators: `AND`, `OR` - * - Example: - * - `sleep.interval.end_time >= "2023-11-24T00:00:00Z" AND - * sleep.interval.end_time < "2023-11-25T00:00:00Z"` - * - * - Session civil end time (**Sleep specific**): - * - Pattern: `sleep.interval.civil_end_time` - * - Supported comparison operators: `>=`, `<` - * - Date with optional time literal expected in ISO 8601 - * `YYYY-MM-DD[THH:mm:ss]` format - * - Supported logical operators: `AND`, `OR` - * - Example: - * - `sleep.interval.civil_end_time >= "2023-11-24" AND - * sleep.interval.civil_end_time < "2023-11-25"` - * - * - * Data points in the response will be ordered by the interval start time in - * descending order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.devicesandservices.health.v4.DataPoint|DataPoint}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v4/data_points_service.list_data_points.js - * region_tag:health_v4_generated_DataPointsService_ListDataPoints_async - */ + /** + * Equivalent to `listDataPoints`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent data type of the Data Point collection. + * + * Format: `users/me/dataTypes/{data_type}`, e.g.: + * + * - `users/me/dataTypes/steps` + * - `users/me/dataTypes/weight` + * + * For a list of the supported data types see the [DataPoint + * data][google.devicesandservices.health.v4.DataPoint] union + * field. + * @param {number} [request.pageSize] + * Optional. The maximum number of data points to return. + * If unspecified, at most 1440 data points will be returned. + * The maximum page size is 10000; values above that will be truncated + * accordingly. + * For `exercise` and `sleep` the default page size is 25. + * The maximum page size for `exercise` and `sleep` is 25. + * @param {string} [request.pageToken] + * Optional. The `next_page_token` from a previous request, if any. + * @param {string} [request.filter] + * Optional. Filter expression following https://google.aip.dev/160. + * + * A time range (either physical or civil) can be specified. + * + * The supported filter fields are: + * + * + * - Interval start time: + * - Pattern: `{interval_data_type}.interval.start_time` + * - Supported comparison operators: `>=`, `<` + * - Timestamp literal expected in RFC-3339 format + * - Supported logical operators: `AND` + * - Example: + * - `steps.interval.start_time >= "2023-11-24T00:00:00Z" AND + * steps.interval.start_time < "2023-11-25T00:00:00Z"` + * - `distance.interval.start_time >= "2024-08-14T12:34:56Z"` + * + * - Interval civil start time: + * - Pattern: `{interval_data_type}.interval.civil_start_time` + * - Supported comparison operators: `>=`, `<` + * - Date with optional time literal expected in ISO 8601 + * `YYYY-MM-DD[THH:mm:ss]` format + * - Supported logical operators: `AND` + * - Example: + * - `steps.interval.civil_start_time >= "2023-11-24" AND + * steps.interval.civil_start_time < "2023-11-25"` + * - `distance.interval.civil_start_time >= "2024-08-14T12:34:56"` + * + * - Sample observation physical time: + * - Pattern: `{sample_data_type}.sample_time.physical_time` + * - Supported comparison operators: `>=`, `<` + * - Timestamp literal expected in RFC-3339 format + * - Supported logical operators: `AND` + * - Example: + * - `weight.sample_time.physical_time >= "2023-11-24T00:00:00Z" + * AND weight.sample_time.physical_time < "2023-11-25T00:00:00Z"` + * - `weight.sample_time.physical_time >= + * "2024-08-14T12:34:56Z"` + * + * - Sample observation civil time: + * - Pattern: `{sample_data_type}.sample_time.civil_time` + * - Supported comparison operators: `>=`, `<` + * - Date with optional time literal expected in ISO 8601 + * `YYYY-MM-DD[THH:mm:ss]` format + * - Supported logical operators: `AND` + * - Example: + * - `weight.sample_time.civil_time >= "2023-11-24" AND + * weight.sample_time.civil_time < "2023-11-25"` + * - `weight.sample_time.civil_time >= "2024-08-14T12:34:56"` + * + * - Daily summary date: + * - Pattern: `{daily_summary_data_type}.date` + * - Supported comparison operators: `>=`, `<` + * - Date literal expected in ISO 8601 `YYYY-MM-DD` format + * - Supported logical operators: `AND` + * - Example: + * - `daily_heart_rate_variability.date < "2024-08-15"` + * + * + * + * - Session civil start time (**Excluding Sleep and ECG**): + * - Pattern: `{session_data_type}.interval.civil_start_time` + * - Supported comparison operators: `>=`, `<` + * - Date with optional time literal expected in ISO 8601 + * `YYYY-MM-DD[THH:mm:ss]` format + * - Supported logical operators: `AND` + * - Example: + * - `exercise.interval.civil_start_time >= "2023-11-24" AND + * exercise.interval.civil_start_time < "2023-11-25"` + * - `exercise.interval.civil_start_time >= "2024-08-14T12:34:56"` + * + * - Session start time (**ECG specific**): + * - Pattern: `electrocardiogram.interval.start_time` + * - Supported comparison operators: `>=` + * - Timestamp literal expected in RFC-3339 format + * - Example: + * - `electrocardiogram.interval.start_time >= "2024-08-14T12:34:56Z"` + * - Note: Only filtering by start time is supported for ECG. Filtering + * by end time (e.g., `electrocardiogram.interval.end_time`) is not + * supported. + * + * - Session end time (**Sleep specific**): + * - Pattern: `sleep.interval.end_time` + * - Supported comparison operators: `>=`, `<` + * - Timestamp literal expected in RFC-3339 format + * - Supported logical operators: `AND`, `OR` + * - Example: + * - `sleep.interval.end_time >= "2023-11-24T00:00:00Z" AND + * sleep.interval.end_time < "2023-11-25T00:00:00Z"` + * + * - Session civil end time (**Sleep specific**): + * - Pattern: `sleep.interval.civil_end_time` + * - Supported comparison operators: `>=`, `<` + * - Date with optional time literal expected in ISO 8601 + * `YYYY-MM-DD[THH:mm:ss]` format + * - Supported logical operators: `AND`, `OR` + * - Example: + * - `sleep.interval.civil_end_time >= "2023-11-24" AND + * sleep.interval.civil_end_time < "2023-11-25"` + * + * + * Data points in the response will be ordered by the interval start time in + * descending order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.devicesandservices.health.v4.DataPoint|DataPoint}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_points_service.list_data_points.js + * region_tag:health_v4_generated_DataPointsService_ListDataPoints_async + */ listDataPointsAsync( - request?: protos.google.devicesandservices.health.v4.IListDataPointsRequest, - options?: CallOptions): - AsyncIterable{ + request?: protos.google.devicesandservices.health.v4.IListDataPointsRequest, + options?: CallOptions, + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); const defaultCallSettings = this._defaults['listDataPoints']; const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); + this.initialize().catch((err) => { + throw err; + }); this._log.info('listDataPoints iterate %j', request); return this.descriptors.page.listDataPoints.asyncIterate( this.innerApiCalls['listDataPoints'] as GaxCall, request as {}, - callSettings + callSettings, ) as AsyncIterable; } - /** - * Reconcile data points from multiple data sources into a single data stream. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent data type of the Data Point collection. - * - * Format: `users/me/dataTypes/{data_type}`, e.g.: - * - * - `users/me/dataTypes/steps` - * - `users/me/dataTypes/heart-rate` - * - * For a list of the supported data types see the - * [DataPoint - * data][google.devicesandservices.health.v4.DataPoint] union - * field. - * @param {number} [request.pageSize] - * Optional. The maximum number of data points to return. - * If unspecified, at most 1440 data points will be returned. - * The maximum page size is 10000; values above that will be truncated - * accordingly. - * For `exercise` and `sleep` the default page size is 25. - * The maximum page size for `exercise` and `sleep` is 25. - * @param {string} [request.pageToken] - * Optional. The `next_page_token` from a previous request, if any. - * @param {string} [request.filter] - * Optional. Filter expression based on https://aip.dev/160. - * - * A time range, either physical or civil, can be specified. - * See the - * {@link protos.google.devicesandservices.health.v4.ListDataPointsRequest.filter|ListDataPointsRequest.filter} - * for the supported fields and syntax. - * @param {string} [request.dataSourceFamily] - * Optional. The data source family name to reconcile. - * - * If empty, data points from all data sources will be reconciled. - * - * 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 - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.devicesandservices.health.v4.ReconciledDataPoint|ReconciledDataPoint}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `reconcileDataPointsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ + /** + * Reconcile data points from multiple data sources into a single data stream. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent data type of the Data Point collection. + * + * Format: `users/me/dataTypes/{data_type}`, e.g.: + * + * - `users/me/dataTypes/steps` + * - `users/me/dataTypes/heart-rate` + * + * For a list of the supported data types see the + * [DataPoint + * data][google.devicesandservices.health.v4.DataPoint] union + * field. + * @param {number} [request.pageSize] + * Optional. The maximum number of data points to return. + * If unspecified, at most 1440 data points will be returned. + * The maximum page size is 10000; values above that will be truncated + * accordingly. + * For `exercise` and `sleep` the default page size is 25. + * The maximum page size for `exercise` and `sleep` is 25. + * @param {string} [request.pageToken] + * Optional. The `next_page_token` from a previous request, if any. + * @param {string} [request.filter] + * Optional. Filter expression based on https://aip.dev/160. + * + * A time range, either physical or civil, can be specified. + * See the + * {@link protos.google.devicesandservices.health.v4.ListDataPointsRequest.filter|ListDataPointsRequest.filter} + * for the supported fields and syntax. + * @param {string} [request.dataSourceFamily] + * Optional. The data source family name to reconcile. + * + * If empty, data points from all data sources will be reconciled. + * + * 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 + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.devicesandservices.health.v4.ReconciledDataPoint|ReconciledDataPoint}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `reconcileDataPointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ reconcileDataPoints( - request?: protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, - options?: CallOptions): - Promise<[ - protos.google.devicesandservices.health.v4.IReconciledDataPoint[], - protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest|null, - protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse - ]>; + request?: protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IReconciledDataPoint[], + protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest | null, + protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse, + ] + >; reconcileDataPoints( - request: protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, - protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IReconciledDataPoint>): void; + request: protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, + | protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IReconciledDataPoint + >, + ): void; reconcileDataPoints( - request: protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, - callback: PaginationCallback< - protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, - protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IReconciledDataPoint>): void; + request: protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, + callback: PaginationCallback< + protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, + | protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IReconciledDataPoint + >, + ): void; reconcileDataPoints( - request?: protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< + request?: protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, - protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IReconciledDataPoint>, - callback?: PaginationCallback< - protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, - protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IReconciledDataPoint>): - Promise<[ - protos.google.devicesandservices.health.v4.IReconciledDataPoint[], - protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest|null, - protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse - ]>|void { + | protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IReconciledDataPoint + >, + callback?: PaginationCallback< + protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, + | protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IReconciledDataPoint + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IReconciledDataPoint[], + protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest | null, + protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, - protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IReconciledDataPoint>|undefined = callback + const wrappedCallback: + | PaginationCallback< + protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, + | protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IReconciledDataPoint + > + | undefined = callback ? (error, values, nextPageRequest, rawResponse) => { this._log.info('reconcileDataPoints values %j', values); callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. @@ -1731,294 +2253,323 @@ export class DataPointsServiceClient { this._log.info('reconcileDataPoints request %j', request); return this.innerApiCalls .reconcileDataPoints(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.devicesandservices.health.v4.IReconciledDataPoint[], - protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest|null, - protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse - ]) => { - this._log.info('reconcileDataPoints values %j', response); - return [response, input, output]; - }); + ?.then( + ([response, input, output]: [ + protos.google.devicesandservices.health.v4.IReconciledDataPoint[], + protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest | null, + protos.google.devicesandservices.health.v4.IReconcileDataPointsResponse, + ]) => { + this._log.info('reconcileDataPoints values %j', response); + return [response, input, output]; + }, + ); } -/** - * Equivalent to `reconcileDataPoints`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent data type of the Data Point collection. - * - * Format: `users/me/dataTypes/{data_type}`, e.g.: - * - * - `users/me/dataTypes/steps` - * - `users/me/dataTypes/heart-rate` - * - * For a list of the supported data types see the - * [DataPoint - * data][google.devicesandservices.health.v4.DataPoint] union - * field. - * @param {number} [request.pageSize] - * Optional. The maximum number of data points to return. - * If unspecified, at most 1440 data points will be returned. - * The maximum page size is 10000; values above that will be truncated - * accordingly. - * For `exercise` and `sleep` the default page size is 25. - * The maximum page size for `exercise` and `sleep` is 25. - * @param {string} [request.pageToken] - * Optional. The `next_page_token` from a previous request, if any. - * @param {string} [request.filter] - * Optional. Filter expression based on https://aip.dev/160. - * - * A time range, either physical or civil, can be specified. - * See the - * {@link protos.google.devicesandservices.health.v4.ListDataPointsRequest.filter|ListDataPointsRequest.filter} - * for the supported fields and syntax. - * @param {string} [request.dataSourceFamily] - * Optional. The data source family name to reconcile. - * - * If empty, data points from all data sources will be reconciled. - * - * 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 - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.devicesandservices.health.v4.ReconciledDataPoint|ReconciledDataPoint} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `reconcileDataPointsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ + /** + * Equivalent to `reconcileDataPoints`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent data type of the Data Point collection. + * + * Format: `users/me/dataTypes/{data_type}`, e.g.: + * + * - `users/me/dataTypes/steps` + * - `users/me/dataTypes/heart-rate` + * + * For a list of the supported data types see the + * [DataPoint + * data][google.devicesandservices.health.v4.DataPoint] union + * field. + * @param {number} [request.pageSize] + * Optional. The maximum number of data points to return. + * If unspecified, at most 1440 data points will be returned. + * The maximum page size is 10000; values above that will be truncated + * accordingly. + * For `exercise` and `sleep` the default page size is 25. + * The maximum page size for `exercise` and `sleep` is 25. + * @param {string} [request.pageToken] + * Optional. The `next_page_token` from a previous request, if any. + * @param {string} [request.filter] + * Optional. Filter expression based on https://aip.dev/160. + * + * A time range, either physical or civil, can be specified. + * See the + * {@link protos.google.devicesandservices.health.v4.ListDataPointsRequest.filter|ListDataPointsRequest.filter} + * for the supported fields and syntax. + * @param {string} [request.dataSourceFamily] + * Optional. The data source family name to reconcile. + * + * If empty, data points from all data sources will be reconciled. + * + * 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 + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.devicesandservices.health.v4.ReconciledDataPoint|ReconciledDataPoint} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `reconcileDataPointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ reconcileDataPointsStream( - request?: protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, - options?: CallOptions): - Transform{ + request?: protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, + options?: CallOptions, + ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); const defaultCallSettings = this._defaults['reconcileDataPoints']; const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); + this.initialize().catch((err) => { + throw err; + }); this._log.info('reconcileDataPoints stream %j', request); return this.descriptors.page.reconcileDataPoints.createStream( this.innerApiCalls.reconcileDataPoints as GaxCall, request, - callSettings + callSettings, ); } -/** - * Equivalent to `reconcileDataPoints`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent data type of the Data Point collection. - * - * Format: `users/me/dataTypes/{data_type}`, e.g.: - * - * - `users/me/dataTypes/steps` - * - `users/me/dataTypes/heart-rate` - * - * For a list of the supported data types see the - * [DataPoint - * data][google.devicesandservices.health.v4.DataPoint] union - * field. - * @param {number} [request.pageSize] - * Optional. The maximum number of data points to return. - * If unspecified, at most 1440 data points will be returned. - * The maximum page size is 10000; values above that will be truncated - * accordingly. - * For `exercise` and `sleep` the default page size is 25. - * The maximum page size for `exercise` and `sleep` is 25. - * @param {string} [request.pageToken] - * Optional. The `next_page_token` from a previous request, if any. - * @param {string} [request.filter] - * Optional. Filter expression based on https://aip.dev/160. - * - * A time range, either physical or civil, can be specified. - * See the - * {@link protos.google.devicesandservices.health.v4.ListDataPointsRequest.filter|ListDataPointsRequest.filter} - * for the supported fields and syntax. - * @param {string} [request.dataSourceFamily] - * Optional. The data source family name to reconcile. - * - * If empty, data points from all data sources will be reconciled. - * - * 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 - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.devicesandservices.health.v4.ReconciledDataPoint|ReconciledDataPoint}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v4/data_points_service.reconcile_data_points.js - * region_tag:health_v4_generated_DataPointsService_ReconcileDataPoints_async - */ + /** + * Equivalent to `reconcileDataPoints`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent data type of the Data Point collection. + * + * Format: `users/me/dataTypes/{data_type}`, e.g.: + * + * - `users/me/dataTypes/steps` + * - `users/me/dataTypes/heart-rate` + * + * For a list of the supported data types see the + * [DataPoint + * data][google.devicesandservices.health.v4.DataPoint] union + * field. + * @param {number} [request.pageSize] + * Optional. The maximum number of data points to return. + * If unspecified, at most 1440 data points will be returned. + * The maximum page size is 10000; values above that will be truncated + * accordingly. + * For `exercise` and `sleep` the default page size is 25. + * The maximum page size for `exercise` and `sleep` is 25. + * @param {string} [request.pageToken] + * Optional. The `next_page_token` from a previous request, if any. + * @param {string} [request.filter] + * Optional. Filter expression based on https://aip.dev/160. + * + * A time range, either physical or civil, can be specified. + * See the + * {@link protos.google.devicesandservices.health.v4.ListDataPointsRequest.filter|ListDataPointsRequest.filter} + * for the supported fields and syntax. + * @param {string} [request.dataSourceFamily] + * Optional. The data source family name to reconcile. + * + * If empty, data points from all data sources will be reconciled. + * + * 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 + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.devicesandservices.health.v4.ReconciledDataPoint|ReconciledDataPoint}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_points_service.reconcile_data_points.js + * region_tag:health_v4_generated_DataPointsService_ReconcileDataPoints_async + */ reconcileDataPointsAsync( - request?: protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, - options?: CallOptions): - AsyncIterable{ + request?: protos.google.devicesandservices.health.v4.IReconcileDataPointsRequest, + options?: CallOptions, + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); const defaultCallSettings = this._defaults['reconcileDataPoints']; const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); + this.initialize().catch((err) => { + throw err; + }); this._log.info('reconcileDataPoints iterate %j', request); return this.descriptors.page.reconcileDataPoints.asyncIterate( this.innerApiCalls['reconcileDataPoints'] as GaxCall, request as {}, - callSettings + callSettings, ) as AsyncIterable; } - /** - * Roll up data points over physical time intervals for supported data types. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent data type of the Data Point collection. - * - * Format: `users/{user}/dataTypes/{data_type}`, e.g.: - * - * - `users/me/dataTypes/steps` - * - `users/me/dataTypes/distance` - * - * For a list of the supported data types see the [RollupDataPoint - * value][google.devicesandservices.health.v4.RollupDataPoint] - * union field. - * @param {google.type.Interval} request.range - * Required. Closed-open range of data points that will be rolled up. - * The maximum range for `calories-in-heart-rate-zone`, `heart-rate`, - * `active-minutes` and `total-calories` is 14 days. - * The maximum range for all other data types is 90 days. - * @param {google.protobuf.Duration} request.windowSize - * Required. The size of the time window to group data points into before - * applying the aggregation functions. - * @param {number} [request.pageSize] - * Optional. The maximum number of data points to return. - * If unspecified, at most 1440 data points will be returned. - * The maximum page size is 10000; values above that will be truncated - * accordingly. - * @param {string} [request.pageToken] - * Optional. The next_page_token from a previous request, if any. - * All other request fields need to be the same as in the initial request - * when the page token is specified. - * @param {string} [request.dataSourceFamily] - * Optional. The data source family name to roll up. - * - * If empty, data points from all available data sources will be rolled up. - * - * 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 - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.devicesandservices.health.v4.RollupDataPoint|RollupDataPoint}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `rollUpDataPointsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ + /** + * Roll up data points over physical time intervals for supported data types. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent data type of the Data Point collection. + * + * Format: `users/{user}/dataTypes/{data_type}`, e.g.: + * + * - `users/me/dataTypes/steps` + * - `users/me/dataTypes/distance` + * + * For a list of the supported data types see the [RollupDataPoint + * value][google.devicesandservices.health.v4.RollupDataPoint] + * union field. + * @param {google.type.Interval} request.range + * Required. Closed-open range of data points that will be rolled up. + * The maximum range for `calories-in-heart-rate-zone`, `heart-rate`, + * `active-minutes` and `total-calories` is 14 days. + * The maximum range for all other data types is 90 days. + * @param {google.protobuf.Duration} request.windowSize + * Required. The size of the time window to group data points into before + * applying the aggregation functions. + * @param {number} [request.pageSize] + * Optional. The maximum number of data points to return. + * If unspecified, at most 1440 data points will be returned. + * The maximum page size is 10000; values above that will be truncated + * accordingly. + * @param {string} [request.pageToken] + * Optional. The next_page_token from a previous request, if any. + * All other request fields need to be the same as in the initial request + * when the page token is specified. + * @param {string} [request.dataSourceFamily] + * Optional. The data source family name to roll up. + * + * If empty, data points from all available data sources will be rolled up. + * + * 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 + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.devicesandservices.health.v4.RollupDataPoint|RollupDataPoint}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `rollUpDataPointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ rollUpDataPoints( - request?: protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, - options?: CallOptions): - Promise<[ - protos.google.devicesandservices.health.v4.IRollupDataPoint[], - protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest|null, - protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse - ]>; + request?: protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IRollupDataPoint[], + protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest | null, + protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse, + ] + >; rollUpDataPoints( - request: protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, - protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IRollupDataPoint>): void; + request: protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, + | protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IRollupDataPoint + >, + ): void; rollUpDataPoints( - request: protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, - callback: PaginationCallback< - protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, - protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IRollupDataPoint>): void; + request: protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, + callback: PaginationCallback< + protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, + | protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IRollupDataPoint + >, + ): void; rollUpDataPoints( - request?: protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, - protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IRollupDataPoint>, - callback?: PaginationCallback< + request?: protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, - protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IRollupDataPoint>): - Promise<[ - protos.google.devicesandservices.health.v4.IRollupDataPoint[], - protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest|null, - protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse - ]>|void { + | protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IRollupDataPoint + >, + callback?: PaginationCallback< + protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, + | protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IRollupDataPoint + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IRollupDataPoint[], + protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest | null, + protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, - protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse|null|undefined, - protos.google.devicesandservices.health.v4.IRollupDataPoint>|undefined = callback + const wrappedCallback: + | PaginationCallback< + protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, + | protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IRollupDataPoint + > + | undefined = callback ? (error, values, nextPageRequest, rawResponse) => { this._log.info('rollUpDataPoints values %j', values); callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. @@ -2027,176 +2578,180 @@ export class DataPointsServiceClient { this._log.info('rollUpDataPoints request %j', request); return this.innerApiCalls .rollUpDataPoints(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.devicesandservices.health.v4.IRollupDataPoint[], - protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest|null, - protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse - ]) => { - this._log.info('rollUpDataPoints values %j', response); - return [response, input, output]; - }); + ?.then( + ([response, input, output]: [ + protos.google.devicesandservices.health.v4.IRollupDataPoint[], + protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest | null, + protos.google.devicesandservices.health.v4.IRollUpDataPointsResponse, + ]) => { + this._log.info('rollUpDataPoints values %j', response); + return [response, input, output]; + }, + ); } -/** - * Equivalent to `rollUpDataPoints`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent data type of the Data Point collection. - * - * Format: `users/{user}/dataTypes/{data_type}`, e.g.: - * - * - `users/me/dataTypes/steps` - * - `users/me/dataTypes/distance` - * - * For a list of the supported data types see the [RollupDataPoint - * value][google.devicesandservices.health.v4.RollupDataPoint] - * union field. - * @param {google.type.Interval} request.range - * Required. Closed-open range of data points that will be rolled up. - * The maximum range for `calories-in-heart-rate-zone`, `heart-rate`, - * `active-minutes` and `total-calories` is 14 days. - * The maximum range for all other data types is 90 days. - * @param {google.protobuf.Duration} request.windowSize - * Required. The size of the time window to group data points into before - * applying the aggregation functions. - * @param {number} [request.pageSize] - * Optional. The maximum number of data points to return. - * If unspecified, at most 1440 data points will be returned. - * The maximum page size is 10000; values above that will be truncated - * accordingly. - * @param {string} [request.pageToken] - * Optional. The next_page_token from a previous request, if any. - * All other request fields need to be the same as in the initial request - * when the page token is specified. - * @param {string} [request.dataSourceFamily] - * Optional. The data source family name to roll up. - * - * If empty, data points from all available data sources will be rolled up. - * - * 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 - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.devicesandservices.health.v4.RollupDataPoint|RollupDataPoint} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `rollUpDataPointsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ + /** + * Equivalent to `rollUpDataPoints`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent data type of the Data Point collection. + * + * Format: `users/{user}/dataTypes/{data_type}`, e.g.: + * + * - `users/me/dataTypes/steps` + * - `users/me/dataTypes/distance` + * + * For a list of the supported data types see the [RollupDataPoint + * value][google.devicesandservices.health.v4.RollupDataPoint] + * union field. + * @param {google.type.Interval} request.range + * Required. Closed-open range of data points that will be rolled up. + * The maximum range for `calories-in-heart-rate-zone`, `heart-rate`, + * `active-minutes` and `total-calories` is 14 days. + * The maximum range for all other data types is 90 days. + * @param {google.protobuf.Duration} request.windowSize + * Required. The size of the time window to group data points into before + * applying the aggregation functions. + * @param {number} [request.pageSize] + * Optional. The maximum number of data points to return. + * If unspecified, at most 1440 data points will be returned. + * The maximum page size is 10000; values above that will be truncated + * accordingly. + * @param {string} [request.pageToken] + * Optional. The next_page_token from a previous request, if any. + * All other request fields need to be the same as in the initial request + * when the page token is specified. + * @param {string} [request.dataSourceFamily] + * Optional. The data source family name to roll up. + * + * If empty, data points from all available data sources will be rolled up. + * + * 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 + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.devicesandservices.health.v4.RollupDataPoint|RollupDataPoint} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `rollUpDataPointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ rollUpDataPointsStream( - request?: protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, - options?: CallOptions): - Transform{ + request?: protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, + options?: CallOptions, + ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); const defaultCallSettings = this._defaults['rollUpDataPoints']; const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); + this.initialize().catch((err) => { + throw err; + }); this._log.info('rollUpDataPoints stream %j', request); return this.descriptors.page.rollUpDataPoints.createStream( this.innerApiCalls.rollUpDataPoints as GaxCall, request, - callSettings + callSettings, ); } -/** - * Equivalent to `rollUpDataPoints`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent data type of the Data Point collection. - * - * Format: `users/{user}/dataTypes/{data_type}`, e.g.: - * - * - `users/me/dataTypes/steps` - * - `users/me/dataTypes/distance` - * - * For a list of the supported data types see the [RollupDataPoint - * value][google.devicesandservices.health.v4.RollupDataPoint] - * union field. - * @param {google.type.Interval} request.range - * Required. Closed-open range of data points that will be rolled up. - * The maximum range for `calories-in-heart-rate-zone`, `heart-rate`, - * `active-minutes` and `total-calories` is 14 days. - * The maximum range for all other data types is 90 days. - * @param {google.protobuf.Duration} request.windowSize - * Required. The size of the time window to group data points into before - * applying the aggregation functions. - * @param {number} [request.pageSize] - * Optional. The maximum number of data points to return. - * If unspecified, at most 1440 data points will be returned. - * The maximum page size is 10000; values above that will be truncated - * accordingly. - * @param {string} [request.pageToken] - * Optional. The next_page_token from a previous request, if any. - * All other request fields need to be the same as in the initial request - * when the page token is specified. - * @param {string} [request.dataSourceFamily] - * Optional. The data source family name to roll up. - * - * If empty, data points from all available data sources will be rolled up. - * - * 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 - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.devicesandservices.health.v4.RollupDataPoint|RollupDataPoint}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v4/data_points_service.roll_up_data_points.js - * region_tag:health_v4_generated_DataPointsService_RollUpDataPoints_async - */ + /** + * Equivalent to `rollUpDataPoints`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent data type of the Data Point collection. + * + * Format: `users/{user}/dataTypes/{data_type}`, e.g.: + * + * - `users/me/dataTypes/steps` + * - `users/me/dataTypes/distance` + * + * For a list of the supported data types see the [RollupDataPoint + * value][google.devicesandservices.health.v4.RollupDataPoint] + * union field. + * @param {google.type.Interval} request.range + * Required. Closed-open range of data points that will be rolled up. + * The maximum range for `calories-in-heart-rate-zone`, `heart-rate`, + * `active-minutes` and `total-calories` is 14 days. + * The maximum range for all other data types is 90 days. + * @param {google.protobuf.Duration} request.windowSize + * Required. The size of the time window to group data points into before + * applying the aggregation functions. + * @param {number} [request.pageSize] + * Optional. The maximum number of data points to return. + * If unspecified, at most 1440 data points will be returned. + * The maximum page size is 10000; values above that will be truncated + * accordingly. + * @param {string} [request.pageToken] + * Optional. The next_page_token from a previous request, if any. + * All other request fields need to be the same as in the initial request + * when the page token is specified. + * @param {string} [request.dataSourceFamily] + * Optional. The data source family name to roll up. + * + * If empty, data points from all available data sources will be rolled up. + * + * 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 + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.devicesandservices.health.v4.RollupDataPoint|RollupDataPoint}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_points_service.roll_up_data_points.js + * region_tag:health_v4_generated_DataPointsService_RollUpDataPoints_async + */ rollUpDataPointsAsync( - request?: protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, - options?: CallOptions): - AsyncIterable{ + request?: protos.google.devicesandservices.health.v4.IRollUpDataPointsRequest, + options?: CallOptions, + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); const defaultCallSettings = this._defaults['rollUpDataPoints']; const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); + this.initialize().catch((err) => { + throw err; + }); this._log.info('rollUpDataPoints iterate %j', request); return this.descriptors.page.rollUpDataPoints.asyncIterate( this.innerApiCalls['rollUpDataPoints'] as GaxCall, request as {}, - callSettings + callSettings, ) as AsyncIterable; } // -------------------- @@ -2211,7 +2766,7 @@ export class DataPointsServiceClient { * @param {string} data_point * @returns {string} Resource name string. */ - dataPointPath(user:string,dataType:string,dataPoint:string) { + dataPointPath(user: string, dataType: string, dataPoint: string) { return this.pathTemplates.dataPointPathTemplate.render({ user: user, data_type: dataType, @@ -2238,7 +2793,8 @@ export class DataPointsServiceClient { * @returns {string} A string representing the data_type. */ matchDataTypeFromDataPointName(dataPointName: string) { - return this.pathTemplates.dataPointPathTemplate.match(dataPointName).data_type; + return this.pathTemplates.dataPointPathTemplate.match(dataPointName) + .data_type; } /** @@ -2249,7 +2805,8 @@ export class DataPointsServiceClient { * @returns {string} A string representing the data_point. */ matchDataPointFromDataPointName(dataPointName: string) { - return this.pathTemplates.dataPointPathTemplate.match(dataPointName).data_point; + return this.pathTemplates.dataPointPathTemplate.match(dataPointName) + .data_point; } /** @@ -2259,7 +2816,7 @@ export class DataPointsServiceClient { * @param {string} data_type * @returns {string} Resource name string. */ - dataTypePath(user:string,dataType:string) { + dataTypePath(user: string, dataType: string) { return this.pathTemplates.dataTypePathTemplate.render({ user: user, data_type: dataType, @@ -2285,7 +2842,8 @@ export class DataPointsServiceClient { * @returns {string} A string representing the data_type. */ matchDataTypeFromDataTypeName(dataTypeName: string) { - return this.pathTemplates.dataTypePathTemplate.match(dataTypeName).data_type; + return this.pathTemplates.dataTypePathTemplate.match(dataTypeName) + .data_type; } /** @@ -2294,7 +2852,7 @@ export class DataPointsServiceClient { * @param {string} user * @returns {string} Resource name string. */ - identityPath(user:string) { + identityPath(user: string) { return this.pathTemplates.identityPathTemplate.render({ user: user, }); @@ -2311,13 +2869,74 @@ export class DataPointsServiceClient { return this.pathTemplates.identityPathTemplate.match(identityName).user; } + /** + * Return a fully-qualified irnProfile resource name string. + * + * @param {string} user + * @returns {string} Resource name string. + */ + irnProfilePath(user: string) { + return this.pathTemplates.irnProfilePathTemplate.render({ + user: user, + }); + } + + /** + * Parse the user from IrnProfile resource. + * + * @param {string} irnProfileName + * A fully-qualified path representing IrnProfile resource. + * @returns {string} A string representing the user. + */ + matchUserFromIrnProfileName(irnProfileName: string) { + return this.pathTemplates.irnProfilePathTemplate.match(irnProfileName).user; + } + + /** + * Return a fully-qualified pairedDevice resource name string. + * + * @param {string} user + * @param {string} paired_device + * @returns {string} Resource name string. + */ + pairedDevicePath(user: string, pairedDevice: string) { + return this.pathTemplates.pairedDevicePathTemplate.render({ + user: user, + paired_device: pairedDevice, + }); + } + + /** + * Parse the user from PairedDevice resource. + * + * @param {string} pairedDeviceName + * A fully-qualified path representing PairedDevice resource. + * @returns {string} A string representing the user. + */ + matchUserFromPairedDeviceName(pairedDeviceName: string) { + return this.pathTemplates.pairedDevicePathTemplate.match(pairedDeviceName) + .user; + } + + /** + * Parse the paired_device from PairedDevice resource. + * + * @param {string} pairedDeviceName + * A fully-qualified path representing PairedDevice resource. + * @returns {string} A string representing the paired_device. + */ + matchPairedDeviceFromPairedDeviceName(pairedDeviceName: string) { + return this.pathTemplates.pairedDevicePathTemplate.match(pairedDeviceName) + .paired_device; + } + /** * Return a fully-qualified profile resource name string. * * @param {string} user * @returns {string} Resource name string. */ - profilePath(user:string) { + profilePath(user: string) { return this.pathTemplates.profilePathTemplate.render({ user: user, }); @@ -2340,7 +2959,7 @@ export class DataPointsServiceClient { * @param {string} user * @returns {string} Resource name string. */ - settingsPath(user:string) { + settingsPath(user: string) { return this.pathTemplates.settingsPathTemplate.render({ user: user, }); @@ -2357,6 +2976,119 @@ export class DataPointsServiceClient { return this.pathTemplates.settingsPathTemplate.match(settingsName).user; } + /** + * Return a fully-qualified subscriber resource name string. + * + * @param {string} project + * @param {string} subscriber + * @returns {string} Resource name string. + */ + subscriberPath(project: string, subscriber: string) { + return this.pathTemplates.subscriberPathTemplate.render({ + project: project, + subscriber: subscriber, + }); + } + + /** + * Parse the project from Subscriber resource. + * + * @param {string} subscriberName + * A fully-qualified path representing Subscriber resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriberName(subscriberName: string) { + return this.pathTemplates.subscriberPathTemplate.match(subscriberName) + .project; + } + + /** + * Parse the subscriber from Subscriber resource. + * + * @param {string} subscriberName + * A fully-qualified path representing Subscriber resource. + * @returns {string} A string representing the subscriber. + */ + matchSubscriberFromSubscriberName(subscriberName: string) { + return this.pathTemplates.subscriberPathTemplate.match(subscriberName) + .subscriber; + } + + /** + * Return a fully-qualified subscription resource name string. + * + * @param {string} project + * @param {string} subscriber + * @param {string} subscription + * @returns {string} Resource name string. + */ + subscriptionPath(project: string, subscriber: string, subscription: string) { + return this.pathTemplates.subscriptionPathTemplate.render({ + project: project, + subscriber: subscriber, + subscription: subscription, + }); + } + + /** + * Parse the project from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .project; + } + + /** + * Parse the subscriber from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscriber. + */ + matchSubscriberFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .subscriber; + } + + /** + * Parse the subscription from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscription. + */ + matchSubscriptionFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .subscription; + } + + /** + * Return a fully-qualified user resource name string. + * + * @param {string} user + * @returns {string} Resource name string. + */ + userPath(user: string) { + return this.pathTemplates.userPathTemplate.render({ + user: user, + }); + } + + /** + * Parse the user from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the user. + */ + matchUserFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).user; + } + /** * Terminate the gRPC channel and close the client. * @@ -2365,7 +3097,7 @@ export class DataPointsServiceClient { */ close(): Promise { if (this.dataPointsServiceStub && !this._terminated) { - return this.dataPointsServiceStub.then(stub => { + return this.dataPointsServiceStub.then((stub) => { this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); @@ -2374,4 +3106,4 @@ export class DataPointsServiceClient { } return Promise.resolve(); } -} \ No newline at end of file +} diff --git a/packages/google-devicesandservices-health/src/v4/data_points_service_client_config.json b/packages/google-devicesandservices-health/src/v4/data_points_service_client_config.json index 115cf1e2cb7e..32c12f29f8ae 100644 --- a/packages/google-devicesandservices-health/src/v4/data_points_service_client_config.json +++ b/packages/google-devicesandservices-health/src/v4/data_points_service_client_config.json @@ -33,8 +33,9 @@ }, "methods": { "GetDataPoint": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "ListDataPoints": { "timeout_millis": 60000, diff --git a/packages/google-devicesandservices-health/src/v4/data_points_service_proto_list.json b/packages/google-devicesandservices-health/src/v4/data_points_service_proto_list.json index 83e0cabd2c8c..5acf20bc8e57 100644 --- a/packages/google-devicesandservices-health/src/v4/data_points_service_proto_list.json +++ b/packages/google-devicesandservices-health/src/v4/data_points_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/devicesandservices/health/v4/data_model.proto", "../../protos/google/devicesandservices/health/v4/data_points.proto", "../../protos/google/devicesandservices/health/v4/data_source.proto", + "../../protos/google/devicesandservices/health/v4/data_subscription_service.proto", "../../protos/google/devicesandservices/health/v4/health_profile.proto", + "../../protos/google/devicesandservices/health/v4/medical_device_info.proto", "../../protos/google/devicesandservices/health/v4/webhook_notification_cloud_log.proto" ] diff --git a/packages/google-devicesandservices-health/src/v4/data_subscription_service_client.ts b/packages/google-devicesandservices-health/src/v4/data_subscription_service_client.ts new file mode 100644 index 000000000000..a688bf564483 --- /dev/null +++ b/packages/google-devicesandservices-health/src/v4/data_subscription_service_client.ts @@ -0,0 +1,2437 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v4/data_subscription_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './data_subscription_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Data Subscription Service that allows clients (e.g., Fitbit 3P + * applications, internal Fitbit Services) to manage their subscriber endpoints. + * This service provides CRUD APIs for subscribers, + * and also offers functionalities for subscriber verification and statistics. + * @class + * @memberof v4 + */ +export class DataSubscriptionServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('health'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + dataSubscriptionServiceStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of DataSubscriptionServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new DataSubscriptionServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof DataSubscriptionServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'health.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + dataPointPathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/dataTypes/{data_type}/dataPoints/{data_point}', + ), + dataTypePathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/dataTypes/{data_type}', + ), + identityPathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/identity', + ), + irnProfilePathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/irnProfile', + ), + pairedDevicePathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/pairedDevices/{paired_device}', + ), + profilePathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/profile', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + settingsPathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/settings', + ), + subscriberPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscribers/{subscriber}', + ), + subscriptionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscribers/{subscriber}/subscriptions/{subscription}', + ), + userPathTemplate: new this._gaxModule.PathTemplate('users/{user}'), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listSubscribers: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'subscribers', + ), + listSubscriptions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'subscriptions', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = []; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createSubscriberResponse = protoFilesRoot.lookup( + '.google.devicesandservices.health.v4.Subscriber', + ) as gax.protobuf.Type; + const createSubscriberMetadata = protoFilesRoot.lookup( + '.google.devicesandservices.health.v4.CreateSubscriberMetadata', + ) as gax.protobuf.Type; + const updateSubscriberResponse = protoFilesRoot.lookup( + '.google.devicesandservices.health.v4.Subscriber', + ) as gax.protobuf.Type; + const updateSubscriberMetadata = protoFilesRoot.lookup( + '.google.devicesandservices.health.v4.UpdateSubscriberMetadata', + ) as gax.protobuf.Type; + const deleteSubscriberResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const deleteSubscriberMetadata = protoFilesRoot.lookup( + '.google.devicesandservices.health.v4.DeleteSubscriberMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createSubscriber: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSubscriberResponse.decode.bind(createSubscriberResponse), + createSubscriberMetadata.decode.bind(createSubscriberMetadata), + ), + updateSubscriber: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateSubscriberResponse.decode.bind(updateSubscriberResponse), + updateSubscriberMetadata.decode.bind(updateSubscriberMetadata), + ), + deleteSubscriber: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteSubscriberResponse.decode.bind(deleteSubscriberResponse), + deleteSubscriberMetadata.decode.bind(deleteSubscriberMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.devicesandservices.health.v4.DataSubscriptionService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.dataSubscriptionServiceStub) { + return this.dataSubscriptionServiceStub; + } + + // Put together the "service stub" for + // google.devicesandservices.health.v4.DataSubscriptionService. + this.dataSubscriptionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.devicesandservices.health.v4.DataSubscriptionService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.devicesandservices.health.v4 + .DataSubscriptionService, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const dataSubscriptionServiceStubMethods = [ + 'createSubscriber', + 'listSubscribers', + 'updateSubscriber', + 'deleteSubscriber', + 'createSubscription', + 'listSubscriptions', + 'updateSubscription', + 'deleteSubscription', + ]; + for (const methodName of dataSubscriptionServiceStubMethods) { + const callPromise = this.dataSubscriptionServiceStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.dataSubscriptionServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'health.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'health.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Creates a subscription for a specific user to a specific subscriber. + * This method requires the subscriber to have a `SubscriptionCreatePolicy` + * set to `MANUAL` for the given data types. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent subscriber. + * Format: projects/{project}/subscribers/{subscriber} + * The {subscriber} ID is user-settable (4-36 characters, matching + * /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or + * system-generated otherwise. + * @param {string} [request.subscriptionId] + * Optional. The {subscription_id} is user-settable + * (4-36 chars, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or system-generated + * otherwise. + * If provided, the ID must be unique within the parent subscriber. + * @param {google.devicesandservices.health.v4.CreateSubscriptionPayload} request.subscription + * Required. The subscription to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.Subscription|Subscription}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_subscription_service.create_subscription.js + * region_tag:health_v4_generated_DataSubscriptionService_CreateSubscription_async + */ + createSubscription( + request?: protos.google.devicesandservices.health.v4.ICreateSubscriptionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.ISubscription, + ( + | protos.google.devicesandservices.health.v4.ICreateSubscriptionRequest + | undefined + ), + {} | undefined, + ] + >; + createSubscription( + request: protos.google.devicesandservices.health.v4.ICreateSubscriptionRequest, + options: CallOptions, + callback: Callback< + protos.google.devicesandservices.health.v4.ISubscription, + | protos.google.devicesandservices.health.v4.ICreateSubscriptionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createSubscription( + request: protos.google.devicesandservices.health.v4.ICreateSubscriptionRequest, + callback: Callback< + protos.google.devicesandservices.health.v4.ISubscription, + | protos.google.devicesandservices.health.v4.ICreateSubscriptionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createSubscription( + request?: protos.google.devicesandservices.health.v4.ICreateSubscriptionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devicesandservices.health.v4.ISubscription, + | protos.google.devicesandservices.health.v4.ICreateSubscriptionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devicesandservices.health.v4.ISubscription, + | protos.google.devicesandservices.health.v4.ICreateSubscriptionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.ISubscription, + ( + | protos.google.devicesandservices.health.v4.ICreateSubscriptionRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('createSubscription request %j', request); + const wrappedCallback: + | Callback< + protos.google.devicesandservices.health.v4.ISubscription, + | protos.google.devicesandservices.health.v4.ICreateSubscriptionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSubscription response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSubscription(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.devicesandservices.health.v4.ISubscription, + ( + | protos.google.devicesandservices.health.v4.ICreateSubscriptionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createSubscription response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the data types for an existing user subscription. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.devicesandservices.health.v4.Subscription} request.subscription + * Required. The subscription to update. + * The subscription's `name` field is used to identify the subscription to + * update. Format: + * projects/{project}/subscribers/{subscriber}/subscriptions/{subscription} + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.Subscription|Subscription}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_subscription_service.update_subscription.js + * region_tag:health_v4_generated_DataSubscriptionService_UpdateSubscription_async + */ + updateSubscription( + request?: protos.google.devicesandservices.health.v4.IUpdateSubscriptionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.ISubscription, + ( + | protos.google.devicesandservices.health.v4.IUpdateSubscriptionRequest + | undefined + ), + {} | undefined, + ] + >; + updateSubscription( + request: protos.google.devicesandservices.health.v4.IUpdateSubscriptionRequest, + options: CallOptions, + callback: Callback< + protos.google.devicesandservices.health.v4.ISubscription, + | protos.google.devicesandservices.health.v4.IUpdateSubscriptionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateSubscription( + request: protos.google.devicesandservices.health.v4.IUpdateSubscriptionRequest, + callback: Callback< + protos.google.devicesandservices.health.v4.ISubscription, + | protos.google.devicesandservices.health.v4.IUpdateSubscriptionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateSubscription( + request?: protos.google.devicesandservices.health.v4.IUpdateSubscriptionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devicesandservices.health.v4.ISubscription, + | protos.google.devicesandservices.health.v4.IUpdateSubscriptionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devicesandservices.health.v4.ISubscription, + | protos.google.devicesandservices.health.v4.IUpdateSubscriptionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.ISubscription, + ( + | protos.google.devicesandservices.health.v4.IUpdateSubscriptionRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'subscription.name': request.subscription!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateSubscription request %j', request); + const wrappedCallback: + | Callback< + protos.google.devicesandservices.health.v4.ISubscription, + | protos.google.devicesandservices.health.v4.IUpdateSubscriptionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSubscription response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSubscription(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.devicesandservices.health.v4.ISubscription, + ( + | protos.google.devicesandservices.health.v4.IUpdateSubscriptionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateSubscription response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a specific user subscription, stopping notifications for this + * user to this subscriber. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the subscription to delete. + * Format: + * `projects/{project}/subscribers/{subscriber}/subscriptions/{subscription}` + * Example: + * `projects/my-project/subscribers/my-subscriber-123/subscriptions/my-subscription-456` + * The {subscriber} ID is user-settable (4-36 characters, matching + * /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or + * system-generated otherwise. The {subscription} ID is user-settable (4-36 + * characters, matching + * /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or system-generated if not provided + * during creation. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_subscription_service.delete_subscription.js + * region_tag:health_v4_generated_DataSubscriptionService_DeleteSubscription_async + */ + deleteSubscription( + request?: protos.google.devicesandservices.health.v4.IDeleteSubscriptionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.devicesandservices.health.v4.IDeleteSubscriptionRequest + | undefined + ), + {} | undefined, + ] + >; + deleteSubscription( + request: protos.google.devicesandservices.health.v4.IDeleteSubscriptionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.devicesandservices.health.v4.IDeleteSubscriptionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteSubscription( + request: protos.google.devicesandservices.health.v4.IDeleteSubscriptionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.devicesandservices.health.v4.IDeleteSubscriptionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteSubscription( + request?: protos.google.devicesandservices.health.v4.IDeleteSubscriptionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.devicesandservices.health.v4.IDeleteSubscriptionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.devicesandservices.health.v4.IDeleteSubscriptionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.devicesandservices.health.v4.IDeleteSubscriptionRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteSubscription request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.devicesandservices.health.v4.IDeleteSubscriptionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSubscription response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSubscription(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.devicesandservices.health.v4.IDeleteSubscriptionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteSubscription response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Registers a new subscriber endpoint to receive notifications. + * A subscriber represents an application or service that wishes to receive + * data change notifications for users who have granted consent. + * + * **Endpoint Verification:** + * For a subscriber to be successfully created, the provided `endpoint_uri` + * must be a valid HTTPS endpoint and must pass an automated verification + * check. The backend will send two HTTP POST requests to the `endpoint_uri`: + * + * 1. **Verification with Authorization:** + * * **Headers:** Includes `Content-Type: application/json` and + * `Authorization` (with the exact value from + * `CreateSubscriberPayload.endpoint_authorization.secret`). + * * **Body:** `{"type": "verification"}` + * * **Expected Response:** HTTP `201 Created`. + * + * 2. **Verification without Authorization:** + * * **Headers:** Includes `Content-Type: application/json`. The + * `Authorization` header is OMITTED. + * * **Body:** `{"type": "verification"}` + * * **Expected Response:** HTTP `401 Unauthorized` or `403 Forbidden`. + * + * Both tests must pass for the subscriber creation to succeed. If + * verification fails, the operation will not be completed and an error will + * be returned. This process ensures the endpoint is reachable and correctly + * validates the `Authorization` header. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this subscriber will be created. + * Format: projects/{project} + * Example: projects/my-project-123 + * @param {google.devicesandservices.health.v4.CreateSubscriberPayload} request.subscriber + * Required. The subscriber to create. + * @param {string} [request.subscriberId] + * Optional. The ID to use for the subscriber, which will become the final + * component of the subscriber's resource name. + * + * This value should be 4-36 characters, and valid characters + * are /[a-z]([a-z0-9-]{2,34}[a-z0-9])/. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_subscription_service.create_subscriber.js + * region_tag:health_v4_generated_DataSubscriptionService_CreateSubscriber_async + */ + createSubscriber( + request?: protos.google.devicesandservices.health.v4.ICreateSubscriberRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.ICreateSubscriberMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createSubscriber( + request: protos.google.devicesandservices.health.v4.ICreateSubscriberRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.ICreateSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createSubscriber( + request: protos.google.devicesandservices.health.v4.ICreateSubscriberRequest, + callback: Callback< + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.ICreateSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createSubscriber( + request?: protos.google.devicesandservices.health.v4.ICreateSubscriberRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.ICreateSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.ICreateSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.ICreateSubscriberMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.ICreateSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSubscriber response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSubscriber request %j', request); + return this.innerApiCalls + .createSubscriber(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.ICreateSubscriberMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createSubscriber response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createSubscriber()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_subscription_service.create_subscriber.js + * region_tag:health_v4_generated_DataSubscriptionService_CreateSubscriber_async + */ + async checkCreateSubscriberProgress( + name: string, + ): Promise< + LROperation< + protos.google.devicesandservices.health.v4.Subscriber, + protos.google.devicesandservices.health.v4.CreateSubscriberMetadata + > + > { + this._log.info('createSubscriber long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createSubscriber, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.devicesandservices.health.v4.Subscriber, + protos.google.devicesandservices.health.v4.CreateSubscriberMetadata + >; + } + /** + * Updates the configuration of an existing subscriber, such as the + * endpoint URI or the data types it's interested in. + * + * **Endpoint Verification:** + * If the `endpoint_uri` or `endpoint_authorization` field is included in the + * `update_mask`, the backend will re-verify the endpoint. The verification + * process is the same as described in `CreateSubscriber`: + * + * 1. **Verification with Authorization:** POST to the new or existing + * `endpoint_uri` with the new or existing `Authorization` secret. Expects + * HTTP `201 Created`. + * 2. **Verification without Authorization:** POST to the `endpoint_uri` + * without the `Authorization` header. Expects HTTP `401 Unauthorized` or + * `403 Forbidden`. + * + * Both tests must pass using the potentially updated values for the + * subscriber update to succeed. If verification fails, the update will not + * be applied, and an error will be returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.devicesandservices.health.v4.Subscriber} request.subscriber + * Required. The subscriber resource to update. Its 'name' field is mapped to + * the URI, and the value of the 'name' field should be of the form: + * "projects/{project}/subscribers/{subscriber_id}". + * The remaining fields of the Subscriber object represent the new values + * for the corresponding fields in the existing subscriber resource. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. A field mask that specifies which fields of the Subscriber + * message are to be updated. This allows for partial updates. Supported + * fields: + * - endpoint_uri + * - subscriber_configs + * - endpoint_authorization + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_subscription_service.update_subscriber.js + * region_tag:health_v4_generated_DataSubscriptionService_UpdateSubscriber_async + */ + updateSubscriber( + request?: protos.google.devicesandservices.health.v4.IUpdateSubscriberRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.IUpdateSubscriberMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateSubscriber( + request: protos.google.devicesandservices.health.v4.IUpdateSubscriberRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.IUpdateSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateSubscriber( + request: protos.google.devicesandservices.health.v4.IUpdateSubscriberRequest, + callback: Callback< + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.IUpdateSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateSubscriber( + request?: protos.google.devicesandservices.health.v4.IUpdateSubscriberRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.IUpdateSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.IUpdateSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.IUpdateSubscriberMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'subscriber.name': request.subscriber!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.IUpdateSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateSubscriber response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateSubscriber request %j', request); + return this.innerApiCalls + .updateSubscriber(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.IUpdateSubscriberMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateSubscriber response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateSubscriber()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_subscription_service.update_subscriber.js + * region_tag:health_v4_generated_DataSubscriptionService_UpdateSubscriber_async + */ + async checkUpdateSubscriberProgress( + name: string, + ): Promise< + LROperation< + protos.google.devicesandservices.health.v4.Subscriber, + protos.google.devicesandservices.health.v4.UpdateSubscriberMetadata + > + > { + this._log.info('updateSubscriber long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateSubscriber, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.devicesandservices.health.v4.Subscriber, + protos.google.devicesandservices.health.v4.UpdateSubscriberMetadata + >; + } + /** + * Deletes a subscriber registration. This will stop all notifications + * to the subscriber's endpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the subscriber to delete. + * Format: projects/{project}/subscribers/{subscriber} + * Example: projects/my-project/subscribers/my-subscriber-123 + * The {subscriber} ID is user-settable (4-36 characters, matching + * /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or system-generated if not provided + * during creation. + * @param {boolean} [request.force] + * Optional. If set to true, any child resources (e.g., subscriptions) will + * also be deleted. If false (default) and child resources exist, the request + * will fail. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_subscription_service.delete_subscriber.js + * region_tag:health_v4_generated_DataSubscriptionService_DeleteSubscriber_async + */ + deleteSubscriber( + request?: protos.google.devicesandservices.health.v4.IDeleteSubscriberRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.devicesandservices.health.v4.IDeleteSubscriberMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteSubscriber( + request: protos.google.devicesandservices.health.v4.IDeleteSubscriberRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.devicesandservices.health.v4.IDeleteSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteSubscriber( + request: protos.google.devicesandservices.health.v4.IDeleteSubscriberRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.devicesandservices.health.v4.IDeleteSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteSubscriber( + request?: protos.google.devicesandservices.health.v4.IDeleteSubscriberRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.devicesandservices.health.v4.IDeleteSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.devicesandservices.health.v4.IDeleteSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.devicesandservices.health.v4.IDeleteSubscriberMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.devicesandservices.health.v4.IDeleteSubscriberMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteSubscriber response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteSubscriber request %j', request); + return this.innerApiCalls + .deleteSubscriber(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.devicesandservices.health.v4.IDeleteSubscriberMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteSubscriber response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteSubscriber()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_subscription_service.delete_subscriber.js + * region_tag:health_v4_generated_DataSubscriptionService_DeleteSubscriber_async + */ + async checkDeleteSubscriberProgress( + name: string, + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.devicesandservices.health.v4.DeleteSubscriberMetadata + > + > { + this._log.info('deleteSubscriber long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteSubscriber, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.devicesandservices.health.v4.DeleteSubscriberMetadata + >; + } + /** + * Lists all subscribers registered within the owned Google Cloud Project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of subscribers. + * Format: projects/{project} + * @param {number} [request.pageSize] + * Optional. The maximum number of subscribers to return. The service may + * return fewer than this value. If unspecified, at most 50 subscribers will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSubscribers` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSubscribers` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.devicesandservices.health.v4.Subscriber|Subscriber}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSubscribersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSubscribers( + request?: protos.google.devicesandservices.health.v4.IListSubscribersRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.ISubscriber[], + protos.google.devicesandservices.health.v4.IListSubscribersRequest | null, + protos.google.devicesandservices.health.v4.IListSubscribersResponse, + ] + >; + listSubscribers( + request: protos.google.devicesandservices.health.v4.IListSubscribersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.devicesandservices.health.v4.IListSubscribersRequest, + | protos.google.devicesandservices.health.v4.IListSubscribersResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.ISubscriber + >, + ): void; + listSubscribers( + request: protos.google.devicesandservices.health.v4.IListSubscribersRequest, + callback: PaginationCallback< + protos.google.devicesandservices.health.v4.IListSubscribersRequest, + | protos.google.devicesandservices.health.v4.IListSubscribersResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.ISubscriber + >, + ): void; + listSubscribers( + request?: protos.google.devicesandservices.health.v4.IListSubscribersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.devicesandservices.health.v4.IListSubscribersRequest, + | protos.google.devicesandservices.health.v4.IListSubscribersResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.ISubscriber + >, + callback?: PaginationCallback< + protos.google.devicesandservices.health.v4.IListSubscribersRequest, + | protos.google.devicesandservices.health.v4.IListSubscribersResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.ISubscriber + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.ISubscriber[], + protos.google.devicesandservices.health.v4.IListSubscribersRequest | null, + protos.google.devicesandservices.health.v4.IListSubscribersResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.devicesandservices.health.v4.IListSubscribersRequest, + | protos.google.devicesandservices.health.v4.IListSubscribersResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.ISubscriber + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSubscribers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSubscribers request %j', request); + return this.innerApiCalls + .listSubscribers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.devicesandservices.health.v4.ISubscriber[], + protos.google.devicesandservices.health.v4.IListSubscribersRequest | null, + protos.google.devicesandservices.health.v4.IListSubscribersResponse, + ]) => { + this._log.info('listSubscribers values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSubscribers`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of subscribers. + * Format: projects/{project} + * @param {number} [request.pageSize] + * Optional. The maximum number of subscribers to return. The service may + * return fewer than this value. If unspecified, at most 50 subscribers will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSubscribers` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSubscribers` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.devicesandservices.health.v4.Subscriber|Subscriber} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSubscribersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSubscribersStream( + request?: protos.google.devicesandservices.health.v4.IListSubscribersRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSubscribers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSubscribers stream %j', request); + return this.descriptors.page.listSubscribers.createStream( + this.innerApiCalls.listSubscribers as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSubscribers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of subscribers. + * Format: projects/{project} + * @param {number} [request.pageSize] + * Optional. The maximum number of subscribers to return. The service may + * return fewer than this value. If unspecified, at most 50 subscribers will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSubscribers` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSubscribers` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.devicesandservices.health.v4.Subscriber|Subscriber}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_subscription_service.list_subscribers.js + * region_tag:health_v4_generated_DataSubscriptionService_ListSubscribers_async + */ + listSubscribersAsync( + request?: protos.google.devicesandservices.health.v4.IListSubscribersRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSubscribers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSubscribers iterate %j', request); + return this.descriptors.page.listSubscribers.asyncIterate( + this.innerApiCalls['listSubscribers'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists all active subscriptions for a given subscriber. This can be + * filtered, for example, by user or data type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent subscriber. + * Format: projects/{project}/subscribers/{subscriber} + * The {subscriber} ID is user-settable (4-36 characters, matching + * /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or + * system-generated otherwise. + * @param {string} [request.filter] + * Optional. A filter to apply to the list of subscriptions. + * The filter syntax is described in https://google.aip.dev/160. + * The filter can be applied to the following fields: + * - `user` + * - `data_type` + * + * The `user` identifier (e.g., `user1` in `users/user1`) refers to the public + * `healthUserId` + * + * Example: user = "users/user1" + * Example: user = "users/user1" OR user = "users/user2" + * Example: user = "users/user1" AND (data_type = "sleep" OR data_type = + * "weight") + * @param {number} [request.pageSize] + * Optional. The maximum number of subscriptions to return. The service may + * return fewer than this value. If unspecified, at most 50 subscriptions will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSubscriptions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSubscriptions` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.devicesandservices.health.v4.Subscription|Subscription}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSubscriptionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSubscriptions( + request?: protos.google.devicesandservices.health.v4.IListSubscriptionsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.ISubscription[], + protos.google.devicesandservices.health.v4.IListSubscriptionsRequest | null, + protos.google.devicesandservices.health.v4.IListSubscriptionsResponse, + ] + >; + listSubscriptions( + request: protos.google.devicesandservices.health.v4.IListSubscriptionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.devicesandservices.health.v4.IListSubscriptionsRequest, + | protos.google.devicesandservices.health.v4.IListSubscriptionsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.ISubscription + >, + ): void; + listSubscriptions( + request: protos.google.devicesandservices.health.v4.IListSubscriptionsRequest, + callback: PaginationCallback< + protos.google.devicesandservices.health.v4.IListSubscriptionsRequest, + | protos.google.devicesandservices.health.v4.IListSubscriptionsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.ISubscription + >, + ): void; + listSubscriptions( + request?: protos.google.devicesandservices.health.v4.IListSubscriptionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.devicesandservices.health.v4.IListSubscriptionsRequest, + | protos.google.devicesandservices.health.v4.IListSubscriptionsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.ISubscription + >, + callback?: PaginationCallback< + protos.google.devicesandservices.health.v4.IListSubscriptionsRequest, + | protos.google.devicesandservices.health.v4.IListSubscriptionsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.ISubscription + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.ISubscription[], + protos.google.devicesandservices.health.v4.IListSubscriptionsRequest | null, + protos.google.devicesandservices.health.v4.IListSubscriptionsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.devicesandservices.health.v4.IListSubscriptionsRequest, + | protos.google.devicesandservices.health.v4.IListSubscriptionsResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.ISubscription + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSubscriptions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSubscriptions request %j', request); + return this.innerApiCalls + .listSubscriptions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.devicesandservices.health.v4.ISubscription[], + protos.google.devicesandservices.health.v4.IListSubscriptionsRequest | null, + protos.google.devicesandservices.health.v4.IListSubscriptionsResponse, + ]) => { + this._log.info('listSubscriptions values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSubscriptions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent subscriber. + * Format: projects/{project}/subscribers/{subscriber} + * The {subscriber} ID is user-settable (4-36 characters, matching + * /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or + * system-generated otherwise. + * @param {string} [request.filter] + * Optional. A filter to apply to the list of subscriptions. + * The filter syntax is described in https://google.aip.dev/160. + * The filter can be applied to the following fields: + * - `user` + * - `data_type` + * + * The `user` identifier (e.g., `user1` in `users/user1`) refers to the public + * `healthUserId` + * + * Example: user = "users/user1" + * Example: user = "users/user1" OR user = "users/user2" + * Example: user = "users/user1" AND (data_type = "sleep" OR data_type = + * "weight") + * @param {number} [request.pageSize] + * Optional. The maximum number of subscriptions to return. The service may + * return fewer than this value. If unspecified, at most 50 subscriptions will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSubscriptions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSubscriptions` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.devicesandservices.health.v4.Subscription|Subscription} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSubscriptionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSubscriptionsStream( + request?: protos.google.devicesandservices.health.v4.IListSubscriptionsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSubscriptions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSubscriptions stream %j', request); + return this.descriptors.page.listSubscriptions.createStream( + this.innerApiCalls.listSubscriptions as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSubscriptions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent subscriber. + * Format: projects/{project}/subscribers/{subscriber} + * The {subscriber} ID is user-settable (4-36 characters, matching + * /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or + * system-generated otherwise. + * @param {string} [request.filter] + * Optional. A filter to apply to the list of subscriptions. + * The filter syntax is described in https://google.aip.dev/160. + * The filter can be applied to the following fields: + * - `user` + * - `data_type` + * + * The `user` identifier (e.g., `user1` in `users/user1`) refers to the public + * `healthUserId` + * + * Example: user = "users/user1" + * Example: user = "users/user1" OR user = "users/user2" + * Example: user = "users/user1" AND (data_type = "sleep" OR data_type = + * "weight") + * @param {number} [request.pageSize] + * Optional. The maximum number of subscriptions to return. The service may + * return fewer than this value. If unspecified, at most 50 subscriptions will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSubscriptions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSubscriptions` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.devicesandservices.health.v4.Subscription|Subscription}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v4/data_subscription_service.list_subscriptions.js + * region_tag:health_v4_generated_DataSubscriptionService_ListSubscriptions_async + */ + listSubscriptionsAsync( + request?: protos.google.devicesandservices.health.v4.IListSubscriptionsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSubscriptions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSubscriptions iterate %j', request); + return this.descriptors.page.listSubscriptions.asyncIterate( + this.innerApiCalls['listSubscriptions'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified dataPoint resource name string. + * + * @param {string} user + * @param {string} data_type + * @param {string} data_point + * @returns {string} Resource name string. + */ + dataPointPath(user: string, dataType: string, dataPoint: string) { + return this.pathTemplates.dataPointPathTemplate.render({ + user: user, + data_type: dataType, + data_point: dataPoint, + }); + } + + /** + * Parse the user from DataPoint resource. + * + * @param {string} dataPointName + * A fully-qualified path representing DataPoint resource. + * @returns {string} A string representing the user. + */ + matchUserFromDataPointName(dataPointName: string) { + return this.pathTemplates.dataPointPathTemplate.match(dataPointName).user; + } + + /** + * Parse the data_type from DataPoint resource. + * + * @param {string} dataPointName + * A fully-qualified path representing DataPoint resource. + * @returns {string} A string representing the data_type. + */ + matchDataTypeFromDataPointName(dataPointName: string) { + return this.pathTemplates.dataPointPathTemplate.match(dataPointName) + .data_type; + } + + /** + * Parse the data_point from DataPoint resource. + * + * @param {string} dataPointName + * A fully-qualified path representing DataPoint resource. + * @returns {string} A string representing the data_point. + */ + matchDataPointFromDataPointName(dataPointName: string) { + return this.pathTemplates.dataPointPathTemplate.match(dataPointName) + .data_point; + } + + /** + * Return a fully-qualified dataType resource name string. + * + * @param {string} user + * @param {string} data_type + * @returns {string} Resource name string. + */ + dataTypePath(user: string, dataType: string) { + return this.pathTemplates.dataTypePathTemplate.render({ + user: user, + data_type: dataType, + }); + } + + /** + * Parse the user from DataType resource. + * + * @param {string} dataTypeName + * A fully-qualified path representing DataType resource. + * @returns {string} A string representing the user. + */ + matchUserFromDataTypeName(dataTypeName: string) { + return this.pathTemplates.dataTypePathTemplate.match(dataTypeName).user; + } + + /** + * Parse the data_type from DataType resource. + * + * @param {string} dataTypeName + * A fully-qualified path representing DataType resource. + * @returns {string} A string representing the data_type. + */ + matchDataTypeFromDataTypeName(dataTypeName: string) { + return this.pathTemplates.dataTypePathTemplate.match(dataTypeName) + .data_type; + } + + /** + * Return a fully-qualified identity resource name string. + * + * @param {string} user + * @returns {string} Resource name string. + */ + identityPath(user: string) { + return this.pathTemplates.identityPathTemplate.render({ + user: user, + }); + } + + /** + * Parse the user from Identity resource. + * + * @param {string} identityName + * A fully-qualified path representing Identity resource. + * @returns {string} A string representing the user. + */ + matchUserFromIdentityName(identityName: string) { + return this.pathTemplates.identityPathTemplate.match(identityName).user; + } + + /** + * Return a fully-qualified irnProfile resource name string. + * + * @param {string} user + * @returns {string} Resource name string. + */ + irnProfilePath(user: string) { + return this.pathTemplates.irnProfilePathTemplate.render({ + user: user, + }); + } + + /** + * Parse the user from IrnProfile resource. + * + * @param {string} irnProfileName + * A fully-qualified path representing IrnProfile resource. + * @returns {string} A string representing the user. + */ + matchUserFromIrnProfileName(irnProfileName: string) { + return this.pathTemplates.irnProfilePathTemplate.match(irnProfileName).user; + } + + /** + * Return a fully-qualified pairedDevice resource name string. + * + * @param {string} user + * @param {string} paired_device + * @returns {string} Resource name string. + */ + pairedDevicePath(user: string, pairedDevice: string) { + return this.pathTemplates.pairedDevicePathTemplate.render({ + user: user, + paired_device: pairedDevice, + }); + } + + /** + * Parse the user from PairedDevice resource. + * + * @param {string} pairedDeviceName + * A fully-qualified path representing PairedDevice resource. + * @returns {string} A string representing the user. + */ + matchUserFromPairedDeviceName(pairedDeviceName: string) { + return this.pathTemplates.pairedDevicePathTemplate.match(pairedDeviceName) + .user; + } + + /** + * Parse the paired_device from PairedDevice resource. + * + * @param {string} pairedDeviceName + * A fully-qualified path representing PairedDevice resource. + * @returns {string} A string representing the paired_device. + */ + matchPairedDeviceFromPairedDeviceName(pairedDeviceName: string) { + return this.pathTemplates.pairedDevicePathTemplate.match(pairedDeviceName) + .paired_device; + } + + /** + * Return a fully-qualified profile resource name string. + * + * @param {string} user + * @returns {string} Resource name string. + */ + profilePath(user: string) { + return this.pathTemplates.profilePathTemplate.render({ + user: user, + }); + } + + /** + * Parse the user from Profile resource. + * + * @param {string} profileName + * A fully-qualified path representing Profile resource. + * @returns {string} A string representing the user. + */ + matchUserFromProfileName(profileName: string) { + return this.pathTemplates.profilePathTemplate.match(profileName).user; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified settings resource name string. + * + * @param {string} user + * @returns {string} Resource name string. + */ + settingsPath(user: string) { + return this.pathTemplates.settingsPathTemplate.render({ + user: user, + }); + } + + /** + * Parse the user from Settings resource. + * + * @param {string} settingsName + * A fully-qualified path representing Settings resource. + * @returns {string} A string representing the user. + */ + matchUserFromSettingsName(settingsName: string) { + return this.pathTemplates.settingsPathTemplate.match(settingsName).user; + } + + /** + * Return a fully-qualified subscriber resource name string. + * + * @param {string} project + * @param {string} subscriber + * @returns {string} Resource name string. + */ + subscriberPath(project: string, subscriber: string) { + return this.pathTemplates.subscriberPathTemplate.render({ + project: project, + subscriber: subscriber, + }); + } + + /** + * Parse the project from Subscriber resource. + * + * @param {string} subscriberName + * A fully-qualified path representing Subscriber resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriberName(subscriberName: string) { + return this.pathTemplates.subscriberPathTemplate.match(subscriberName) + .project; + } + + /** + * Parse the subscriber from Subscriber resource. + * + * @param {string} subscriberName + * A fully-qualified path representing Subscriber resource. + * @returns {string} A string representing the subscriber. + */ + matchSubscriberFromSubscriberName(subscriberName: string) { + return this.pathTemplates.subscriberPathTemplate.match(subscriberName) + .subscriber; + } + + /** + * Return a fully-qualified subscription resource name string. + * + * @param {string} project + * @param {string} subscriber + * @param {string} subscription + * @returns {string} Resource name string. + */ + subscriptionPath(project: string, subscriber: string, subscription: string) { + return this.pathTemplates.subscriptionPathTemplate.render({ + project: project, + subscriber: subscriber, + subscription: subscription, + }); + } + + /** + * Parse the project from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .project; + } + + /** + * Parse the subscriber from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscriber. + */ + matchSubscriberFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .subscriber; + } + + /** + * Parse the subscription from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscription. + */ + matchSubscriptionFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .subscription; + } + + /** + * Return a fully-qualified user resource name string. + * + * @param {string} user + * @returns {string} Resource name string. + */ + userPath(user: string) { + return this.pathTemplates.userPathTemplate.render({ + user: user, + }); + } + + /** + * Parse the user from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the user. + */ + matchUserFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).user; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.dataSubscriptionServiceStub && !this._terminated) { + return this.dataSubscriptionServiceStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-devicesandservices-health/src/v4/data_subscription_service_client_config.json b/packages/google-devicesandservices-health/src/v4/data_subscription_service_client_config.json new file mode 100644 index 000000000000..531dab9642f7 --- /dev/null +++ b/packages/google-devicesandservices-health/src/v4/data_subscription_service_client_config.json @@ -0,0 +1,78 @@ +{ + "interfaces": { + "google.devicesandservices.health.v4.DataSubscriptionService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateSubscriber": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSubscribers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateSubscriber": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSubscriber": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSubscriptions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-devicesandservices-health/src/v4/data_subscription_service_proto_list.json b/packages/google-devicesandservices-health/src/v4/data_subscription_service_proto_list.json new file mode 100644 index 000000000000..5acf20bc8e57 --- /dev/null +++ b/packages/google-devicesandservices-health/src/v4/data_subscription_service_proto_list.json @@ -0,0 +1,10 @@ +[ + "../../protos/google/devicesandservices/health/v4/data_coordinates.proto", + "../../protos/google/devicesandservices/health/v4/data_model.proto", + "../../protos/google/devicesandservices/health/v4/data_points.proto", + "../../protos/google/devicesandservices/health/v4/data_source.proto", + "../../protos/google/devicesandservices/health/v4/data_subscription_service.proto", + "../../protos/google/devicesandservices/health/v4/health_profile.proto", + "../../protos/google/devicesandservices/health/v4/medical_device_info.proto", + "../../protos/google/devicesandservices/health/v4/webhook_notification_cloud_log.proto" +] diff --git a/packages/google-devicesandservices-health/src/v4/gapic_metadata.json b/packages/google-devicesandservices-health/src/v4/gapic_metadata.json index d68477a6bf05..9f94d83bf075 100644 --- a/packages/google-devicesandservices-health/src/v4/gapic_metadata.json +++ b/packages/google-devicesandservices-health/src/v4/gapic_metadata.json @@ -121,6 +121,108 @@ } } }, + "DataSubscriptionService": { + "clients": { + "grpc": { + "libraryClient": "DataSubscriptionServiceClient", + "rpcs": { + "CreateSubscription": { + "methods": [ + "createSubscription" + ] + }, + "UpdateSubscription": { + "methods": [ + "updateSubscription" + ] + }, + "DeleteSubscription": { + "methods": [ + "deleteSubscription" + ] + }, + "CreateSubscriber": { + "methods": [ + "createSubscriber" + ] + }, + "UpdateSubscriber": { + "methods": [ + "updateSubscriber" + ] + }, + "DeleteSubscriber": { + "methods": [ + "deleteSubscriber" + ] + }, + "ListSubscribers": { + "methods": [ + "listSubscribers", + "listSubscribersStream", + "listSubscribersAsync" + ] + }, + "ListSubscriptions": { + "methods": [ + "listSubscriptions", + "listSubscriptionsStream", + "listSubscriptionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DataSubscriptionServiceClient", + "rpcs": { + "CreateSubscription": { + "methods": [ + "createSubscription" + ] + }, + "UpdateSubscription": { + "methods": [ + "updateSubscription" + ] + }, + "DeleteSubscription": { + "methods": [ + "deleteSubscription" + ] + }, + "CreateSubscriber": { + "methods": [ + "createSubscriber" + ] + }, + "UpdateSubscriber": { + "methods": [ + "updateSubscriber" + ] + }, + "DeleteSubscriber": { + "methods": [ + "deleteSubscriber" + ] + }, + "ListSubscribers": { + "methods": [ + "listSubscribers", + "listSubscribersStream", + "listSubscribersAsync" + ] + }, + "ListSubscriptions": { + "methods": [ + "listSubscriptions", + "listSubscriptionsStream", + "listSubscriptionsAsync" + ] + } + } + } + } + }, "HealthProfileService": { "clients": { "grpc": { @@ -150,6 +252,23 @@ "methods": [ "getIdentity" ] + }, + "GetIrnProfile": { + "methods": [ + "getIrnProfile" + ] + }, + "GetPairedDevice": { + "methods": [ + "getPairedDevice" + ] + }, + "ListPairedDevices": { + "methods": [ + "listPairedDevices", + "listPairedDevicesStream", + "listPairedDevicesAsync" + ] } } }, @@ -180,6 +299,23 @@ "methods": [ "getIdentity" ] + }, + "GetIrnProfile": { + "methods": [ + "getIrnProfile" + ] + }, + "GetPairedDevice": { + "methods": [ + "getPairedDevice" + ] + }, + "ListPairedDevices": { + "methods": [ + "listPairedDevices", + "listPairedDevicesStream", + "listPairedDevicesAsync" + ] } } } diff --git a/packages/google-devicesandservices-health/src/v4/health_profile_service_client.ts b/packages/google-devicesandservices-health/src/v4/health_profile_service_client.ts index d00ca6d2fbe3..ac3f69431630 100644 --- a/packages/google-devicesandservices-health/src/v4/health_profile_service_client.ts +++ b/packages/google-devicesandservices-health/src/v4/health_profile_service_client.ts @@ -18,11 +18,18 @@ /* global window */ import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; - +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import { Transform } from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -44,7 +51,7 @@ export class HealthProfileServiceClient { private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; + private _defaults: { [method: string]: gax.CallSettings }; private _universeDomain: string; private _servicePath: string; private _log = logging.log('health'); @@ -57,9 +64,9 @@ export class HealthProfileServiceClient { batching: {}, }; warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - healthProfileServiceStub?: Promise<{[name: string]: Function}>; + innerApiCalls: { [name: string]: Function }; + pathTemplates: { [name: string]: gax.PathTemplate }; + healthProfileServiceStub?: Promise<{ [name: string]: Function }>; /** * Construct an instance of HealthProfileServiceClient. @@ -100,21 +107,42 @@ export class HealthProfileServiceClient { * const client = new HealthProfileServiceClient({fallback: true}, gax); * ``` */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof HealthProfileServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'health.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); // Request numeric enum values if REST transport is used. opts.numericEnums = true; @@ -139,7 +167,7 @@ export class HealthProfileServiceClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; @@ -153,10 +181,7 @@ export class HealthProfileServiceClient { } // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -178,26 +203,53 @@ export class HealthProfileServiceClient { // Create useful helper objects for these. this.pathTemplates = { dataPointPathTemplate: new this._gaxModule.PathTemplate( - 'users/{user}/dataTypes/{data_type}/dataPoints/{data_point}' + 'users/{user}/dataTypes/{data_type}/dataPoints/{data_point}', ), dataTypePathTemplate: new this._gaxModule.PathTemplate( - 'users/{user}/dataTypes/{data_type}' + 'users/{user}/dataTypes/{data_type}', ), identityPathTemplate: new this._gaxModule.PathTemplate( - 'users/{user}/identity' + 'users/{user}/identity', + ), + irnProfilePathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/irnProfile', + ), + pairedDevicePathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/pairedDevices/{paired_device}', ), profilePathTemplate: new this._gaxModule.PathTemplate( - 'users/{user}/profile' + 'users/{user}/profile', ), settingsPathTemplate: new this._gaxModule.PathTemplate( - 'users/{user}/settings' + 'users/{user}/settings', + ), + subscriberPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscribers/{subscriber}', + ), + subscriptionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscribers/{subscriber}/subscriptions/{subscription}', + ), + userPathTemplate: new this._gaxModule.PathTemplate('users/{user}'), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listPairedDevices: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'pairedDevices', ), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.devicesandservices.health.v4.HealthProfileService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.devicesandservices.health.v4.HealthProfileService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code @@ -228,36 +280,50 @@ export class HealthProfileServiceClient { // Put together the "service stub" for // google.devicesandservices.health.v4.HealthProfileService. this.healthProfileServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.devicesandservices.health.v4.HealthProfileService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.devicesandservices.health.v4.HealthProfileService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.devicesandservices.health.v4.HealthProfileService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.devicesandservices.health.v4 + .HealthProfileService, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; // Iterate over each of the methods that the service provides // and create an API call method for each. - const healthProfileServiceStubMethods = - ['getProfile', 'updateProfile', 'getSettings', 'updateSettings', 'getIdentity']; + const healthProfileServiceStubMethods = [ + 'getProfile', + 'updateProfile', + 'getSettings', + 'updateSettings', + 'getIdentity', + 'getIrnProfile', + 'getPairedDevice', + 'listPairedDevices', + ]; for (const methodName of healthProfileServiceStubMethods) { const callPromise = this.healthProfileServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { throw err; - }); + }, + ); - const descriptor = - undefined; + const descriptor = this.descriptors.page[methodName] || undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], descriptor, - this._opts.fallback + this._opts.fallback, ); this.innerApiCalls[methodName] = apiCall; @@ -272,8 +338,14 @@ export class HealthProfileServiceClient { * @returns {string} The DNS address for this service. */ static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); } return 'health.googleapis.com'; } @@ -284,8 +356,14 @@ export class HealthProfileServiceClient { * @returns {string} The DNS address for this service. */ static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); } return 'health.googleapis.com'; } @@ -318,10 +396,12 @@ export class HealthProfileServiceClient { static get scopes() { return [ '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' + 'https://www.googleapis.com/auth/googlehealth.sleep.readonly', ]; } @@ -331,8 +411,9 @@ export class HealthProfileServiceClient { * Return the project ID used by this class. * @returns {Promise} A promise that resolves to string containing the project ID. */ - getProjectId(callback?: Callback): - Promise|void { + getProjectId( + callback?: Callback, + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -343,487 +424,1260 @@ export class HealthProfileServiceClient { // ------------------- // -- Service calls -- // ------------------- -/** - * Returns user Profile details. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Profile. - * Format: `users/me/profile`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.Profile|Profile}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v4/health_profile_service.get_profile.js - * region_tag:health_v4_generated_HealthProfileService_GetProfile_async - */ + /** + * Returns user Profile details. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Profile. + * Format: `users/me/profile`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.Profile|Profile}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v4/health_profile_service.get_profile.js + * region_tag:health_v4_generated_HealthProfileService_GetProfile_async + */ getProfile( - request?: protos.google.devicesandservices.health.v4.IGetProfileRequest, - options?: CallOptions): - Promise<[ - protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IGetProfileRequest|undefined, {}|undefined - ]>; + request?: protos.google.devicesandservices.health.v4.IGetProfileRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IProfile, + protos.google.devicesandservices.health.v4.IGetProfileRequest | undefined, + {} | undefined, + ] + >; getProfile( - request: protos.google.devicesandservices.health.v4.IGetProfileRequest, - options: CallOptions, - callback: Callback< - protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IGetProfileRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IGetProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.devicesandservices.health.v4.IProfile, + | protos.google.devicesandservices.health.v4.IGetProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): void; getProfile( - request: protos.google.devicesandservices.health.v4.IGetProfileRequest, - callback: Callback< - protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IGetProfileRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IGetProfileRequest, + callback: Callback< + protos.google.devicesandservices.health.v4.IProfile, + | protos.google.devicesandservices.health.v4.IGetProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): void; getProfile( - request?: protos.google.devicesandservices.health.v4.IGetProfileRequest, - optionsOrCallback?: CallOptions|Callback< + request?: protos.google.devicesandservices.health.v4.IGetProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IGetProfileRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IGetProfileRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IGetProfileRequest|undefined, {}|undefined - ]>|void { + | protos.google.devicesandservices.health.v4.IGetProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devicesandservices.health.v4.IProfile, + | protos.google.devicesandservices.health.v4.IGetProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IProfile, + protos.google.devicesandservices.health.v4.IGetProfileRequest | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; }); - this.initialize().catch(err => {throw err}); this._log.info('getProfile request %j', request); - const wrappedCallback: Callback< - protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IGetProfileRequest|null|undefined, - {}|null|undefined>|undefined = callback + const wrappedCallback: + | Callback< + protos.google.devicesandservices.health.v4.IProfile, + | protos.google.devicesandservices.health.v4.IGetProfileRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback ? (error, response, options, rawResponse) => { this._log.info('getProfile response %j', response); callback!(error, response, options, rawResponse); // We verified callback above. } : undefined; - return this.innerApiCalls.getProfile(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IGetProfileRequest|undefined, - {}|undefined - ]) => { - this._log.info('getProfile response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + return this.innerApiCalls + .getProfile(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.devicesandservices.health.v4.IProfile, + ( + | protos.google.devicesandservices.health.v4.IGetProfileRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getProfile response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); } throw error; }); } -/** - * Updates the user's profile details. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.devicesandservices.health.v4.Profile} request.profile - * Required. Profile details. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The list of fields to be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.Profile|Profile}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v4/health_profile_service.update_profile.js - * region_tag:health_v4_generated_HealthProfileService_UpdateProfile_async - */ + /** + * Updates the user's profile details. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.devicesandservices.health.v4.Profile} request.profile + * Required. Profile details. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.Profile|Profile}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v4/health_profile_service.update_profile.js + * region_tag:health_v4_generated_HealthProfileService_UpdateProfile_async + */ updateProfile( - request?: protos.google.devicesandservices.health.v4.IUpdateProfileRequest, - options?: CallOptions): - Promise<[ - protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IUpdateProfileRequest|undefined, {}|undefined - ]>; + request?: protos.google.devicesandservices.health.v4.IUpdateProfileRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IProfile, + ( + | protos.google.devicesandservices.health.v4.IUpdateProfileRequest + | undefined + ), + {} | undefined, + ] + >; updateProfile( - request: protos.google.devicesandservices.health.v4.IUpdateProfileRequest, - options: CallOptions, - callback: Callback< - protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IUpdateProfileRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IUpdateProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.devicesandservices.health.v4.IProfile, + | protos.google.devicesandservices.health.v4.IUpdateProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): void; updateProfile( - request: protos.google.devicesandservices.health.v4.IUpdateProfileRequest, - callback: Callback< - protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IUpdateProfileRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IUpdateProfileRequest, + callback: Callback< + protos.google.devicesandservices.health.v4.IProfile, + | protos.google.devicesandservices.health.v4.IUpdateProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): void; updateProfile( - request?: protos.google.devicesandservices.health.v4.IUpdateProfileRequest, - optionsOrCallback?: CallOptions|Callback< + request?: protos.google.devicesandservices.health.v4.IUpdateProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IUpdateProfileRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IUpdateProfileRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IUpdateProfileRequest|undefined, {}|undefined - ]>|void { + | protos.google.devicesandservices.health.v4.IUpdateProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devicesandservices.health.v4.IProfile, + | protos.google.devicesandservices.health.v4.IUpdateProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IProfile, + ( + | protos.google.devicesandservices.health.v4.IUpdateProfileRequest + | undefined + ), + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'profile.name': request.profile!.name ?? '', + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'profile.name': request.profile!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; }); - this.initialize().catch(err => {throw err}); this._log.info('updateProfile request %j', request); - const wrappedCallback: Callback< - protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IUpdateProfileRequest|null|undefined, - {}|null|undefined>|undefined = callback + const wrappedCallback: + | Callback< + protos.google.devicesandservices.health.v4.IProfile, + | protos.google.devicesandservices.health.v4.IUpdateProfileRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback ? (error, response, options, rawResponse) => { this._log.info('updateProfile response %j', response); callback!(error, response, options, rawResponse); // We verified callback above. } : undefined; - return this.innerApiCalls.updateProfile(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.devicesandservices.health.v4.IProfile, - protos.google.devicesandservices.health.v4.IUpdateProfileRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateProfile response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + return this.innerApiCalls + .updateProfile(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.devicesandservices.health.v4.IProfile, + ( + | protos.google.devicesandservices.health.v4.IUpdateProfileRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateProfile response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); } throw error; }); } -/** - * Returns user settings details. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Settings. - * Format: `users/me/settings`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.Settings|Settings}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v4/health_profile_service.get_settings.js - * region_tag:health_v4_generated_HealthProfileService_GetSettings_async - */ + /** + * Returns user settings details. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Settings. + * Format: `users/me/settings`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.Settings|Settings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v4/health_profile_service.get_settings.js + * region_tag:health_v4_generated_HealthProfileService_GetSettings_async + */ getSettings( - request?: protos.google.devicesandservices.health.v4.IGetSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IGetSettingsRequest|undefined, {}|undefined - ]>; + request?: protos.google.devicesandservices.health.v4.IGetSettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.ISettings, + ( + | protos.google.devicesandservices.health.v4.IGetSettingsRequest + | undefined + ), + {} | undefined, + ] + >; getSettings( - request: protos.google.devicesandservices.health.v4.IGetSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IGetSettingsRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IGetSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.devicesandservices.health.v4.ISettings, + | protos.google.devicesandservices.health.v4.IGetSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; getSettings( - request: protos.google.devicesandservices.health.v4.IGetSettingsRequest, - callback: Callback< - protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IGetSettingsRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IGetSettingsRequest, + callback: Callback< + protos.google.devicesandservices.health.v4.ISettings, + | protos.google.devicesandservices.health.v4.IGetSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; getSettings( - request?: protos.google.devicesandservices.health.v4.IGetSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IGetSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.devicesandservices.health.v4.IGetSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IGetSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IGetSettingsRequest|undefined, {}|undefined - ]>|void { + | protos.google.devicesandservices.health.v4.IGetSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devicesandservices.health.v4.ISettings, + | protos.google.devicesandservices.health.v4.IGetSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.ISettings, + ( + | protos.google.devicesandservices.health.v4.IGetSettingsRequest + | undefined + ), + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; }); - this.initialize().catch(err => {throw err}); this._log.info('getSettings request %j', request); - const wrappedCallback: Callback< - protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IGetSettingsRequest|null|undefined, - {}|null|undefined>|undefined = callback + const wrappedCallback: + | Callback< + protos.google.devicesandservices.health.v4.ISettings, + | protos.google.devicesandservices.health.v4.IGetSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback ? (error, response, options, rawResponse) => { this._log.info('getSettings response %j', response); callback!(error, response, options, rawResponse); // We verified callback above. } : undefined; - return this.innerApiCalls.getSettings(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IGetSettingsRequest|undefined, - {}|undefined - ]) => { - this._log.info('getSettings response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + return this.innerApiCalls + .getSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.devicesandservices.health.v4.ISettings, + ( + | protos.google.devicesandservices.health.v4.IGetSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getSettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); } throw error; }); } -/** - * Updates the user's settings details. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.devicesandservices.health.v4.Settings} request.settings - * Required. Settings details - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The list of fields to be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.Settings|Settings}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v4/health_profile_service.update_settings.js - * region_tag:health_v4_generated_HealthProfileService_UpdateSettings_async - */ + /** + * Updates the user's settings details. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.devicesandservices.health.v4.Settings} request.settings + * Required. Settings details + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.Settings|Settings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v4/health_profile_service.update_settings.js + * region_tag:health_v4_generated_HealthProfileService_UpdateSettings_async + */ updateSettings( - request?: protos.google.devicesandservices.health.v4.IUpdateSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IUpdateSettingsRequest|undefined, {}|undefined - ]>; + request?: protos.google.devicesandservices.health.v4.IUpdateSettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.ISettings, + ( + | protos.google.devicesandservices.health.v4.IUpdateSettingsRequest + | undefined + ), + {} | undefined, + ] + >; updateSettings( - request: protos.google.devicesandservices.health.v4.IUpdateSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IUpdateSettingsRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IUpdateSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.devicesandservices.health.v4.ISettings, + | protos.google.devicesandservices.health.v4.IUpdateSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; updateSettings( - request: protos.google.devicesandservices.health.v4.IUpdateSettingsRequest, - callback: Callback< - protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IUpdateSettingsRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IUpdateSettingsRequest, + callback: Callback< + protos.google.devicesandservices.health.v4.ISettings, + | protos.google.devicesandservices.health.v4.IUpdateSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; updateSettings( - request?: protos.google.devicesandservices.health.v4.IUpdateSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IUpdateSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.devicesandservices.health.v4.IUpdateSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IUpdateSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IUpdateSettingsRequest|undefined, {}|undefined - ]>|void { + | protos.google.devicesandservices.health.v4.IUpdateSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devicesandservices.health.v4.ISettings, + | protos.google.devicesandservices.health.v4.IUpdateSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.ISettings, + ( + | protos.google.devicesandservices.health.v4.IUpdateSettingsRequest + | undefined + ), + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'settings.name': request.settings!.name ?? '', + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'settings.name': request.settings!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; }); - this.initialize().catch(err => {throw err}); this._log.info('updateSettings request %j', request); - const wrappedCallback: Callback< - protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IUpdateSettingsRequest|null|undefined, - {}|null|undefined>|undefined = callback + const wrappedCallback: + | Callback< + protos.google.devicesandservices.health.v4.ISettings, + | protos.google.devicesandservices.health.v4.IUpdateSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback ? (error, response, options, rawResponse) => { this._log.info('updateSettings response %j', response); callback!(error, response, options, rawResponse); // We verified callback above. } : undefined; - return this.innerApiCalls.updateSettings(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.devicesandservices.health.v4.ISettings, - protos.google.devicesandservices.health.v4.IUpdateSettingsRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateSettings response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + return this.innerApiCalls + .updateSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.devicesandservices.health.v4.ISettings, + ( + | protos.google.devicesandservices.health.v4.IUpdateSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateSettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); } throw error; }); } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Identity. - * Format: `users/me/identity` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.Identity|Identity}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v4/health_profile_service.get_identity.js - * region_tag:health_v4_generated_HealthProfileService_GetIdentity_async - */ + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Identity. + * Format: `users/me/identity` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.Identity|Identity}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v4/health_profile_service.get_identity.js + * region_tag:health_v4_generated_HealthProfileService_GetIdentity_async + */ getIdentity( - request?: protos.google.devicesandservices.health.v4.IGetIdentityRequest, - options?: CallOptions): - Promise<[ - protos.google.devicesandservices.health.v4.IIdentity, - protos.google.devicesandservices.health.v4.IGetIdentityRequest|undefined, {}|undefined - ]>; + request?: protos.google.devicesandservices.health.v4.IGetIdentityRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IIdentity, + ( + | protos.google.devicesandservices.health.v4.IGetIdentityRequest + | undefined + ), + {} | undefined, + ] + >; getIdentity( - request: protos.google.devicesandservices.health.v4.IGetIdentityRequest, - options: CallOptions, - callback: Callback< - protos.google.devicesandservices.health.v4.IIdentity, - protos.google.devicesandservices.health.v4.IGetIdentityRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IGetIdentityRequest, + options: CallOptions, + callback: Callback< + protos.google.devicesandservices.health.v4.IIdentity, + | protos.google.devicesandservices.health.v4.IGetIdentityRequest + | null + | undefined, + {} | null | undefined + >, + ): void; getIdentity( - request: protos.google.devicesandservices.health.v4.IGetIdentityRequest, - callback: Callback< - protos.google.devicesandservices.health.v4.IIdentity, - protos.google.devicesandservices.health.v4.IGetIdentityRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.devicesandservices.health.v4.IGetIdentityRequest, + callback: Callback< + protos.google.devicesandservices.health.v4.IIdentity, + | protos.google.devicesandservices.health.v4.IGetIdentityRequest + | null + | undefined, + {} | null | undefined + >, + ): void; getIdentity( - request?: protos.google.devicesandservices.health.v4.IGetIdentityRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.devicesandservices.health.v4.IIdentity, - protos.google.devicesandservices.health.v4.IGetIdentityRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.devicesandservices.health.v4.IGetIdentityRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.devicesandservices.health.v4.IIdentity, - protos.google.devicesandservices.health.v4.IGetIdentityRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.devicesandservices.health.v4.IIdentity, - protos.google.devicesandservices.health.v4.IGetIdentityRequest|undefined, {}|undefined - ]>|void { + | protos.google.devicesandservices.health.v4.IGetIdentityRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devicesandservices.health.v4.IIdentity, + | protos.google.devicesandservices.health.v4.IGetIdentityRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IIdentity, + ( + | protos.google.devicesandservices.health.v4.IGetIdentityRequest + | undefined + ), + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; }); - this.initialize().catch(err => {throw err}); this._log.info('getIdentity request %j', request); - const wrappedCallback: Callback< - protos.google.devicesandservices.health.v4.IIdentity, - protos.google.devicesandservices.health.v4.IGetIdentityRequest|null|undefined, - {}|null|undefined>|undefined = callback + const wrappedCallback: + | Callback< + protos.google.devicesandservices.health.v4.IIdentity, + | protos.google.devicesandservices.health.v4.IGetIdentityRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback ? (error, response, options, rawResponse) => { this._log.info('getIdentity response %j', response); callback!(error, response, options, rawResponse); // We verified callback above. } : undefined; - return this.innerApiCalls.getIdentity(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.devicesandservices.health.v4.IIdentity, - protos.google.devicesandservices.health.v4.IGetIdentityRequest|undefined, - {}|undefined - ]) => { - this._log.info('getIdentity response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + return this.innerApiCalls + .getIdentity(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.devicesandservices.health.v4.IIdentity, + ( + | protos.google.devicesandservices.health.v4.IGetIdentityRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getIdentity response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns user's IRN Profile details. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.IrnProfile|IrnProfile}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v4/health_profile_service.get_irn_profile.js + * region_tag:health_v4_generated_HealthProfileService_GetIrnProfile_async + */ + getIrnProfile( + request?: protos.google.devicesandservices.health.v4.IGetIrnProfileRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IIrnProfile, + ( + | protos.google.devicesandservices.health.v4.IGetIrnProfileRequest + | undefined + ), + {} | undefined, + ] + >; + getIrnProfile( + request: protos.google.devicesandservices.health.v4.IGetIrnProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.devicesandservices.health.v4.IIrnProfile, + | protos.google.devicesandservices.health.v4.IGetIrnProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getIrnProfile( + request: protos.google.devicesandservices.health.v4.IGetIrnProfileRequest, + callback: Callback< + protos.google.devicesandservices.health.v4.IIrnProfile, + | protos.google.devicesandservices.health.v4.IGetIrnProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getIrnProfile( + request?: protos.google.devicesandservices.health.v4.IGetIrnProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devicesandservices.health.v4.IIrnProfile, + | protos.google.devicesandservices.health.v4.IGetIrnProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devicesandservices.health.v4.IIrnProfile, + | protos.google.devicesandservices.health.v4.IGetIrnProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IIrnProfile, + ( + | protos.google.devicesandservices.health.v4.IGetIrnProfileRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getIrnProfile request %j', request); + const wrappedCallback: + | Callback< + protos.google.devicesandservices.health.v4.IIrnProfile, + | protos.google.devicesandservices.health.v4.IGetIrnProfileRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIrnProfile response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getIrnProfile(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.devicesandservices.health.v4.IIrnProfile, + ( + | protos.google.devicesandservices.health.v4.IGetIrnProfileRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getIrnProfile response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns user's Device. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the device to retrieve. + * Format: users/{user}/devices/{device} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.devicesandservices.health.v4.PairedDevice|PairedDevice}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v4/health_profile_service.get_paired_device.js + * region_tag:health_v4_generated_HealthProfileService_GetPairedDevice_async + */ + getPairedDevice( + request?: protos.google.devicesandservices.health.v4.IGetPairedDeviceRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IPairedDevice, + ( + | protos.google.devicesandservices.health.v4.IGetPairedDeviceRequest + | undefined + ), + {} | undefined, + ] + >; + getPairedDevice( + request: protos.google.devicesandservices.health.v4.IGetPairedDeviceRequest, + options: CallOptions, + callback: Callback< + protos.google.devicesandservices.health.v4.IPairedDevice, + | protos.google.devicesandservices.health.v4.IGetPairedDeviceRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getPairedDevice( + request: protos.google.devicesandservices.health.v4.IGetPairedDeviceRequest, + callback: Callback< + protos.google.devicesandservices.health.v4.IPairedDevice, + | protos.google.devicesandservices.health.v4.IGetPairedDeviceRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getPairedDevice( + request?: protos.google.devicesandservices.health.v4.IGetPairedDeviceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devicesandservices.health.v4.IPairedDevice, + | protos.google.devicesandservices.health.v4.IGetPairedDeviceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devicesandservices.health.v4.IPairedDevice, + | protos.google.devicesandservices.health.v4.IGetPairedDeviceRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IPairedDevice, + ( + | protos.google.devicesandservices.health.v4.IGetPairedDeviceRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getPairedDevice request %j', request); + const wrappedCallback: + | Callback< + protos.google.devicesandservices.health.v4.IPairedDevice, + | protos.google.devicesandservices.health.v4.IGetPairedDeviceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPairedDevice response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPairedDevice(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.devicesandservices.health.v4.IPairedDevice, + ( + | protos.google.devicesandservices.health.v4.IGetPairedDeviceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPairedDevice response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); } throw error; }); } + /** + * Returns the user's list of paired 1P trackers and smartwatches. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of devices. + * Format: users/{user} + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.devicesandservices.health.v4.PairedDevice|PairedDevice}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPairedDevicesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPairedDevices( + request?: protos.google.devicesandservices.health.v4.IListPairedDevicesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IPairedDevice[], + protos.google.devicesandservices.health.v4.IListPairedDevicesRequest | null, + protos.google.devicesandservices.health.v4.IListPairedDevicesResponse, + ] + >; + listPairedDevices( + request: protos.google.devicesandservices.health.v4.IListPairedDevicesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.devicesandservices.health.v4.IListPairedDevicesRequest, + | protos.google.devicesandservices.health.v4.IListPairedDevicesResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IPairedDevice + >, + ): void; + listPairedDevices( + request: protos.google.devicesandservices.health.v4.IListPairedDevicesRequest, + callback: PaginationCallback< + protos.google.devicesandservices.health.v4.IListPairedDevicesRequest, + | protos.google.devicesandservices.health.v4.IListPairedDevicesResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IPairedDevice + >, + ): void; + listPairedDevices( + request?: protos.google.devicesandservices.health.v4.IListPairedDevicesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.devicesandservices.health.v4.IListPairedDevicesRequest, + | protos.google.devicesandservices.health.v4.IListPairedDevicesResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IPairedDevice + >, + callback?: PaginationCallback< + protos.google.devicesandservices.health.v4.IListPairedDevicesRequest, + | protos.google.devicesandservices.health.v4.IListPairedDevicesResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IPairedDevice + >, + ): Promise< + [ + protos.google.devicesandservices.health.v4.IPairedDevice[], + protos.google.devicesandservices.health.v4.IListPairedDevicesRequest | null, + protos.google.devicesandservices.health.v4.IListPairedDevicesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.devicesandservices.health.v4.IListPairedDevicesRequest, + | protos.google.devicesandservices.health.v4.IListPairedDevicesResponse + | null + | undefined, + protos.google.devicesandservices.health.v4.IPairedDevice + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPairedDevices values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPairedDevices request %j', request); + return this.innerApiCalls + .listPairedDevices(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.devicesandservices.health.v4.IPairedDevice[], + protos.google.devicesandservices.health.v4.IListPairedDevicesRequest | null, + protos.google.devicesandservices.health.v4.IListPairedDevicesResponse, + ]) => { + this._log.info('listPairedDevices values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listPairedDevices`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of devices. + * Format: users/{user} + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.devicesandservices.health.v4.PairedDevice|PairedDevice} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listPairedDevicesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPairedDevicesStream( + request?: protos.google.devicesandservices.health.v4.IListPairedDevicesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPairedDevices']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPairedDevices stream %j', request); + return this.descriptors.page.listPairedDevices.createStream( + this.innerApiCalls.listPairedDevices as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listPairedDevices`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of devices. + * Format: users/{user} + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.devicesandservices.health.v4.PairedDevice|PairedDevice}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v4/health_profile_service.list_paired_devices.js + * region_tag:health_v4_generated_HealthProfileService_ListPairedDevices_async + */ + listPairedDevicesAsync( + request?: protos.google.devicesandservices.health.v4.IListPairedDevicesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPairedDevices']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPairedDevices iterate %j', request); + return this.descriptors.page.listPairedDevices.asyncIterate( + this.innerApiCalls['listPairedDevices'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -836,7 +1690,7 @@ export class HealthProfileServiceClient { * @param {string} data_point * @returns {string} Resource name string. */ - dataPointPath(user:string,dataType:string,dataPoint:string) { + dataPointPath(user: string, dataType: string, dataPoint: string) { return this.pathTemplates.dataPointPathTemplate.render({ user: user, data_type: dataType, @@ -863,7 +1717,8 @@ export class HealthProfileServiceClient { * @returns {string} A string representing the data_type. */ matchDataTypeFromDataPointName(dataPointName: string) { - return this.pathTemplates.dataPointPathTemplate.match(dataPointName).data_type; + return this.pathTemplates.dataPointPathTemplate.match(dataPointName) + .data_type; } /** @@ -874,7 +1729,8 @@ export class HealthProfileServiceClient { * @returns {string} A string representing the data_point. */ matchDataPointFromDataPointName(dataPointName: string) { - return this.pathTemplates.dataPointPathTemplate.match(dataPointName).data_point; + return this.pathTemplates.dataPointPathTemplate.match(dataPointName) + .data_point; } /** @@ -884,7 +1740,7 @@ export class HealthProfileServiceClient { * @param {string} data_type * @returns {string} Resource name string. */ - dataTypePath(user:string,dataType:string) { + dataTypePath(user: string, dataType: string) { return this.pathTemplates.dataTypePathTemplate.render({ user: user, data_type: dataType, @@ -910,7 +1766,8 @@ export class HealthProfileServiceClient { * @returns {string} A string representing the data_type. */ matchDataTypeFromDataTypeName(dataTypeName: string) { - return this.pathTemplates.dataTypePathTemplate.match(dataTypeName).data_type; + return this.pathTemplates.dataTypePathTemplate.match(dataTypeName) + .data_type; } /** @@ -919,7 +1776,7 @@ export class HealthProfileServiceClient { * @param {string} user * @returns {string} Resource name string. */ - identityPath(user:string) { + identityPath(user: string) { return this.pathTemplates.identityPathTemplate.render({ user: user, }); @@ -936,13 +1793,74 @@ export class HealthProfileServiceClient { return this.pathTemplates.identityPathTemplate.match(identityName).user; } + /** + * Return a fully-qualified irnProfile resource name string. + * + * @param {string} user + * @returns {string} Resource name string. + */ + irnProfilePath(user: string) { + return this.pathTemplates.irnProfilePathTemplate.render({ + user: user, + }); + } + + /** + * Parse the user from IrnProfile resource. + * + * @param {string} irnProfileName + * A fully-qualified path representing IrnProfile resource. + * @returns {string} A string representing the user. + */ + matchUserFromIrnProfileName(irnProfileName: string) { + return this.pathTemplates.irnProfilePathTemplate.match(irnProfileName).user; + } + + /** + * Return a fully-qualified pairedDevice resource name string. + * + * @param {string} user + * @param {string} paired_device + * @returns {string} Resource name string. + */ + pairedDevicePath(user: string, pairedDevice: string) { + return this.pathTemplates.pairedDevicePathTemplate.render({ + user: user, + paired_device: pairedDevice, + }); + } + + /** + * Parse the user from PairedDevice resource. + * + * @param {string} pairedDeviceName + * A fully-qualified path representing PairedDevice resource. + * @returns {string} A string representing the user. + */ + matchUserFromPairedDeviceName(pairedDeviceName: string) { + return this.pathTemplates.pairedDevicePathTemplate.match(pairedDeviceName) + .user; + } + + /** + * Parse the paired_device from PairedDevice resource. + * + * @param {string} pairedDeviceName + * A fully-qualified path representing PairedDevice resource. + * @returns {string} A string representing the paired_device. + */ + matchPairedDeviceFromPairedDeviceName(pairedDeviceName: string) { + return this.pathTemplates.pairedDevicePathTemplate.match(pairedDeviceName) + .paired_device; + } + /** * Return a fully-qualified profile resource name string. * * @param {string} user * @returns {string} Resource name string. */ - profilePath(user:string) { + profilePath(user: string) { return this.pathTemplates.profilePathTemplate.render({ user: user, }); @@ -965,7 +1883,7 @@ export class HealthProfileServiceClient { * @param {string} user * @returns {string} Resource name string. */ - settingsPath(user:string) { + settingsPath(user: string) { return this.pathTemplates.settingsPathTemplate.render({ user: user, }); @@ -982,6 +1900,119 @@ export class HealthProfileServiceClient { return this.pathTemplates.settingsPathTemplate.match(settingsName).user; } + /** + * Return a fully-qualified subscriber resource name string. + * + * @param {string} project + * @param {string} subscriber + * @returns {string} Resource name string. + */ + subscriberPath(project: string, subscriber: string) { + return this.pathTemplates.subscriberPathTemplate.render({ + project: project, + subscriber: subscriber, + }); + } + + /** + * Parse the project from Subscriber resource. + * + * @param {string} subscriberName + * A fully-qualified path representing Subscriber resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriberName(subscriberName: string) { + return this.pathTemplates.subscriberPathTemplate.match(subscriberName) + .project; + } + + /** + * Parse the subscriber from Subscriber resource. + * + * @param {string} subscriberName + * A fully-qualified path representing Subscriber resource. + * @returns {string} A string representing the subscriber. + */ + matchSubscriberFromSubscriberName(subscriberName: string) { + return this.pathTemplates.subscriberPathTemplate.match(subscriberName) + .subscriber; + } + + /** + * Return a fully-qualified subscription resource name string. + * + * @param {string} project + * @param {string} subscriber + * @param {string} subscription + * @returns {string} Resource name string. + */ + subscriptionPath(project: string, subscriber: string, subscription: string) { + return this.pathTemplates.subscriptionPathTemplate.render({ + project: project, + subscriber: subscriber, + subscription: subscription, + }); + } + + /** + * Parse the project from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .project; + } + + /** + * Parse the subscriber from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscriber. + */ + matchSubscriberFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .subscriber; + } + + /** + * Parse the subscription from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscription. + */ + matchSubscriptionFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .subscription; + } + + /** + * Return a fully-qualified user resource name string. + * + * @param {string} user + * @returns {string} Resource name string. + */ + userPath(user: string) { + return this.pathTemplates.userPathTemplate.render({ + user: user, + }); + } + + /** + * Parse the user from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the user. + */ + matchUserFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).user; + } + /** * Terminate the gRPC channel and close the client. * @@ -990,7 +2021,7 @@ export class HealthProfileServiceClient { */ close(): Promise { if (this.healthProfileServiceStub && !this._terminated) { - return this.healthProfileServiceStub.then(stub => { + return this.healthProfileServiceStub.then((stub) => { this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); @@ -998,4 +2029,4 @@ export class HealthProfileServiceClient { } return Promise.resolve(); } -} \ No newline at end of file +} diff --git a/packages/google-devicesandservices-health/src/v4/health_profile_service_client_config.json b/packages/google-devicesandservices-health/src/v4/health_profile_service_client_config.json index 1bbf177e8922..61b7d4b4b449 100644 --- a/packages/google-devicesandservices-health/src/v4/health_profile_service_client_config.json +++ b/packages/google-devicesandservices-health/src/v4/health_profile_service_client_config.json @@ -53,8 +53,24 @@ "retry_params_name": "default" }, "GetIdentity": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetIrnProfile": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetPairedDevice": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListPairedDevices": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-devicesandservices-health/src/v4/health_profile_service_proto_list.json b/packages/google-devicesandservices-health/src/v4/health_profile_service_proto_list.json index 83e0cabd2c8c..5acf20bc8e57 100644 --- a/packages/google-devicesandservices-health/src/v4/health_profile_service_proto_list.json +++ b/packages/google-devicesandservices-health/src/v4/health_profile_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/devicesandservices/health/v4/data_model.proto", "../../protos/google/devicesandservices/health/v4/data_points.proto", "../../protos/google/devicesandservices/health/v4/data_source.proto", + "../../protos/google/devicesandservices/health/v4/data_subscription_service.proto", "../../protos/google/devicesandservices/health/v4/health_profile.proto", + "../../protos/google/devicesandservices/health/v4/medical_device_info.proto", "../../protos/google/devicesandservices/health/v4/webhook_notification_cloud_log.proto" ] diff --git a/packages/google-devicesandservices-health/src/v4/index.ts b/packages/google-devicesandservices-health/src/v4/index.ts index ff65b47ecbeb..999fa5214042 100644 --- a/packages/google-devicesandservices-health/src/v4/index.ts +++ b/packages/google-devicesandservices-health/src/v4/index.ts @@ -16,5 +16,6 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export {DataPointsServiceClient} from './data_points_service_client'; -export {HealthProfileServiceClient} from './health_profile_service_client'; +export { DataPointsServiceClient } from './data_points_service_client'; +export { DataSubscriptionServiceClient } from './data_subscription_service_client'; +export { HealthProfileServiceClient } from './health_profile_service_client'; diff --git a/packages/google-devicesandservices-health/system-test/fixtures/sample/src/index.js b/packages/google-devicesandservices-health/system-test/fixtures/sample/src/index.js index 9231dc3b7862..8633e2fe2ff2 100644 --- a/packages/google-devicesandservices-health/system-test/fixtures/sample/src/index.js +++ b/packages/google-devicesandservices-health/system-test/fixtures/sample/src/index.js @@ -22,6 +22,7 @@ const health = require('@google-cloud/health'); function main() { const dataPointsServiceClient = new health.DataPointsServiceClient(); + const dataSubscriptionServiceClient = new health.DataSubscriptionServiceClient(); const healthProfileServiceClient = new health.HealthProfileServiceClient(); } diff --git a/packages/google-devicesandservices-health/system-test/fixtures/sample/src/index.ts b/packages/google-devicesandservices-health/system-test/fixtures/sample/src/index.ts index 284ceef5762a..742222903e2a 100644 --- a/packages/google-devicesandservices-health/system-test/fixtures/sample/src/index.ts +++ b/packages/google-devicesandservices-health/system-test/fixtures/sample/src/index.ts @@ -16,13 +16,24 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {DataPointsServiceClient, HealthProfileServiceClient} from '@google-cloud/health'; +import { + DataPointsServiceClient, + DataSubscriptionServiceClient, + HealthProfileServiceClient, +} from '@google-cloud/health'; // check that the client class type name can be used function doStuffWithDataPointsServiceClient(client: DataPointsServiceClient) { client.close(); } -function doStuffWithHealthProfileServiceClient(client: HealthProfileServiceClient) { +function doStuffWithDataSubscriptionServiceClient( + client: DataSubscriptionServiceClient, +) { + client.close(); +} +function doStuffWithHealthProfileServiceClient( + client: HealthProfileServiceClient, +) { client.close(); } @@ -31,6 +42,9 @@ function main() { const dataPointsServiceClient = new DataPointsServiceClient(); doStuffWithDataPointsServiceClient(dataPointsServiceClient); // check that the client instance can be created + const dataSubscriptionServiceClient = new DataSubscriptionServiceClient(); + doStuffWithDataSubscriptionServiceClient(dataSubscriptionServiceClient); + // check that the client instance can be created const healthProfileServiceClient = new HealthProfileServiceClient(); doStuffWithHealthProfileServiceClient(healthProfileServiceClient); } diff --git a/packages/google-devicesandservices-health/system-test/install.ts b/packages/google-devicesandservices-health/system-test/install.ts index f66069aa3940..ccf167042d2e 100644 --- a/packages/google-devicesandservices-health/system-test/install.ts +++ b/packages/google-devicesandservices-health/system-test/install.ts @@ -16,34 +16,36 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; +import { packNTest } from 'pack-n-play'; +import { readFileSync } from 'fs'; +import { describe, it } from 'mocha'; describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { + it('TypeScript code', async function () { this.timeout(300000); const options = { packageDir: process.cwd(), sample: { description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts', + ).toString(), + }, }; await packNTest(options); }); - it('JavaScript code', async function() { + it('JavaScript code', async function () { this.timeout(300000); const options = { packageDir: process.cwd(), sample: { description: 'JavaScript user can use the library', - cjs: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } + cjs: readFileSync( + './system-test/fixtures/sample/src/index.js', + ).toString(), + }, }; await packNTest(options); }); - }); diff --git a/packages/google-devicesandservices-health/test/gapic_data_points_service_v4.ts b/packages/google-devicesandservices-health/test/gapic_data_points_service_v4.ts index f8cbaf7c9677..dbfd85eab0b2 100644 --- a/packages/google-devicesandservices-health/test/gapic_data_points_service_v4.ts +++ b/packages/google-devicesandservices-health/test/gapic_data_points_service_v4.ts @@ -19,1961 +19,2798 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; import * as datapointsserviceModule from '../src'; -import {PassThrough} from 'stream'; +import { PassThrough } from 'stream'; -import {protobuf, LROperation, operationsProtos} from 'google-gax'; +import { protobuf, LROperation, operationsProtos } from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); // eslint-disable-next-line @typescript-eslint/no-unused-vars function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; } function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; } function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); } -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); } -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); } -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); } -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); } - return sinon.stub().returns(mockStream); + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); } -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); } describe('v4.DataPointsServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'health.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = datapointsserviceModule.v4.DataPointsServiceClient.servicePath; - assert.strictEqual(servicePath, 'health.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = datapointsserviceModule.v4.DataPointsServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'health.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'health.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'health.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new datapointsserviceModule.v4.DataPointsServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'health.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new datapointsserviceModule.v4.DataPointsServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'health.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new datapointsserviceModule.v4.DataPointsServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = datapointsserviceModule.v4.DataPointsServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'health.googleapis.com'); + }); - it('should create a client with no option', () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient(); - assert(client); - }); + it('has universeDomain', () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); - it('should create a client with gRPC fallback', () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - fallback: true, - }); - assert(client); - }); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + datapointsserviceModule.v4.DataPointsServiceClient.servicePath; + assert.strictEqual(servicePath, 'health.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + datapointsserviceModule.v4.DataPointsServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'health.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'health.example.com'); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.dataPointsServiceStub, undefined); - await client.initialize(); - assert(client.dataPointsServiceStub); - }); + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'health.example.com'); + }); - it('has close method for the initialized client', done => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.dataPointsServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new datapointsserviceModule.v4.DataPointsServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'health.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new datapointsserviceModule.v4.DataPointsServiceClient( + { universeDomain: 'configured.example.com' }, + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'health.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new datapointsserviceModule.v4.DataPointsServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', }); + }); + }); - it('has close method for the non-initialized client', done => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.dataPointsServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); + it('has port', () => { + const port = datapointsserviceModule.v4.DataPointsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); + it('should create a client with no option', () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient(); + assert(client); + }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); + it('should create a client with gRPC fallback', () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + fallback: true, + }); + assert(client); }); - describe('getDataPoint', () => { - it('invokes getDataPoint without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetDataPointRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetDataPointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.DataPoint() - ); - client.innerApiCalls.getDataPoint = stubSimpleCall(expectedResponse); - const [response] = await client.getDataPoint(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDataPoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataPoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.dataPointsServiceStub, undefined); + await client.initialize(); + assert(client.dataPointsServiceStub); + }); - it('invokes getDataPoint without error using callback', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetDataPointRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetDataPointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.DataPoint() - ); - client.innerApiCalls.getDataPoint = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDataPoint( - request, - (err?: Error|null, result?: protos.google.devicesandservices.health.v4.IDataPoint|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDataPoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataPoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + it('has close method for the initialized client', (done) => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.dataPointsServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; }); + }); - it('invokes getDataPoint with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetDataPointRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetDataPointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataPoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataPoint(request), expectedError); - const actualRequest = (client.innerApiCalls.getDataPoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataPoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + it('has close method for the non-initialized client', (done) => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.dataPointsServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; }); + }); - it('invokes getDataPoint with closed client', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetDataPointRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetDataPointRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getDataPoint(request), expectedError); - }); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - describe('dailyRollUpDataPoints', () => { - it('invokes dailyRollUpDataPoints without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse() - ); - client.innerApiCalls.dailyRollUpDataPoints = stubSimpleCall(expectedResponse); - const [response] = await client.dailyRollUpDataPoints(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.dailyRollUpDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.dailyRollUpDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getDataPoint', () => { + it('invokes getDataPoint without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetDataPointRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetDataPointRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DataPoint(), + ); + client.innerApiCalls.getDataPoint = stubSimpleCall(expectedResponse); + const [response] = await client.getDataPoint(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataPoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataPoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes dailyRollUpDataPoints without error using callback', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse() - ); - client.innerApiCalls.dailyRollUpDataPoints = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.dailyRollUpDataPoints( - request, - (err?: Error|null, result?: protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.dailyRollUpDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.dailyRollUpDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes getDataPoint without error using callback', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetDataPointRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetDataPointRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DataPoint(), + ); + client.innerApiCalls.getDataPoint = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataPoint( + request, + ( + err?: Error | null, + result?: protos.google.devicesandservices.health.v4.IDataPoint | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataPoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataPoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes dailyRollUpDataPoints with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.dailyRollUpDataPoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.dailyRollUpDataPoints(request), expectedError); - const actualRequest = (client.innerApiCalls.dailyRollUpDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.dailyRollUpDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes getDataPoint with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetDataPointRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetDataPointRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataPoint = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getDataPoint(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDataPoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataPoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes dailyRollUpDataPoints with closed client', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.dailyRollUpDataPoints(request), expectedError); - }); + it('invokes getDataPoint with closed client', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetDataPointRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetDataPointRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getDataPoint(request), expectedError); + }); + }); + + describe('dailyRollUpDataPoints', () => { + it('invokes dailyRollUpDataPoints without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse(), + ); + client.innerApiCalls.dailyRollUpDataPoints = + stubSimpleCall(expectedResponse); + const [response] = await client.dailyRollUpDataPoints(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.dailyRollUpDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.dailyRollUpDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - describe('exportExerciseTcx', () => { - it('invokes exportExerciseTcx without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ExportExerciseTcxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ExportExerciseTcxRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ExportExerciseTcxResponse() - ); - client.innerApiCalls.exportExerciseTcx = stubSimpleCall(expectedResponse); - const [response] = await client.exportExerciseTcx(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.exportExerciseTcx as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportExerciseTcx as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes dailyRollUpDataPoints without error using callback', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse(), + ); + client.innerApiCalls.dailyRollUpDataPoints = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.dailyRollUpDataPoints( + request, + ( + err?: Error | null, + result?: protos.google.devicesandservices.health.v4.IDailyRollUpDataPointsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.dailyRollUpDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.dailyRollUpDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes exportExerciseTcx without error using callback', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ExportExerciseTcxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ExportExerciseTcxRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ExportExerciseTcxResponse() - ); - client.innerApiCalls.exportExerciseTcx = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportExerciseTcx( - request, - (err?: Error|null, result?: protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.exportExerciseTcx as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportExerciseTcx as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes dailyRollUpDataPoints with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.dailyRollUpDataPoints = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.dailyRollUpDataPoints(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.dailyRollUpDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.dailyRollUpDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes exportExerciseTcx with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ExportExerciseTcxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ExportExerciseTcxRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportExerciseTcx = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.exportExerciseTcx(request), expectedError); - const actualRequest = (client.innerApiCalls.exportExerciseTcx as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportExerciseTcx as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes dailyRollUpDataPoints with closed client', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.dailyRollUpDataPoints(request), + expectedError, + ); + }); + }); + + describe('exportExerciseTcx', () => { + it('invokes exportExerciseTcx without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ExportExerciseTcxRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ExportExerciseTcxRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ExportExerciseTcxResponse(), + ); + client.innerApiCalls.exportExerciseTcx = stubSimpleCall(expectedResponse); + const [response] = await client.exportExerciseTcx(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportExerciseTcx as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportExerciseTcx as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes exportExerciseTcx with closed client', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ExportExerciseTcxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ExportExerciseTcxRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.exportExerciseTcx(request), expectedError); - }); + it('invokes exportExerciseTcx without error using callback', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ExportExerciseTcxRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ExportExerciseTcxRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ExportExerciseTcxResponse(), + ); + client.innerApiCalls.exportExerciseTcx = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportExerciseTcx( + request, + ( + err?: Error | null, + result?: protos.google.devicesandservices.health.v4.IExportExerciseTcxResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportExerciseTcx as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportExerciseTcx as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - describe('createDataPoint', () => { - it('invokes createDataPoint without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.CreateDataPointRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.CreateDataPointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createDataPoint = stubLongRunningCall(expectedResponse); - const [operation] = await client.createDataPoint(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDataPoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataPoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes exportExerciseTcx with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ExportExerciseTcxRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ExportExerciseTcxRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportExerciseTcx = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.exportExerciseTcx(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportExerciseTcx as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportExerciseTcx as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes createDataPoint without error using callback', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.CreateDataPointRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.CreateDataPointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createDataPoint = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDataPoint( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDataPoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataPoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes exportExerciseTcx with closed client', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ExportExerciseTcxRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ExportExerciseTcxRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.exportExerciseTcx(request), expectedError); + }); + }); + + describe('createDataPoint', () => { + it('invokes createDataPoint without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.CreateDataPointRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.CreateDataPointRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createDataPoint = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createDataPoint(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataPoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataPoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes createDataPoint with call error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.CreateDataPointRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.CreateDataPointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataPoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createDataPoint(request), expectedError); - const actualRequest = (client.innerApiCalls.createDataPoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataPoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes createDataPoint without error using callback', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.CreateDataPointRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.CreateDataPointRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createDataPoint = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataPoint( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.ICreateDataPointOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.ICreateDataPointOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataPoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataPoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes createDataPoint with LRO error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.CreateDataPointRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.CreateDataPointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataPoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createDataPoint(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createDataPoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataPoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes createDataPoint with call error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.CreateDataPointRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.CreateDataPointRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataPoint = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createDataPoint(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDataPoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataPoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes checkCreateDataPointProgress without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateDataPointProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); + it('invokes createDataPoint with LRO error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.CreateDataPointRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.CreateDataPointRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataPoint = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createDataPoint(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createDataPoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataPoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes checkCreateDataPointProgress with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateDataPointProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); + it('invokes checkCreateDataPointProgress without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateDataPointProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - describe('updateDataPoint', () => { - it('invokes updateDataPoint without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.UpdateDataPointRequest() - ); - request.dataPoint ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.UpdateDataPointRequest', ['dataPoint', 'name']); - request.dataPoint.name = defaultValue1; - const expectedHeaderRequestParams = `data_point.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateDataPoint = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateDataPoint(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDataPoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataPoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes checkCreateDataPointProgress with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateDataPointProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateDataPoint', () => { + it('invokes updateDataPoint without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateDataPointRequest(), + ); + request.dataPoint ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateDataPointRequest', + ['dataPoint', 'name'], + ); + request.dataPoint.name = defaultValue1; + const expectedHeaderRequestParams = `data_point.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateDataPoint = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateDataPoint(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataPoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataPoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes updateDataPoint without error using callback', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.UpdateDataPointRequest() - ); - request.dataPoint ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.UpdateDataPointRequest', ['dataPoint', 'name']); - request.dataPoint.name = defaultValue1; - const expectedHeaderRequestParams = `data_point.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateDataPoint = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDataPoint( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDataPoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataPoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes updateDataPoint without error using callback', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateDataPointRequest(), + ); + request.dataPoint ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateDataPointRequest', + ['dataPoint', 'name'], + ); + request.dataPoint.name = defaultValue1; + const expectedHeaderRequestParams = `data_point.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateDataPoint = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataPoint( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.devicesandservices.health.v4.IDataPoint, + protos.google.devicesandservices.health.v4.IUpdateDataPointOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataPoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataPoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes updateDataPoint with call error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.UpdateDataPointRequest() - ); - request.dataPoint ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.UpdateDataPointRequest', ['dataPoint', 'name']); - request.dataPoint.name = defaultValue1; - const expectedHeaderRequestParams = `data_point.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataPoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateDataPoint(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDataPoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataPoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes updateDataPoint with call error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateDataPointRequest(), + ); + request.dataPoint ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateDataPointRequest', + ['dataPoint', 'name'], + ); + request.dataPoint.name = defaultValue1; + const expectedHeaderRequestParams = `data_point.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataPoint = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateDataPoint(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDataPoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataPoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes updateDataPoint with LRO error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.UpdateDataPointRequest() - ); - request.dataPoint ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.UpdateDataPointRequest', ['dataPoint', 'name']); - request.dataPoint.name = defaultValue1; - const expectedHeaderRequestParams = `data_point.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataPoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateDataPoint(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateDataPoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataPoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes updateDataPoint with LRO error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateDataPointRequest(), + ); + request.dataPoint ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateDataPointRequest', + ['dataPoint', 'name'], + ); + request.dataPoint.name = defaultValue1; + const expectedHeaderRequestParams = `data_point.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataPoint = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateDataPoint(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDataPoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataPoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes checkUpdateDataPointProgress without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateDataPointProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); + it('invokes checkUpdateDataPointProgress without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateDataPointProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); - it('invokes checkUpdateDataPointProgress with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateDataPointProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); + it('invokes checkUpdateDataPointProgress with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateDataPointProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('batchDeleteDataPoints', () => { + it('invokes batchDeleteDataPoints without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.batchDeleteDataPoints = + stubLongRunningCall(expectedResponse); + const [operation] = await client.batchDeleteDataPoints(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchDeleteDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - describe('batchDeleteDataPoints', () => { - it('invokes batchDeleteDataPoints without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchDeleteDataPoints = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchDeleteDataPoints(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchDeleteDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes batchDeleteDataPoints without error using callback', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.batchDeleteDataPoints = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchDeleteDataPoints( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse, + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsResponse, + protos.google.devicesandservices.health.v4.IBatchDeleteDataPointsOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchDeleteDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes batchDeleteDataPoints without error using callback', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchDeleteDataPoints = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchDeleteDataPoints( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchDeleteDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes batchDeleteDataPoints with call error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteDataPoints = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.batchDeleteDataPoints(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.batchDeleteDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes batchDeleteDataPoints with call error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchDeleteDataPoints = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchDeleteDataPoints(request), expectedError); - const actualRequest = (client.innerApiCalls.batchDeleteDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes batchDeleteDataPoints with LRO error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteDataPoints = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.batchDeleteDataPoints(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.batchDeleteDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes batchDeleteDataPoints with LRO error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchDeleteDataPoints = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchDeleteDataPoints(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.batchDeleteDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes checkBatchDeleteDataPointsProgress without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchDeleteDataPointsProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); - it('invokes checkBatchDeleteDataPointsProgress without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBatchDeleteDataPointsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); + it('invokes checkBatchDeleteDataPointsProgress with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkBatchDeleteDataPointsProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listDataPoints', () => { + it('invokes listDataPoints without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.DataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.DataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.DataPoint(), + ), + ]; + client.innerApiCalls.listDataPoints = stubSimpleCall(expectedResponse); + const [response] = await client.listDataPoints(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes checkBatchDeleteDataPointsProgress with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkBatchDeleteDataPointsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); + it('invokes listDataPoints without error using callback', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.DataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.DataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.DataPoint(), + ), + ]; + client.innerApiCalls.listDataPoints = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataPoints( + request, + ( + err?: Error | null, + result?: + | protos.google.devicesandservices.health.v4.IDataPoint[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - describe('listDataPoints', () => { - it('invokes listDataPoints without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ListDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ListDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.devicesandservices.health.v4.DataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.DataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.DataPoint()), - ]; - client.innerApiCalls.listDataPoints = stubSimpleCall(expectedResponse); - const [response] = await client.listDataPoints(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes listDataPoints with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataPoints = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listDataPoints(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes listDataPoints without error using callback', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ListDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ListDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.devicesandservices.health.v4.DataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.DataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.DataPoint()), - ]; - client.innerApiCalls.listDataPoints = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDataPoints( - request, - (err?: Error|null, result?: protos.google.devicesandservices.health.v4.IDataPoint[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes listDataPointsStream without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.DataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.DataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.DataPoint(), + ), + ]; + client.descriptors.page.listDataPoints.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDataPointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devicesandservices.health.v4.DataPoint[] = + []; + stream.on( + 'data', + (response: protos.google.devicesandservices.health.v4.DataPoint) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listDataPoints.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataPoints, request), + ); + assert( + (client.descriptors.page.listDataPoints.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); - it('invokes listDataPoints with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ListDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ListDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDataPoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDataPoints(request), expectedError); - const actualRequest = (client.innerApiCalls.listDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes listDataPointsStream with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataPoints.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataPointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devicesandservices.health.v4.DataPoint[] = + []; + stream.on( + 'data', + (response: protos.google.devicesandservices.health.v4.DataPoint) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDataPoints.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataPoints, request), + ); + assert( + (client.descriptors.page.listDataPoints.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); - it('invokes listDataPointsStream without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ListDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ListDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.devicesandservices.health.v4.DataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.DataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.DataPoint()), - ]; - client.descriptors.page.listDataPoints.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDataPointsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.devicesandservices.health.v4.DataPoint[] = []; - stream.on('data', (response: protos.google.devicesandservices.health.v4.DataPoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDataPoints.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataPoints, request)); - assert( - (client.descriptors.page.listDataPoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); + it('uses async iteration with listDataPoints without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.DataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.DataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.DataPoint(), + ), + ]; + client.descriptors.page.listDataPoints.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.devicesandservices.health.v4.IDataPoint[] = + []; + const iterable = client.listDataPointsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataPoints.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listDataPoints.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); - it('invokes listDataPointsStream with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ListDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ListDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDataPoints.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDataPointsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.devicesandservices.health.v4.DataPoint[] = []; - stream.on('data', (response: protos.google.devicesandservices.health.v4.DataPoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDataPoints.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataPoints, request)); - assert( - (client.descriptors.page.listDataPoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); + it('uses async iteration with listDataPoints with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataPoints.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataPointsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.devicesandservices.health.v4.IDataPoint[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataPoints.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listDataPoints.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('reconcileDataPoints', () => { + it('invokes reconcileDataPoints without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconcileDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ReconcileDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconciledDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconciledDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconciledDataPoint(), + ), + ]; + client.innerApiCalls.reconcileDataPoints = + stubSimpleCall(expectedResponse); + const [response] = await client.reconcileDataPoints(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.reconcileDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.reconcileDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('uses async iteration with listDataPoints without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ListDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ListDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.devicesandservices.health.v4.DataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.DataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.DataPoint()), - ]; - client.descriptors.page.listDataPoints.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.devicesandservices.health.v4.IDataPoint[] = []; - const iterable = client.listDataPointsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); + it('invokes reconcileDataPoints without error using callback', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconcileDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ReconcileDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconciledDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconciledDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconciledDataPoint(), + ), + ]; + client.innerApiCalls.reconcileDataPoints = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.reconcileDataPoints( + request, + ( + err?: Error | null, + result?: + | protos.google.devicesandservices.health.v4.IReconciledDataPoint[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDataPoints.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDataPoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDataPoints with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ListDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ListDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDataPoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDataPointsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.devicesandservices.health.v4.IDataPoint[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDataPoints.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDataPoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.reconcileDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.reconcileDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - describe('reconcileDataPoints', () => { - it('invokes reconcileDataPoints without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ReconcileDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ReconcileDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.devicesandservices.health.v4.ReconciledDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.ReconciledDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.ReconciledDataPoint()), - ]; - client.innerApiCalls.reconcileDataPoints = stubSimpleCall(expectedResponse); - const [response] = await client.reconcileDataPoints(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.reconcileDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.reconcileDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes reconcileDataPoints with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconcileDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ReconcileDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.reconcileDataPoints = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.reconcileDataPoints(request), expectedError); + const actualRequest = ( + client.innerApiCalls.reconcileDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.reconcileDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('invokes reconcileDataPoints without error using callback', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ReconcileDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ReconcileDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.devicesandservices.health.v4.ReconciledDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.ReconciledDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.ReconciledDataPoint()), - ]; - client.innerApiCalls.reconcileDataPoints = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.reconcileDataPoints( - request, - (err?: Error|null, result?: protos.google.devicesandservices.health.v4.IReconciledDataPoint[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.reconcileDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.reconcileDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes reconcileDataPointsStream without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconcileDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ReconcileDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconciledDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconciledDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconciledDataPoint(), + ), + ]; + client.descriptors.page.reconcileDataPoints.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.reconcileDataPointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devicesandservices.health.v4.ReconciledDataPoint[] = + []; + stream.on( + 'data', + ( + response: protos.google.devicesandservices.health.v4.ReconciledDataPoint, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.reconcileDataPoints.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.reconcileDataPoints, request), + ); + assert( + (client.descriptors.page.reconcileDataPoints.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); - it('invokes reconcileDataPoints with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ReconcileDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ReconcileDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.reconcileDataPoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.reconcileDataPoints(request), expectedError); - const actualRequest = (client.innerApiCalls.reconcileDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.reconcileDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes reconcileDataPointsStream with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconcileDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ReconcileDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.reconcileDataPoints.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.reconcileDataPointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devicesandservices.health.v4.ReconciledDataPoint[] = + []; + stream.on( + 'data', + ( + response: protos.google.devicesandservices.health.v4.ReconciledDataPoint, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.reconcileDataPoints.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.reconcileDataPoints, request), + ); + assert( + (client.descriptors.page.reconcileDataPoints.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); - it('invokes reconcileDataPointsStream without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ReconcileDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ReconcileDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.devicesandservices.health.v4.ReconciledDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.ReconciledDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.ReconciledDataPoint()), - ]; - client.descriptors.page.reconcileDataPoints.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.reconcileDataPointsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.devicesandservices.health.v4.ReconciledDataPoint[] = []; - stream.on('data', (response: protos.google.devicesandservices.health.v4.ReconciledDataPoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.reconcileDataPoints.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.reconcileDataPoints, request)); - assert( - (client.descriptors.page.reconcileDataPoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); + it('uses async iteration with reconcileDataPoints without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconcileDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ReconcileDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconciledDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconciledDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconciledDataPoint(), + ), + ]; + client.descriptors.page.reconcileDataPoints.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.devicesandservices.health.v4.IReconciledDataPoint[] = + []; + const iterable = client.reconcileDataPointsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.reconcileDataPoints.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.reconcileDataPoints.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); - it('invokes reconcileDataPointsStream with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ReconcileDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ReconcileDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.reconcileDataPoints.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.reconcileDataPointsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.devicesandservices.health.v4.ReconciledDataPoint[] = []; - stream.on('data', (response: protos.google.devicesandservices.health.v4.ReconciledDataPoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.reconcileDataPoints.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.reconcileDataPoints, request)); - assert( - (client.descriptors.page.reconcileDataPoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); + it('uses async iteration with reconcileDataPoints with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ReconcileDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ReconcileDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.reconcileDataPoints.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.reconcileDataPointsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.devicesandservices.health.v4.IReconciledDataPoint[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.reconcileDataPoints.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.reconcileDataPoints.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('rollUpDataPoints', () => { + it('invokes rollUpDataPoints without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollUpDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.RollUpDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollupDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollupDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollupDataPoint(), + ), + ]; + client.innerApiCalls.rollUpDataPoints = stubSimpleCall(expectedResponse); + const [response] = await client.rollUpDataPoints(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rollUpDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollUpDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('uses async iteration with reconcileDataPoints without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ReconcileDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ReconcileDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.devicesandservices.health.v4.ReconciledDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.ReconciledDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.ReconciledDataPoint()), - ]; - client.descriptors.page.reconcileDataPoints.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.devicesandservices.health.v4.IReconciledDataPoint[] = []; - const iterable = client.reconcileDataPointsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); + it('invokes rollUpDataPoints without error using callback', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollUpDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.RollUpDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollupDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollupDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollupDataPoint(), + ), + ]; + client.innerApiCalls.rollUpDataPoints = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollUpDataPoints( + request, + ( + err?: Error | null, + result?: + | protos.google.devicesandservices.health.v4.IRollupDataPoint[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.reconcileDataPoints.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.reconcileDataPoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rollUpDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollUpDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('uses async iteration with reconcileDataPoints with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.ReconcileDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.ReconcileDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.reconcileDataPoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.reconcileDataPointsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.devicesandservices.health.v4.IReconciledDataPoint[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.reconcileDataPoints.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.reconcileDataPoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); + it('invokes rollUpDataPoints with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollUpDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.RollUpDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollUpDataPoints = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.rollUpDataPoints(request), expectedError); + const actualRequest = ( + client.innerApiCalls.rollUpDataPoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollUpDataPoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - describe('rollUpDataPoints', () => { - it('invokes rollUpDataPoints without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.RollUpDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.RollUpDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.devicesandservices.health.v4.RollupDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.RollupDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.RollupDataPoint()), - ]; - client.innerApiCalls.rollUpDataPoints = stubSimpleCall(expectedResponse); - const [response] = await client.rollUpDataPoints(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollUpDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollUpDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes rollUpDataPointsStream without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollUpDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.RollUpDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollupDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollupDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollupDataPoint(), + ), + ]; + client.descriptors.page.rollUpDataPoints.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.rollUpDataPointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devicesandservices.health.v4.RollupDataPoint[] = + []; + stream.on( + 'data', + ( + response: protos.google.devicesandservices.health.v4.RollupDataPoint, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.rollUpDataPoints.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.rollUpDataPoints, request), + ); + assert( + (client.descriptors.page.rollUpDataPoints.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); - it('invokes rollUpDataPoints without error using callback', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.RollUpDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.RollUpDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.devicesandservices.health.v4.RollupDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.RollupDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.RollupDataPoint()), - ]; - client.innerApiCalls.rollUpDataPoints = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.rollUpDataPoints( - request, - (err?: Error|null, result?: protos.google.devicesandservices.health.v4.IRollupDataPoint[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollUpDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollUpDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('invokes rollUpDataPointsStream with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollUpDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.RollUpDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.rollUpDataPoints.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.rollUpDataPointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devicesandservices.health.v4.RollupDataPoint[] = + []; + stream.on( + 'data', + ( + response: protos.google.devicesandservices.health.v4.RollupDataPoint, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.rollUpDataPoints.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.rollUpDataPoints, request), + ); + assert( + (client.descriptors.page.rollUpDataPoints.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); - it('invokes rollUpDataPoints with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.RollUpDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.RollUpDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.rollUpDataPoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rollUpDataPoints(request), expectedError); - const actualRequest = (client.innerApiCalls.rollUpDataPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollUpDataPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); + it('uses async iteration with rollUpDataPoints without error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollUpDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.RollUpDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollupDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollupDataPoint(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollupDataPoint(), + ), + ]; + client.descriptors.page.rollUpDataPoints.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.devicesandservices.health.v4.IRollupDataPoint[] = + []; + const iterable = client.rollUpDataPointsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.rollUpDataPoints.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.rollUpDataPoints.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); - it('invokes rollUpDataPointsStream without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.RollUpDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.RollUpDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.devicesandservices.health.v4.RollupDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.RollupDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.RollupDataPoint()), - ]; - client.descriptors.page.rollUpDataPoints.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.rollUpDataPointsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.devicesandservices.health.v4.RollupDataPoint[] = []; - stream.on('data', (response: protos.google.devicesandservices.health.v4.RollupDataPoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.rollUpDataPoints.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.rollUpDataPoints, request)); - assert( - (client.descriptors.page.rollUpDataPoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); + it('uses async iteration with rollUpDataPoints with error', async () => { + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.RollUpDataPointsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.RollUpDataPointsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.rollUpDataPoints.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.rollUpDataPointsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.devicesandservices.health.v4.IRollupDataPoint[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.rollUpDataPoints.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.rollUpDataPoints.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('Path templates', () => { + describe('dataPoint', async () => { + const fakePath = '/rendered/path/dataPoint'; + const expectedParameters = { + user: 'userValue', + data_type: 'dataTypeValue', + data_point: 'dataPointValue', + }; + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dataPointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataPointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataPointPath', () => { + const result = client.dataPointPath( + 'userValue', + 'dataTypeValue', + 'dataPointValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataPointPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromDataPointName', () => { + const result = client.matchUserFromDataPointName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.dataPointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataTypeFromDataPointName', () => { + const result = client.matchDataTypeFromDataPointName(fakePath); + assert.strictEqual(result, 'dataTypeValue'); + assert( + (client.pathTemplates.dataPointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataPointFromDataPointName', () => { + const result = client.matchDataPointFromDataPointName(fakePath); + assert.strictEqual(result, 'dataPointValue'); + assert( + (client.pathTemplates.dataPointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); - it('invokes rollUpDataPointsStream with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.RollUpDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.RollUpDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.rollUpDataPoints.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.rollUpDataPointsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.devicesandservices.health.v4.RollupDataPoint[] = []; - stream.on('data', (response: protos.google.devicesandservices.health.v4.RollupDataPoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.rollUpDataPoints.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.rollUpDataPoints, request)); - assert( - (client.descriptors.page.rollUpDataPoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); + describe('dataType', async () => { + const fakePath = '/rendered/path/dataType'; + const expectedParameters = { + user: 'userValue', + data_type: 'dataTypeValue', + }; + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dataTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataTypePath', () => { + const result = client.dataTypePath('userValue', 'dataTypeValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromDataTypeName', () => { + const result = client.matchUserFromDataTypeName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.dataTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataTypeFromDataTypeName', () => { + const result = client.matchDataTypeFromDataTypeName(fakePath); + assert.strictEqual(result, 'dataTypeValue'); + assert( + (client.pathTemplates.dataTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); - it('uses async iteration with rollUpDataPoints without error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.RollUpDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.RollUpDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.devicesandservices.health.v4.RollupDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.RollupDataPoint()), - generateSampleMessage(new protos.google.devicesandservices.health.v4.RollupDataPoint()), - ]; - client.descriptors.page.rollUpDataPoints.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.devicesandservices.health.v4.IRollupDataPoint[] = []; - const iterable = client.rollUpDataPointsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.rollUpDataPoints.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.rollUpDataPoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); + describe('identity', async () => { + const fakePath = '/rendered/path/identity'; + const expectedParameters = { + user: 'userValue', + }; + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.identityPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.identityPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('identityPath', () => { + const result = client.identityPath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.identityPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromIdentityName', () => { + const result = client.matchUserFromIdentityName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.identityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); - it('uses async iteration with rollUpDataPoints with error', async () => { - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.RollUpDataPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.RollUpDataPointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.rollUpDataPoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.rollUpDataPointsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.devicesandservices.health.v4.IRollupDataPoint[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.rollUpDataPoints.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.rollUpDataPoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); + describe('irnProfile', async () => { + const fakePath = '/rendered/path/irnProfile'; + const expectedParameters = { + user: 'userValue', + }; + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.irnProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.irnProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('irnProfilePath', () => { + const result = client.irnProfilePath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.irnProfilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromIrnProfileName', () => { + const result = client.matchUserFromIrnProfileName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.irnProfilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); }); - describe('Path templates', () => { - - describe('dataPoint', async () => { - const fakePath = "/rendered/path/dataPoint"; - const expectedParameters = { - user: "userValue", - data_type: "dataTypeValue", - data_point: "dataPointValue", - }; - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.dataPointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataPointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataPointPath', () => { - const result = client.dataPointPath("userValue", "dataTypeValue", "dataPointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataPointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchUserFromDataPointName', () => { - const result = client.matchUserFromDataPointName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.dataPointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataTypeFromDataPointName', () => { - const result = client.matchDataTypeFromDataPointName(fakePath); - assert.strictEqual(result, "dataTypeValue"); - assert((client.pathTemplates.dataPointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataPointFromDataPointName', () => { - const result = client.matchDataPointFromDataPointName(fakePath); - assert.strictEqual(result, "dataPointValue"); - assert((client.pathTemplates.dataPointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + describe('pairedDevice', async () => { + const fakePath = '/rendered/path/pairedDevice'; + const expectedParameters = { + user: 'userValue', + paired_device: 'pairedDeviceValue', + }; + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pairedDevicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pairedDevicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pairedDevicePath', () => { + const result = client.pairedDevicePath( + 'userValue', + 'pairedDeviceValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pairedDevicePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromPairedDeviceName', () => { + const result = client.matchUserFromPairedDeviceName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.pairedDevicePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPairedDeviceFromPairedDeviceName', () => { + const result = client.matchPairedDeviceFromPairedDeviceName(fakePath); + assert.strictEqual(result, 'pairedDeviceValue'); + assert( + (client.pathTemplates.pairedDevicePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); - describe('dataType', async () => { - const fakePath = "/rendered/path/dataType"; - const expectedParameters = { - user: "userValue", - data_type: "dataTypeValue", - }; - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.dataTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataTypePath', () => { - const result = client.dataTypePath("userValue", "dataTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchUserFromDataTypeName', () => { - const result = client.matchUserFromDataTypeName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.dataTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataTypeFromDataTypeName', () => { - const result = client.matchDataTypeFromDataTypeName(fakePath); - assert.strictEqual(result, "dataTypeValue"); - assert((client.pathTemplates.dataTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + describe('profile', async () => { + const fakePath = '/rendered/path/profile'; + const expectedParameters = { + user: 'userValue', + }; + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.profilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.profilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('profilePath', () => { + const result = client.profilePath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.profilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromProfileName', () => { + const result = client.matchUserFromProfileName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.profilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); - describe('identity', async () => { - const fakePath = "/rendered/path/identity"; - const expectedParameters = { - user: "userValue", - }; - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.identityPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.identityPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('identityPath', () => { - const result = client.identityPath("userValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.identityPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchUserFromIdentityName', () => { - const result = client.matchUserFromIdentityName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.identityPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + describe('settings', async () => { + const fakePath = '/rendered/path/settings'; + const expectedParameters = { + user: 'userValue', + }; + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.settingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.settingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('settingsPath', () => { + const result = client.settingsPath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.settingsPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromSettingsName', () => { + const result = client.matchUserFromSettingsName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.settingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); - describe('profile', async () => { - const fakePath = "/rendered/path/profile"; - const expectedParameters = { - user: "userValue", - }; - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.profilePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.profilePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('profilePath', () => { - const result = client.profilePath("userValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.profilePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchUserFromProfileName', () => { - const result = client.matchUserFromProfileName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.profilePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + describe('subscriber', async () => { + const fakePath = '/rendered/path/subscriber'; + const expectedParameters = { + project: 'projectValue', + subscriber: 'subscriberValue', + }; + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.subscriberPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.subscriberPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('subscriberPath', () => { + const result = client.subscriberPath('projectValue', 'subscriberValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.subscriberPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSubscriberName', () => { + const result = client.matchProjectFromSubscriberName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.subscriberPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSubscriberFromSubscriberName', () => { + const result = client.matchSubscriberFromSubscriberName(fakePath); + assert.strictEqual(result, 'subscriberValue'); + assert( + (client.pathTemplates.subscriberPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); - describe('settings', async () => { - const fakePath = "/rendered/path/settings"; - const expectedParameters = { - user: "userValue", - }; - const client = new datapointsserviceModule.v4.DataPointsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.settingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.settingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('settingsPath', () => { - const result = client.settingsPath("userValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.settingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchUserFromSettingsName', () => { - const result = client.matchUserFromSettingsName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.settingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + describe('subscription', async () => { + const fakePath = '/rendered/path/subscription'; + const expectedParameters = { + project: 'projectValue', + subscriber: 'subscriberValue', + subscription: 'subscriptionValue', + }; + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.subscriptionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.subscriptionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('subscriptionPath', () => { + const result = client.subscriptionPath( + 'projectValue', + 'subscriberValue', + 'subscriptionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.subscriptionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSubscriptionName', () => { + const result = client.matchProjectFromSubscriptionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSubscriberFromSubscriptionName', () => { + const result = client.matchSubscriberFromSubscriptionName(fakePath); + assert.strictEqual(result, 'subscriberValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSubscriptionFromSubscriptionName', () => { + const result = client.matchSubscriptionFromSubscriptionName(fakePath); + assert.strictEqual(result, 'subscriptionValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('user', async () => { + const fakePath = '/rendered/path/user'; + const expectedParameters = { + user: 'userValue', + }; + const client = new datapointsserviceModule.v4.DataPointsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.userPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromUserName', () => { + const result = client.matchUserFromUserName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); }); + }); }); diff --git a/packages/google-devicesandservices-health/test/gapic_data_subscription_service_v4.ts b/packages/google-devicesandservices-health/test/gapic_data_subscription_service_v4.ts new file mode 100644 index 000000000000..e9250b6ffc51 --- /dev/null +++ b/packages/google-devicesandservices-health/test/gapic_data_subscription_service_v4.ts @@ -0,0 +1,2585 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as datasubscriptionserviceModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LROperation, operationsProtos } from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v4.DataSubscriptionServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'health.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + datasubscriptionserviceModule.v4.DataSubscriptionServiceClient + .servicePath; + assert.strictEqual(servicePath, 'health.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + datasubscriptionserviceModule.v4.DataSubscriptionServiceClient + .apiEndpoint; + assert.strictEqual(apiEndpoint, 'health.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'health.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'health.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'health.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'health.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = + datasubscriptionserviceModule.v4.DataSubscriptionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.dataSubscriptionServiceStub, undefined); + await client.initialize(); + assert(client.dataSubscriptionServiceStub); + }); + + it('has close method for the initialized client', (done) => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.dataSubscriptionServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.dataSubscriptionServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createSubscription', () => { + it('invokes createSubscription without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.CreateSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.CreateSubscriptionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ); + client.innerApiCalls.createSubscription = + stubSimpleCall(expectedResponse); + const [response] = await client.createSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSubscription without error using callback', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.CreateSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.CreateSubscriptionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ); + client.innerApiCalls.createSubscription = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSubscription( + request, + ( + err?: Error | null, + result?: protos.google.devicesandservices.health.v4.ISubscription | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSubscription with error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.CreateSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.CreateSubscriptionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSubscription = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createSubscription(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSubscription with closed client', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.CreateSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.CreateSubscriptionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createSubscription(request), expectedError); + }); + }); + + describe('updateSubscription', () => { + it('invokes updateSubscription without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateSubscriptionRequest(), + ); + request.subscription ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateSubscriptionRequest', + ['subscription', 'name'], + ); + request.subscription.name = defaultValue1; + const expectedHeaderRequestParams = `subscription.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ); + client.innerApiCalls.updateSubscription = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSubscription without error using callback', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateSubscriptionRequest(), + ); + request.subscription ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateSubscriptionRequest', + ['subscription', 'name'], + ); + request.subscription.name = defaultValue1; + const expectedHeaderRequestParams = `subscription.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ); + client.innerApiCalls.updateSubscription = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSubscription( + request, + ( + err?: Error | null, + result?: protos.google.devicesandservices.health.v4.ISubscription | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSubscription with error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateSubscriptionRequest(), + ); + request.subscription ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateSubscriptionRequest', + ['subscription', 'name'], + ); + request.subscription.name = defaultValue1; + const expectedHeaderRequestParams = `subscription.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSubscription = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateSubscription(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSubscription with closed client', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateSubscriptionRequest(), + ); + request.subscription ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateSubscriptionRequest', + ['subscription', 'name'], + ); + request.subscription.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateSubscription(request), expectedError); + }); + }); + + describe('deleteSubscription', () => { + it('invokes deleteSubscription without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DeleteSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.DeleteSubscriptionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSubscription = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSubscription without error using callback', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DeleteSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.DeleteSubscriptionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSubscription = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSubscription( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSubscription with error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DeleteSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.DeleteSubscriptionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSubscription = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteSubscription(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSubscription with closed client', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DeleteSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.DeleteSubscriptionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteSubscription(request), expectedError); + }); + }); + + describe('createSubscriber', () => { + it('invokes createSubscriber without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.CreateSubscriberRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.CreateSubscriberRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createSubscriber = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createSubscriber(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSubscriber without error using callback', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.CreateSubscriberRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.CreateSubscriberRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createSubscriber = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSubscriber( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.ICreateSubscriberMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.ICreateSubscriberMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSubscriber with call error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.CreateSubscriberRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.CreateSubscriberRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSubscriber = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createSubscriber(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSubscriber with LRO error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.CreateSubscriberRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.CreateSubscriberRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSubscriber = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createSubscriber(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSubscriberProgress without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateSubscriberProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSubscriberProgress with error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateSubscriberProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateSubscriber', () => { + it('invokes updateSubscriber without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateSubscriberRequest(), + ); + request.subscriber ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateSubscriberRequest', + ['subscriber', 'name'], + ); + request.subscriber.name = defaultValue1; + const expectedHeaderRequestParams = `subscriber.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateSubscriber = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateSubscriber(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSubscriber without error using callback', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateSubscriberRequest(), + ); + request.subscriber ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateSubscriberRequest', + ['subscriber', 'name'], + ); + request.subscriber.name = defaultValue1; + const expectedHeaderRequestParams = `subscriber.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateSubscriber = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSubscriber( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.IUpdateSubscriberMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.devicesandservices.health.v4.ISubscriber, + protos.google.devicesandservices.health.v4.IUpdateSubscriberMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSubscriber with call error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateSubscriberRequest(), + ); + request.subscriber ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateSubscriberRequest', + ['subscriber', 'name'], + ); + request.subscriber.name = defaultValue1; + const expectedHeaderRequestParams = `subscriber.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSubscriber = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateSubscriber(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSubscriber with LRO error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateSubscriberRequest(), + ); + request.subscriber ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateSubscriberRequest', + ['subscriber', 'name'], + ); + request.subscriber.name = defaultValue1; + const expectedHeaderRequestParams = `subscriber.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSubscriber = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateSubscriber(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateSubscriberProgress without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateSubscriberProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateSubscriberProgress with error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateSubscriberProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteSubscriber', () => { + it('invokes deleteSubscriber without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DeleteSubscriberRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.DeleteSubscriberRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteSubscriber = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteSubscriber(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSubscriber without error using callback', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DeleteSubscriberRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.DeleteSubscriberRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteSubscriber = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSubscriber( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.devicesandservices.health.v4.IDeleteSubscriberMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.devicesandservices.health.v4.IDeleteSubscriberMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSubscriber with call error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DeleteSubscriberRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.DeleteSubscriberRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSubscriber = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteSubscriber(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSubscriber with LRO error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.DeleteSubscriberRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.DeleteSubscriberRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSubscriber = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteSubscriber(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteSubscriberProgress without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteSubscriberProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteSubscriberProgress with error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkDeleteSubscriberProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listSubscribers', () => { + it('invokes listSubscribers without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListSubscribersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListSubscribersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscriber(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscriber(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscriber(), + ), + ]; + client.innerApiCalls.listSubscribers = stubSimpleCall(expectedResponse); + const [response] = await client.listSubscribers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSubscribers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubscribers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscribers without error using callback', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListSubscribersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListSubscribersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscriber(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscriber(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscriber(), + ), + ]; + client.innerApiCalls.listSubscribers = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSubscribers( + request, + ( + err?: Error | null, + result?: + | protos.google.devicesandservices.health.v4.ISubscriber[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSubscribers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubscribers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscribers with error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListSubscribersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListSubscribersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSubscribers = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listSubscribers(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSubscribers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubscribers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscribersStream without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListSubscribersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListSubscribersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscriber(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscriber(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscriber(), + ), + ]; + client.descriptors.page.listSubscribers.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSubscribersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devicesandservices.health.v4.Subscriber[] = + []; + stream.on( + 'data', + (response: protos.google.devicesandservices.health.v4.Subscriber) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listSubscribers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSubscribers, request), + ); + assert( + (client.descriptors.page.listSubscribers.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listSubscribersStream with error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListSubscribersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListSubscribersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSubscribers.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSubscribersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devicesandservices.health.v4.Subscriber[] = + []; + stream.on( + 'data', + (response: protos.google.devicesandservices.health.v4.Subscriber) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSubscribers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSubscribers, request), + ); + assert( + (client.descriptors.page.listSubscribers.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSubscribers without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListSubscribersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListSubscribersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscriber(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscriber(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscriber(), + ), + ]; + client.descriptors.page.listSubscribers.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.devicesandservices.health.v4.ISubscriber[] = + []; + const iterable = client.listSubscribersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSubscribers.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSubscribers.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSubscribers with error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListSubscribersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListSubscribersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSubscribers.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSubscribersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.devicesandservices.health.v4.ISubscriber[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSubscribers.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSubscribers.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listSubscriptions', () => { + it('invokes listSubscriptions without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListSubscriptionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ), + ]; + client.innerApiCalls.listSubscriptions = stubSimpleCall(expectedResponse); + const [response] = await client.listSubscriptions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSubscriptions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubscriptions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscriptions without error using callback', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListSubscriptionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ), + ]; + client.innerApiCalls.listSubscriptions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSubscriptions( + request, + ( + err?: Error | null, + result?: + | protos.google.devicesandservices.health.v4.ISubscription[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSubscriptions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubscriptions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscriptions with error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListSubscriptionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSubscriptions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listSubscriptions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSubscriptions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubscriptions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscriptionsStream without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListSubscriptionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ), + ]; + client.descriptors.page.listSubscriptions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSubscriptionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devicesandservices.health.v4.Subscription[] = + []; + stream.on( + 'data', + ( + response: protos.google.devicesandservices.health.v4.Subscription, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listSubscriptions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSubscriptions, request), + ); + assert( + (client.descriptors.page.listSubscriptions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listSubscriptionsStream with error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListSubscriptionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSubscriptions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSubscriptionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devicesandservices.health.v4.Subscription[] = + []; + stream.on( + 'data', + ( + response: protos.google.devicesandservices.health.v4.Subscription, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSubscriptions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSubscriptions, request), + ); + assert( + (client.descriptors.page.listSubscriptions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSubscriptions without error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListSubscriptionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.Subscription(), + ), + ]; + client.descriptors.page.listSubscriptions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.devicesandservices.health.v4.ISubscription[] = + []; + const iterable = client.listSubscriptionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSubscriptions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSubscriptions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSubscriptions with error', async () => { + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListSubscriptionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSubscriptions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSubscriptionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.devicesandservices.health.v4.ISubscription[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSubscriptions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSubscriptions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('Path templates', () => { + describe('dataPoint', async () => { + const fakePath = '/rendered/path/dataPoint'; + const expectedParameters = { + user: 'userValue', + data_type: 'dataTypeValue', + data_point: 'dataPointValue', + }; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dataPointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataPointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataPointPath', () => { + const result = client.dataPointPath( + 'userValue', + 'dataTypeValue', + 'dataPointValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataPointPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromDataPointName', () => { + const result = client.matchUserFromDataPointName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.dataPointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataTypeFromDataPointName', () => { + const result = client.matchDataTypeFromDataPointName(fakePath); + assert.strictEqual(result, 'dataTypeValue'); + assert( + (client.pathTemplates.dataPointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataPointFromDataPointName', () => { + const result = client.matchDataPointFromDataPointName(fakePath); + assert.strictEqual(result, 'dataPointValue'); + assert( + (client.pathTemplates.dataPointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('dataType', async () => { + const fakePath = '/rendered/path/dataType'; + const expectedParameters = { + user: 'userValue', + data_type: 'dataTypeValue', + }; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dataTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataTypePath', () => { + const result = client.dataTypePath('userValue', 'dataTypeValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromDataTypeName', () => { + const result = client.matchUserFromDataTypeName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.dataTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataTypeFromDataTypeName', () => { + const result = client.matchDataTypeFromDataTypeName(fakePath); + assert.strictEqual(result, 'dataTypeValue'); + assert( + (client.pathTemplates.dataTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('identity', async () => { + const fakePath = '/rendered/path/identity'; + const expectedParameters = { + user: 'userValue', + }; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.identityPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.identityPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('identityPath', () => { + const result = client.identityPath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.identityPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromIdentityName', () => { + const result = client.matchUserFromIdentityName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.identityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('irnProfile', async () => { + const fakePath = '/rendered/path/irnProfile'; + const expectedParameters = { + user: 'userValue', + }; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.irnProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.irnProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('irnProfilePath', () => { + const result = client.irnProfilePath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.irnProfilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromIrnProfileName', () => { + const result = client.matchUserFromIrnProfileName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.irnProfilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('pairedDevice', async () => { + const fakePath = '/rendered/path/pairedDevice'; + const expectedParameters = { + user: 'userValue', + paired_device: 'pairedDeviceValue', + }; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pairedDevicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pairedDevicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pairedDevicePath', () => { + const result = client.pairedDevicePath( + 'userValue', + 'pairedDeviceValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pairedDevicePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromPairedDeviceName', () => { + const result = client.matchUserFromPairedDeviceName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.pairedDevicePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPairedDeviceFromPairedDeviceName', () => { + const result = client.matchPairedDeviceFromPairedDeviceName(fakePath); + assert.strictEqual(result, 'pairedDeviceValue'); + assert( + (client.pathTemplates.pairedDevicePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('profile', async () => { + const fakePath = '/rendered/path/profile'; + const expectedParameters = { + user: 'userValue', + }; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.profilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.profilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('profilePath', () => { + const result = client.profilePath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.profilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromProfileName', () => { + const result = client.matchUserFromProfileName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.profilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('settings', async () => { + const fakePath = '/rendered/path/settings'; + const expectedParameters = { + user: 'userValue', + }; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.settingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.settingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('settingsPath', () => { + const result = client.settingsPath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.settingsPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromSettingsName', () => { + const result = client.matchUserFromSettingsName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.settingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('subscriber', async () => { + const fakePath = '/rendered/path/subscriber'; + const expectedParameters = { + project: 'projectValue', + subscriber: 'subscriberValue', + }; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.subscriberPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.subscriberPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('subscriberPath', () => { + const result = client.subscriberPath('projectValue', 'subscriberValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.subscriberPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSubscriberName', () => { + const result = client.matchProjectFromSubscriberName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.subscriberPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSubscriberFromSubscriberName', () => { + const result = client.matchSubscriberFromSubscriberName(fakePath); + assert.strictEqual(result, 'subscriberValue'); + assert( + (client.pathTemplates.subscriberPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('subscription', async () => { + const fakePath = '/rendered/path/subscription'; + const expectedParameters = { + project: 'projectValue', + subscriber: 'subscriberValue', + subscription: 'subscriptionValue', + }; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.subscriptionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.subscriptionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('subscriptionPath', () => { + const result = client.subscriptionPath( + 'projectValue', + 'subscriberValue', + 'subscriptionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.subscriptionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSubscriptionName', () => { + const result = client.matchProjectFromSubscriptionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSubscriberFromSubscriptionName', () => { + const result = client.matchSubscriberFromSubscriptionName(fakePath); + assert.strictEqual(result, 'subscriberValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSubscriptionFromSubscriptionName', () => { + const result = client.matchSubscriptionFromSubscriptionName(fakePath); + assert.strictEqual(result, 'subscriptionValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('user', async () => { + const fakePath = '/rendered/path/user'; + const expectedParameters = { + user: 'userValue', + }; + const client = + new datasubscriptionserviceModule.v4.DataSubscriptionServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.userPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromUserName', () => { + const result = client.matchUserFromUserName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/packages/google-devicesandservices-health/test/gapic_health_profile_service_v4.ts b/packages/google-devicesandservices-health/test/gapic_health_profile_service_v4.ts index e6948e7e08fa..b4a7a7665c3e 100644 --- a/packages/google-devicesandservices-health/test/gapic_health_profile_service_v4.ts +++ b/packages/google-devicesandservices-health/test/gapic_health_profile_service_v4.ts @@ -19,921 +19,2097 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; import * as healthprofileserviceModule from '../src'; -import {protobuf} from 'google-gax'; +import { PassThrough } from 'stream'; + +import { protobuf } from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); // eslint-disable-next-line @typescript-eslint/no-unused-vars function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; } function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; } function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); } -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); } describe('v4.HealthProfileServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'health.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = healthprofileserviceModule.v4.HealthProfileServiceClient.servicePath; - assert.strictEqual(servicePath, 'health.googleapis.com'); - assert(stub.called); - stub.restore(); - }); + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'health.googleapis.com'); + }); - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = healthprofileserviceModule.v4.HealthProfileServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'health.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'health.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'health.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'health.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'health.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new healthprofileserviceModule.v4.HealthProfileServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + it('has universeDomain', () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + healthprofileserviceModule.v4.HealthProfileServiceClient.servicePath; + assert.strictEqual(servicePath, 'health.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + healthprofileserviceModule.v4.HealthProfileServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'health.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + universeDomain: 'example.com', }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'health.example.com'); + }); - it('has port', () => { - const port = healthprofileserviceModule.v4.HealthProfileServiceClient.port; - assert(port); - assert(typeof port === 'number'); + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + universe_domain: 'example.com', }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'health.example.com'); + }); - it('should create a client with no option', () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient(); - assert(client); + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'health.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } }); - it('should create a client with gRPC fallback', () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - fallback: true, + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + universeDomain: 'configured.example.com', }); - assert(client); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'health.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.healthProfileServiceStub, undefined); - await client.initialize(); - assert(client.healthProfileServiceStub); + it('has port', () => { + const port = + healthprofileserviceModule.v4.HealthProfileServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + fallback: true, }); + assert(client); + }); - it('has close method for the initialized client', done => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.healthProfileServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); + it('has initialize method and supports deferred initialization', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', }); + assert.strictEqual(client.healthProfileServiceStub, undefined); + await client.initialize(); + assert(client.healthProfileServiceStub); + }); - it('has close method for the non-initialized client', done => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.healthProfileServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); + it('has close method for the initialized client', (done) => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.healthProfileServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; }); + }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + it('has close method for the non-initialized client', (done) => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', }); + assert.strictEqual(client.healthProfileServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - describe('getProfile', () => { - it('invokes getProfile without error', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.Profile() - ); - client.innerApiCalls.getProfile = stubSimpleCall(expectedResponse); - const [response] = await client.getProfile(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProfile without error using callback', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.Profile() - ); - client.innerApiCalls.getProfile = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getProfile( - request, - (err?: Error|null, result?: protos.google.devicesandservices.health.v4.IProfile|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProfile with error', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getProfile = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getProfile(request), expectedError); - const actualRequest = (client.innerApiCalls.getProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProfile with closed client', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetProfileRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getProfile(request), expectedError); - }); - }); - - describe('updateProfile', () => { - it('invokes updateProfile without error', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.UpdateProfileRequest() - ); - request.profile ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.UpdateProfileRequest', ['profile', 'name']); - request.profile.name = defaultValue1; - const expectedHeaderRequestParams = `profile.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.Profile() - ); - client.innerApiCalls.updateProfile = stubSimpleCall(expectedResponse); - const [response] = await client.updateProfile(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateProfile without error using callback', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.UpdateProfileRequest() - ); - request.profile ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.UpdateProfileRequest', ['profile', 'name']); - request.profile.name = defaultValue1; - const expectedHeaderRequestParams = `profile.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.Profile() - ); - client.innerApiCalls.updateProfile = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateProfile( - request, - (err?: Error|null, result?: protos.google.devicesandservices.health.v4.IProfile|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateProfile with error', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.UpdateProfileRequest() - ); - request.profile ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.UpdateProfileRequest', ['profile', 'name']); - request.profile.name = defaultValue1; - const expectedHeaderRequestParams = `profile.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateProfile = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateProfile(request), expectedError); - const actualRequest = (client.innerApiCalls.updateProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateProfile with closed client', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.UpdateProfileRequest() - ); - request.profile ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.UpdateProfileRequest', ['profile', 'name']); - request.profile.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateProfile(request), expectedError); - }); - }); - - describe('getSettings', () => { - it('invokes getSettings without error', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.Settings() - ); - client.innerApiCalls.getSettings = stubSimpleCall(expectedResponse); - const [response] = await client.getSettings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSettings without error using callback', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.Settings() - ); - client.innerApiCalls.getSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSettings( - request, - (err?: Error|null, result?: protos.google.devicesandservices.health.v4.ISettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSettings with error', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.getSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSettings with closed client', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getSettings(request), expectedError); - }); - }); - - describe('updateSettings', () => { - it('invokes updateSettings without error', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.UpdateSettingsRequest() - ); - request.settings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.UpdateSettingsRequest', ['settings', 'name']); - request.settings.name = defaultValue1; - const expectedHeaderRequestParams = `settings.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.Settings() - ); - client.innerApiCalls.updateSettings = stubSimpleCall(expectedResponse); - const [response] = await client.updateSettings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSettings without error using callback', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.UpdateSettingsRequest() - ); - request.settings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.UpdateSettingsRequest', ['settings', 'name']); - request.settings.name = defaultValue1; - const expectedHeaderRequestParams = `settings.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.Settings() - ); - client.innerApiCalls.updateSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSettings( - request, - (err?: Error|null, result?: protos.google.devicesandservices.health.v4.ISettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSettings with error', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.UpdateSettingsRequest() - ); - request.settings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.UpdateSettingsRequest', ['settings', 'name']); - request.settings.name = defaultValue1; - const expectedHeaderRequestParams = `settings.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.updateSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSettings with closed client', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.UpdateSettingsRequest() - ); - request.settings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.UpdateSettingsRequest', ['settings', 'name']); - request.settings.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateSettings(request), expectedError); - }); - }); - - describe('getIdentity', () => { - it('invokes getIdentity without error', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetIdentityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetIdentityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.Identity() - ); - client.innerApiCalls.getIdentity = stubSimpleCall(expectedResponse); - const [response] = await client.getIdentity(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIdentity as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIdentity as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIdentity without error using callback', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetIdentityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetIdentityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.devicesandservices.health.v4.Identity() - ); - client.innerApiCalls.getIdentity = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIdentity( - request, - (err?: Error|null, result?: protos.google.devicesandservices.health.v4.IIdentity|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIdentity as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIdentity as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIdentity with error', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetIdentityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetIdentityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIdentity = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIdentity(request), expectedError); - const actualRequest = (client.innerApiCalls.getIdentity as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIdentity as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIdentity with closed client', async () => { - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.devicesandservices.health.v4.GetIdentityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.devicesandservices.health.v4.GetIdentityRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getIdentity(request), expectedError); - }); - }); - - describe('Path templates', () => { - - describe('dataPoint', async () => { - const fakePath = "/rendered/path/dataPoint"; - const expectedParameters = { - user: "userValue", - data_type: "dataTypeValue", - data_point: "dataPointValue", - }; - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.dataPointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataPointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataPointPath', () => { - const result = client.dataPointPath("userValue", "dataTypeValue", "dataPointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataPointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); - it('matchUserFromDataPointName', () => { - const result = client.matchUserFromDataPointName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.dataPointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); + describe('getProfile', () => { + it('invokes getProfile without error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.Profile(), + ); + client.innerApiCalls.getProfile = stubSimpleCall(expectedResponse); + const [response] = await client.getProfile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('matchDataTypeFromDataPointName', () => { - const result = client.matchDataTypeFromDataPointName(fakePath); - assert.strictEqual(result, "dataTypeValue"); - assert((client.pathTemplates.dataPointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); + it('invokes getProfile without error using callback', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.Profile(), + ); + client.innerApiCalls.getProfile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProfile( + request, + ( + err?: Error | null, + result?: protos.google.devicesandservices.health.v4.IProfile | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('matchDataPointFromDataPointName', () => { - const result = client.matchDataPointFromDataPointName(fakePath); - assert.strictEqual(result, "dataPointValue"); - assert((client.pathTemplates.dataPointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); + it('invokes getProfile with error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProfile = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getProfile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - describe('dataType', async () => { - const fakePath = "/rendered/path/dataType"; - const expectedParameters = { - user: "userValue", - data_type: "dataTypeValue", - }; - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.dataTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataTypePath', () => { - const result = client.dataTypePath("userValue", "dataTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); + it('invokes getProfile with closed client', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getProfile(request), expectedError); + }); + }); - it('matchUserFromDataTypeName', () => { - const result = client.matchUserFromDataTypeName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.dataTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); + describe('updateProfile', () => { + it('invokes updateProfile without error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateProfileRequest(), + ); + request.profile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateProfileRequest', + ['profile', 'name'], + ); + request.profile.name = defaultValue1; + const expectedHeaderRequestParams = `profile.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.Profile(), + ); + client.innerApiCalls.updateProfile = stubSimpleCall(expectedResponse); + const [response] = await client.updateProfile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('matchDataTypeFromDataTypeName', () => { - const result = client.matchDataTypeFromDataTypeName(fakePath); - assert.strictEqual(result, "dataTypeValue"); - assert((client.pathTemplates.dataTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); + it('invokes updateProfile without error using callback', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateProfileRequest(), + ); + request.profile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateProfileRequest', + ['profile', 'name'], + ); + request.profile.name = defaultValue1; + const expectedHeaderRequestParams = `profile.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.Profile(), + ); + client.innerApiCalls.updateProfile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateProfile( + request, + ( + err?: Error | null, + result?: protos.google.devicesandservices.health.v4.IProfile | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - describe('identity', async () => { - const fakePath = "/rendered/path/identity"; - const expectedParameters = { - user: "userValue", - }; - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.identityPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.identityPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('identityPath', () => { - const result = client.identityPath("userValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.identityPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); + it('invokes updateProfile with error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateProfileRequest(), + ); + request.profile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateProfileRequest', + ['profile', 'name'], + ); + request.profile.name = defaultValue1; + const expectedHeaderRequestParams = `profile.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateProfile = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateProfile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('matchUserFromIdentityName', () => { - const result = client.matchUserFromIdentityName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.identityPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); + it('invokes updateProfile with closed client', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateProfileRequest(), + ); + request.profile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateProfileRequest', + ['profile', 'name'], + ); + request.profile.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateProfile(request), expectedError); + }); + }); - describe('profile', async () => { - const fakePath = "/rendered/path/profile"; - const expectedParameters = { - user: "userValue", - }; - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.profilePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.profilePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('profilePath', () => { - const result = client.profilePath("userValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.profilePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); + describe('getSettings', () => { + it('invokes getSettings without error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.Settings(), + ); + client.innerApiCalls.getSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('matchUserFromProfileName', () => { - const result = client.matchUserFromProfileName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.profilePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); + it('invokes getSettings without error using callback', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.Settings(), + ); + client.innerApiCalls.getSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSettings( + request, + ( + err?: Error | null, + result?: protos.google.devicesandservices.health.v4.ISettings | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - describe('settings', async () => { - const fakePath = "/rendered/path/settings"; - const expectedParameters = { - user: "userValue", - }; - const client = new healthprofileserviceModule.v4.HealthProfileServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.settingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.settingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('settingsPath', () => { - const result = client.settingsPath("userValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.settingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); + it('invokes getSettings with error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getSettings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('matchUserFromSettingsName', () => { - const result = client.matchUserFromSettingsName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.settingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); + it('invokes getSettings with closed client', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getSettings(request), expectedError); + }); + }); + + describe('updateSettings', () => { + it('invokes updateSettings without error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateSettingsRequest(), + ); + request.settings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateSettingsRequest', + ['settings', 'name'], + ); + request.settings.name = defaultValue1; + const expectedHeaderRequestParams = `settings.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.Settings(), + ); + client.innerApiCalls.updateSettings = stubSimpleCall(expectedResponse); + const [response] = await client.updateSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSettings without error using callback', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateSettingsRequest(), + ); + request.settings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateSettingsRequest', + ['settings', 'name'], + ); + request.settings.name = defaultValue1; + const expectedHeaderRequestParams = `settings.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.Settings(), + ); + client.innerApiCalls.updateSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSettings( + request, + ( + err?: Error | null, + result?: protos.google.devicesandservices.health.v4.ISettings | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSettings with error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateSettingsRequest(), + ); + request.settings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateSettingsRequest', + ['settings', 'name'], + ); + request.settings.name = defaultValue1; + const expectedHeaderRequestParams = `settings.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateSettings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSettings with closed client', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.UpdateSettingsRequest(), + ); + request.settings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.UpdateSettingsRequest', + ['settings', 'name'], + ); + request.settings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateSettings(request), expectedError); + }); + }); + + describe('getIdentity', () => { + it('invokes getIdentity without error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetIdentityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetIdentityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.Identity(), + ); + client.innerApiCalls.getIdentity = stubSimpleCall(expectedResponse); + const [response] = await client.getIdentity(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIdentity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIdentity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIdentity without error using callback', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetIdentityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetIdentityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.Identity(), + ); + client.innerApiCalls.getIdentity = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIdentity( + request, + ( + err?: Error | null, + result?: protos.google.devicesandservices.health.v4.IIdentity | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIdentity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIdentity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIdentity with error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetIdentityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetIdentityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIdentity = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getIdentity(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIdentity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIdentity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIdentity with closed client', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetIdentityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetIdentityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getIdentity(request), expectedError); + }); + }); + + describe('getIrnProfile', () => { + it('invokes getIrnProfile without error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetIrnProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetIrnProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.IrnProfile(), + ); + client.innerApiCalls.getIrnProfile = stubSimpleCall(expectedResponse); + const [response] = await client.getIrnProfile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIrnProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIrnProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIrnProfile without error using callback', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetIrnProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetIrnProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.IrnProfile(), + ); + client.innerApiCalls.getIrnProfile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIrnProfile( + request, + ( + err?: Error | null, + result?: protos.google.devicesandservices.health.v4.IIrnProfile | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIrnProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIrnProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIrnProfile with error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetIrnProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetIrnProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIrnProfile = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getIrnProfile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIrnProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIrnProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIrnProfile with closed client', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetIrnProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetIrnProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getIrnProfile(request), expectedError); + }); + }); + + describe('getPairedDevice', () => { + it('invokes getPairedDevice without error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetPairedDeviceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetPairedDeviceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.PairedDevice(), + ); + client.innerApiCalls.getPairedDevice = stubSimpleCall(expectedResponse); + const [response] = await client.getPairedDevice(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPairedDevice as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPairedDevice as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPairedDevice without error using callback', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetPairedDeviceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetPairedDeviceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.devicesandservices.health.v4.PairedDevice(), + ); + client.innerApiCalls.getPairedDevice = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPairedDevice( + request, + ( + err?: Error | null, + result?: protos.google.devicesandservices.health.v4.IPairedDevice | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPairedDevice as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPairedDevice as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPairedDevice with error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetPairedDeviceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetPairedDeviceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPairedDevice = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getPairedDevice(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPairedDevice as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPairedDevice as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPairedDevice with closed client', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.GetPairedDeviceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.GetPairedDeviceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getPairedDevice(request), expectedError); + }); + }); + + describe('listPairedDevices', () => { + it('invokes listPairedDevices without error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListPairedDevicesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListPairedDevicesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.PairedDevice(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.PairedDevice(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.PairedDevice(), + ), + ]; + client.innerApiCalls.listPairedDevices = stubSimpleCall(expectedResponse); + const [response] = await client.listPairedDevices(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPairedDevices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPairedDevices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPairedDevices without error using callback', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListPairedDevicesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListPairedDevicesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.PairedDevice(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.PairedDevice(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.PairedDevice(), + ), + ]; + client.innerApiCalls.listPairedDevices = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPairedDevices( + request, + ( + err?: Error | null, + result?: + | protos.google.devicesandservices.health.v4.IPairedDevice[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPairedDevices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPairedDevices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPairedDevices with error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListPairedDevicesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListPairedDevicesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPairedDevices = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listPairedDevices(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPairedDevices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPairedDevices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPairedDevicesStream without error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListPairedDevicesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListPairedDevicesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.PairedDevice(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.PairedDevice(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.PairedDevice(), + ), + ]; + client.descriptors.page.listPairedDevices.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPairedDevicesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devicesandservices.health.v4.PairedDevice[] = + []; + stream.on( + 'data', + ( + response: protos.google.devicesandservices.health.v4.PairedDevice, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listPairedDevices.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPairedDevices, request), + ); + assert( + (client.descriptors.page.listPairedDevices.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listPairedDevicesStream with error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListPairedDevicesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListPairedDevicesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPairedDevices.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPairedDevicesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devicesandservices.health.v4.PairedDevice[] = + []; + stream.on( + 'data', + ( + response: protos.google.devicesandservices.health.v4.PairedDevice, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPairedDevices.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPairedDevices, request), + ); + assert( + (client.descriptors.page.listPairedDevices.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listPairedDevices without error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListPairedDevicesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListPairedDevicesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devicesandservices.health.v4.PairedDevice(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.PairedDevice(), + ), + generateSampleMessage( + new protos.google.devicesandservices.health.v4.PairedDevice(), + ), + ]; + client.descriptors.page.listPairedDevices.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.devicesandservices.health.v4.IPairedDevice[] = + []; + const iterable = client.listPairedDevicesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPairedDevices.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listPairedDevices.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listPairedDevices with error', async () => { + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.devicesandservices.health.v4.ListPairedDevicesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devicesandservices.health.v4.ListPairedDevicesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPairedDevices.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPairedDevicesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.devicesandservices.health.v4.IPairedDevice[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPairedDevices.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listPairedDevices.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('Path templates', () => { + describe('dataPoint', async () => { + const fakePath = '/rendered/path/dataPoint'; + const expectedParameters = { + user: 'userValue', + data_type: 'dataTypeValue', + data_point: 'dataPointValue', + }; + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dataPointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataPointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataPointPath', () => { + const result = client.dataPointPath( + 'userValue', + 'dataTypeValue', + 'dataPointValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataPointPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromDataPointName', () => { + const result = client.matchUserFromDataPointName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.dataPointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataTypeFromDataPointName', () => { + const result = client.matchDataTypeFromDataPointName(fakePath); + assert.strictEqual(result, 'dataTypeValue'); + assert( + (client.pathTemplates.dataPointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataPointFromDataPointName', () => { + const result = client.matchDataPointFromDataPointName(fakePath); + assert.strictEqual(result, 'dataPointValue'); + assert( + (client.pathTemplates.dataPointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('dataType', async () => { + const fakePath = '/rendered/path/dataType'; + const expectedParameters = { + user: 'userValue', + data_type: 'dataTypeValue', + }; + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dataTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataTypePath', () => { + const result = client.dataTypePath('userValue', 'dataTypeValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromDataTypeName', () => { + const result = client.matchUserFromDataTypeName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.dataTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataTypeFromDataTypeName', () => { + const result = client.matchDataTypeFromDataTypeName(fakePath); + assert.strictEqual(result, 'dataTypeValue'); + assert( + (client.pathTemplates.dataTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('identity', async () => { + const fakePath = '/rendered/path/identity'; + const expectedParameters = { + user: 'userValue', + }; + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.identityPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.identityPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('identityPath', () => { + const result = client.identityPath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.identityPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromIdentityName', () => { + const result = client.matchUserFromIdentityName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.identityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('irnProfile', async () => { + const fakePath = '/rendered/path/irnProfile'; + const expectedParameters = { + user: 'userValue', + }; + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.irnProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.irnProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('irnProfilePath', () => { + const result = client.irnProfilePath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.irnProfilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromIrnProfileName', () => { + const result = client.matchUserFromIrnProfileName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.irnProfilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('pairedDevice', async () => { + const fakePath = '/rendered/path/pairedDevice'; + const expectedParameters = { + user: 'userValue', + paired_device: 'pairedDeviceValue', + }; + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pairedDevicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pairedDevicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pairedDevicePath', () => { + const result = client.pairedDevicePath( + 'userValue', + 'pairedDeviceValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pairedDevicePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromPairedDeviceName', () => { + const result = client.matchUserFromPairedDeviceName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.pairedDevicePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPairedDeviceFromPairedDeviceName', () => { + const result = client.matchPairedDeviceFromPairedDeviceName(fakePath); + assert.strictEqual(result, 'pairedDeviceValue'); + assert( + (client.pathTemplates.pairedDevicePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('profile', async () => { + const fakePath = '/rendered/path/profile'; + const expectedParameters = { + user: 'userValue', + }; + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.profilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.profilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('profilePath', () => { + const result = client.profilePath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.profilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromProfileName', () => { + const result = client.matchUserFromProfileName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.profilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('settings', async () => { + const fakePath = '/rendered/path/settings'; + const expectedParameters = { + user: 'userValue', + }; + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.settingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.settingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('settingsPath', () => { + const result = client.settingsPath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.settingsPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromSettingsName', () => { + const result = client.matchUserFromSettingsName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.settingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('subscriber', async () => { + const fakePath = '/rendered/path/subscriber'; + const expectedParameters = { + project: 'projectValue', + subscriber: 'subscriberValue', + }; + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.subscriberPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.subscriberPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('subscriberPath', () => { + const result = client.subscriberPath('projectValue', 'subscriberValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.subscriberPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSubscriberName', () => { + const result = client.matchProjectFromSubscriberName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.subscriberPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSubscriberFromSubscriberName', () => { + const result = client.matchSubscriberFromSubscriberName(fakePath); + assert.strictEqual(result, 'subscriberValue'); + assert( + (client.pathTemplates.subscriberPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('subscription', async () => { + const fakePath = '/rendered/path/subscription'; + const expectedParameters = { + project: 'projectValue', + subscriber: 'subscriberValue', + subscription: 'subscriptionValue', + }; + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.subscriptionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.subscriptionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('subscriptionPath', () => { + const result = client.subscriptionPath( + 'projectValue', + 'subscriberValue', + 'subscriptionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.subscriptionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSubscriptionName', () => { + const result = client.matchProjectFromSubscriptionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSubscriberFromSubscriptionName', () => { + const result = client.matchSubscriberFromSubscriptionName(fakePath); + assert.strictEqual(result, 'subscriberValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSubscriptionFromSubscriptionName', () => { + const result = client.matchSubscriptionFromSubscriptionName(fakePath); + assert.strictEqual(result, 'subscriptionValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('user', async () => { + const fakePath = '/rendered/path/user'; + const expectedParameters = { + user: 'userValue', + }; + const client = + new healthprofileserviceModule.v4.HealthProfileServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.userPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchUserFromUserName', () => { + const result = client.matchUserFromUserName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); }); + }); });