This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * DataPointName name = DataPointName.of("[USER]", "[DATA_TYPE]", "[DATA_POINT]");
+ * DataPoint response = dataPointsServiceClient.getDataPoint(name);
+ * }
+ * }
+ *
+ * Note: close() needs to be called on the DataPointsServiceClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *
| Method | + *Description | + *Method Variants | + *
|---|---|---|
GetDataPoint |
+ * Get a single identifyable data point. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListDataPoints |
+ * Query user health and fitness data points. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateDataPoint |
+ * Creates a single identifiable data point. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateDataPoint |
+ * Updates a single identifiable data point. If a data point with the specified `name` is not found, the request will fail. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
BatchDeleteDataPoints |
+ * Delete a batch of identifyable data points. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ReconcileDataPoints |
+ * Reconcile data points from multiple data sources into a single data stream. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
RollUpDataPoints |
+ * Roll up data points over physical time intervals for supported data types. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DailyRollUpDataPoints |
+ * Roll up data points over civil time intervals for supported data types. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ExportExerciseTcx |
+ * Exports exercise data in TCX format. + * Note: While the Authorization section below states that any one of the listed scopes is accepted, this specific method requires the user to provide both one of the `activity_and_fitness` scopes (`normal` or `readonly`) AND one of the `location` scopes (`normal` or `readonly`) in their access token to succeed. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of DataPointsServiceSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DataPointsServiceSettings dataPointsServiceSettings =
+ * DataPointsServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * DataPointsServiceClient dataPointsServiceClient =
+ * DataPointsServiceClient.create(dataPointsServiceSettings);
+ * }
+ *
+ * To customize the endpoint: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DataPointsServiceSettings dataPointsServiceSettings =
+ * DataPointsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DataPointsServiceClient dataPointsServiceClient =
+ * DataPointsServiceClient.create(dataPointsServiceSettings);
+ * }
+ *
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DataPointsServiceSettings dataPointsServiceSettings =
+ * DataPointsServiceSettings.newHttpJsonBuilder().build();
+ * DataPointsServiceClient dataPointsServiceClient =
+ * DataPointsServiceClient.create(dataPointsServiceSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class DataPointsServiceClient implements BackgroundResource { + private final DataPointsServiceSettings settings; + private final DataPointsServiceStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of DataPointsServiceClient with default settings. */ + public static final DataPointsServiceClient create() throws IOException { + return create(DataPointsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of DataPointsServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final DataPointsServiceClient create(DataPointsServiceSettings settings) + throws IOException { + return new DataPointsServiceClient(settings); + } + + /** + * Constructs an instance of DataPointsServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(DataPointsServiceSettings). + */ + public static final DataPointsServiceClient create(DataPointsServiceStub stub) { + return new DataPointsServiceClient(stub); + } + + /** + * Constructs an instance of DataPointsServiceClient, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected DataPointsServiceClient(DataPointsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((DataPointsServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected DataPointsServiceClient(DataPointsServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final DataPointsServiceSettings getSettings() { + return settings; + } + + public DataPointsServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a single identifyable data point. + * + *
Sample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * DataPointName name = DataPointName.of("[USER]", "[DATA_TYPE]", "[DATA_POINT]");
+ * DataPoint response = dataPointsServiceClient.getDataPoint(name);
+ * }
+ * }
+ *
+ * @param name 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataPoint getDataPoint(DataPointName name) { + GetDataPointRequest request = + GetDataPointRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getDataPoint(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a single identifyable data point. + * + *
Sample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * String name = DataPointName.of("[USER]", "[DATA_TYPE]", "[DATA_POINT]").toString();
+ * DataPoint response = dataPointsServiceClient.getDataPoint(name);
+ * }
+ * }
+ *
+ * @param name 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataPoint getDataPoint(String name) { + GetDataPointRequest request = GetDataPointRequest.newBuilder().setName(name).build(); + return getDataPoint(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a single identifyable data point. + * + *
Sample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * GetDataPointRequest request =
+ * GetDataPointRequest.newBuilder()
+ * .setName(DataPointName.of("[USER]", "[DATA_TYPE]", "[DATA_POINT]").toString())
+ * .build();
+ * DataPoint response = dataPointsServiceClient.getDataPoint(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataPoint getDataPoint(GetDataPointRequest request) {
+ return getDataPointCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get a single identifyable data point.
+ *
+ * Sample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * GetDataPointRequest request =
+ * GetDataPointRequest.newBuilder()
+ * .setName(DataPointName.of("[USER]", "[DATA_TYPE]", "[DATA_POINT]").toString())
+ * .build();
+ * ApiFuture future =
+ * dataPointsServiceClient.getDataPointCallable().futureCall(request);
+ * // Do something.
+ * DataPoint response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * DataTypeName parent = DataTypeName.of("[USER]", "[DATA_TYPE]");
+ * for (DataPoint element : dataPointsServiceClient.listDataPoints(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent data type of the Data Point collection.
+ * Format: `users/me/dataTypes/{data_type}`, e.g.: + *
- `users/me/dataTypes/steps` - `users/me/dataTypes/weight` + *
For a list of the supported data types see the [DataPoint + * data][google.devicesandservices.health.v4.DataPoint] union field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDataPointsPagedResponse listDataPoints(DataTypeName parent) { + ListDataPointsRequest request = + ListDataPointsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDataPoints(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Query user health and fitness data points. + * + *
Sample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * String parent = DataTypeName.of("[USER]", "[DATA_TYPE]").toString();
+ * for (DataPoint element : dataPointsServiceClient.listDataPoints(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent data type of the Data Point collection.
+ * Format: `users/me/dataTypes/{data_type}`, e.g.: + *
- `users/me/dataTypes/steps` - `users/me/dataTypes/weight` + *
For a list of the supported data types see the [DataPoint + * data][google.devicesandservices.health.v4.DataPoint] union field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDataPointsPagedResponse listDataPoints(String parent) { + ListDataPointsRequest request = ListDataPointsRequest.newBuilder().setParent(parent).build(); + return listDataPoints(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Query user health and fitness data points. + * + *
Sample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * ListDataPointsRequest request =
+ * ListDataPointsRequest.newBuilder()
+ * .setParent(DataTypeName.of("[USER]", "[DATA_TYPE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * for (DataPoint element : dataPointsServiceClient.listDataPoints(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDataPointsPagedResponse listDataPoints(ListDataPointsRequest request) {
+ return listDataPointsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Query user health and fitness data points.
+ *
+ * Sample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * ListDataPointsRequest request =
+ * ListDataPointsRequest.newBuilder()
+ * .setParent(DataTypeName.of("[USER]", "[DATA_TYPE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * ApiFuture future =
+ * dataPointsServiceClient.listDataPointsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (DataPoint element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * ListDataPointsRequest request =
+ * ListDataPointsRequest.newBuilder()
+ * .setParent(DataTypeName.of("[USER]", "[DATA_TYPE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * while (true) {
+ * ListDataPointsResponse response =
+ * dataPointsServiceClient.listDataPointsCallable().call(request);
+ * for (DataPoint element : response.getDataPointsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * DataTypeName parent = DataTypeName.of("[USER]", "[DATA_TYPE]");
+ * DataPoint dataPoint = DataPoint.newBuilder().build();
+ * DataPoint response = dataPointsServiceClient.createDataPointAsync(parent, dataPoint).get();
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource name where the data point will be created. Format:
+ * `users/{user}/dataTypes/{data_type}`
+ * @param dataPoint Required. The data point to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * String parent = DataTypeName.of("[USER]", "[DATA_TYPE]").toString();
+ * DataPoint dataPoint = DataPoint.newBuilder().build();
+ * DataPoint response = dataPointsServiceClient.createDataPointAsync(parent, dataPoint).get();
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource name where the data point will be created. Format:
+ * `users/{user}/dataTypes/{data_type}`
+ * @param dataPoint Required. The data point to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * CreateDataPointRequest request =
+ * CreateDataPointRequest.newBuilder()
+ * .setParent(DataTypeName.of("[USER]", "[DATA_TYPE]").toString())
+ * .setDataPoint(DataPoint.newBuilder().build())
+ * .build();
+ * DataPoint response = dataPointsServiceClient.createDataPointAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * CreateDataPointRequest request =
+ * CreateDataPointRequest.newBuilder()
+ * .setParent(DataTypeName.of("[USER]", "[DATA_TYPE]").toString())
+ * .setDataPoint(DataPoint.newBuilder().build())
+ * .build();
+ * OperationFuture future =
+ * dataPointsServiceClient.createDataPointOperationCallable().futureCall(request);
+ * // Do something.
+ * DataPoint response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ CreateDataPointRequest, DataPoint, CreateDataPointOperationMetadata>
+ createDataPointOperationCallable() {
+ return stub.createDataPointOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a single identifiable data point.
+ *
+ * Sample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * CreateDataPointRequest request =
+ * CreateDataPointRequest.newBuilder()
+ * .setParent(DataTypeName.of("[USER]", "[DATA_TYPE]").toString())
+ * .setDataPoint(DataPoint.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * dataPointsServiceClient.createDataPointCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * DataPoint dataPoint = DataPoint.newBuilder().build();
+ * DataPoint response = dataPointsServiceClient.updateDataPointAsync(dataPoint).get();
+ * }
+ * }
+ *
+ * @param dataPoint Required. The data point to update
+ * The data point's `name` field is used to identify the data point to update. + *
Format: `users/{user}/dataTypes/{data_type}/dataPoints/{data_point}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Note: While the Authorization section below states that any one of the listed scopes is
+ * accepted, this specific method requires the user to provide both one of the
+ * `activity_and_fitness` scopes (`normal` or `readonly`) AND one of the `location` scopes
+ * (`normal` or `readonly`) in their access token to succeed.
+ *
+ * Sample code:
+ *
+ * Format: `users/{user}/dataTypes/exercise/dataPoints/{data_point}` Example:
+ * `users/me/dataTypes/exercise/dataPoints/2026443605080188808`
+ * The `{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.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ExportExerciseTcxResponse exportExerciseTcx(DataPointName name) {
+ ExportExerciseTcxRequest request =
+ ExportExerciseTcxRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return exportExerciseTcx(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Exports exercise data in TCX format.
+ *
+ * Note: While the Authorization section below states that any one of the listed scopes is
+ * accepted, this specific method requires the user to provide both one of the
+ * `activity_and_fitness` scopes (`normal` or `readonly`) AND one of the `location` scopes
+ * (`normal` or `readonly`) in their access token to succeed.
+ *
+ * Sample code:
+ *
+ * Format: `users/{user}/dataTypes/exercise/dataPoints/{data_point}` Example:
+ * `users/me/dataTypes/exercise/dataPoints/2026443605080188808`
+ * The `{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.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ExportExerciseTcxResponse exportExerciseTcx(String name) {
+ ExportExerciseTcxRequest request = ExportExerciseTcxRequest.newBuilder().setName(name).build();
+ return exportExerciseTcx(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Exports exercise data in TCX format.
+ *
+ * Note: While the Authorization section below states that any one of the listed scopes is
+ * accepted, this specific method requires the user to provide both one of the
+ * `activity_and_fitness` scopes (`normal` or `readonly`) AND one of the `location` scopes
+ * (`normal` or `readonly`) in their access token to succeed.
+ *
+ * Sample code:
+ *
+ * Note: While the Authorization section below states that any one of the listed scopes is
+ * accepted, this specific method requires the user to provide both one of the
+ * `activity_and_fitness` scopes (`normal` or `readonly`) AND one of the `location` scopes
+ * (`normal` or `readonly`) in their access token to succeed.
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of getDataPoint:
+ *
+ * To configure the RetrySettings of a Long Running Operation method, create an
+ * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to
+ * configure the RetrySettings for createDataPoint:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class provides the ability to make remote calls to the backing service through method
+ * calls that map to API methods. Sample code to get started:
+ *
+ * Note: close() needs to be called on the HealthProfileServiceClient object to clean up
+ * resources such as threads. In the example above, try-with-resources is used, which automatically
+ * calls close().
+ *
+ * GetProfile Returns user Profile details. Request object method variants only take one parameter, a request object, which must be constructed before the call. getProfile(GetProfileRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. getProfile(ProfileName name)
+ * getProfile(String name)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. getProfileCallable()
+ * UpdateProfile Updates the user's profile details. Request object method variants only take one parameter, a request object, which must be constructed before the call. updateProfile(UpdateProfileRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. updateProfile(Profile profile, FieldMask updateMask)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. updateProfileCallable()
+ * GetSettings Returns user settings details. Request object method variants only take one parameter, a request object, which must be constructed before the call. getSettings(GetSettingsRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. getSettings(SettingsName name)
+ * getSettings(String name)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. getSettingsCallable()
+ * UpdateSettings Updates the user's settings details. Request object method variants only take one parameter, a request object, which must be constructed before the call. updateSettings(UpdateSettingsRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. updateSettings(Settings settings, FieldMask updateMask)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. updateSettingsCallable()
+ * GetIdentity Gets the user's identity.
+ * It includes the legacy Fitbit user ID and the Google user ID and it can be used by migrating clients to map identifiers between the two systems. Request object method variants only take one parameter, a request object, which must be constructed before the call. getIdentity(GetIdentityRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. getIdentity(IdentityName name)
+ * getIdentity(String name)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. getIdentityCallable()
+ * See the individual methods for example code.
+ *
+ * Many parameters require resource names to be formatted in a particular way. To assist with
+ * these names, this class includes a format method for each type of name, and additionally a parse
+ * method to extract the individual identifiers contained within names that are returned.
+ *
+ * This class can be customized by passing in a custom instance of HealthProfileServiceSettings
+ * to create(). For example:
+ *
+ * To customize credentials:
+ *
+ * To customize the endpoint:
+ *
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@Generated("by gapic-generator-java")
+public class HealthProfileServiceClient implements BackgroundResource {
+ private final HealthProfileServiceSettings settings;
+ private final HealthProfileServiceStub stub;
+
+ /** Constructs an instance of HealthProfileServiceClient with default settings. */
+ public static final HealthProfileServiceClient create() throws IOException {
+ return create(HealthProfileServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of HealthProfileServiceClient, using the given settings. The channels
+ * are created based on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final HealthProfileServiceClient create(HealthProfileServiceSettings settings)
+ throws IOException {
+ return new HealthProfileServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of HealthProfileServiceClient, using the given stub for making calls.
+ * This is for advanced usage - prefer using create(HealthProfileServiceSettings).
+ */
+ public static final HealthProfileServiceClient create(HealthProfileServiceStub stub) {
+ return new HealthProfileServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of HealthProfileServiceClient, using the given settings. This is
+ * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+ * should be preferred.
+ */
+ protected HealthProfileServiceClient(HealthProfileServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((HealthProfileServiceStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected HealthProfileServiceClient(HealthProfileServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final HealthProfileServiceSettings getSettings() {
+ return settings;
+ }
+
+ public HealthProfileServiceStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns user Profile details.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * It includes the legacy Fitbit user ID and the Google user ID and it can be used by migrating
+ * clients to map identifiers between the two systems.
+ *
+ * Sample code:
+ *
+ * It includes the legacy Fitbit user ID and the Google user ID and it can be used by migrating
+ * clients to map identifiers between the two systems.
+ *
+ * Sample code:
+ *
+ * It includes the legacy Fitbit user ID and the Google user ID and it can be used by migrating
+ * clients to map identifiers between the two systems.
+ *
+ * Sample code:
+ *
+ * It includes the legacy Fitbit user ID and the Google user ID and it can be used by migrating
+ * clients to map identifiers between the two systems.
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of getProfile:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= DataPointsServiceClient =======================
+ *
+ * Service Description: Data Points Service exposing the user's health and fitness measured and
+ * derived data.
+ *
+ * Sample for DataPointsServiceClient:
+ *
+ * ======================= HealthProfileServiceClient =======================
+ *
+ * Service Description: Health Profile Service
+ *
+ * Sample for HealthProfileServiceClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class DataPointsServiceStub implements BackgroundResource {
+
+ public OperationsStub getOperationsStub() {
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
+ }
+
+ public UnaryCallable The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of getDataPoint:
+ *
+ * To configure the RetrySettings of a Long Running Operation method, create an
+ * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to
+ * configure the RetrySettings for createDataPoint:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcDataPointsServiceCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcDataPointsServiceStub extends DataPointsServiceStub {
+ private static final MethodDescriptor{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * UpdateDataPointRequest request =
+ * UpdateDataPointRequest.newBuilder().setDataPoint(DataPoint.newBuilder().build()).build();
+ * DataPoint response = dataPointsServiceClient.updateDataPointAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * UpdateDataPointRequest request =
+ * UpdateDataPointRequest.newBuilder().setDataPoint(DataPoint.newBuilder().build()).build();
+ * OperationFuture
+ */
+ public final OperationCallable<
+ UpdateDataPointRequest, DataPoint, UpdateDataPointOperationMetadata>
+ updateDataPointOperationCallable() {
+ return stub.updateDataPointOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a single identifiable data point. If a data point with the specified `name` is not
+ * found, the request will fail.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * UpdateDataPointRequest request =
+ * UpdateDataPointRequest.newBuilder().setDataPoint(DataPoint.newBuilder().build()).build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * BatchDeleteDataPointsRequest request =
+ * BatchDeleteDataPointsRequest.newBuilder()
+ * .setParent(DataTypeName.of("[USER]", "[DATA_TYPE]").toString())
+ * .addAllNames(new ArrayList
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture<
+ BatchDeleteDataPointsResponse, BatchDeleteDataPointsOperationMetadata>
+ batchDeleteDataPointsAsync(BatchDeleteDataPointsRequest request) {
+ return batchDeleteDataPointsOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Delete a batch of identifyable data points.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * BatchDeleteDataPointsRequest request =
+ * BatchDeleteDataPointsRequest.newBuilder()
+ * .setParent(DataTypeName.of("[USER]", "[DATA_TYPE]").toString())
+ * .addAllNames(new ArrayList
+ */
+ public final OperationCallable<
+ BatchDeleteDataPointsRequest,
+ BatchDeleteDataPointsResponse,
+ BatchDeleteDataPointsOperationMetadata>
+ batchDeleteDataPointsOperationCallable() {
+ return stub.batchDeleteDataPointsOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Delete a batch of identifyable data points.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * BatchDeleteDataPointsRequest request =
+ * BatchDeleteDataPointsRequest.newBuilder()
+ * .setParent(DataTypeName.of("[USER]", "[DATA_TYPE]").toString())
+ * .addAllNames(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * ReconcileDataPointsRequest request =
+ * ReconcileDataPointsRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setDataSourceFamily("dataSourceFamily586548265")
+ * .build();
+ * for (ReconciledDataPoint element :
+ * dataPointsServiceClient.reconcileDataPoints(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ReconcileDataPointsPagedResponse reconcileDataPoints(
+ ReconcileDataPointsRequest request) {
+ return reconcileDataPointsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reconcile data points from multiple data sources into a single data stream.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * ReconcileDataPointsRequest request =
+ * ReconcileDataPointsRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setDataSourceFamily("dataSourceFamily586548265")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * ReconcileDataPointsRequest request =
+ * ReconcileDataPointsRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setDataSourceFamily("dataSourceFamily586548265")
+ * .build();
+ * while (true) {
+ * ReconcileDataPointsResponse response =
+ * dataPointsServiceClient.reconcileDataPointsCallable().call(request);
+ * for (ReconciledDataPoint element : response.getDataPointsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * RollUpDataPointsRequest request =
+ * RollUpDataPointsRequest.newBuilder()
+ * .setParent(DataTypeName.of("[USER]", "[DATA_TYPE]").toString())
+ * .setRange(Interval.newBuilder().build())
+ * .setWindowSize(Duration.newBuilder().build())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setDataSourceFamily("dataSourceFamily586548265")
+ * .build();
+ * for (RollupDataPoint element :
+ * dataPointsServiceClient.rollUpDataPoints(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final RollUpDataPointsPagedResponse rollUpDataPoints(RollUpDataPointsRequest request) {
+ return rollUpDataPointsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Roll up data points over physical time intervals for supported data types.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * RollUpDataPointsRequest request =
+ * RollUpDataPointsRequest.newBuilder()
+ * .setParent(DataTypeName.of("[USER]", "[DATA_TYPE]").toString())
+ * .setRange(Interval.newBuilder().build())
+ * .setWindowSize(Duration.newBuilder().build())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setDataSourceFamily("dataSourceFamily586548265")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * RollUpDataPointsRequest request =
+ * RollUpDataPointsRequest.newBuilder()
+ * .setParent(DataTypeName.of("[USER]", "[DATA_TYPE]").toString())
+ * .setRange(Interval.newBuilder().build())
+ * .setWindowSize(Duration.newBuilder().build())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setDataSourceFamily("dataSourceFamily586548265")
+ * .build();
+ * while (true) {
+ * RollUpDataPointsResponse response =
+ * dataPointsServiceClient.rollUpDataPointsCallable().call(request);
+ * for (RollupDataPoint element : response.getRollupDataPointsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * DailyRollUpDataPointsRequest request =
+ * DailyRollUpDataPointsRequest.newBuilder()
+ * .setParent(DataTypeName.of("[USER]", "[DATA_TYPE]").toString())
+ * .setRange(CivilTimeInterval.newBuilder().build())
+ * .setWindowSizeDays(1064520774)
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setDataSourceFamily("dataSourceFamily586548265")
+ * .build();
+ * DailyRollUpDataPointsResponse response =
+ * dataPointsServiceClient.dailyRollUpDataPoints(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DailyRollUpDataPointsResponse dailyRollUpDataPoints(
+ DailyRollUpDataPointsRequest request) {
+ return dailyRollUpDataPointsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Roll up data points over civil time intervals for supported data types.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * DailyRollUpDataPointsRequest request =
+ * DailyRollUpDataPointsRequest.newBuilder()
+ * .setParent(DataTypeName.of("[USER]", "[DATA_TYPE]").toString())
+ * .setRange(CivilTimeInterval.newBuilder().build())
+ * .setWindowSizeDays(1064520774)
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setDataSourceFamily("dataSourceFamily586548265")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * DataPointName name = DataPointName.of("[USER]", "[DATA_TYPE]", "[DATA_POINT]");
+ * ExportExerciseTcxResponse response = dataPointsServiceClient.exportExerciseTcx(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the exercise data point to export.
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * String name = DataPointName.of("[USER]", "[DATA_TYPE]", "[DATA_POINT]").toString();
+ * ExportExerciseTcxResponse response = dataPointsServiceClient.exportExerciseTcx(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the exercise data point to export.
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * ExportExerciseTcxRequest request =
+ * ExportExerciseTcxRequest.newBuilder()
+ * .setName(DataPointName.of("[USER]", "[DATA_TYPE]", "[DATA_POINT]").toString())
+ * .setPartialData(true)
+ * .build();
+ * ExportExerciseTcxResponse response = dataPointsServiceClient.exportExerciseTcx(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ExportExerciseTcxResponse exportExerciseTcx(ExportExerciseTcxRequest request) {
+ return exportExerciseTcxCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Exports exercise data in TCX format.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * ExportExerciseTcxRequest request =
+ * ExportExerciseTcxRequest.newBuilder()
+ * .setName(DataPointName.of("[USER]", "[DATA_TYPE]", "[DATA_POINT]").toString())
+ * .setPartialData(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DataPointsServiceSettings.Builder dataPointsServiceSettingsBuilder =
+ * DataPointsServiceSettings.newBuilder();
+ * dataPointsServiceSettingsBuilder
+ * .getDataPointSettings()
+ * .setRetrySettings(
+ * dataPointsServiceSettingsBuilder
+ * .getDataPointSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * DataPointsServiceSettings dataPointsServiceSettings = dataPointsServiceSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DataPointsServiceSettings.Builder dataPointsServiceSettingsBuilder =
+ * DataPointsServiceSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ * OperationalTimedPollAlgorithm.create(
+ * RetrySettings.newBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ * .setRetryDelayMultiplier(1.5)
+ * .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ * .setTotalTimeoutDuration(Duration.ofHours(24))
+ * .build());
+ * dataPointsServiceSettingsBuilder
+ * .createClusterOperationSettings()
+ * .setPollingAlgorithm(timedRetryAlgorithm)
+ * .build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class DataPointsServiceSettings extends ClientSettings{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * ProfileName name = ProfileName.of("[USER]");
+ * Profile response = healthProfileServiceClient.getProfile(name);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ *
+ *
+ * Method
+ * Description
+ * Method Variants
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * HealthProfileServiceSettings healthProfileServiceSettings =
+ * HealthProfileServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create(healthProfileServiceSettings);
+ * }
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * HealthProfileServiceSettings healthProfileServiceSettings =
+ * HealthProfileServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create(healthProfileServiceSettings);
+ * }
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * HealthProfileServiceSettings healthProfileServiceSettings =
+ * HealthProfileServiceSettings.newHttpJsonBuilder().build();
+ * HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create(healthProfileServiceSettings);
+ * }
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * ProfileName name = ProfileName.of("[USER]");
+ * Profile response = healthProfileServiceClient.getProfile(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Profile. Format: `users/me/profile`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Profile getProfile(ProfileName name) {
+ GetProfileRequest request =
+ GetProfileRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getProfile(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns user Profile details.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * String name = ProfileName.of("[USER]").toString();
+ * Profile response = healthProfileServiceClient.getProfile(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Profile. Format: `users/me/profile`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Profile getProfile(String name) {
+ GetProfileRequest request = GetProfileRequest.newBuilder().setName(name).build();
+ return getProfile(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns user Profile details.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * GetProfileRequest request =
+ * GetProfileRequest.newBuilder().setName(ProfileName.of("[USER]").toString()).build();
+ * Profile response = healthProfileServiceClient.getProfile(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Profile getProfile(GetProfileRequest request) {
+ return getProfileCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns user Profile details.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * GetProfileRequest request =
+ * GetProfileRequest.newBuilder().setName(ProfileName.of("[USER]").toString()).build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * Profile profile = Profile.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Profile response = healthProfileServiceClient.updateProfile(profile, updateMask);
+ * }
+ * }
+ *
+ * @param profile Required. Profile details.
+ * @param updateMask Optional. The list of fields to be updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Profile updateProfile(Profile profile, FieldMask updateMask) {
+ UpdateProfileRequest request =
+ UpdateProfileRequest.newBuilder().setProfile(profile).setUpdateMask(updateMask).build();
+ return updateProfile(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the user's profile details.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * UpdateProfileRequest request =
+ * UpdateProfileRequest.newBuilder()
+ * .setProfile(Profile.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Profile response = healthProfileServiceClient.updateProfile(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Profile updateProfile(UpdateProfileRequest request) {
+ return updateProfileCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the user's profile details.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * UpdateProfileRequest request =
+ * UpdateProfileRequest.newBuilder()
+ * .setProfile(Profile.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * SettingsName name = SettingsName.of("[USER]");
+ * Settings response = healthProfileServiceClient.getSettings(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Settings. Format: `users/me/settings`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Settings getSettings(SettingsName name) {
+ GetSettingsRequest request =
+ GetSettingsRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getSettings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns user settings details.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * String name = SettingsName.of("[USER]").toString();
+ * Settings response = healthProfileServiceClient.getSettings(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Settings. Format: `users/me/settings`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Settings getSettings(String name) {
+ GetSettingsRequest request = GetSettingsRequest.newBuilder().setName(name).build();
+ return getSettings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns user settings details.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * GetSettingsRequest request =
+ * GetSettingsRequest.newBuilder().setName(SettingsName.of("[USER]").toString()).build();
+ * Settings response = healthProfileServiceClient.getSettings(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Settings getSettings(GetSettingsRequest request) {
+ return getSettingsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns user settings details.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * GetSettingsRequest request =
+ * GetSettingsRequest.newBuilder().setName(SettingsName.of("[USER]").toString()).build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * Settings settings = Settings.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Settings response = healthProfileServiceClient.updateSettings(settings, updateMask);
+ * }
+ * }
+ *
+ * @param settings Required. Settings details
+ * @param updateMask Optional. The list of fields to be updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Settings updateSettings(Settings settings, FieldMask updateMask) {
+ UpdateSettingsRequest request =
+ UpdateSettingsRequest.newBuilder().setSettings(settings).setUpdateMask(updateMask).build();
+ return updateSettings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the user's settings details.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * UpdateSettingsRequest request =
+ * UpdateSettingsRequest.newBuilder()
+ * .setSettings(Settings.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Settings response = healthProfileServiceClient.updateSettings(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Settings updateSettings(UpdateSettingsRequest request) {
+ return updateSettingsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the user's settings details.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * UpdateSettingsRequest request =
+ * UpdateSettingsRequest.newBuilder()
+ * .setSettings(Settings.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * IdentityName name = IdentityName.of("[USER]");
+ * Identity response = healthProfileServiceClient.getIdentity(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the Identity. Format: `users/me/identity`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Identity getIdentity(IdentityName name) {
+ GetIdentityRequest request =
+ GetIdentityRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getIdentity(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the user's identity.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * String name = IdentityName.of("[USER]").toString();
+ * Identity response = healthProfileServiceClient.getIdentity(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the Identity. Format: `users/me/identity`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Identity getIdentity(String name) {
+ GetIdentityRequest request = GetIdentityRequest.newBuilder().setName(name).build();
+ return getIdentity(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the user's identity.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * GetIdentityRequest request =
+ * GetIdentityRequest.newBuilder().setName(IdentityName.of("[USER]").toString()).build();
+ * Identity response = healthProfileServiceClient.getIdentity(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Identity getIdentity(GetIdentityRequest request) {
+ return getIdentityCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the user's identity.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * GetIdentityRequest request =
+ * GetIdentityRequest.newBuilder().setName(IdentityName.of("[USER]").toString()).build();
+ * ApiFuture
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * HealthProfileServiceSettings.Builder healthProfileServiceSettingsBuilder =
+ * HealthProfileServiceSettings.newBuilder();
+ * healthProfileServiceSettingsBuilder
+ * .getProfileSettings()
+ * .setRetrySettings(
+ * healthProfileServiceSettingsBuilder
+ * .getProfileSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * HealthProfileServiceSettings healthProfileServiceSettings =
+ * healthProfileServiceSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ */
+@Generated("by gapic-generator-java")
+public class HealthProfileServiceSettings extends ClientSettings{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DataPointsServiceClient dataPointsServiceClient = DataPointsServiceClient.create()) {
+ * DataPointName name = DataPointName.of("[USER]", "[DATA_TYPE]", "[DATA_POINT]");
+ * DataPoint response = dataPointsServiceClient.getDataPoint(name);
+ * }
+ * }
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HealthProfileServiceClient healthProfileServiceClient =
+ * HealthProfileServiceClient.create()) {
+ * ProfileName name = ProfileName.of("[USER]");
+ * Profile response = healthProfileServiceClient.getProfile(name);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.devicesandservices.health.v4;
+
+import javax.annotation.Generated;
diff --git a/java-health/google-cloud-health/src/main/java/com/google/devicesandservices/health/v4/stub/DataPointsServiceStub.java b/java-health/google-cloud-health/src/main/java/com/google/devicesandservices/health/v4/stub/DataPointsServiceStub.java
new file mode 100644
index 000000000000..ef530394eaf0
--- /dev/null
+++ b/java-health/google-cloud-health/src/main/java/com/google/devicesandservices/health/v4/stub/DataPointsServiceStub.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.devicesandservices.health.v4.stub;
+
+import static com.google.devicesandservices.health.v4.DataPointsServiceClient.ListDataPointsPagedResponse;
+import static com.google.devicesandservices.health.v4.DataPointsServiceClient.ReconcileDataPointsPagedResponse;
+import static com.google.devicesandservices.health.v4.DataPointsServiceClient.RollUpDataPointsPagedResponse;
+
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.devicesandservices.health.v4.BatchDeleteDataPointsOperationMetadata;
+import com.google.devicesandservices.health.v4.BatchDeleteDataPointsRequest;
+import com.google.devicesandservices.health.v4.BatchDeleteDataPointsResponse;
+import com.google.devicesandservices.health.v4.CreateDataPointOperationMetadata;
+import com.google.devicesandservices.health.v4.CreateDataPointRequest;
+import com.google.devicesandservices.health.v4.DailyRollUpDataPointsRequest;
+import com.google.devicesandservices.health.v4.DailyRollUpDataPointsResponse;
+import com.google.devicesandservices.health.v4.DataPoint;
+import com.google.devicesandservices.health.v4.ExportExerciseTcxRequest;
+import com.google.devicesandservices.health.v4.ExportExerciseTcxResponse;
+import com.google.devicesandservices.health.v4.GetDataPointRequest;
+import com.google.devicesandservices.health.v4.ListDataPointsRequest;
+import com.google.devicesandservices.health.v4.ListDataPointsResponse;
+import com.google.devicesandservices.health.v4.ReconcileDataPointsRequest;
+import com.google.devicesandservices.health.v4.ReconcileDataPointsResponse;
+import com.google.devicesandservices.health.v4.RollUpDataPointsRequest;
+import com.google.devicesandservices.health.v4.RollUpDataPointsResponse;
+import com.google.devicesandservices.health.v4.UpdateDataPointOperationMetadata;
+import com.google.devicesandservices.health.v4.UpdateDataPointRequest;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the DataPointsService service API.
+ *
+ *
+ *
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DataPointsServiceStubSettings.Builder dataPointsServiceSettingsBuilder =
+ * DataPointsServiceStubSettings.newBuilder();
+ * dataPointsServiceSettingsBuilder
+ * .getDataPointSettings()
+ * .setRetrySettings(
+ * dataPointsServiceSettingsBuilder
+ * .getDataPointSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * DataPointsServiceStubSettings dataPointsServiceSettings =
+ * dataPointsServiceSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ *
+ * {@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DataPointsServiceStubSettings.Builder dataPointsServiceSettingsBuilder =
+ * DataPointsServiceStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ * OperationalTimedPollAlgorithm.create(
+ * RetrySettings.newBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ * .setRetryDelayMultiplier(1.5)
+ * .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ * .setTotalTimeoutDuration(Duration.ofHours(24))
+ * .build());
+ * dataPointsServiceSettingsBuilder
+ * .createClusterOperationSettings()
+ * .setPollingAlgorithm(timedRetryAlgorithm)
+ * .build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+@SuppressWarnings("CanonicalDuration")
+public class DataPointsServiceStubSettings extends StubSettings