| GitHub Repository | Product Reference | RPC Documentation |
Service Description: Health Profile Service
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:
// 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);
}
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().
| Method | Description | Method Variants |
|---|---|---|
GetProfile |
Returns user Profile details. |
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.
|
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.
"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.
|
GetSettings |
Returns user settings details. |
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.
|
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.
"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.
|
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.
"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.
|
GetIrnProfile |
Returns user's IRN Profile details. |
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.
|
GetPairedDevice |
Returns user's Device. |
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.
|
ListPairedDevices |
Returns the user's list of paired 1P trackers and smartwatches. |
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 HealthProfileServiceSettings to create(). For example:
To customize credentials:
// 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);
To customize the endpoint:
// 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);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// 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);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final HealthProfileServiceClient create()Constructs an instance of HealthProfileServiceClient with default settings.
| Returns | |
|---|---|
| Type | Description |
HealthProfileServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(HealthProfileServiceSettings settings)
public static final HealthProfileServiceClient create(HealthProfileServiceSettings settings)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.
| Parameter | |
|---|---|
| Name | Description |
settings |
HealthProfileServiceSettings |
| Returns | |
|---|---|
| Type | Description |
HealthProfileServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(HealthProfileServiceStub stub)
public static final HealthProfileServiceClient create(HealthProfileServiceStub stub)Constructs an instance of HealthProfileServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(HealthProfileServiceSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
HealthProfileServiceStub |
| Returns | |
|---|---|
| Type | Description |
HealthProfileServiceClient |
|
Constructors
HealthProfileServiceClient(HealthProfileServiceSettings settings)
protected HealthProfileServiceClient(HealthProfileServiceSettings settings)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.
| Parameter | |
|---|---|
| Name | Description |
settings |
HealthProfileServiceSettings |
HealthProfileServiceClient(HealthProfileServiceStub stub)
protected HealthProfileServiceClient(HealthProfileServiceStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
HealthProfileServiceStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)| Parameters | |
|---|---|
| Name | Description |
duration |
long |
unit |
TimeUnit |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
| Exceptions | |
|---|---|
| Type | Description |
InterruptedException |
|
close()
public final void close()getIdentity(GetIdentityRequest request)
public final Identity getIdentity(GetIdentityRequest request)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.
Sample 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);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetIdentityRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Identity |
|
getIdentity(IdentityName name)
public final Identity getIdentity(IdentityName name)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.
Sample 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);
}
| Parameter | |
|---|---|
| Name | Description |
name |
IdentityNameRequired. The resource name of the Identity. Format: |
| Returns | |
|---|---|
| Type | Description |
Identity |
|
getIdentity(String name)
public final Identity getIdentity(String name)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.
Sample 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);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The resource name of the Identity. Format: |
| Returns | |
|---|---|
| Type | Description |
Identity |
|
getIdentityCallable()
public final UnaryCallable<GetIdentityRequest,Identity> getIdentityCallable()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.
Sample 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<Identity> future =
healthProfileServiceClient.getIdentityCallable().futureCall(request);
// Do something.
Identity response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetIdentityRequest,Identity> |
|
getIrnProfile(GetIrnProfileRequest request)
public final IrnProfile getIrnProfile(GetIrnProfileRequest request)Returns user's IRN Profile details.
Sample 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()) {
GetIrnProfileRequest request =
GetIrnProfileRequest.newBuilder().setName(IrnProfileName.of("[USER]").toString()).build();
IrnProfile response = healthProfileServiceClient.getIrnProfile(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetIrnProfileRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
IrnProfile |
|
getIrnProfile(IrnProfileName name)
public final IrnProfile getIrnProfile(IrnProfileName name)Returns user's IRN Profile details.
Sample 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()) {
IrnProfileName name = IrnProfileName.of("[USER]");
IrnProfile response = healthProfileServiceClient.getIrnProfile(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
IrnProfileNameRequired. The resource name of the IRN Profile. Format: |
| Returns | |
|---|---|
| Type | Description |
IrnProfile |
|
getIrnProfile(String name)
public final IrnProfile getIrnProfile(String name)Returns user's IRN Profile details.
Sample 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 = IrnProfileName.of("[USER]").toString();
IrnProfile response = healthProfileServiceClient.getIrnProfile(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The resource name of the IRN Profile. Format: |
| Returns | |
|---|---|
| Type | Description |
IrnProfile |
|
getIrnProfileCallable()
public final UnaryCallable<GetIrnProfileRequest,IrnProfile> getIrnProfileCallable()Returns user's IRN Profile details.
Sample 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()) {
GetIrnProfileRequest request =
GetIrnProfileRequest.newBuilder().setName(IrnProfileName.of("[USER]").toString()).build();
ApiFuture<IrnProfile> future =
healthProfileServiceClient.getIrnProfileCallable().futureCall(request);
// Do something.
IrnProfile response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetIrnProfileRequest,IrnProfile> |
|
getPairedDevice(GetPairedDeviceRequest request)
public final PairedDevice getPairedDevice(GetPairedDeviceRequest request)Returns user's Device.
Sample 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()) {
GetPairedDeviceRequest request =
GetPairedDeviceRequest.newBuilder()
.setName(PairedDeviceName.of("[USER]", "[PAIRED_DEVICE]").toString())
.build();
PairedDevice response = healthProfileServiceClient.getPairedDevice(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetPairedDeviceRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
PairedDevice |
|
getPairedDevice(PairedDeviceName name)
public final PairedDevice getPairedDevice(PairedDeviceName name)Returns user's Device.
Sample 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()) {
PairedDeviceName name = PairedDeviceName.of("[USER]", "[PAIRED_DEVICE]");
PairedDevice response = healthProfileServiceClient.getPairedDevice(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
PairedDeviceNameRequired. The name of the device to retrieve. Format: users/{user}/devices/{device} |
| Returns | |
|---|---|
| Type | Description |
PairedDevice |
|
getPairedDevice(String name)
public final PairedDevice getPairedDevice(String name)Returns user's Device.
Sample 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 = PairedDeviceName.of("[USER]", "[PAIRED_DEVICE]").toString();
PairedDevice response = healthProfileServiceClient.getPairedDevice(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the device to retrieve. Format: users/{user}/devices/{device} |
| Returns | |
|---|---|
| Type | Description |
PairedDevice |
|
getPairedDeviceCallable()
public final UnaryCallable<GetPairedDeviceRequest,PairedDevice> getPairedDeviceCallable()Returns user's Device.
Sample 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()) {
GetPairedDeviceRequest request =
GetPairedDeviceRequest.newBuilder()
.setName(PairedDeviceName.of("[USER]", "[PAIRED_DEVICE]").toString())
.build();
ApiFuture<PairedDevice> future =
healthProfileServiceClient.getPairedDeviceCallable().futureCall(request);
// Do something.
PairedDevice response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetPairedDeviceRequest,PairedDevice> |
|
getProfile(GetProfileRequest request)
public final Profile getProfile(GetProfileRequest request)Returns user Profile details.
Sample 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);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetProfileRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Profile |
|
getProfile(ProfileName name)
public final Profile getProfile(ProfileName name)Returns user Profile details.
Sample 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);
}
| Parameter | |
|---|---|
| Name | Description |
name |
ProfileNameRequired. The name of the Profile. Format: |
| Returns | |
|---|---|
| Type | Description |
Profile |
|
getProfile(String name)
public final Profile getProfile(String name)Returns user Profile details.
Sample 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);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the Profile. Format: |
| Returns | |
|---|---|
| Type | Description |
Profile |
|
getProfileCallable()
public final UnaryCallable<GetProfileRequest,Profile> getProfileCallable()Returns user Profile details.
Sample 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<Profile> future =
healthProfileServiceClient.getProfileCallable().futureCall(request);
// Do something.
Profile response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetProfileRequest,Profile> |
|
getSettings()
public final HealthProfileServiceSettings getSettings()| Returns | |
|---|---|
| Type | Description |
HealthProfileServiceSettings |
|
getSettings(GetSettingsRequest request)
public final Settings getSettings(GetSettingsRequest request)Returns user settings details.
Sample 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);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetSettingsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Settings |
|
getSettings(SettingsName name)
public final Settings getSettings(SettingsName name)Returns user settings details.
Sample 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);
}
| Parameter | |
|---|---|
| Name | Description |
name |
SettingsNameRequired. The name of the Settings. Format: |
| Returns | |
|---|---|
| Type | Description |
Settings |
|
getSettings(String name)
public final Settings getSettings(String name)Returns user settings details.
Sample 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);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the Settings. Format: |
| Returns | |
|---|---|
| Type | Description |
Settings |
|
getSettingsCallable()
public final UnaryCallable<GetSettingsRequest,Settings> getSettingsCallable()Returns user settings details.
Sample 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<Settings> future =
healthProfileServiceClient.getSettingsCallable().futureCall(request);
// Do something.
Settings response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetSettingsRequest,Settings> |
|
getStub()
public HealthProfileServiceStub getStub()| Returns | |
|---|---|
| Type | Description |
HealthProfileServiceStub |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listPairedDevices(ListPairedDevicesRequest request)
public final HealthProfileServiceClient.ListPairedDevicesPagedResponse listPairedDevices(ListPairedDevicesRequest request)Returns the user's list of paired 1P trackers and smartwatches.
Sample 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()) {
ListPairedDevicesRequest request =
ListPairedDevicesRequest.newBuilder()
.setParent(UserName.of("[USER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (PairedDevice element :
healthProfileServiceClient.listPairedDevices(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListPairedDevicesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
HealthProfileServiceClient.ListPairedDevicesPagedResponse |
|
listPairedDevices(UserName parent)
public final HealthProfileServiceClient.ListPairedDevicesPagedResponse listPairedDevices(UserName parent)Returns the user's list of paired 1P trackers and smartwatches.
Sample 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()) {
UserName parent = UserName.of("[USER]");
for (PairedDevice element :
healthProfileServiceClient.listPairedDevices(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
UserNameRequired. The parent, which owns this collection of devices. Format: users/{user} |
| Returns | |
|---|---|
| Type | Description |
HealthProfileServiceClient.ListPairedDevicesPagedResponse |
|
listPairedDevices(String parent)
public final HealthProfileServiceClient.ListPairedDevicesPagedResponse listPairedDevices(String parent)Returns the user's list of paired 1P trackers and smartwatches.
Sample 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 parent = UserName.of("[USER]").toString();
for (PairedDevice element :
healthProfileServiceClient.listPairedDevices(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent, which owns this collection of devices. Format: users/{user} |
| Returns | |
|---|---|
| Type | Description |
HealthProfileServiceClient.ListPairedDevicesPagedResponse |
|
listPairedDevicesCallable()
public final UnaryCallable<ListPairedDevicesRequest,ListPairedDevicesResponse> listPairedDevicesCallable()Returns the user's list of paired 1P trackers and smartwatches.
Sample 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()) {
ListPairedDevicesRequest request =
ListPairedDevicesRequest.newBuilder()
.setParent(UserName.of("[USER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListPairedDevicesResponse response =
healthProfileServiceClient.listPairedDevicesCallable().call(request);
for (PairedDevice element : response.getPairedDevicesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListPairedDevicesRequest,ListPairedDevicesResponse> |
|
listPairedDevicesPagedCallable()
public final UnaryCallable<ListPairedDevicesRequest,HealthProfileServiceClient.ListPairedDevicesPagedResponse> listPairedDevicesPagedCallable()Returns the user's list of paired 1P trackers and smartwatches.
Sample 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()) {
ListPairedDevicesRequest request =
ListPairedDevicesRequest.newBuilder()
.setParent(UserName.of("[USER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<PairedDevice> future =
healthProfileServiceClient.listPairedDevicesPagedCallable().futureCall(request);
// Do something.
for (PairedDevice element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListPairedDevicesRequest,ListPairedDevicesPagedResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()updateProfile(Profile profile, FieldMask updateMask)
public final Profile updateProfile(Profile profile, FieldMask updateMask)Updates the user's profile details.
Sample 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);
}
| Parameters | |
|---|---|
| Name | Description |
profile |
ProfileRequired. Profile details. |
updateMask |
FieldMaskOptional. The list of fields to be updated. |
| Returns | |
|---|---|
| Type | Description |
Profile |
|
updateProfile(UpdateProfileRequest request)
public final Profile updateProfile(UpdateProfileRequest request)Updates the user's profile details.
Sample 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);
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateProfileRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Profile |
|
updateProfileCallable()
public final UnaryCallable<UpdateProfileRequest,Profile> updateProfileCallable()Updates the user's profile details.
Sample 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<Profile> future =
healthProfileServiceClient.updateProfileCallable().futureCall(request);
// Do something.
Profile response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateProfileRequest,Profile> |
|
updateSettings(Settings settings, FieldMask updateMask)
public final Settings updateSettings(Settings settings, FieldMask updateMask)Updates the user's settings details.
Sample 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);
}
| Parameters | |
|---|---|
| Name | Description |
settings |
SettingsRequired. Settings details |
updateMask |
FieldMaskOptional. The list of fields to be updated. |
| Returns | |
|---|---|
| Type | Description |
Settings |
|
updateSettings(UpdateSettingsRequest request)
public final Settings updateSettings(UpdateSettingsRequest request)Updates the user's settings details.
Sample 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);
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateSettingsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Settings |
|
updateSettingsCallable()
public final UnaryCallable<UpdateSettingsRequest,Settings> updateSettingsCallable()Updates the user's settings details.
Sample 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<Settings> future =
healthProfileServiceClient.updateSettingsCallable().futureCall(request);
// Do something.
Settings response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateSettingsRequest,Settings> |
|