Class: Google::Apis::HealthV4::GoogleHealthAPIService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/health_v4/service.rb

Overview

Google Health API

The Google Health API lets you view and manage health and fitness metrics and measurement data.

Examples:

require 'google/apis/health_v4'

Health = Google::Apis::HealthV4 # Alias the module
service = Health::GoogleHealthAPIService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://health.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGoogleHealthAPIService

Returns a new instance of GoogleHealthAPIService.



48
49
50
51
52
53
# File 'lib/google/apis/health_v4/service.rb', line 48

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-health_v4',
        client_version: Google::Apis::HealthV4::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



41
42
43
# File 'lib/google/apis/health_v4/service.rb', line 41

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



46
47
48
# File 'lib/google/apis/health_v4/service.rb', line 46

def quota_user
  @quota_user
end

Instance Method Details

#batch_delete_data_points(parent, batch_delete_data_points_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::Operation

Delete a batch of identifyable data points.

Parameters:

  • parent (String)

    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 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 innames` must match this field.

  • batch_delete_data_points_request_object (Google::Apis::HealthV4::BatchDeleteDataPointsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



657
658
659
660
661
662
663
664
665
666
667
# File 'lib/google/apis/health_v4/service.rb', line 657

def batch_delete_data_points(parent, batch_delete_data_points_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v4/{+parent}/dataPoints:batchDelete', options)
  command.request_representation = Google::Apis::HealthV4::BatchDeleteDataPointsRequest::Representation
  command.request_object = batch_delete_data_points_request_object
  command.response_representation = Google::Apis::HealthV4::Operation::Representation
  command.response_class = Google::Apis::HealthV4::Operation
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_subscriber(parent, create_subscriber_payload_object = nil, subscriber_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::Operation

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.

Parameters:

  • parent (String)

    Required. The parent resource where this subscriber will be created. Format: projects/project Example: projects/my-project-123

  • create_subscriber_payload_object (Google::Apis::HealthV4::CreateSubscriberPayload) (defaults to: nil)
  • subscriber_id (String) (defaults to: nil)

    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/.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/google/apis/health_v4/service.rb', line 97

def create_project_subscriber(parent, create_subscriber_payload_object = nil, subscriber_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v4/{+parent}/subscribers', options)
  command.request_representation = Google::Apis::HealthV4::CreateSubscriberPayload::Representation
  command.request_object = create_subscriber_payload_object
  command.response_representation = Google::Apis::HealthV4::Operation::Representation
  command.response_class = Google::Apis::HealthV4::Operation
  command.params['parent'] = parent unless parent.nil?
  command.query['subscriberId'] = subscriber_id unless subscriber_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_subscriber_subscription(parent, create_subscription_payload_object = nil, subscription_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::Subscription

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.

Parameters:

  • parent (String)

    Required. The parent subscriber. Format: projects/project/subscribers/ subscriber The subscriber ID is user-settable (4-36 characters, matching / a-z/) if provided during creation, or system- generated otherwise.

  • create_subscription_payload_object (Google::Apis::HealthV4::CreateSubscriptionPayload) (defaults to: nil)
  • subscription_id (String) (defaults to: nil)

    Optional. The subscription_id is user-settable (4-36 chars, matching /a-z/) or system-generated otherwise. If provided, the ID must be unique within the parent subscriber.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/google/apis/health_v4/service.rb', line 278

def create_project_subscriber_subscription(parent, create_subscription_payload_object = nil, subscription_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v4/{+parent}/subscriptions', options)
  command.request_representation = Google::Apis::HealthV4::CreateSubscriptionPayload::Representation
  command.request_object = create_subscription_payload_object
  command.response_representation = Google::Apis::HealthV4::Subscription::Representation
  command.response_class = Google::Apis::HealthV4::Subscription
  command.params['parent'] = parent unless parent.nil?
  command.query['subscriptionId'] = subscription_id unless subscription_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_user_data_type_data_point(parent, data_point_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::Operation

Creates a single identifiable data point.

Parameters:

  • parent (String)

    Required. The parent resource name where the data point will be created. Format: users/user/dataTypes/data_type``

  • data_point_object (Google::Apis::HealthV4::DataPoint) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



691
692
693
694
695
696
697
698
699
700
701
# File 'lib/google/apis/health_v4/service.rb', line 691

def create_user_data_type_data_point(parent, data_point_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v4/{+parent}/dataPoints', options)
  command.request_representation = Google::Apis::HealthV4::DataPoint::Representation
  command.request_object = data_point_object
  command.response_representation = Google::Apis::HealthV4::Operation::Representation
  command.response_class = Google::Apis::HealthV4::Operation
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#daily_roll_up_data_points(parent, daily_roll_up_data_points_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::DailyRollUpDataPointsResponse

Roll up data points over civil time intervals for supported data types.

Parameters:

  • parent (String)

    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 union field.

  • daily_roll_up_data_points_request_object (Google::Apis::HealthV4::DailyRollUpDataPointsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



727
728
729
730
731
732
733
734
735
736
737
# File 'lib/google/apis/health_v4/service.rb', line 727

def daily_roll_up_data_points(parent, daily_roll_up_data_points_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v4/{+parent}/dataPoints:dailyRollUp', options)
  command.request_representation = Google::Apis::HealthV4::DailyRollUpDataPointsRequest::Representation
  command.request_object = daily_roll_up_data_points_request_object
  command.response_representation = Google::Apis::HealthV4::DailyRollUpDataPointsResponse::Representation
  command.response_class = Google::Apis::HealthV4::DailyRollUpDataPointsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_subscriber(name, force: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::Operation

Deletes a subscriber registration. This will stop all notifications to the subscriber's endpoint.

Parameters:

  • name (String)

    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/) or system-generated if not provided during creation.

  • force (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



139
140
141
142
143
144
145
146
147
148
# File 'lib/google/apis/health_v4/service.rb', line 139

def delete_project_subscriber(name, force: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v4/{+name}', options)
  command.response_representation = Google::Apis::HealthV4::Operation::Representation
  command.response_class = Google::Apis::HealthV4::Operation
  command.params['name'] = name unless name.nil?
  command.query['force'] = force unless force.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_subscriber_subscription(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::Empty

Deletes a specific user subscription, stopping notifications for this user to this subscriber.

Parameters:

  • name (String)

    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-456ThesubscriberID 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. ThesubscriptionID 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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



319
320
321
322
323
324
325
326
327
# File 'lib/google/apis/health_v4/service.rb', line 319

def delete_project_subscriber_subscription(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v4/{+name}', options)
  command.response_representation = Google::Apis::HealthV4::Empty::Representation
  command.response_class = Google::Apis::HealthV4::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#export_user_data_type_data_point_exercise_tcx(name, partial_data: nil, fields: nil, quota_user: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::ExportExerciseTcxResponse

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.

Parameters:

  • name (String)

    Required. The resource name of the exercise data point to export. Format: users/user/dataTypes/exercise/dataPoints/data_pointExample: `users/me/ dataTypes/exercise/dataPoints/2026443605080188808` Theuseris the alias `" me"` currently. Future versions may support user IDs. Thedata_point`` ID maps to the exercise ID, which is a long integer.

  • partial_data (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • download_dest (IO, String) (defaults to: nil)

    IO stream or filename to receive content download

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
# File 'lib/google/apis/health_v4/service.rb', line 778

def export_user_data_type_data_point_exercise_tcx(name, partial_data: nil, fields: nil, quota_user: nil, download_dest: nil, options: nil, &block)
  if download_dest.nil?
    command = make_simple_command(:get, 'v4/{+name}:exportExerciseTcx', options)
  else
    command = make_download_command(:get, 'v4/{+name}:exportExerciseTcx', options)
    command.download_dest = download_dest
  end
  command.response_representation = Google::Apis::HealthV4::ExportExerciseTcxResponse::Representation
  command.response_class = Google::Apis::HealthV4::ExportExerciseTcxResponse
  command.params['name'] = name unless name.nil?
  command.query['partialData'] = partial_data unless partial_data.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_data_type_data_point(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::DataPoint

Get a single identifyable data point.

Parameters:

  • name (String)

    Required. The name of the data point to retrieve. Format: users/user/ dataTypes/data_type/dataPoints/data_point`` See DataPoint.name for examples and possible values.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



816
817
818
819
820
821
822
823
824
# File 'lib/google/apis/health_v4/service.rb', line 816

def get_user_data_type_data_point(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v4/{+name}', options)
  command.response_representation = Google::Apis::HealthV4::DataPoint::Representation
  command.response_class = Google::Apis::HealthV4::DataPoint
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_identity(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::Identity

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.

Parameters:

  • name (String)

    Required. The resource name of the Identity. Format: users/me/identity

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



447
448
449
450
451
452
453
454
455
# File 'lib/google/apis/health_v4/service.rb', line 447

def get_user_identity(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v4/{+name}', options)
  command.response_representation = Google::Apis::HealthV4::Identity::Representation
  command.response_class = Google::Apis::HealthV4::Identity
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_irn_profile(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::IrnProfile

Returns user's IRN Profile details.

Parameters:

  • name (String)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



481
482
483
484
485
486
487
488
489
# File 'lib/google/apis/health_v4/service.rb', line 481

def get_user_irn_profile(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v4/{+name}', options)
  command.response_representation = Google::Apis::HealthV4::IrnProfile::Representation
  command.response_class = Google::Apis::HealthV4::IrnProfile
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_paired_device(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::PairedDevice

Returns user's Device.

Parameters:

  • name (String)

    Required. The name of the device to retrieve. Format: users/user/devices/ device

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1078
1079
1080
1081
1082
1083
1084
1085
1086
# File 'lib/google/apis/health_v4/service.rb', line 1078

def get_user_paired_device(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v4/{+name}', options)
  command.response_representation = Google::Apis::HealthV4::PairedDevice::Representation
  command.response_class = Google::Apis::HealthV4::PairedDevice
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_profile(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::Profile

Returns user Profile details.

Parameters:

  • name (String)

    Required. The name of the Profile. Format: users/me/profile.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



511
512
513
514
515
516
517
518
519
# File 'lib/google/apis/health_v4/service.rb', line 511

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v4/{+name}', options)
  command.response_representation = Google::Apis::HealthV4::Profile::Representation
  command.response_class = Google::Apis::HealthV4::Profile
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_settings(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::Settings

Returns user settings details.

Parameters:

  • name (String)

    Required. The name of the Settings. Format: users/me/settings.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



541
542
543
544
545
546
547
548
549
# File 'lib/google/apis/health_v4/service.rb', line 541

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v4/{+name}', options)
  command.response_representation = Google::Apis::HealthV4::Settings::Representation
  command.response_class = Google::Apis::HealthV4::Settings
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_subscriber_subscriptions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::ListSubscriptionsResponse

Lists all active subscriptions for a given subscriber. This can be filtered, for example, by user or data type.

Parameters:

  • parent (String)

    Required. The parent subscriber. Format: projects/project/subscribers/ subscriber The subscriber ID is user-settable (4-36 characters, matching / a-z/) if provided during creation, or system- generated otherwise.

  • filter (String) (defaults to: nil)

    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 health_user_id Example: user = "users/ user1" Example: user = "users/user1" OR user = "users/user2" Example: user = " users/user1" AND (data_type = "sleep" OR data_type = "weight")

  • page_size (Fixnum) (defaults to: nil)

    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.

  • page_token (String) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/google/apis/health_v4/service.rb', line 369

def list_project_subscriber_subscriptions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v4/{+parent}/subscriptions', options)
  command.response_representation = Google::Apis::HealthV4::ListSubscriptionsResponse::Representation
  command.response_class = Google::Apis::HealthV4::ListSubscriptionsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_subscribers(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::ListSubscribersResponse

Lists all subscribers registered within the owned Google Cloud Project.

Parameters:

  • parent (String)

    Required. The parent, which owns this collection of subscribers. Format: projects/project

  • page_size (Fixnum) (defaults to: nil)

    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.

  • page_token (String) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



180
181
182
183
184
185
186
187
188
189
190
# File 'lib/google/apis/health_v4/service.rb', line 180

def list_project_subscribers(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v4/{+parent}/subscribers', options)
  command.response_representation = Google::Apis::HealthV4::ListSubscribersResponse::Representation
  command.response_class = Google::Apis::HealthV4::ListSubscribersResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_data_type_data_points(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::ListDataPointsResponse

Query user health and fitness data points.

Parameters:

  • parent (String)

    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 union field.

  • filter (String) (defaults to: nil)

    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.
  • page_size (Fixnum) (defaults to: nil)

    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.

  • page_token (String) (defaults to: nil)

    Optional. The next_page_token from a previous request, if any.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



908
909
910
911
912
913
914
915
916
917
918
919
# File 'lib/google/apis/health_v4/service.rb', line 908

def list_user_data_type_data_points(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v4/{+parent}/dataPoints', options)
  command.response_representation = Google::Apis::HealthV4::ListDataPointsResponse::Representation
  command.response_class = Google::Apis::HealthV4::ListDataPointsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_paired_devices(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::ListPairedDevicesResponse

Returns the user's list of paired 1P trackers and smartwatches.

Parameters:

  • parent (String)

    Required. The parent, which owns this collection of devices. Format: users/ user

  • page_size (Fixnum) (defaults to: nil)

    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.

  • page_token (String) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
# File 'lib/google/apis/health_v4/service.rb', line 1118

def list_user_paired_devices(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v4/{+parent}/pairedDevices', options)
  command.response_representation = Google::Apis::HealthV4::ListPairedDevicesResponse::Representation
  command.response_class = Google::Apis::HealthV4::ListPairedDevicesResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_project_subscriber(name, subscriber_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::Operation

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.

Parameters:

  • name (String)

    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/) 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

  • subscriber_object (Google::Apis::HealthV4::Subscriber) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/google/apis/health_v4/service.rb', line 235

def patch_project_subscriber(name, subscriber_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v4/{+name}', options)
  command.request_representation = Google::Apis::HealthV4::Subscriber::Representation
  command.request_object = subscriber_object
  command.response_representation = Google::Apis::HealthV4::Operation::Representation
  command.response_class = Google::Apis::HealthV4::Operation
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_project_subscriber_subscription(name, subscription_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::Subscription

Updates the data types for an existing user subscription.

Parameters:

  • name (String)

    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-456The projectID is mandatory (6-30 characters, matching /a-z6,30/) The subscriberID 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 subscriptionID is user-settable (4-36 chars, matching /[a-z]([a-z0-9-]2,34` [a-z0-9])/) or system-generated otherwise.

  • subscription_object (Google::Apis::HealthV4::Subscription) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Optional. The list of fields to update.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



412
413
414
415
416
417
418
419
420
421
422
423
# File 'lib/google/apis/health_v4/service.rb', line 412

def patch_project_subscriber_subscription(name, subscription_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v4/{+name}', options)
  command.request_representation = Google::Apis::HealthV4::Subscription::Representation
  command.request_object = subscription_object
  command.response_representation = Google::Apis::HealthV4::Subscription::Representation
  command.response_class = Google::Apis::HealthV4::Subscription
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_user_data_type_data_point(name, data_point_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::Operation

Updates a single identifiable data point. If a data point with the specified name is not found, the request will fail.

Parameters:

  • name (String)

    Identifier. Data point name, only supported for the subset of identifiable data types. For the majority of the data types, individual data points do not need to be identified and this field would be empty. Format: users/user/ dataTypes/data_type/dataPoints/data_pointExample: `users/abcd1234/ dataTypes/sleep/dataPoints/a1b2c3d4-e5f6-7890-1234-567890abcdef` Theuser ID is a system-generated identifier, as described in Identity.health_user_id. Thedata_typeID corresponds to the kebab-case version of the field names in the DataPoint data union field, e.g. `total-calories` for the ` total_calories` field. Thedata_point`` ID can be client-provided or system- generated. If client-provided, it must be a string of 4-63 characters, containing only lowercase letters, numbers, and hyphens.

  • data_point_object (Google::Apis::HealthV4::DataPoint) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



953
954
955
956
957
958
959
960
961
962
963
# File 'lib/google/apis/health_v4/service.rb', line 953

def patch_user_data_type_data_point(name, data_point_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v4/{+name}', options)
  command.request_representation = Google::Apis::HealthV4::DataPoint::Representation
  command.request_object = data_point_object
  command.response_representation = Google::Apis::HealthV4::Operation::Representation
  command.response_class = Google::Apis::HealthV4::Operation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#reconcile_user_data_type_data_point(parent, data_source_family: nil, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::ReconcileDataPointsResponse

Reconcile data points from multiple data sources into a single data stream.

Parameters:

  • parent (String)

    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 union field.

  • data_source_family (String) (defaults to: nil)

    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

  • filter (String) (defaults to: nil)

    Optional. Filter expression based on https://aip.dev/160. A time range, either physical or civil, can be specified. See the ListDataPointsRequest.filter for the supported fields and syntax.

  • page_size (Fixnum) (defaults to: nil)

    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.

  • page_token (String) (defaults to: nil)

    Optional. The next_page_token from a previous request, if any.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
# File 'lib/google/apis/health_v4/service.rb', line 1007

def reconcile_user_data_type_data_point(parent, data_source_family: nil, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v4/{+parent}/dataPoints:reconcile', options)
  command.response_representation = Google::Apis::HealthV4::ReconcileDataPointsResponse::Representation
  command.response_class = Google::Apis::HealthV4::ReconcileDataPointsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['dataSourceFamily'] = data_source_family unless data_source_family.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#roll_up_data_points(parent, roll_up_data_points_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::RollUpDataPointsResponse

Roll up data points over physical time intervals for supported data types.

Parameters:

  • parent (String)

    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 union field.

  • roll_up_data_points_request_object (Google::Apis::HealthV4::RollUpDataPointsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
# File 'lib/google/apis/health_v4/service.rb', line 1045

def roll_up_data_points(parent, roll_up_data_points_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v4/{+parent}/dataPoints:rollUp', options)
  command.request_representation = Google::Apis::HealthV4::RollUpDataPointsRequest::Representation
  command.request_object = roll_up_data_points_request_object
  command.response_representation = Google::Apis::HealthV4::RollUpDataPointsResponse::Representation
  command.response_class = Google::Apis::HealthV4::RollUpDataPointsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_user_profile(name, profile_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::Profile

Updates the user's profile details.

Parameters:

  • name (String)

    Identifier. The resource name of this Profile resource. Format: users/user/ profile Example: users/1234567890/profile or users/me/profile The user ID is a system-generated Google Health API user ID, a string of 1-63 characters consisting of lowercase and uppercase letters, numbers, and hyphens. The literal me can also be used to refer to the authenticated user.

  • profile_object (Google::Apis::HealthV4::Profile) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Optional. The list of fields to be updated.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



578
579
580
581
582
583
584
585
586
587
588
589
# File 'lib/google/apis/health_v4/service.rb', line 578

def (name, profile_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v4/{+name}', options)
  command.request_representation = Google::Apis::HealthV4::Profile::Representation
  command.request_object = profile_object
  command.response_representation = Google::Apis::HealthV4::Profile::Representation
  command.response_class = Google::Apis::HealthV4::Profile
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_user_settings(name, settings_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::HealthV4::Settings

Updates the user's settings details.

Parameters:

  • name (String)

    Identifier. The resource name of this Settings resource. Format: users/user/ settings Example: users/1234567890/settings or users/me/settings The user ID is a system-generated Google Health API user ID, a string of 1-63 characters consisting of lowercase and uppercase letters, numbers, and hyphens. The literal me can also be used to refer to the authenticated user.

  • settings_object (Google::Apis::HealthV4::Settings) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Optional. The list of fields to be updated.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



618
619
620
621
622
623
624
625
626
627
628
629
# File 'lib/google/apis/health_v4/service.rb', line 618

def (name, settings_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v4/{+name}', options)
  command.request_representation = Google::Apis::HealthV4::Settings::Representation
  command.request_object = settings_object
  command.response_representation = Google::Apis::HealthV4::Settings::Representation
  command.response_class = Google::Apis::HealthV4::Settings
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end