Service Client: Google::Devicesandservices::Health::V4::DataSubscriptionService::DataSubscriptionServiceClient
Client stub representing the remote DataSubscriptionService gRPC service. Delegates call dispatching to Google::gRPC::Client.
target
The endpoint target address. Defaults to devicesandservices.googleapis.com:443.
credentials
The authentication credentials provider. Defaults to application default credentials via Google::Auth.
NAME
Google::Devicesandservices::Health::V4::DataSubscriptionService - Compiled Protocol Buffers messages for google/devicesandservices/health/v4/data_subscription_service.proto
SYNOPSIS
use Google::Devicesandservices::Health::V4::DataSubscriptionService;
my $msg = Google::Devicesandservices::Health::V4::DataSubscriptionService::CreateSubscriberRequest->new({
parent => $parent,
subscriber => $subscriber,
subscriber_id => $subscriber_id,
});
# Read or update a field
my $val = $msg->parent();
# Binary wire-format roundtrip
my $bytes = $msg->serialize();
my $decoded = Google::Devicesandservices::Health::V4::DataSubscriptionService::CreateSubscriberRequest->parse($bytes);
# Canonical ProtoJSON
my $json = $msg->to_json();
DESCRIPTION
Auto-generated Protobuf message classes compiled from google/devicesandservices/health/v4/data_subscription_service.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().
MESSAGES
Google::Devicesandservices::Health::V4::DataSubscriptionService::CreateSubscriberRequest
-- Messages -- Request message for CreateSubscriber.
Inherits from Protobuf::Message.
Accessors
$msg->parent()/$msg->parent($value)Type:
StringRequired. The parent resource where this subscriber will be created. Format: projects/{project_number} Example: projects/1234567890
$msg->subscriber()/$msg->subscriber($value)Type:
Message(Google::Devicesandservices::Health::V4::DataSubscriptionService::CreateSubscriberPayload)Required. The subscriber to create.
$msg->subscriber_id()/$msg->subscriber_id($value)Type:
StringOptional. The ID to use for the subscriber, which will become the final component of the subscriber's resource name.
This value should be 4-36 characters, and valid characters are /[a-z]([a-z0-9-]{2,34}[a-z0-9])/.
Google::Devicesandservices::Health::V4::DataSubscriptionService::ListSubscribersRequest
Request message for ListSubscribers.
Inherits from Protobuf::Message.
Accessors
$msg->parent()/$msg->parent($value)Type:
StringRequired. The parent, which owns this collection of subscribers. Format: projects/{project}
$msg->page_size()/$msg->page_size($value)Type:
Int32Optional. 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.
$msg->page_token()/$msg->page_token($value)Type:
StringOptional. 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.
Google::Devicesandservices::Health::V4::DataSubscriptionService::ListSubscribersResponse
Response message for ListSubscribers.
Inherits from Protobuf::Message.
Accessors
$msg->subscribers()/$msg->subscribers($value)Type:
Message(Google::Devicesandservices::Health::V4::DataSubscriptionService::Subscriber)Subscribers from the specified project.
$msg->next_page_token()/$msg->next_page_token($value)Type:
StringA token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
$msg->total_size()/$msg->total_size($value)Type:
Int32The total number of subscribers matching the request.
Google::Devicesandservices::Health::V4::DataSubscriptionService::UpdateSubscriberRequest
Request message for UpdateSubscriber.
Inherits from Protobuf::Message.
Accessors
$msg->subscriber()/$msg->subscriber($value)Type:
Message(Google::Devicesandservices::Health::V4::DataSubscriptionService::Subscriber)Required. The subscriber resource to update. Its 'name' field is mapped to the URI, and the value of the 'name' field should be of the form: "projects/{project}/subscribers/{subscriber_id}". The remaining fields of the Subscriber object represent the new values for the corresponding fields in the existing subscriber resource.
$msg->update_mask()/$msg->update_mask($value)Type:
Message(Google::Protobuf::FieldMask::FieldMask)Optional. A field mask that specifies which fields of the Subscriber message are to be updated. This allows for partial updates. Supported fields: - endpoint_uri - subscriber_configs - endpoint_authorization
Google::Devicesandservices::Health::V4::DataSubscriptionService::DeleteSubscriberRequest
Request message for DeleteSubscriber.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. The name of the subscriber to delete. Format: projects/{project}/subscribers/{subscriber} Example: projects/my-project/subscribers/my-subscriber-123 The {subscriber} ID is user-settable (4-36 characters, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or system-generated if not provided during creation.
$msg->force()/$msg->force($value)Type:
BoolOptional. 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.
Google::Devicesandservices::Health::V4::DataSubscriptionService::CreateSubscriptionRequest
Request message for CreateSubscription.
Inherits from Protobuf::Message.
Accessors
$msg->parent()/$msg->parent($value)Type:
StringRequired. The parent subscriber. Format: projects/{project}/subscribers/{subscriber} The {subscriber} ID is user-settable (4-36 characters, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or system-generated otherwise.
$msg->subscription_id()/$msg->subscription_id($value)Type:
StringOptional. The {subscription_id} is user-settable (4-36 chars, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or system-generated otherwise. If provided, the ID must be unique within the parent subscriber.
$msg->subscription()/$msg->subscription($value)Type:
Message(Google::Devicesandservices::Health::V4::DataSubscriptionService::CreateSubscriptionPayload)Required. The subscription to create.
Google::Devicesandservices::Health::V4::DataSubscriptionService::ListSubscriptionsRequest
Request message for ListSubscriptions.
Inherits from Protobuf::Message.
Accessors
$msg->parent()/$msg->parent($value)Type:
StringRequired. The parent subscriber. Format: projects/{project}/subscribers/{subscriber} The {subscriber} ID is user-settable (4-36 characters, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or system-generated otherwise.
$msg->filter()/$msg->filter($value)Type:
StringOptional. 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")
$msg->page_size()/$msg->page_size($value)Type:
Int32Optional. 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.
$msg->page_token()/$msg->page_token($value)Type:
StringOptional. 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.
Google::Devicesandservices::Health::V4::DataSubscriptionService::ListSubscriptionsResponse
Response message for ListSubscriptions.
Inherits from Protobuf::Message.
Accessors
$msg->subscriptions()/$msg->subscriptions($value)Type:
Message(Google::Devicesandservices::Health::V4::DataSubscriptionService::Subscription)The subscriptions from the specified subscriber.
$msg->next_page_token()/$msg->next_page_token($value)Type:
StringA token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
Google::Devicesandservices::Health::V4::DataSubscriptionService::UpdateSubscriptionRequest
Request message for UpdateSubscription.
Inherits from Protobuf::Message.
Accessors
$msg->subscription()/$msg->subscription($value)Type:
Message(Google::Devicesandservices::Health::V4::DataSubscriptionService::Subscription)Required. The subscription to update. The subscription's `name` field is used to identify the subscription to update. Format: projects/{project}/subscribers/{subscriber}/subscriptions/{subscription}
$msg->update_mask()/$msg->update_mask($value)Type:
Message(Google::Protobuf::FieldMask::FieldMask)Optional. The list of fields to update.
Google::Devicesandservices::Health::V4::DataSubscriptionService::DeleteSubscriptionRequest
Request message for DeleteSubscription.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. The resource name of the subscription to delete. Format: `projects/{project}/subscribers/{subscriber}/subscriptions/{subscription}` Example: `projects/my-project/subscribers/my-subscriber-123/subscriptions/my-subscription-456` The {subscriber} ID is user-settable (4-36 characters, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or system-generated otherwise. The {subscription} ID is user-settable (4-36 characters, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or system-generated if not provided during creation.
Google::Devicesandservices::Health::V4::DataSubscriptionService::Subscriber
-- Resource Messages -- A subscriber receives notifications from Google Health API.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringIdentifier. The resource name of the Subscriber. Format: projects/{project}/subscribers/{subscriber} The {project} ID is a Google Cloud Project ID or Project Number. The {subscriber} ID is user-settable (4-36 characters, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or system-generated otherwise (e.g., a UUID). Example (User-settable subscriber ID): projects/my-project/subscribers/my-sub-123 Example (System-generated subscriber ID): projects/my-project/subscribers/a1b2c3d4-e5f6-7890-1234-567890abcdef
$msg->endpoint_uri()/$msg->endpoint_uri($value)Type:
StringRequired. The full HTTPS URI where update notifications will be sent. The URI must be a valid URL and use HTTPS as the scheme. This endpoint will be verified during CreateSubscriber and UpdateSubscriber calls. See RPC documentation for verification details.
$msg->create_time()/$msg->create_time($value)Type:
Message(Google::Protobuf::Timestamp::Timestamp)Output only. The time at which the subscriber was created.
$msg->update_time()/$msg->update_time($value)Type:
Message(Google::Protobuf::Timestamp::Timestamp)Output only. The time at which the subscriber was last updated.
$msg->subscriber_configs()/$msg->subscriber_configs($value)Type:
Message(Google::Devicesandservices::Health::V4::DataSubscriptionService::SubscriberConfig)Optional. Configuration for the subscriber.
$msg->endpoint_authorization()/$msg->endpoint_authorization($value)Type:
Message(Google::Devicesandservices::Health::V4::DataSubscriptionService::EndpointAuthorization)Required. Authorization mechanism for a subscriber endpoint. This is required to ensure the endpoint can be verified.
$msg->state()/$msg->state($value)Type:
Enum(Google::Devicesandservices::Health::V4::Subscriber::State)Output only. The state of the subscriber.
Enum: Subscriber::State
STATE_UNSPECIFIED=>0UNVERIFIED=>1ACTIVE=>2INACTIVE=>3
Google::Devicesandservices::Health::V4::DataSubscriptionService::Subscription
A subscription to a data collection for a specific user, to be delivered to a subscriber.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringIdentifier. The resource name of the Subscription. Format: `projects/{project}/subscribers/{subscriber}/subscriptions/{subscription}` Example: `projects/my-project/subscribers/my-subscriber-123/subscriptions/my-subscription-456` The {project} ID is mandatory (6-30 characters, matching /[a-z][a-z0-9-]{6,30}/) The {subscriber} ID is user-settable (4-36 characters, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or system-generated otherwise. The {subscription} ID is user-settable (4-36 chars, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or system-generated otherwise.
$msg->data_types()/$msg->data_types($value)Type:
StringOptional. Data types subscribed to. A subscriber will only receive notifications for data types that are declared here. A subscription can only subscribe to the data types of the subscriber. The values should be in the format "users/{health_user_id}/dataTypes/{data_type}" where `{data_type}` is one of "altitude", "distance", "floors", "sleep", "steps", "weight".
$msg->user()/$msg->user($value)Type:
StringImmutable. The resource name of the user for whom this subscription is active. Format: `users/{user}` where `{user}` is the public `healthUserId` as returned by the `GetIdentity` action in the profile PAPI (see `google.devicesandservices.health.v4main.HealthProfileService.GetIdentity`).
Google::Devicesandservices::Health::V4::DataSubscriptionService::SubscriberConfig
Configuration for a subscriber. A notification is sent to a subscription ONLY if the subscriber has a config for the data type.
Inherits from Protobuf::Message.
Accessors
$msg->data_types()/$msg->data_types($value)Type:
StringRequired. See [Google Health API data types](https://developers.google.com/health/data-types) for the list of supported data types. Values should be in kebab-case.
$msg->subscription_create_policy()/$msg->subscription_create_policy($value)Type:
Enum(Google::Devicesandservices::Health::V4::SubscriberConfig::SubscriptionCreatePolicy)Required. Policy for subscription creation.
Enum: SubscriberConfig::SubscriptionCreatePolicy
SUBSCRIPTION_CREATE_POLICY_UNSPECIFIED=>0AUTOMATIC=>1MANUAL=>2
Google::Devicesandservices::Health::V4::DataSubscriptionService::EndpointAuthorization
Authorization mechanism for a subscriber endpoint. For all requests sent by the Webhooks service, the JSON payload is cryptographically signed. The signature is delivered in the `GOOGLE-HEALTH-API-SIGNATURE` HTTP header. This is an ECDSA (NIST P256) signature of the JSON payload. Clients must verify this signature using Google Health API's public key to confirm the payload was sent by the Health API.
Inherits from Protobuf::Message.
Accessors
$msg->secret()/$msg->secret($value)Type:
StringRequired. Input only. Provides a client-provided secret that will be sent with each notification to the subscriber endpoint using the "Authorization" header. The value must include the authorization scheme, e.g., "Bearer <token>" or "Basic <credentials>", as it will be used as the full Authorization header value. This secret is used by the API to test the endpoint during `CreateSubscriber` and `UpdateSubscriber` calls, and will be sent in the `Authorization` header for all subsequent webhook notifications to this endpoint.
$msg->secret_set()/$msg->secret_set($value)Type:
BoolOutput only. Whether the secret is set.
Google::Devicesandservices::Health::V4::DataSubscriptionService::CreateSubscriberPayload
Payload for creating a subscriber.
Inherits from Protobuf::Message.
Accessors
$msg->endpoint_uri()/$msg->endpoint_uri($value)Type:
StringRequired. The full HTTPS URI where update notifications will be sent. The URI must be a valid URL and use HTTPS as the scheme. This endpoint will be verified during the `CreateSubscriber` call. See CreateSubscriber RPC documentation for verification details.
$msg->subscriber_configs()/$msg->subscriber_configs($value)Type:
Message(Google::Devicesandservices::Health::V4::DataSubscriptionService::SubscriberConfig)Optional. Configuration for the subscriber.
$msg->endpoint_authorization()/$msg->endpoint_authorization($value)Type:
Message(Google::Devicesandservices::Health::V4::DataSubscriptionService::EndpointAuthorization)Required. Authorization mechanism for the subscriber endpoint. The `secret` within this message is crucial for endpoint verification and for securing webhook notifications.
Google::Devicesandservices::Health::V4::DataSubscriptionService::CreateSubscriptionPayload
Payload for creating a subscription.
Inherits from Protobuf::Message.
Accessors
$msg->data_types()/$msg->data_types($value)Type:
StringOptional. Data types subscribed to.
$msg->user()/$msg->user($value)Type:
StringRequired. Immutable. The resource name of the user for whom this subscription is active. Format: `users/{user}` where `{user}` is the public `healthUserId` as returned by the `GetIdentity` action in the profile PAPI (see `google.devicesandservices.health.v4main.HealthProfileService.GetIdentity`).
Google::Devicesandservices::Health::V4::DataSubscriptionService::CreateSubscriberMetadata
Represents metadata for creating a subscriber.
Inherits from Protobuf::Message.
Google::Devicesandservices::Health::V4::DataSubscriptionService::UpdateSubscriberMetadata
Represents metadata for updating a subscriber.
Inherits from Protobuf::Message.
Google::Devicesandservices::Health::V4::DataSubscriptionService::DeleteSubscriberMetadata
Represents metadata for deleting a subscriber.
Inherits from Protobuf::Message.
SEE ALSO
Protobuf, Protobuf::Message, Google::Devicesandservices::Health::V4::DataSubscriptionService::Types, https://protobuf.dev/
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.