Class Subscription.Builder (0.2.0)

public static final class Subscription.Builder extends GeneratedMessage.Builder<Subscription.Builder> implements SubscriptionOrBuilder

A subscription to a data collection for a specific user, to be delivered to a subscriber.

Protobuf type google.devicesandservices.health.v4.Subscription

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllDataTypes(Iterable<String> values)

public Subscription.Builder addAllDataTypes(Iterable<String> values)

Optional. Data types subscribed to. A subscriber will only receive notifications for data types that are declared here. A subscription can only subscribe to the data types of the subscriber. Supported data types are: "altitude", "distance", "floors", "sleep", "steps", "weight".

repeated string data_types = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Parameter
Name Description
values Iterable<String>

The dataTypes to add.

Returns
Type Description
Subscription.Builder

This builder for chaining.

addDataTypes(String value)

public Subscription.Builder addDataTypes(String value)

Optional. Data types subscribed to. A subscriber will only receive notifications for data types that are declared here. A subscription can only subscribe to the data types of the subscriber. Supported data types are: "altitude", "distance", "floors", "sleep", "steps", "weight".

repeated string data_types = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The dataTypes to add.

Returns
Type Description
Subscription.Builder

This builder for chaining.

addDataTypesBytes(ByteString value)

public Subscription.Builder addDataTypesBytes(ByteString value)

Optional. Data types subscribed to. A subscriber will only receive notifications for data types that are declared here. A subscription can only subscribe to the data types of the subscriber. Supported data types are: "altitude", "distance", "floors", "sleep", "steps", "weight".

repeated string data_types = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes of the dataTypes to add.

Returns
Type Description
Subscription.Builder

This builder for chaining.

build()

public Subscription build()
Returns
Type Description
Subscription

buildPartial()

public Subscription buildPartial()
Returns
Type Description
Subscription

clear()

public Subscription.Builder clear()
Returns
Type Description
Subscription.Builder
Overrides

clearDataTypes()

public Subscription.Builder clearDataTypes()

Optional. Data types subscribed to. A subscriber will only receive notifications for data types that are declared here. A subscription can only subscribe to the data types of the subscriber. Supported data types are: "altitude", "distance", "floors", "sleep", "steps", "weight".

repeated string data_types = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Returns
Type Description
Subscription.Builder

This builder for chaining.

clearName()

public Subscription.Builder clearName()

Identifier. The resource name of the Subscription. Format: projects/{project}/subscribers/{subscriber}/subscriptions/{subscription} Example: projects/my-project/subscribers/my-subscriber-123/subscriptions/my-subscription-456 The {project} ID is mandatory (6-30 characters, matching /a-z{6,30}/) The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. The {subscription} ID is user-settable (4-36 chars, matching /a-z/) or system-generated otherwise.

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Returns
Type Description
Subscription.Builder

This builder for chaining.

clearUser()

public Subscription.Builder clearUser()

Immutable. The resource name of the user for whom this subscription is active. Format: users/{user} where {user} is the public healthUserId as returned by the GetIdentity action in the profile PAPI (see google.devicesandservices.health.v4main.HealthProfileService.GetIdentity).

string user = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }

Returns
Type Description
Subscription.Builder

This builder for chaining.

getDataTypes(int index)

public String getDataTypes(int index)

Optional. Data types subscribed to. A subscriber will only receive notifications for data types that are declared here. A subscription can only subscribe to the data types of the subscriber. Supported data types are: "altitude", "distance", "floors", "sleep", "steps", "weight".

repeated string data_types = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The dataTypes at the given index.

getDataTypesBytes(int index)

public ByteString getDataTypesBytes(int index)

Optional. Data types subscribed to. A subscriber will only receive notifications for data types that are declared here. A subscription can only subscribe to the data types of the subscriber. Supported data types are: "altitude", "distance", "floors", "sleep", "steps", "weight".

repeated string data_types = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the dataTypes at the given index.

getDataTypesCount()

public int getDataTypesCount()

Optional. Data types subscribed to. A subscriber will only receive notifications for data types that are declared here. A subscription can only subscribe to the data types of the subscriber. Supported data types are: "altitude", "distance", "floors", "sleep", "steps", "weight".

repeated string data_types = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Returns
Type Description
int

The count of dataTypes.

getDataTypesList()

public ProtocolStringList getDataTypesList()

Optional. Data types subscribed to. A subscriber will only receive notifications for data types that are declared here. A subscription can only subscribe to the data types of the subscriber. Supported data types are: "altitude", "distance", "floors", "sleep", "steps", "weight".

repeated string data_types = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Returns
Type Description
ProtocolStringList

A list containing the dataTypes.

getDefaultInstanceForType()

public Subscription getDefaultInstanceForType()
Returns
Type Description
Subscription

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getName()

public String getName()

Identifier. The resource name of the Subscription. Format: projects/{project}/subscribers/{subscriber}/subscriptions/{subscription} Example: projects/my-project/subscribers/my-subscriber-123/subscriptions/my-subscription-456 The {project} ID is mandatory (6-30 characters, matching /a-z{6,30}/) The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. The {subscription} ID is user-settable (4-36 chars, matching /a-z/) or system-generated otherwise.

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Identifier. The resource name of the Subscription. Format: projects/{project}/subscribers/{subscriber}/subscriptions/{subscription} Example: projects/my-project/subscribers/my-subscriber-123/subscriptions/my-subscription-456 The {project} ID is mandatory (6-30 characters, matching /a-z{6,30}/) The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. The {subscription} ID is user-settable (4-36 chars, matching /a-z/) or system-generated otherwise.

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Returns
Type Description
ByteString

The bytes for name.

getUser()

public String getUser()

Immutable. The resource name of the user for whom this subscription is active. Format: users/{user} where {user} is the public healthUserId as returned by the GetIdentity action in the profile PAPI (see google.devicesandservices.health.v4main.HealthProfileService.GetIdentity).

string user = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }

Returns
Type Description
String

The user.

getUserBytes()

public ByteString getUserBytes()

Immutable. The resource name of the user for whom this subscription is active. Format: users/{user} where {user} is the public healthUserId as returned by the GetIdentity action in the profile PAPI (see google.devicesandservices.health.v4main.HealthProfileService.GetIdentity).

string user = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for user.

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Subscription other)

public Subscription.Builder mergeFrom(Subscription other)
Parameter
Name Description
other Subscription
Returns
Type Description
Subscription.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Subscription.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Subscription.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Subscription.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Subscription.Builder
Overrides

setDataTypes(int index, String value)

public Subscription.Builder setDataTypes(int index, String value)

Optional. Data types subscribed to. A subscriber will only receive notifications for data types that are declared here. A subscription can only subscribe to the data types of the subscriber. Supported data types are: "altitude", "distance", "floors", "sleep", "steps", "weight".

repeated string data_types = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Parameters
Name Description
index int

The index to set the value at.

value String

The dataTypes to set.

Returns
Type Description
Subscription.Builder

This builder for chaining.

setName(String value)

public Subscription.Builder setName(String value)

Identifier. The resource name of the Subscription. Format: projects/{project}/subscribers/{subscriber}/subscriptions/{subscription} Example: projects/my-project/subscribers/my-subscriber-123/subscriptions/my-subscription-456 The {project} ID is mandatory (6-30 characters, matching /a-z{6,30}/) The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. The {subscription} ID is user-settable (4-36 chars, matching /a-z/) or system-generated otherwise.

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Parameter
Name Description
value String

The name to set.

Returns
Type Description
Subscription.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Subscription.Builder setNameBytes(ByteString value)

Identifier. The resource name of the Subscription. Format: projects/{project}/subscribers/{subscriber}/subscriptions/{subscription} Example: projects/my-project/subscribers/my-subscriber-123/subscriptions/my-subscription-456 The {project} ID is mandatory (6-30 characters, matching /a-z{6,30}/) The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. The {subscription} ID is user-settable (4-36 chars, matching /a-z/) or system-generated otherwise.

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
Subscription.Builder

This builder for chaining.

setUser(String value)

public Subscription.Builder setUser(String value)

Immutable. The resource name of the user for whom this subscription is active. Format: users/{user} where {user} is the public healthUserId as returned by the GetIdentity action in the profile PAPI (see google.devicesandservices.health.v4main.HealthProfileService.GetIdentity).

string user = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The user to set.

Returns
Type Description
Subscription.Builder

This builder for chaining.

setUserBytes(ByteString value)

public Subscription.Builder setUserBytes(ByteString value)

Immutable. The resource name of the user for whom this subscription is active. Format: users/{user} where {user} is the public healthUserId as returned by the GetIdentity action in the profile PAPI (see google.devicesandservices.health.v4main.HealthProfileService.GetIdentity).

string user = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for user to set.

Returns
Type Description
Subscription.Builder

This builder for chaining.