Class DataSubscriptionServiceClientImpl
DataSubscriptionService client wrapper implementation, for convenient use.
Inherited Members
Namespace: Google.DevicesAndServices.Health.V4
Assembly: Google.DevicesAndServices.Health.V4.dll
Syntax
public sealed class DataSubscriptionServiceClientImpl : DataSubscriptionServiceClient
Remarks
Data Subscription Service that allows clients (e.g., Fitbit 3P applications, internal Fitbit Services) to manage their subscriber endpoints. This service provides CRUD APIs for subscribers, and also offers functionalities for subscriber verification and statistics.
Constructors
DataSubscriptionServiceClientImpl(DataSubscriptionServiceClient, DataSubscriptionServiceSettings, ILogger)
Constructs a client wrapper for the DataSubscriptionService service, with the specified gRPC client and settings.
Declaration
public DataSubscriptionServiceClientImpl(DataSubscriptionService.DataSubscriptionServiceClient grpcClient, DataSubscriptionServiceSettings settings, ILogger logger)
Parameters
| Type | Name | Description |
|---|---|---|
| DataSubscriptionService.DataSubscriptionServiceClient | grpcClient | The underlying gRPC client. |
| DataSubscriptionServiceSettings | settings | The base DataSubscriptionServiceSettings used within this client. |
| ILogger | logger | Optional ILogger to use within this client. |
Properties
CreateSubscriberOperationsClient
The long-running operations client for CreateSubscriber.
Declaration
public override OperationsClient CreateSubscriberOperationsClient { get; }
Property Value
| Type | Description |
|---|---|
| OperationsClient |
Overrides
DeleteSubscriberOperationsClient
The long-running operations client for DeleteSubscriber.
Declaration
public override OperationsClient DeleteSubscriberOperationsClient { get; }
Property Value
| Type | Description |
|---|---|
| OperationsClient |
Overrides
GrpcClient
The underlying gRPC DataSubscriptionService client
Declaration
public override DataSubscriptionService.DataSubscriptionServiceClient GrpcClient { get; }
Property Value
| Type | Description |
|---|---|
| DataSubscriptionService.DataSubscriptionServiceClient |
Overrides
UpdateSubscriberOperationsClient
The long-running operations client for UpdateSubscriber.
Declaration
public override OperationsClient UpdateSubscriberOperationsClient { get; }
Property Value
| Type | Description |
|---|---|
| OperationsClient |
Overrides
Methods
CreateSubscriber(CreateSubscriberRequest, CallSettings)
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:
- Verification with Authorization:
- Headers: Includes
Content-Type: application/jsonandAuthorization(with the exact value fromCreateSubscriberPayload.endpoint_authorization.secret). - Body:
{"type": "verification"} - Expected Response: HTTP
201 Created.
- Verification without Authorization:
- Headers: Includes
Content-Type: application/json. TheAuthorizationheader is OMITTED. - Body:
{"type": "verification"} - Expected Response: HTTP
401 Unauthorizedor403 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.
Declaration
public override Operation<Subscriber, CreateSubscriberMetadata> CreateSubscriber(CreateSubscriberRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateSubscriberRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Operation<Subscriber, CreateSubscriberMetadata> | The RPC response. |
Overrides
CreateSubscriberAsync(CreateSubscriberRequest, CallSettings)
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:
- Verification with Authorization:
- Headers: Includes
Content-Type: application/jsonandAuthorization(with the exact value fromCreateSubscriberPayload.endpoint_authorization.secret). - Body:
{"type": "verification"} - Expected Response: HTTP
201 Created.
- Verification without Authorization:
- Headers: Includes
Content-Type: application/json. TheAuthorizationheader is OMITTED. - Body:
{"type": "verification"} - Expected Response: HTTP
401 Unauthorizedor403 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.
Declaration
public override Task<Operation<Subscriber, CreateSubscriberMetadata>> CreateSubscriberAsync(CreateSubscriberRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateSubscriberRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Subscriber, CreateSubscriberMetadata>> | A Task containing the RPC response. |
Overrides
CreateSubscription(CreateSubscriptionRequest, CallSettings)
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.
Declaration
public override Subscription CreateSubscription(CreateSubscriptionRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateSubscriptionRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Subscription | The RPC response. |
Overrides
CreateSubscriptionAsync(CreateSubscriptionRequest, CallSettings)
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.
Declaration
public override Task<Subscription> CreateSubscriptionAsync(CreateSubscriptionRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateSubscriptionRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Subscription> | A Task containing the RPC response. |
Overrides
DeleteSubscriber(DeleteSubscriberRequest, CallSettings)
Deletes a subscriber registration. This will stop all notifications to the subscriber's endpoint.
Declaration
public override Operation<Empty, DeleteSubscriberMetadata> DeleteSubscriber(DeleteSubscriberRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteSubscriberRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Operation<Empty, DeleteSubscriberMetadata> | The RPC response. |
Overrides
DeleteSubscriberAsync(DeleteSubscriberRequest, CallSettings)
Deletes a subscriber registration. This will stop all notifications to the subscriber's endpoint.
Declaration
public override Task<Operation<Empty, DeleteSubscriberMetadata>> DeleteSubscriberAsync(DeleteSubscriberRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteSubscriberRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Empty, DeleteSubscriberMetadata>> | A Task containing the RPC response. |
Overrides
DeleteSubscription(DeleteSubscriptionRequest, CallSettings)
Deletes a specific user subscription, stopping notifications for this user to this subscriber.
Declaration
public override void DeleteSubscription(DeleteSubscriptionRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteSubscriptionRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Overrides
DeleteSubscriptionAsync(DeleteSubscriptionRequest, CallSettings)
Deletes a specific user subscription, stopping notifications for this user to this subscriber.
Declaration
public override Task DeleteSubscriptionAsync(DeleteSubscriptionRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteSubscriptionRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Overrides
ListSubscribers(ListSubscribersRequest, CallSettings)
Lists all subscribers registered within the owned Google Cloud Project.
Declaration
public override PagedEnumerable<ListSubscribersResponse, Subscriber> ListSubscribers(ListSubscribersRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListSubscribersRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedEnumerable<ListSubscribersResponse, Subscriber> | A pageable sequence of Subscriber resources. |
Overrides
ListSubscribersAsync(ListSubscribersRequest, CallSettings)
Lists all subscribers registered within the owned Google Cloud Project.
Declaration
public override PagedAsyncEnumerable<ListSubscribersResponse, Subscriber> ListSubscribersAsync(ListSubscribersRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListSubscribersRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedAsyncEnumerable<ListSubscribersResponse, Subscriber> | A pageable asynchronous sequence of Subscriber resources. |
Overrides
ListSubscriptions(ListSubscriptionsRequest, CallSettings)
Lists all active subscriptions for a given subscriber. This can be filtered, for example, by user or data type.
Declaration
public override PagedEnumerable<ListSubscriptionsResponse, Subscription> ListSubscriptions(ListSubscriptionsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListSubscriptionsRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedEnumerable<ListSubscriptionsResponse, Subscription> | A pageable sequence of Subscription resources. |
Overrides
ListSubscriptionsAsync(ListSubscriptionsRequest, CallSettings)
Lists all active subscriptions for a given subscriber. This can be filtered, for example, by user or data type.
Declaration
public override PagedAsyncEnumerable<ListSubscriptionsResponse, Subscription> ListSubscriptionsAsync(ListSubscriptionsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListSubscriptionsRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedAsyncEnumerable<ListSubscriptionsResponse, Subscription> | A pageable asynchronous sequence of Subscription resources. |
Overrides
UpdateSubscriber(UpdateSubscriberRequest, CallSettings)
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:
- Verification with Authorization: POST to the new or existing
endpoint_uriwith the new or existingAuthorizationsecret. Expects HTTP201 Created. - Verification without Authorization: POST to the
endpoint_uriwithout theAuthorizationheader. Expects HTTP401 Unauthorizedor403 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.
Declaration
public override Operation<Subscriber, UpdateSubscriberMetadata> UpdateSubscriber(UpdateSubscriberRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateSubscriberRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Operation<Subscriber, UpdateSubscriberMetadata> | The RPC response. |
Overrides
UpdateSubscriberAsync(UpdateSubscriberRequest, CallSettings)
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:
- Verification with Authorization: POST to the new or existing
endpoint_uriwith the new or existingAuthorizationsecret. Expects HTTP201 Created. - Verification without Authorization: POST to the
endpoint_uriwithout theAuthorizationheader. Expects HTTP401 Unauthorizedor403 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.
Declaration
public override Task<Operation<Subscriber, UpdateSubscriberMetadata>> UpdateSubscriberAsync(UpdateSubscriberRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateSubscriberRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Subscriber, UpdateSubscriberMetadata>> | A Task containing the RPC response. |
Overrides
UpdateSubscription(UpdateSubscriptionRequest, CallSettings)
Updates the data types for an existing user subscription.
Declaration
public override Subscription UpdateSubscription(UpdateSubscriptionRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateSubscriptionRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Subscription | The RPC response. |
Overrides
UpdateSubscriptionAsync(UpdateSubscriptionRequest, CallSettings)
Updates the data types for an existing user subscription.
Declaration
public override Task<Subscription> UpdateSubscriptionAsync(UpdateSubscriptionRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateSubscriptionRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Subscription> | A Task containing the RPC response. |