DataPointsService¶
- class google.devicesandservices.health_v4.services.data_points_service.DataPointsServiceAsyncClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.devicesandservices.health_v4.services.data_points_service.transports.base.DataPointsServiceTransport, typing.Callable[[...], google.devicesandservices.health_v4.services.data_points_service.transports.base.DataPointsServiceTransport]]] = 'grpc_asyncio', client_options: typing.Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)[source]¶
Data Points Service exposing the user’s health and fitness measured and derived data.
Instantiates the data points service async client.
- Parameters
credentials (Optional[google.auth.credentials.Credentials]) – The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.
transport (Optional[Union[str,DataPointsServiceTransport,Callable[..., DataPointsServiceTransport]]]) – The transport to use, or a Callable that constructs and returns a new transport to use. If a Callable is given, it will be called with the same set of initialization arguments as used in the DataPointsServiceTransport constructor. If set to None, a transport is chosen automatically.
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]) –
Custom options for the client.
1. The
api_endpointproperty can be used to override the default endpoint provided by the client whentransportis not explicitly provided. Only if this property is not set andtransportwas not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: “always” (always use the default mTLS endpoint), “never” (always use the default regular endpoint) and “auto” (auto-switch to the default mTLS endpoint if client certificate is present; this is the default value).2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “true”, then the
client_cert_sourceproperty can be used to provide a client certificate for mTLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is “false” or not set, no client certificate will be used.3. The
universe_domainproperty can be used to override the default “googleapis.com” universe. Note thatapi_endpointproperty still takes precedence; anduniverse_domainis currently not supported for mTLS.client_info (google.api_core.gapic_v1.client_info.ClientInfo) – The client info used to send a user-agent string along with API requests. If
None, then default info will be used. Generally, you only need to set this if you’re developing your own client library.
- Raises
google.auth.exceptions.MutualTlsChannelError – If mutual TLS transport creation failed for any reason.
- property api_endpoint: str¶
Return the API endpoint used by the client instance.
- Returns
The API endpoint used by the client instance.
- Return type
- async batch_delete_data_points(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.BatchDeleteDataPointsRequest, dict]] = None, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.api_core.operation_async.AsyncOperation[source]¶
Delete a batch of identifyable data points.
# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 async def sample_batch_delete_data_points(): # Create a client client = health_v4.DataPointsServiceAsyncClient() # Initialize request argument(s) request = health_v4.BatchDeleteDataPointsRequest( names=['names_value1', 'names_value2'], ) # Make the request operation = await client.batch_delete_data_points(request=request) print("Waiting for operation to complete...") response = await operation.result() # Handle the response print(response)
- Parameters
request (Optional[Union[google.devicesandservices.health_v4.types.BatchDeleteDataPointsRequest, dict]]) – The request object. Request to delete a batch of identifiable data points.
retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
An object representing a long-running operation.
The result type for the operation will be
google.devicesandservices.health_v4.types.BatchDeleteDataPointsResponseResponse containing the list of possibly soft-deleted DataPoints.- Return type
- static common_billing_account_path(billing_account: str) str¶
Returns a fully-qualified billing_account string.
- static common_location_path(project: str, location: str) str¶
Returns a fully-qualified location string.
- static common_organization_path(organization: str) str¶
Returns a fully-qualified organization string.
- async create_data_point(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.CreateDataPointRequest, dict]] = None, *, parent: Optional[str] = None, data_point: Optional[google.devicesandservices.health_v4.types.data_points.DataPoint] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.api_core.operation_async.AsyncOperation[source]¶
Creates a single identifiable data point.
# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 async def sample_create_data_point(): # Create a client client = health_v4.DataPointsServiceAsyncClient() # Initialize request argument(s) request = health_v4.CreateDataPointRequest( parent="parent_value", ) # Make the request operation = await client.create_data_point(request=request) print("Waiting for operation to complete...") response = await operation.result() # Handle the response print(response)
- Parameters
request (Optional[Union[google.devicesandservices.health_v4.types.CreateDataPointRequest, dict]]) – The request object. Request to create an identifiable data point.
parent (
str) –Required. The parent resource name where the data point will be created. Format:
users/{user}/dataTypes/{data_type}This corresponds to the
parentfield on therequestinstance; ifrequestis provided, this should not be set.data_point (
google.devicesandservices.health_v4.types.DataPoint) – Required. The data point to create. This corresponds to thedata_pointfield on therequestinstance; ifrequestis provided, this should not be set.retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
An object representing a long-running operation.
The result type for the operation will be
google.devicesandservices.health_v4.types.DataPointA computed or recorded metric.- Return type
- async daily_roll_up_data_points(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.DailyRollUpDataPointsRequest, dict]] = None, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.devicesandservices.health_v4.types.data_points.DailyRollUpDataPointsResponse[source]¶
Roll up data points over civil time intervals for supported data types.
# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 async def sample_daily_roll_up_data_points(): # Create a client client = health_v4.DataPointsServiceAsyncClient() # Initialize request argument(s) request = health_v4.DailyRollUpDataPointsRequest( parent="parent_value", ) # Make the request response = await client.daily_roll_up_data_points(request=request) # Handle the response print(response)
- Parameters
request (Optional[Union[google.devicesandservices.health_v4.types.DailyRollUpDataPointsRequest, dict]]) – The request object. Request to roll up data points by civil time intervals.
retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
Response containing the list of rolled up data points.
- Return type
google.devicesandservices.health_v4.types.DailyRollUpDataPointsResponse
- static data_point_path(user: str, data_type: str, data_point: str) str¶
Returns a fully-qualified data_point string.
- async export_exercise_tcx(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.ExportExerciseTcxRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.devicesandservices.health_v4.types.data_points.ExportExerciseTcxResponse[source]¶
Exports exercise data in TCX format.
IMPORTANT: HTTP clients must append
?alt=mediato the request URL to download the raw TCX file.Example:
https://health.googleapis.com/v4/users/me/dataTypes/exercise/dataPoints/EXERCISE_ID:exportExerciseTcx?alt=mediaWithout
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_fitnessscopes (normalorreadonly) AND one of thelocationscopes (normalorreadonly) in their access token to succeed.# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 async def sample_export_exercise_tcx(): # Create a client client = health_v4.DataPointsServiceAsyncClient() # Initialize request argument(s) request = health_v4.ExportExerciseTcxRequest( name="name_value", ) # Make the request response = await client.export_exercise_tcx(request=request) # Handle the response print(response)
- Parameters
request (Optional[Union[google.devicesandservices.health_v4.types.ExportExerciseTcxRequest, dict]]) – The request object. Represents a request to export exercise data in TCX format.
name (
str) –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/2026443605080188808The
{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.This corresponds to the
namefield on therequestinstance; ifrequestis provided, this should not be set.retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
Represents a Response for exporting exercise data in TCX format.
- Return type
google.devicesandservices.health_v4.types.ExportExerciseTcxResponse
- classmethod from_service_account_file(filename: str, *args, **kwargs)[source]¶
- Creates an instance of this client using the provided credentials
file.
- Parameters
filename (str) – The path to the service account private key json file.
args – Additional arguments to pass to the constructor.
kwargs – Additional arguments to pass to the constructor.
- Returns
The constructed client.
- Return type
- classmethod from_service_account_info(info: dict, *args, **kwargs)[source]¶
- Creates an instance of this client using the provided credentials
info.
- Parameters
info (dict) – The service account private key info.
args – Additional arguments to pass to the constructor.
kwargs – Additional arguments to pass to the constructor.
- Returns
The constructed client.
- Return type
- classmethod from_service_account_json(filename: str, *args, **kwargs)¶
- Creates an instance of this client using the provided credentials
file.
- Parameters
filename (str) – The path to the service account private key json file.
args – Additional arguments to pass to the constructor.
kwargs – Additional arguments to pass to the constructor.
- Returns
The constructed client.
- Return type
- async get_data_point(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.GetDataPointRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.devicesandservices.health_v4.types.data_points.DataPoint[source]¶
Get a single identifyable data point.
# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 async def sample_get_data_point(): # Create a client client = health_v4.DataPointsServiceAsyncClient() # Initialize request argument(s) request = health_v4.GetDataPointRequest( name="name_value", ) # Make the request response = await client.get_data_point(request=request) # Handle the response print(response)
- Parameters
request (Optional[Union[google.devicesandservices.health_v4.types.GetDataPointRequest, dict]]) – The request object. Request for getting a single data point
name (
str) –Required. The name of the data point to retrieve.
Format:
users/{user}/dataTypes/{data_type}/dataPoints/{data_point}See [DataPoint.name][google.devicesandservices.health.v4.DataPoint.name] for examples and possible values.
This corresponds to the
namefield on therequestinstance; ifrequestis provided, this should not be set.retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
A computed or recorded metric.
- Return type
- classmethod get_mtls_endpoint_and_cert_source(client_options: Optional[google.api_core.client_options.ClientOptions] = None)[source]¶
Return the API endpoint and client cert source for mutual TLS.
The client cert source is determined in the following order: (1) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not “true”, the client cert source is None. (2) if client_options.client_cert_source is provided, use the provided one; if the default client cert source exists, use the default one; otherwise the client cert source is None.
The API endpoint is determined in the following order: (1) if client_options.api_endpoint if provided, use the provided one. (2) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “always”, use the default mTLS endpoint; if the environment variable is “never”, use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint.
More details can be found at https://google.aip.dev/auth/4114.
- Parameters
client_options (google.api_core.client_options.ClientOptions) – Custom options for the client. Only the api_endpoint and client_cert_source properties may be used in this method.
- Returns
- returns the API endpoint and the
client cert source to use.
- Return type
- Raises
google.auth.exceptions.MutualTLSChannelError – If any errors happen.
- classmethod get_transport_class(label: Optional[str] = None) Type[google.devicesandservices.health_v4.services.data_points_service.transports.base.DataPointsServiceTransport]¶
Returns an appropriate transport class.
- Parameters
label – The name of the desired transport. If none is provided, then the first transport in the registry is used.
- Returns
The transport class to use.
- async list_data_points(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.ListDataPointsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.devicesandservices.health_v4.services.data_points_service.pagers.ListDataPointsAsyncPager[source]¶
Query user health and fitness data points.
# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 async def sample_list_data_points(): # Create a client client = health_v4.DataPointsServiceAsyncClient() # Initialize request argument(s) request = health_v4.ListDataPointsRequest( parent="parent_value", ) # Make the request page_result = client.list_data_points(request=request) # Handle the response async for response in page_result: print(response)
- Parameters
request (Optional[Union[google.devicesandservices.health_v4.types.ListDataPointsRequest, dict]]) – The request object. Request for listing raw data points
parent (
str) –Required. Parent data type of the Data Point collection.
Format:
users/me/dataTypes/{data_type}, e.g.:users/me/dataTypes/stepsusers/me/dataTypes/weight
For a list of the supported data types see the [DataPoint data][google.devicesandservices.health.v4.DataPoint] union field.
This corresponds to the
parentfield on therequestinstance; ifrequestis provided, this should not be set.retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
Response containing raw data points matching the query Iterating over this object will yield results and resolve additional pages automatically.
- Return type
google.devicesandservices.health_v4.services.data_points_service.pagers.ListDataPointsAsyncPager
- static parse_common_billing_account_path(path: str) Dict[str, str]¶
Parse a billing_account path into its component segments.
- static parse_common_folder_path(path: str) Dict[str, str]¶
Parse a folder path into its component segments.
- static parse_common_location_path(path: str) Dict[str, str]¶
Parse a location path into its component segments.
- static parse_common_organization_path(path: str) Dict[str, str]¶
Parse a organization path into its component segments.
- static parse_common_project_path(path: str) Dict[str, str]¶
Parse a project path into its component segments.
- static parse_data_point_path(path: str) Dict[str, str]¶
Parses a data_point path into its component segments.
- static parse_data_type_path(path: str) Dict[str, str]¶
Parses a data_type path into its component segments.
- async reconcile_data_points(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.ReconcileDataPointsRequest, dict]] = None, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.devicesandservices.health_v4.services.data_points_service.pagers.ReconcileDataPointsAsyncPager[source]¶
Reconcile data points from multiple data sources into a single data stream.
# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 async def sample_reconcile_data_points(): # Create a client client = health_v4.DataPointsServiceAsyncClient() # Initialize request argument(s) request = health_v4.ReconcileDataPointsRequest( parent="parent_value", ) # Make the request page_result = client.reconcile_data_points(request=request) # Handle the response async for response in page_result: print(response)
- Parameters
request (Optional[Union[google.devicesandservices.health_v4.types.ReconcileDataPointsRequest, dict]]) – The request object. Request to reconcile data points from multiple data sources.
retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
Response containing the list of reconciled DataPoints. Iterating over this object will yield results and resolve additional pages automatically.
- Return type
- async roll_up_data_points(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.RollUpDataPointsRequest, dict]] = None, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.devicesandservices.health_v4.services.data_points_service.pagers.RollUpDataPointsAsyncPager[source]¶
Roll up data points over physical time intervals for supported data types.
# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 async def sample_roll_up_data_points(): # Create a client client = health_v4.DataPointsServiceAsyncClient() # Initialize request argument(s) request = health_v4.RollUpDataPointsRequest( parent="parent_value", ) # Make the request page_result = client.roll_up_data_points(request=request) # Handle the response async for response in page_result: print(response)
- Parameters
request (Optional[Union[google.devicesandservices.health_v4.types.RollUpDataPointsRequest, dict]]) – The request object. Request to roll up data points by physical time intervals.
retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
Response containing the list of rolled up data points. Iterating over this object will yield results and resolve additional pages automatically.
- Return type
google.devicesandservices.health_v4.services.data_points_service.pagers.RollUpDataPointsAsyncPager
- property transport: google.devicesandservices.health_v4.services.data_points_service.transports.base.DataPointsServiceTransport¶
Returns the transport used by the client instance.
- Returns
The transport used by the client instance.
- Return type
DataPointsServiceTransport
- property universe_domain: str¶
Return the universe domain used by the client instance.
- Returns
- The universe domain used
by the client instance.
- Return type
- async update_data_point(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.UpdateDataPointRequest, dict]] = None, *, data_point: Optional[google.devicesandservices.health_v4.types.data_points.DataPoint] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.api_core.operation_async.AsyncOperation[source]¶
Updates a single identifiable data point. If a data point with the specified
nameis not found, the request will fail.# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 async def sample_update_data_point(): # Create a client client = health_v4.DataPointsServiceAsyncClient() # Initialize request argument(s) request = health_v4.UpdateDataPointRequest( ) # Make the request operation = await client.update_data_point(request=request) print("Waiting for operation to complete...") response = await operation.result() # Handle the response print(response)
- Parameters
request (Optional[Union[google.devicesandservices.health_v4.types.UpdateDataPointRequest, dict]]) – The request object. Request to update an identifiable data point.
data_point (
google.devicesandservices.health_v4.types.DataPoint) –Required. The data point to update
The data point’s
namefield is used to identify the data point to update.Format:
users/{user}/dataTypes/{data_type}/dataPoints/{data_point}This corresponds to the
data_pointfield on therequestinstance; ifrequestis provided, this should not be set.retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
An object representing a long-running operation.
The result type for the operation will be
google.devicesandservices.health_v4.types.DataPointA computed or recorded metric.- Return type
- class google.devicesandservices.health_v4.services.data_points_service.DataPointsServiceClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.devicesandservices.health_v4.services.data_points_service.transports.base.DataPointsServiceTransport, typing.Callable[[...], google.devicesandservices.health_v4.services.data_points_service.transports.base.DataPointsServiceTransport]]] = None, client_options: typing.Optional[typing.Union[google.api_core.client_options.ClientOptions, dict]] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)[source]¶
Data Points Service exposing the user’s health and fitness measured and derived data.
Instantiates the data points service client.
- Parameters
credentials (Optional[google.auth.credentials.Credentials]) – The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.
transport (Optional[Union[str,DataPointsServiceTransport,Callable[..., DataPointsServiceTransport]]]) – The transport to use, or a Callable that constructs and returns a new transport. If a Callable is given, it will be called with the same set of initialization arguments as used in the DataPointsServiceTransport constructor. If set to None, a transport is chosen automatically.
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]) –
Custom options for the client.
1. The
api_endpointproperty can be used to override the default endpoint provided by the client whentransportis not explicitly provided. Only if this property is not set andtransportwas not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: “always” (always use the default mTLS endpoint), “never” (always use the default regular endpoint) and “auto” (auto-switch to the default mTLS endpoint if client certificate is present; this is the default value).2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “true”, then the
client_cert_sourceproperty can be used to provide a client certificate for mTLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is “false” or not set, no client certificate will be used.3. The
universe_domainproperty can be used to override the default “googleapis.com” universe. Note that theapi_endpointproperty still takes precedence; anduniverse_domainis currently not supported for mTLS.client_info (google.api_core.gapic_v1.client_info.ClientInfo) – The client info used to send a user-agent string along with API requests. If
None, then default info will be used. Generally, you only need to set this if you’re developing your own client library.
- Raises
google.auth.exceptions.MutualTLSChannelError – If mutual TLS transport creation failed for any reason.
- __exit__(type, value, traceback)[source]¶
Releases underlying transport’s resources.
Warning
ONLY use as a context manager if the transport is NOT shared with other clients! Exiting the with block will CLOSE the transport and may cause errors in other clients!
- property api_endpoint: str¶
Return the API endpoint used by the client instance.
- Returns
The API endpoint used by the client instance.
- Return type
- batch_delete_data_points(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.BatchDeleteDataPointsRequest, dict]] = None, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.api_core.operation.Operation[source]¶
Delete a batch of identifyable data points.
# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 def sample_batch_delete_data_points(): # Create a client client = health_v4.DataPointsServiceClient() # Initialize request argument(s) request = health_v4.BatchDeleteDataPointsRequest( names=['names_value1', 'names_value2'], ) # Make the request operation = client.batch_delete_data_points(request=request) print("Waiting for operation to complete...") response = operation.result() # Handle the response print(response)
- Parameters
request (Union[google.devicesandservices.health_v4.types.BatchDeleteDataPointsRequest, dict]) – The request object. Request to delete a batch of identifiable data points.
retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
An object representing a long-running operation.
The result type for the operation will be
google.devicesandservices.health_v4.types.BatchDeleteDataPointsResponseResponse containing the list of possibly soft-deleted DataPoints.- Return type
- static common_billing_account_path(billing_account: str) str[source]¶
Returns a fully-qualified billing_account string.
- static common_location_path(project: str, location: str) str[source]¶
Returns a fully-qualified location string.
- static common_organization_path(organization: str) str[source]¶
Returns a fully-qualified organization string.
- create_data_point(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.CreateDataPointRequest, dict]] = None, *, parent: Optional[str] = None, data_point: Optional[google.devicesandservices.health_v4.types.data_points.DataPoint] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.api_core.operation.Operation[source]¶
Creates a single identifiable data point.
# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 def sample_create_data_point(): # Create a client client = health_v4.DataPointsServiceClient() # Initialize request argument(s) request = health_v4.CreateDataPointRequest( parent="parent_value", ) # Make the request operation = client.create_data_point(request=request) print("Waiting for operation to complete...") response = operation.result() # Handle the response print(response)
- Parameters
request (Union[google.devicesandservices.health_v4.types.CreateDataPointRequest, dict]) – The request object. Request to create an identifiable data point.
parent (str) –
Required. The parent resource name where the data point will be created. Format:
users/{user}/dataTypes/{data_type}This corresponds to the
parentfield on therequestinstance; ifrequestis provided, this should not be set.data_point (google.devicesandservices.health_v4.types.DataPoint) – Required. The data point to create. This corresponds to the
data_pointfield on therequestinstance; ifrequestis provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
An object representing a long-running operation.
The result type for the operation will be
google.devicesandservices.health_v4.types.DataPointA computed or recorded metric.- Return type
- daily_roll_up_data_points(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.DailyRollUpDataPointsRequest, dict]] = None, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.devicesandservices.health_v4.types.data_points.DailyRollUpDataPointsResponse[source]¶
Roll up data points over civil time intervals for supported data types.
# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 def sample_daily_roll_up_data_points(): # Create a client client = health_v4.DataPointsServiceClient() # Initialize request argument(s) request = health_v4.DailyRollUpDataPointsRequest( parent="parent_value", ) # Make the request response = client.daily_roll_up_data_points(request=request) # Handle the response print(response)
- Parameters
request (Union[google.devicesandservices.health_v4.types.DailyRollUpDataPointsRequest, dict]) – The request object. Request to roll up data points by civil time intervals.
retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
Response containing the list of rolled up data points.
- Return type
google.devicesandservices.health_v4.types.DailyRollUpDataPointsResponse
- static data_point_path(user: str, data_type: str, data_point: str) str[source]¶
Returns a fully-qualified data_point string.
- static data_type_path(user: str, data_type: str) str[source]¶
Returns a fully-qualified data_type string.
- export_exercise_tcx(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.ExportExerciseTcxRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.devicesandservices.health_v4.types.data_points.ExportExerciseTcxResponse[source]¶
Exports exercise data in TCX format.
IMPORTANT: HTTP clients must append
?alt=mediato the request URL to download the raw TCX file.Example:
https://health.googleapis.com/v4/users/me/dataTypes/exercise/dataPoints/EXERCISE_ID:exportExerciseTcx?alt=mediaWithout
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_fitnessscopes (normalorreadonly) AND one of thelocationscopes (normalorreadonly) in their access token to succeed.# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 def sample_export_exercise_tcx(): # Create a client client = health_v4.DataPointsServiceClient() # Initialize request argument(s) request = health_v4.ExportExerciseTcxRequest( name="name_value", ) # Make the request response = client.export_exercise_tcx(request=request) # Handle the response print(response)
- Parameters
request (Union[google.devicesandservices.health_v4.types.ExportExerciseTcxRequest, dict]) – The request object. Represents a request to export exercise data in TCX format.
name (str) –
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/2026443605080188808The
{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.This corresponds to the
namefield on therequestinstance; ifrequestis provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
Represents a Response for exporting exercise data in TCX format.
- Return type
google.devicesandservices.health_v4.types.ExportExerciseTcxResponse
- classmethod from_service_account_file(filename: str, *args, **kwargs)[source]¶
- Creates an instance of this client using the provided credentials
file.
- Parameters
filename (str) – The path to the service account private key json file.
args – Additional arguments to pass to the constructor.
kwargs – Additional arguments to pass to the constructor.
- Returns
The constructed client.
- Return type
- classmethod from_service_account_info(info: dict, *args, **kwargs)[source]¶
- Creates an instance of this client using the provided credentials
info.
- Parameters
info (dict) – The service account private key info.
args – Additional arguments to pass to the constructor.
kwargs – Additional arguments to pass to the constructor.
- Returns
The constructed client.
- Return type
- classmethod from_service_account_json(filename: str, *args, **kwargs)¶
- Creates an instance of this client using the provided credentials
file.
- Parameters
filename (str) – The path to the service account private key json file.
args – Additional arguments to pass to the constructor.
kwargs – Additional arguments to pass to the constructor.
- Returns
The constructed client.
- Return type
- get_data_point(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.GetDataPointRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.devicesandservices.health_v4.types.data_points.DataPoint[source]¶
Get a single identifyable data point.
# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 def sample_get_data_point(): # Create a client client = health_v4.DataPointsServiceClient() # Initialize request argument(s) request = health_v4.GetDataPointRequest( name="name_value", ) # Make the request response = client.get_data_point(request=request) # Handle the response print(response)
- Parameters
request (Union[google.devicesandservices.health_v4.types.GetDataPointRequest, dict]) – The request object. Request for getting a single data point
name (str) –
Required. The name of the data point to retrieve.
Format:
users/{user}/dataTypes/{data_type}/dataPoints/{data_point}See [DataPoint.name][google.devicesandservices.health.v4.DataPoint.name] for examples and possible values.
This corresponds to the
namefield on therequestinstance; ifrequestis provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
A computed or recorded metric.
- Return type
- classmethod get_mtls_endpoint_and_cert_source(client_options: Optional[google.api_core.client_options.ClientOptions] = None)[source]¶
Deprecated. Return the API endpoint and client cert source for mutual TLS.
The client cert source is determined in the following order: (1) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not “true”, the client cert source is None. (2) if client_options.client_cert_source is provided, use the provided one; if the default client cert source exists, use the default one; otherwise the client cert source is None.
The API endpoint is determined in the following order: (1) if client_options.api_endpoint if provided, use the provided one. (2) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “always”, use the default mTLS endpoint; if the environment variable is “never”, use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint.
More details can be found at https://google.aip.dev/auth/4114.
- Parameters
client_options (google.api_core.client_options.ClientOptions) – Custom options for the client. Only the api_endpoint and client_cert_source properties may be used in this method.
- Returns
- returns the API endpoint and the
client cert source to use.
- Return type
- Raises
google.auth.exceptions.MutualTLSChannelError – If any errors happen.
- list_data_points(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.ListDataPointsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.devicesandservices.health_v4.services.data_points_service.pagers.ListDataPointsPager[source]¶
Query user health and fitness data points.
# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 def sample_list_data_points(): # Create a client client = health_v4.DataPointsServiceClient() # Initialize request argument(s) request = health_v4.ListDataPointsRequest( parent="parent_value", ) # Make the request page_result = client.list_data_points(request=request) # Handle the response for response in page_result: print(response)
- Parameters
request (Union[google.devicesandservices.health_v4.types.ListDataPointsRequest, dict]) – The request object. Request for listing raw data points
parent (str) –
Required. Parent data type of the Data Point collection.
Format:
users/me/dataTypes/{data_type}, e.g.:users/me/dataTypes/stepsusers/me/dataTypes/weight
For a list of the supported data types see the [DataPoint data][google.devicesandservices.health.v4.DataPoint] union field.
This corresponds to the
parentfield on therequestinstance; ifrequestis provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
Response containing raw data points matching the query Iterating over this object will yield results and resolve additional pages automatically.
- Return type
google.devicesandservices.health_v4.services.data_points_service.pagers.ListDataPointsPager
- static parse_common_billing_account_path(path: str) Dict[str, str][source]¶
Parse a billing_account path into its component segments.
- static parse_common_folder_path(path: str) Dict[str, str][source]¶
Parse a folder path into its component segments.
- static parse_common_location_path(path: str) Dict[str, str][source]¶
Parse a location path into its component segments.
- static parse_common_organization_path(path: str) Dict[str, str][source]¶
Parse a organization path into its component segments.
- static parse_common_project_path(path: str) Dict[str, str][source]¶
Parse a project path into its component segments.
- static parse_data_point_path(path: str) Dict[str, str][source]¶
Parses a data_point path into its component segments.
- static parse_data_type_path(path: str) Dict[str, str][source]¶
Parses a data_type path into its component segments.
- reconcile_data_points(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.ReconcileDataPointsRequest, dict]] = None, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.devicesandservices.health_v4.services.data_points_service.pagers.ReconcileDataPointsPager[source]¶
Reconcile data points from multiple data sources into a single data stream.
# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 def sample_reconcile_data_points(): # Create a client client = health_v4.DataPointsServiceClient() # Initialize request argument(s) request = health_v4.ReconcileDataPointsRequest( parent="parent_value", ) # Make the request page_result = client.reconcile_data_points(request=request) # Handle the response for response in page_result: print(response)
- Parameters
request (Union[google.devicesandservices.health_v4.types.ReconcileDataPointsRequest, dict]) – The request object. Request to reconcile data points from multiple data sources.
retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
Response containing the list of reconciled DataPoints. Iterating over this object will yield results and resolve additional pages automatically.
- Return type
google.devicesandservices.health_v4.services.data_points_service.pagers.ReconcileDataPointsPager
- roll_up_data_points(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.RollUpDataPointsRequest, dict]] = None, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.devicesandservices.health_v4.services.data_points_service.pagers.RollUpDataPointsPager[source]¶
Roll up data points over physical time intervals for supported data types.
# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 def sample_roll_up_data_points(): # Create a client client = health_v4.DataPointsServiceClient() # Initialize request argument(s) request = health_v4.RollUpDataPointsRequest( parent="parent_value", ) # Make the request page_result = client.roll_up_data_points(request=request) # Handle the response for response in page_result: print(response)
- Parameters
request (Union[google.devicesandservices.health_v4.types.RollUpDataPointsRequest, dict]) – The request object. Request to roll up data points by physical time intervals.
retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
Response containing the list of rolled up data points. Iterating over this object will yield results and resolve additional pages automatically.
- Return type
google.devicesandservices.health_v4.services.data_points_service.pagers.RollUpDataPointsPager
- property transport: google.devicesandservices.health_v4.services.data_points_service.transports.base.DataPointsServiceTransport¶
Returns the transport used by the client instance.
- Returns
- The transport used by the client
instance.
- Return type
DataPointsServiceTransport
- property universe_domain: str¶
Return the universe domain used by the client instance.
- Returns
The universe domain used by the client instance.
- Return type
- update_data_point(request: Optional[Union[google.devicesandservices.health_v4.types.data_points.UpdateDataPointRequest, dict]] = None, *, data_point: Optional[google.devicesandservices.health_v4.types.data_points.DataPoint] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()) google.api_core.operation.Operation[source]¶
Updates a single identifiable data point. If a data point with the specified
nameis not found, the request will fail.# 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. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.devicesandservices import health_v4 def sample_update_data_point(): # Create a client client = health_v4.DataPointsServiceClient() # Initialize request argument(s) request = health_v4.UpdateDataPointRequest( ) # Make the request operation = client.update_data_point(request=request) print("Waiting for operation to complete...") response = operation.result() # Handle the response print(response)
- Parameters
request (Union[google.devicesandservices.health_v4.types.UpdateDataPointRequest, dict]) – The request object. Request to update an identifiable data point.
data_point (google.devicesandservices.health_v4.types.DataPoint) –
Required. The data point to update
The data point’s
namefield is used to identify the data point to update.Format:
users/{user}/dataTypes/{data_type}/dataPoints/{data_point}This corresponds to the
data_pointfield on therequestinstance; ifrequestis provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- Returns
An object representing a long-running operation.
The result type for the operation will be
google.devicesandservices.health_v4.types.DataPointA computed or recorded metric.- Return type
- class google.devicesandservices.health_v4.services.data_points_service.pagers.ListDataPointsAsyncPager(method: Callable[[...], Awaitable[google.devicesandservices.health_v4.types.data_points.ListDataPointsResponse]], request: google.devicesandservices.health_v4.types.data_points.ListDataPointsRequest, response: google.devicesandservices.health_v4.types.data_points.ListDataPointsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ())[source]¶
A pager for iterating through
list_data_pointsrequests.This class thinly wraps an initial
google.devicesandservices.health_v4.types.ListDataPointsResponseobject, and provides an__aiter__method to iterate through itsdata_pointsfield.If there are more pages, the
__aiter__method will make additionalListDataPointsrequests and continue to iterate through thedata_pointsfield on the corresponding responses.All the usual
google.devicesandservices.health_v4.types.ListDataPointsResponseattributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.Instantiates the pager.
- Parameters
method (Callable) – The method that was originally called, and which instantiated this pager.
request (google.devicesandservices.health_v4.types.ListDataPointsRequest) – The initial request object.
response (google.devicesandservices.health_v4.types.ListDataPointsResponse) – The initial response object.
retry (google.api_core.retry.AsyncRetry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- class google.devicesandservices.health_v4.services.data_points_service.pagers.ListDataPointsPager(method: Callable[[...], google.devicesandservices.health_v4.types.data_points.ListDataPointsResponse], request: google.devicesandservices.health_v4.types.data_points.ListDataPointsRequest, response: google.devicesandservices.health_v4.types.data_points.ListDataPointsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ())[source]¶
A pager for iterating through
list_data_pointsrequests.This class thinly wraps an initial
google.devicesandservices.health_v4.types.ListDataPointsResponseobject, and provides an__iter__method to iterate through itsdata_pointsfield.If there are more pages, the
__iter__method will make additionalListDataPointsrequests and continue to iterate through thedata_pointsfield on the corresponding responses.All the usual
google.devicesandservices.health_v4.types.ListDataPointsResponseattributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.Instantiate the pager.
- Parameters
method (Callable) – The method that was originally called, and which instantiated this pager.
request (google.devicesandservices.health_v4.types.ListDataPointsRequest) – The initial request object.
response (google.devicesandservices.health_v4.types.ListDataPointsResponse) – The initial response object.
retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- class google.devicesandservices.health_v4.services.data_points_service.pagers.ReconcileDataPointsAsyncPager(method: Callable[[...], Awaitable[google.devicesandservices.health_v4.types.data_points.ReconcileDataPointsResponse]], request: google.devicesandservices.health_v4.types.data_points.ReconcileDataPointsRequest, response: google.devicesandservices.health_v4.types.data_points.ReconcileDataPointsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ())[source]¶
A pager for iterating through
reconcile_data_pointsrequests.This class thinly wraps an initial
google.devicesandservices.health_v4.types.ReconcileDataPointsResponseobject, and provides an__aiter__method to iterate through itsdata_pointsfield.If there are more pages, the
__aiter__method will make additionalReconcileDataPointsrequests and continue to iterate through thedata_pointsfield on the corresponding responses.All the usual
google.devicesandservices.health_v4.types.ReconcileDataPointsResponseattributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.Instantiates the pager.
- Parameters
method (Callable) – The method that was originally called, and which instantiated this pager.
request (google.devicesandservices.health_v4.types.ReconcileDataPointsRequest) – The initial request object.
response (google.devicesandservices.health_v4.types.ReconcileDataPointsResponse) – The initial response object.
retry (google.api_core.retry.AsyncRetry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- class google.devicesandservices.health_v4.services.data_points_service.pagers.ReconcileDataPointsPager(method: Callable[[...], google.devicesandservices.health_v4.types.data_points.ReconcileDataPointsResponse], request: google.devicesandservices.health_v4.types.data_points.ReconcileDataPointsRequest, response: google.devicesandservices.health_v4.types.data_points.ReconcileDataPointsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ())[source]¶
A pager for iterating through
reconcile_data_pointsrequests.This class thinly wraps an initial
google.devicesandservices.health_v4.types.ReconcileDataPointsResponseobject, and provides an__iter__method to iterate through itsdata_pointsfield.If there are more pages, the
__iter__method will make additionalReconcileDataPointsrequests and continue to iterate through thedata_pointsfield on the corresponding responses.All the usual
google.devicesandservices.health_v4.types.ReconcileDataPointsResponseattributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.Instantiate the pager.
- Parameters
method (Callable) – The method that was originally called, and which instantiated this pager.
request (google.devicesandservices.health_v4.types.ReconcileDataPointsRequest) – The initial request object.
response (google.devicesandservices.health_v4.types.ReconcileDataPointsResponse) – The initial response object.
retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- class google.devicesandservices.health_v4.services.data_points_service.pagers.RollUpDataPointsAsyncPager(method: Callable[[...], Awaitable[google.devicesandservices.health_v4.types.data_points.RollUpDataPointsResponse]], request: google.devicesandservices.health_v4.types.data_points.RollUpDataPointsRequest, response: google.devicesandservices.health_v4.types.data_points.RollUpDataPointsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ())[source]¶
A pager for iterating through
roll_up_data_pointsrequests.This class thinly wraps an initial
google.devicesandservices.health_v4.types.RollUpDataPointsResponseobject, and provides an__aiter__method to iterate through itsrollup_data_pointsfield.If there are more pages, the
__aiter__method will make additionalRollUpDataPointsrequests and continue to iterate through therollup_data_pointsfield on the corresponding responses.All the usual
google.devicesandservices.health_v4.types.RollUpDataPointsResponseattributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.Instantiates the pager.
- Parameters
method (Callable) – The method that was originally called, and which instantiated this pager.
request (google.devicesandservices.health_v4.types.RollUpDataPointsRequest) – The initial request object.
response (google.devicesandservices.health_v4.types.RollUpDataPointsResponse) – The initial response object.
retry (google.api_core.retry.AsyncRetry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
- class google.devicesandservices.health_v4.services.data_points_service.pagers.RollUpDataPointsPager(method: Callable[[...], google.devicesandservices.health_v4.types.data_points.RollUpDataPointsResponse], request: google.devicesandservices.health_v4.types.data_points.RollUpDataPointsRequest, response: google.devicesandservices.health_v4.types.data_points.RollUpDataPointsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, Union[str, bytes]]] = ())[source]¶
A pager for iterating through
roll_up_data_pointsrequests.This class thinly wraps an initial
google.devicesandservices.health_v4.types.RollUpDataPointsResponseobject, and provides an__iter__method to iterate through itsrollup_data_pointsfield.If there are more pages, the
__iter__method will make additionalRollUpDataPointsrequests and continue to iterate through therollup_data_pointsfield on the corresponding responses.All the usual
google.devicesandservices.health_v4.types.RollUpDataPointsResponseattributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.Instantiate the pager.
- Parameters
method (Callable) – The method that was originally called, and which instantiated this pager.
request (google.devicesandservices.health_v4.types.RollUpDataPointsRequest) – The initial request object.
response (google.devicesandservices.health_v4.types.RollUpDataPointsResponse) – The initial response object.
retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]) – Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.