# Class DataSubscriptionServiceGrpc.DataSubscriptionServiceBlockingStub (0.2.0)

    public static final class DataSubscriptionServiceGrpc.DataSubscriptionServiceBlockingStub extends AbstractBlockingStub<DataSubscriptionServiceGrpc.DataSubscriptionServiceBlockingStub>

A stub to allow clients to do limited synchronous rpc calls to service DataSubscriptionService.

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.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> io.grpc.stub.AbstractStub \> io.grpc.stub.AbstractBlockingStub \> DataSubscriptionServiceGrpc.DataSubscriptionServiceBlockingStub

## Inherited Members

io.grpc.stub.AbstractBlockingStub.\<T\>newStub(io.grpc.stub.AbstractStub.StubFactory\<T\>,io.grpc.Channel) io.grpc.stub.AbstractBlockingStub.\<T\>newStub(io.grpc.stub.AbstractStub.StubFactory\<T\>,io.grpc.Channel,io.grpc.CallOptions) io.grpc.stub.AbstractStub.\<T\>withOption(io.grpc.CallOptions.Key\<T\>,T) io.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions) io.grpc.stub.AbstractStub.getCallOptions() io.grpc.stub.AbstractStub.getChannel() io.grpc.stub.AbstractStub.withCallCredentials(io.grpc.CallCredentials) io.grpc.stub.AbstractStub.withChannel(io.grpc.Channel) io.grpc.stub.AbstractStub.withCompression(java.lang.String) io.grpc.stub.AbstractStub.withDeadline(io.grpc.Deadline) io.grpc.stub.AbstractStub.withDeadlineAfter(java.time.Duration) io.grpc.stub.AbstractStub.withDeadlineAfter(long,java.util.concurrent.TimeUnit) io.grpc.stub.AbstractStub.withExecutor(java.util.concurrent.Executor) io.grpc.stub.AbstractStub.withInterceptors(io.grpc.ClientInterceptor...) io.grpc.stub.AbstractStub.withMaxInboundMessageSize(int) io.grpc.stub.AbstractStub.withMaxOutboundMessageSize(int) io.grpc.stub.AbstractStub.withOnReadyThreshold(int) io.grpc.stub.AbstractStub.withWaitForReady() [Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Methods

### build(Channel channel, CallOptions callOptions)

    protected DataSubscriptionServiceGrpc.DataSubscriptionServiceBlockingStub build(Channel channel, CallOptions callOptions)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `channel` | `io.grpc.Channel` |
| `callOptions` | `io.grpc.CallOptions` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-health/latest/com.google.devicesandservices.health.v4.DataSubscriptionServiceGrpc.DataSubscriptionServiceBlockingStub` |   |

**Overrides** io.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions)

### createSubscriber(CreateSubscriberRequest request)

    public Operation createSubscriber(CreateSubscriberRequest request)

Registers a new subscriber endpoint to receive notifications.
A subscriber represents an application or service that wishes to receive
data change notifications for users who have granted consent.
**Endpoint Verification:**
For a subscriber to be successfully created, the provided `endpoint_uri`
must be a valid HTTPS endpoint and must pass an automated verification
check. The backend will send two HTTP POST requests to the `endpoint_uri`:

1. **Verification with Authorization:**
   - **Headers:** Includes `Content-Type: application/json` and `Authorization` (with the exact value from `CreateSubscriberPayload.endpoint_authorization.secret`).
   - **Body:** `{"type": "verification"}`
   - **Expected Response:** HTTP `201 Created`.
2. **Verification without Authorization:**
   - **Headers:** Includes `Content-Type: application/json`. The `Authorization` header is OMITTED.
   - **Body:** `{"type": "verification"}`
   - **Expected Response:** HTTP `401 Unauthorized` or `403 Forbidden`. Both tests must pass for the subscriber creation to succeed. If verification fails, the operation will not be completed and an error will be returned. This process ensures the endpoint is reachable and correctly validates the `Authorization` header.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-health/latest/com.google.devicesandservices.health.v4.CreateSubscriberRequest` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html` |   |

### createSubscription(CreateSubscriptionRequest request)

    public Subscription createSubscription(CreateSubscriptionRequest request)

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-health/latest/com.google.devicesandservices.health.v4.CreateSubscriptionRequest` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-health/latest/com.google.devicesandservices.health.v4.Subscription` |   |

### deleteSubscriber(DeleteSubscriberRequest request)

    public Operation deleteSubscriber(DeleteSubscriberRequest request)

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-health/latest/com.google.devicesandservices.health.v4.DeleteSubscriberRequest` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html` |   |

### deleteSubscription(DeleteSubscriptionRequest request)

    public Empty deleteSubscription(DeleteSubscriptionRequest request)

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-health/latest/com.google.devicesandservices.health.v4.DeleteSubscriptionRequest` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html` |   |

### listSubscribers(ListSubscribersRequest request)

    public ListSubscribersResponse listSubscribers(ListSubscribersRequest request)

Lists all subscribers registered within the owned Google Cloud Project.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-health/latest/com.google.devicesandservices.health.v4.ListSubscribersRequest` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-health/latest/com.google.devicesandservices.health.v4.ListSubscribersResponse` |   |

### listSubscriptions(ListSubscriptionsRequest request)

    public ListSubscriptionsResponse listSubscriptions(ListSubscriptionsRequest request)

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-health/latest/com.google.devicesandservices.health.v4.ListSubscriptionsRequest` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-health/latest/com.google.devicesandservices.health.v4.ListSubscriptionsResponse` |   |

### updateSubscriber(UpdateSubscriberRequest request)

    public Operation updateSubscriber(UpdateSubscriberRequest request)

Updates the configuration of an existing subscriber, such as the
endpoint URI or the data types it's interested in.
**Endpoint Verification:**
If the `endpoint_uri` or `endpoint_authorization` field is included in the
`update_mask`, the backend will re-verify the endpoint. The verification
process is the same as described in `CreateSubscriber`:

1. **Verification with Authorization:** POST to the new or existing `endpoint_uri` with the new or existing `Authorization` secret. Expects HTTP `201 Created`.
2. **Verification without Authorization:** POST to the `endpoint_uri` without the `Authorization` header. Expects HTTP `401 Unauthorized` or `403 Forbidden`. Both tests must pass using the potentially updated values for the subscriber update to succeed. If verification fails, the update will not be applied, and an error will be returned.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-health/latest/com.google.devicesandservices.health.v4.UpdateSubscriberRequest` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html` |   |

### updateSubscription(UpdateSubscriptionRequest request)

    public Subscription updateSubscription(UpdateSubscriptionRequest request)

Updates the data types for an existing user subscription.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-health/latest/com.google.devicesandservices.health.v4.UpdateSubscriptionRequest` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-health/latest/com.google.devicesandservices.health.v4.Subscription` |   |