Class Subscription.Builder (0.4.0)

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

A subscription to receive events about a Google Workspace resource. To learn more about subscriptions, see the Google Workspace Events API overview.

Protobuf type google.apps.events.subscriptions.v1.Subscription

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllEventTypes(Iterable<String> values)

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

Required. Immutable. Unordered list. Input for creating a subscription. Otherwise, output only. One or more types of events to receive about the target resource. Formatted according to the CloudEvents specification.

The supported event types depend on the target resource of your subscription. For details, see Supported Google Workspace events.

By default, you also receive events about the lifecycle of your subscription. You don't need to specify lifecycle events for this field.

If you specify an event type that doesn't exist for the target resource, the request returns an HTTP 400 Bad Request status code.

repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
valuesIterable<String>

The eventTypes to add.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

addEventTypes(String value)

public Subscription.Builder addEventTypes(String value)

Required. Immutable. Unordered list. Input for creating a subscription. Otherwise, output only. One or more types of events to receive about the target resource. Formatted according to the CloudEvents specification.

The supported event types depend on the target resource of your subscription. For details, see Supported Google Workspace events.

By default, you also receive events about the lifecycle of your subscription. You don't need to specify lifecycle events for this field.

If you specify an event type that doesn't exist for the target resource, the request returns an HTTP 400 Bad Request status code.

repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
valueString

The eventTypes to add.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

addEventTypesBytes(ByteString value)

public Subscription.Builder addEventTypesBytes(ByteString value)

Required. Immutable. Unordered list. Input for creating a subscription. Otherwise, output only. One or more types of events to receive about the target resource. Formatted according to the CloudEvents specification.

The supported event types depend on the target resource of your subscription. For details, see Supported Google Workspace events.

By default, you also receive events about the lifecycle of your subscription. You don't need to specify lifecycle events for this field.

If you specify an event type that doesn't exist for the target resource, the request returns an HTTP 400 Bad Request status code.

repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
valueByteString

The bytes of the eventTypes to add.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Subscription.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Subscription.Builder
Overrides

build()

public Subscription build()
Returns
TypeDescription
Subscription

buildPartial()

public Subscription buildPartial()
Returns
TypeDescription
Subscription

clear()

public Subscription.Builder clear()
Returns
TypeDescription
Subscription.Builder
Overrides

clearAuthority()

public Subscription.Builder clearAuthority()

Output only. The user who authorized the creation of the subscription.

Format: users/{user}

For Google Workspace users, the {user} value is the user.id field from the Directory API.

string authority = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

clearCreateTime()

public Subscription.Builder clearCreateTime()

Output only. The time when the subscription is created.

.google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Subscription.Builder

clearEtag()

public Subscription.Builder clearEtag()

Optional. This checksum is computed by the server based on the value of other fields, and might be sent on update requests to ensure the client has an up-to-date value before proceeding.

string etag = 17 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

clearEventTypes()

public Subscription.Builder clearEventTypes()

Required. Immutable. Unordered list. Input for creating a subscription. Otherwise, output only. One or more types of events to receive about the target resource. Formatted according to the CloudEvents specification.

The supported event types depend on the target resource of your subscription. For details, see Supported Google Workspace events.

By default, you also receive events about the lifecycle of your subscription. You don't need to specify lifecycle events for this field.

If you specify an event type that doesn't exist for the target resource, the request returns an HTTP 400 Bad Request status code.

repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

clearExpiration()

public Subscription.Builder clearExpiration()
Returns
TypeDescription
Subscription.Builder

clearExpireTime()

public Subscription.Builder clearExpireTime()

Non-empty default. The timestamp in UTC when the subscription expires. Always displayed on output, regardless of what was used on input.

.google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT];

Returns
TypeDescription
Subscription.Builder

clearField(Descriptors.FieldDescriptor field)

public Subscription.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Subscription.Builder
Overrides

clearName()

public Subscription.Builder clearName()

Optional. Immutable. Identifier. Resource name of the subscription.

Format: subscriptions/{subscription}

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

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

clearNotificationEndpoint()

public Subscription.Builder clearNotificationEndpoint()

Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.

.google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
Subscription.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public Subscription.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Subscription.Builder
Overrides

clearPayloadOptions()

public Subscription.Builder clearPayloadOptions()

Optional. Options about what data to include in the event payload. Only supported for Google Chat events.

.google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Subscription.Builder

clearReconciling()

public Subscription.Builder clearReconciling()

Output only. If true, the subscription is in the process of being updated.

bool reconciling = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

clearState()

public Subscription.Builder clearState()

Output only. The state of the subscription. Determines whether the subscription can receive events and deliver them to the notification endpoint.

.google.apps.events.subscriptions.v1.Subscription.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

clearSuspensionReason()

public Subscription.Builder clearSuspensionReason()

Output only. The error that suspended the subscription.

To reactivate the subscription, resolve the error and call the ReactivateSubscription method.

.google.apps.events.subscriptions.v1.Subscription.ErrorType suspension_reason = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

clearTargetResource()

public Subscription.Builder clearTargetResource()

Required. Immutable. The Google Workspace resource that's monitored for events, formatted as the full resource name. To learn about target resources and the events that they support, see Supported Google Workspace events.

A user can only authorize your app to create one subscription for a given target resource. If your app tries to create another subscription with the same user credentials, the request returns an ALREADY_EXISTS error.

string target_resource = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

clearTtl()

public Subscription.Builder clearTtl()

Input only. The time-to-live (TTL) or duration for the subscription. If unspecified or set to 0, uses the maximum possible duration.

.google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
TypeDescription
Subscription.Builder

clearUid()

public Subscription.Builder clearUid()

Output only. System-assigned unique identifier for the subscription.

string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

clearUpdateTime()

public Subscription.Builder clearUpdateTime()

Output only. The last time that the subscription is updated.

.google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Subscription.Builder

clone()

public Subscription.Builder clone()
Returns
TypeDescription
Subscription.Builder
Overrides

getAuthority()

public String getAuthority()

Output only. The user who authorized the creation of the subscription.

Format: users/{user}

For Google Workspace users, the {user} value is the user.id field from the Directory API.

string authority = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The authority.

getAuthorityBytes()

public ByteString getAuthorityBytes()

Output only. The user who authorized the creation of the subscription.

Format: users/{user}

For Google Workspace users, the {user} value is the user.id field from the Directory API.

string authority = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for authority.

getCreateTime()

public Timestamp getCreateTime()

Output only. The time when the subscription is created.

.google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Timestamp

The createTime.

getCreateTimeBuilder()

public Timestamp.Builder getCreateTimeBuilder()

Output only. The time when the subscription is created.

.google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Builder

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. The time when the subscription is created.

.google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
TimestampOrBuilder

getDefaultInstanceForType()

public Subscription getDefaultInstanceForType()
Returns
TypeDescription
Subscription

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getEtag()

public String getEtag()

Optional. This checksum is computed by the server based on the value of other fields, and might be sent on update requests to ensure the client has an up-to-date value before proceeding.

string etag = 17 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
String

The etag.

getEtagBytes()

public ByteString getEtagBytes()

Optional. This checksum is computed by the server based on the value of other fields, and might be sent on update requests to ensure the client has an up-to-date value before proceeding.

string etag = 17 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ByteString

The bytes for etag.

getEventTypes(int index)

public String getEventTypes(int index)

Required. Immutable. Unordered list. Input for creating a subscription. Otherwise, output only. One or more types of events to receive about the target resource. Formatted according to the CloudEvents specification.

The supported event types depend on the target resource of your subscription. For details, see Supported Google Workspace events.

By default, you also receive events about the lifecycle of your subscription. You don't need to specify lifecycle events for this field.

If you specify an event type that doesn't exist for the target resource, the request returns an HTTP 400 Bad Request status code.

repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The eventTypes at the given index.

getEventTypesBytes(int index)

public ByteString getEventTypesBytes(int index)

Required. Immutable. Unordered list. Input for creating a subscription. Otherwise, output only. One or more types of events to receive about the target resource. Formatted according to the CloudEvents specification.

The supported event types depend on the target resource of your subscription. For details, see Supported Google Workspace events.

By default, you also receive events about the lifecycle of your subscription. You don't need to specify lifecycle events for this field.

If you specify an event type that doesn't exist for the target resource, the request returns an HTTP 400 Bad Request status code.

repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the eventTypes at the given index.

getEventTypesCount()

public int getEventTypesCount()

Required. Immutable. Unordered list. Input for creating a subscription. Otherwise, output only. One or more types of events to receive about the target resource. Formatted according to the CloudEvents specification.

The supported event types depend on the target resource of your subscription. For details, see Supported Google Workspace events.

By default, you also receive events about the lifecycle of your subscription. You don't need to specify lifecycle events for this field.

If you specify an event type that doesn't exist for the target resource, the request returns an HTTP 400 Bad Request status code.

repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
int

The count of eventTypes.

getEventTypesList()

public ProtocolStringList getEventTypesList()

Required. Immutable. Unordered list. Input for creating a subscription. Otherwise, output only. One or more types of events to receive about the target resource. Formatted according to the CloudEvents specification.

The supported event types depend on the target resource of your subscription. For details, see Supported Google Workspace events.

By default, you also receive events about the lifecycle of your subscription. You don't need to specify lifecycle events for this field.

If you specify an event type that doesn't exist for the target resource, the request returns an HTTP 400 Bad Request status code.

repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
ProtocolStringList

A list containing the eventTypes.

getExpirationCase()

public Subscription.ExpirationCase getExpirationCase()
Returns
TypeDescription
Subscription.ExpirationCase

getExpireTime()

public Timestamp getExpireTime()

Non-empty default. The timestamp in UTC when the subscription expires. Always displayed on output, regardless of what was used on input.

.google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT];

Returns
TypeDescription
Timestamp

The expireTime.

getExpireTimeBuilder()

public Timestamp.Builder getExpireTimeBuilder()

Non-empty default. The timestamp in UTC when the subscription expires. Always displayed on output, regardless of what was used on input.

.google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT];

Returns
TypeDescription
Builder

getExpireTimeOrBuilder()

public TimestampOrBuilder getExpireTimeOrBuilder()

Non-empty default. The timestamp in UTC when the subscription expires. Always displayed on output, regardless of what was used on input.

.google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT];

Returns
TypeDescription
TimestampOrBuilder

getName()

public String getName()

Optional. Immutable. Identifier. Resource name of the subscription.

Format: subscriptions/{subscription}

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

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Optional. Immutable. Identifier. Resource name of the subscription.

Format: subscriptions/{subscription}

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

Returns
TypeDescription
ByteString

The bytes for name.

getNotificationEndpoint()

public NotificationEndpoint getNotificationEndpoint()

Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.

.google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
NotificationEndpoint

The notificationEndpoint.

getNotificationEndpointBuilder()

public NotificationEndpoint.Builder getNotificationEndpointBuilder()

Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.

.google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
NotificationEndpoint.Builder

getNotificationEndpointOrBuilder()

public NotificationEndpointOrBuilder getNotificationEndpointOrBuilder()

Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.

.google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
NotificationEndpointOrBuilder

getPayloadOptions()

public PayloadOptions getPayloadOptions()

Optional. Options about what data to include in the event payload. Only supported for Google Chat events.

.google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
PayloadOptions

The payloadOptions.

getPayloadOptionsBuilder()

public PayloadOptions.Builder getPayloadOptionsBuilder()

Optional. Options about what data to include in the event payload. Only supported for Google Chat events.

.google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
PayloadOptions.Builder

getPayloadOptionsOrBuilder()

public PayloadOptionsOrBuilder getPayloadOptionsOrBuilder()

Optional. Options about what data to include in the event payload. Only supported for Google Chat events.

.google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
PayloadOptionsOrBuilder

getReconciling()

public boolean getReconciling()

Output only. If true, the subscription is in the process of being updated.

bool reconciling = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

The reconciling.

getState()

public Subscription.State getState()

Output only. The state of the subscription. Determines whether the subscription can receive events and deliver them to the notification endpoint.

.google.apps.events.subscriptions.v1.Subscription.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Subscription.State

The state.

getStateValue()

public int getStateValue()

Output only. The state of the subscription. Determines whether the subscription can receive events and deliver them to the notification endpoint.

.google.apps.events.subscriptions.v1.Subscription.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

The enum numeric value on the wire for state.

getSuspensionReason()

public Subscription.ErrorType getSuspensionReason()

Output only. The error that suspended the subscription.

To reactivate the subscription, resolve the error and call the ReactivateSubscription method.

.google.apps.events.subscriptions.v1.Subscription.ErrorType suspension_reason = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Subscription.ErrorType

The suspensionReason.

getSuspensionReasonValue()

public int getSuspensionReasonValue()

Output only. The error that suspended the subscription.

To reactivate the subscription, resolve the error and call the ReactivateSubscription method.

.google.apps.events.subscriptions.v1.Subscription.ErrorType suspension_reason = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

The enum numeric value on the wire for suspensionReason.

getTargetResource()

public String getTargetResource()

Required. Immutable. The Google Workspace resource that's monitored for events, formatted as the full resource name. To learn about target resources and the events that they support, see Supported Google Workspace events.

A user can only authorize your app to create one subscription for a given target resource. If your app tries to create another subscription with the same user credentials, the request returns an ALREADY_EXISTS error.

string target_resource = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The targetResource.

getTargetResourceBytes()

public ByteString getTargetResourceBytes()

Required. Immutable. The Google Workspace resource that's monitored for events, formatted as the full resource name. To learn about target resources and the events that they support, see Supported Google Workspace events.

A user can only authorize your app to create one subscription for a given target resource. If your app tries to create another subscription with the same user credentials, the request returns an ALREADY_EXISTS error.

string target_resource = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for targetResource.

getTtl()

public Duration getTtl()

Input only. The time-to-live (TTL) or duration for the subscription. If unspecified or set to 0, uses the maximum possible duration.

.google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
TypeDescription
Duration

The ttl.

getTtlBuilder()

public Duration.Builder getTtlBuilder()

Input only. The time-to-live (TTL) or duration for the subscription. If unspecified or set to 0, uses the maximum possible duration.

.google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
TypeDescription
Builder

getTtlOrBuilder()

public DurationOrBuilder getTtlOrBuilder()

Input only. The time-to-live (TTL) or duration for the subscription. If unspecified or set to 0, uses the maximum possible duration.

.google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
TypeDescription
DurationOrBuilder

getUid()

public String getUid()

Output only. System-assigned unique identifier for the subscription.

string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
String

The uid.

getUidBytes()

public ByteString getUidBytes()

Output only. System-assigned unique identifier for the subscription.

string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ByteString

The bytes for uid.

getUpdateTime()

public Timestamp getUpdateTime()

Output only. The last time that the subscription is updated.

.google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Timestamp

The updateTime.

getUpdateTimeBuilder()

public Timestamp.Builder getUpdateTimeBuilder()

Output only. The last time that the subscription is updated.

.google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Builder

getUpdateTimeOrBuilder()

public TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. The last time that the subscription is updated.

.google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
TimestampOrBuilder

hasCreateTime()

public boolean hasCreateTime()

Output only. The time when the subscription is created.

.google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

Whether the createTime field is set.

hasExpireTime()

public boolean hasExpireTime()

Non-empty default. The timestamp in UTC when the subscription expires. Always displayed on output, regardless of what was used on input.

.google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT];

Returns
TypeDescription
boolean

Whether the expireTime field is set.

hasNotificationEndpoint()

public boolean hasNotificationEndpoint()

Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.

.google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
boolean

Whether the notificationEndpoint field is set.

hasPayloadOptions()

public boolean hasPayloadOptions()

Optional. Options about what data to include in the event payload. Only supported for Google Chat events.

.google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

Whether the payloadOptions field is set.

hasTtl()

public boolean hasTtl()

Input only. The time-to-live (TTL) or duration for the subscription. If unspecified or set to 0, uses the maximum possible duration.

.google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
TypeDescription
boolean

Whether the ttl field is set.

hasUpdateTime()

public boolean hasUpdateTime()

Output only. The last time that the subscription is updated.

.google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

Whether the updateTime field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeCreateTime(Timestamp value)

public Subscription.Builder mergeCreateTime(Timestamp value)

Output only. The time when the subscription is created.

.google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Subscription.Builder

mergeExpireTime(Timestamp value)

public Subscription.Builder mergeExpireTime(Timestamp value)

Non-empty default. The timestamp in UTC when the subscription expires. Always displayed on output, regardless of what was used on input.

.google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Subscription.Builder

mergeFrom(Subscription other)

public Subscription.Builder mergeFrom(Subscription other)
Parameter
NameDescription
otherSubscription
Returns
TypeDescription
Subscription.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Subscription.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Subscription.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Subscription.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Subscription.Builder
Overrides

mergeNotificationEndpoint(NotificationEndpoint value)

public Subscription.Builder mergeNotificationEndpoint(NotificationEndpoint value)

Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.

.google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
valueNotificationEndpoint
Returns
TypeDescription
Subscription.Builder

mergePayloadOptions(PayloadOptions value)

public Subscription.Builder mergePayloadOptions(PayloadOptions value)

Optional. Options about what data to include in the event payload. Only supported for Google Chat events.

.google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuePayloadOptions
Returns
TypeDescription
Subscription.Builder

mergeTtl(Duration value)

public Subscription.Builder mergeTtl(Duration value)

Input only. The time-to-live (TTL) or duration for the subscription. If unspecified or set to 0, uses the maximum possible duration.

.google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Parameter
NameDescription
valueDuration
Returns
TypeDescription
Subscription.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Subscription.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Subscription.Builder
Overrides

mergeUpdateTime(Timestamp value)

public Subscription.Builder mergeUpdateTime(Timestamp value)

Output only. The last time that the subscription is updated.

.google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Subscription.Builder

setAuthority(String value)

public Subscription.Builder setAuthority(String value)

Output only. The user who authorized the creation of the subscription.

Format: users/{user}

For Google Workspace users, the {user} value is the user.id field from the Directory API.

string authority = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueString

The authority to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setAuthorityBytes(ByteString value)

public Subscription.Builder setAuthorityBytes(ByteString value)

Output only. The user who authorized the creation of the subscription.

Format: users/{user}

For Google Workspace users, the {user} value is the user.id field from the Directory API.

string authority = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueByteString

The bytes for authority to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setCreateTime(Timestamp value)

public Subscription.Builder setCreateTime(Timestamp value)

Output only. The time when the subscription is created.

.google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Subscription.Builder

setCreateTime(Timestamp.Builder builderForValue)

public Subscription.Builder setCreateTime(Timestamp.Builder builderForValue)

Output only. The time when the subscription is created.

.google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
Subscription.Builder

setEtag(String value)

public Subscription.Builder setEtag(String value)

Optional. This checksum is computed by the server based on the value of other fields, and might be sent on update requests to ensure the client has an up-to-date value before proceeding.

string etag = 17 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueString

The etag to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setEtagBytes(ByteString value)

public Subscription.Builder setEtagBytes(ByteString value)

Optional. This checksum is computed by the server based on the value of other fields, and might be sent on update requests to ensure the client has an up-to-date value before proceeding.

string etag = 17 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueByteString

The bytes for etag to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setEventTypes(int index, String value)

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

Required. Immutable. Unordered list. Input for creating a subscription. Otherwise, output only. One or more types of events to receive about the target resource. Formatted according to the CloudEvents specification.

The supported event types depend on the target resource of your subscription. For details, see Supported Google Workspace events.

By default, you also receive events about the lifecycle of your subscription. You don't need to specify lifecycle events for this field.

If you specify an event type that doesn't exist for the target resource, the request returns an HTTP 400 Bad Request status code.

repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE];

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The eventTypes to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setExpireTime(Timestamp value)

public Subscription.Builder setExpireTime(Timestamp value)

Non-empty default. The timestamp in UTC when the subscription expires. Always displayed on output, regardless of what was used on input.

.google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Subscription.Builder

setExpireTime(Timestamp.Builder builderForValue)

public Subscription.Builder setExpireTime(Timestamp.Builder builderForValue)

Non-empty default. The timestamp in UTC when the subscription expires. Always displayed on output, regardless of what was used on input.

.google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT];

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
Subscription.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Subscription.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Subscription.Builder
Overrides

setName(String value)

public Subscription.Builder setName(String value)

Optional. Immutable. Identifier. Resource name of the subscription.

Format: subscriptions/{subscription}

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

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Subscription.Builder setNameBytes(ByteString value)

Optional. Immutable. Identifier. Resource name of the subscription.

Format: subscriptions/{subscription}

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

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setNotificationEndpoint(NotificationEndpoint value)

public Subscription.Builder setNotificationEndpoint(NotificationEndpoint value)

Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.

.google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
valueNotificationEndpoint
Returns
TypeDescription
Subscription.Builder

setNotificationEndpoint(NotificationEndpoint.Builder builderForValue)

public Subscription.Builder setNotificationEndpoint(NotificationEndpoint.Builder builderForValue)

Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.

.google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
builderForValueNotificationEndpoint.Builder
Returns
TypeDescription
Subscription.Builder

setPayloadOptions(PayloadOptions value)

public Subscription.Builder setPayloadOptions(PayloadOptions value)

Optional. Options about what data to include in the event payload. Only supported for Google Chat events.

.google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuePayloadOptions
Returns
TypeDescription
Subscription.Builder

setPayloadOptions(PayloadOptions.Builder builderForValue)

public Subscription.Builder setPayloadOptions(PayloadOptions.Builder builderForValue)

Optional. Options about what data to include in the event payload. Only supported for Google Chat events.

.google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
builderForValuePayloadOptions.Builder
Returns
TypeDescription
Subscription.Builder

setReconciling(boolean value)

public Subscription.Builder setReconciling(boolean value)

Output only. If true, the subscription is in the process of being updated.

bool reconciling = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueboolean

The reconciling to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Subscription.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Subscription.Builder
Overrides

setState(Subscription.State value)

public Subscription.Builder setState(Subscription.State value)

Output only. The state of the subscription. Determines whether the subscription can receive events and deliver them to the notification endpoint.

.google.apps.events.subscriptions.v1.Subscription.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueSubscription.State

The state to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setStateValue(int value)

public Subscription.Builder setStateValue(int value)

Output only. The state of the subscription. Determines whether the subscription can receive events and deliver them to the notification endpoint.

.google.apps.events.subscriptions.v1.Subscription.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueint

The enum numeric value on the wire for state to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setSuspensionReason(Subscription.ErrorType value)

public Subscription.Builder setSuspensionReason(Subscription.ErrorType value)

Output only. The error that suspended the subscription.

To reactivate the subscription, resolve the error and call the ReactivateSubscription method.

.google.apps.events.subscriptions.v1.Subscription.ErrorType suspension_reason = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueSubscription.ErrorType

The suspensionReason to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setSuspensionReasonValue(int value)

public Subscription.Builder setSuspensionReasonValue(int value)

Output only. The error that suspended the subscription.

To reactivate the subscription, resolve the error and call the ReactivateSubscription method.

.google.apps.events.subscriptions.v1.Subscription.ErrorType suspension_reason = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueint

The enum numeric value on the wire for suspensionReason to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setTargetResource(String value)

public Subscription.Builder setTargetResource(String value)

Required. Immutable. The Google Workspace resource that's monitored for events, formatted as the full resource name. To learn about target resources and the events that they support, see Supported Google Workspace events.

A user can only authorize your app to create one subscription for a given target resource. If your app tries to create another subscription with the same user credentials, the request returns an ALREADY_EXISTS error.

string target_resource = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueString

The targetResource to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setTargetResourceBytes(ByteString value)

public Subscription.Builder setTargetResourceBytes(ByteString value)

Required. Immutable. The Google Workspace resource that's monitored for events, formatted as the full resource name. To learn about target resources and the events that they support, see Supported Google Workspace events.

A user can only authorize your app to create one subscription for a given target resource. If your app tries to create another subscription with the same user credentials, the request returns an ALREADY_EXISTS error.

string target_resource = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueByteString

The bytes for targetResource to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setTtl(Duration value)

public Subscription.Builder setTtl(Duration value)

Input only. The time-to-live (TTL) or duration for the subscription. If unspecified or set to 0, uses the maximum possible duration.

.google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Parameter
NameDescription
valueDuration
Returns
TypeDescription
Subscription.Builder

setTtl(Duration.Builder builderForValue)

public Subscription.Builder setTtl(Duration.Builder builderForValue)

Input only. The time-to-live (TTL) or duration for the subscription. If unspecified or set to 0, uses the maximum possible duration.

.google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
Subscription.Builder

setUid(String value)

public Subscription.Builder setUid(String value)

Output only. System-assigned unique identifier for the subscription.

string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueString

The uid to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setUidBytes(ByteString value)

public Subscription.Builder setUidBytes(ByteString value)

Output only. System-assigned unique identifier for the subscription.

string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueByteString

The bytes for uid to set.

Returns
TypeDescription
Subscription.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Subscription.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Subscription.Builder
Overrides

setUpdateTime(Timestamp value)

public Subscription.Builder setUpdateTime(Timestamp value)

Output only. The last time that the subscription is updated.

.google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Subscription.Builder

setUpdateTime(Timestamp.Builder builderForValue)

public Subscription.Builder setUpdateTime(Timestamp.Builder builderForValue)

Output only. The last time that the subscription is updated.

.google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
Subscription.Builder