<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [1.13.0 (latest)](https://docs.cloud.google.com/python/docs/reference/pubsublite/latest/types)
- [1.12.0](https://docs.cloud.google.com/python/docs/reference/pubsublite/1.12.0/types)
- [1.11.1](https://docs.cloud.google.com/python/docs/reference/pubsublite/1.11.1/types)
- [1.10.0](https://docs.cloud.google.com/python/docs/reference/pubsublite/1.10.0/types)
- [1.9.0](https://docs.cloud.google.com/python/docs/reference/pubsublite/1.9.0/types)
- [1.8.3](https://docs.cloud.google.com/python/docs/reference/pubsublite/1.8.3/types)
- [1.7.0](https://docs.cloud.google.com/python/docs/reference/pubsublite/1.7.0/types)
- [1.6.0](https://docs.cloud.google.com/python/docs/reference/pubsublite/1.6.0/types)
- [1.5.0](https://docs.cloud.google.com/python/docs/reference/pubsublite/1.5.0/types)
- [1.4.3](https://docs.cloud.google.com/python/docs/reference/pubsublite/1.4.3/types)
- [1.3.0](https://docs.cloud.google.com/python/docs/reference/pubsublite/1.3.0/types)
- [1.2.0](https://docs.cloud.google.com/python/docs/reference/pubsublite/1.2.0/types)
- [1.1.4](https://docs.cloud.google.com/python/docs/reference/pubsublite/1.1.4/types)
- [1.0.2](https://docs.cloud.google.com/python/docs/reference/pubsublite/1.0.2/types)
- [0.6.1](https://docs.cloud.google.com/python/docs/reference/pubsublite/0.6.1/types)
- [0.5.0](https://docs.cloud.google.com/python/docs/reference/pubsublite/0.5.0/types)
- [0.4.1](https://docs.cloud.google.com/python/docs/reference/pubsublite/0.4.1/types)
- [0.3.0](https://docs.cloud.google.com/python/docs/reference/pubsublite/0.3.0/types)
- [0.2.0](https://docs.cloud.google.com/python/docs/reference/pubsublite/0.2.0/types)
- [0.1.0](https://docs.cloud.google.com/python/docs/reference/pubsublite/0.1.0/types)

# Pub/Sub Lite Client Types

### *class* google.cloud.pubsublite.types.BacklogLocation(value)

A location with respect to the message backlog. BEGINNING refers to the
location of the oldest retained message. END refers to the location past
all currently published messages, skipping the entire message backlog.

### *class* google.cloud.pubsublite.types.CloudRegion(name)

Create new instance of CloudRegion(name,)

#### name(*: \[str\](<https://docs.python.org/3/library/stdtypes.html#str>* )

Alias for field number 0

### *class* google.cloud.pubsublite.types.CloudZone(region, zone_id)

Create new instance of CloudZone(region, zone_id)

#### region(*: google.cloud.pubsublite.types.location.CloudRegio* )

Alias for field number 0

#### zone_id(*: \[str\](<https://docs.python.org/3/library/stdtypes.html#str>* )

Alias for field number 1

### *class* google.cloud.pubsublite.types.EventTime(value: [datetime.datetime](https://docs.python.org/3/library/datetime.html#datetime.datetime))

A user-defined event timestamp of a message.

Create new instance of EventTime(value,)

#### value(*: \[datetime.datetime\](<https://docs.python.org/3/library/datetime.html#datetime.datetime>* )

Alias for field number 0

### *class* google.cloud.pubsublite.types.FlowControlSettings(messages_outstanding, bytes_outstanding)

Create new instance of FlowControlSettings(messages_outstanding, bytes_outstanding)

#### bytes_outstanding(*: \[int\](<https://docs.python.org/3/library/functions.html#int>* )

Alias for field number 1

#### messages_outstanding(*: \[int\](<https://docs.python.org/3/library/functions.html#int>* )

Alias for field number 0

### *class* google.cloud.pubsublite.types.LocationPath(project, location)

Create new instance of LocationPath(project, location)

#### location(*: Union\[google.cloud.pubsublite.types.location.CloudRegion, google.cloud.pubsublite.types.location.CloudZone* )

Alias for field number 1

#### project(*: Union\[[int](https://docs.python.org/3/library/functions.html#int), [str](https://docs.python.org/3/library/stdtypes.html#str)* )

Alias for field number 0

### *class* google.cloud.pubsublite.types.MessageMetadata(partition: google.cloud.pubsublite.types.partition.Partition, cursor: google.cloud.pubsublite_v1.types.common.Cursor)

Information about a message in Pub/Sub Lite.

#### partition()

The partition of the topic that the message was published to.

- **Type**

  Partition

#### cursor()

A cursor containing the offset that the message was assigned.
If this MessageMetadata was returned for a publish result and
publish idempotence was enabled, the offset may be -1 when the
message was identified as a duplicate of an already successfully
published message, but the server did not have sufficient
information to return the message's offset at publish time. Messages
received by subscribers will always have the correct offset.

- **Type**

  Cursor

Create new instance of MessageMetadata(partition, cursor)

#### cursor(*: google.cloud.pubsublite_v1.types.common.Curso* )

Alias for field number 1

#### partition(*: google.cloud.pubsublite.types.partition.Partitio* )

Alias for field number 0

### *class* google.cloud.pubsublite.types.Partition(value)

Create new instance of Partition(value,)

#### value(*: \[int\](<https://docs.python.org/3/library/functions.html#int>* )

Alias for field number 0

### *class* google.cloud.pubsublite.types.PublishTime(value: [datetime.datetime](https://docs.python.org/3/library/datetime.html#datetime.datetime))

The publish timestamp of a message.

Create new instance of PublishTime(value,)

#### value(*: \[datetime.datetime\](<https://docs.python.org/3/library/datetime.html#datetime.datetime>* )

Alias for field number 0

### *class* google.cloud.pubsublite.types.ReservationPath(project, location, name)

Create new instance of ReservationPath(project, location, name)

#### location(*: google.cloud.pubsublite.types.location.CloudRegio* )

Alias for field number 1

#### name(*: \[str\](<https://docs.python.org/3/library/stdtypes.html#str>* )

Alias for field number 2

#### project(*: Union\[[int](https://docs.python.org/3/library/functions.html#int), [str](https://docs.python.org/3/library/stdtypes.html#str)* )

Alias for field number 0

### *class* google.cloud.pubsublite.types.SubscriptionPath(project, location, name)

Create new instance of SubscriptionPath(project, location, name)

#### location(*: Union\[google.cloud.pubsublite.types.location.CloudRegion, google.cloud.pubsublite.types.location.CloudZone* )

Alias for field number 1

#### name(*: \[str\](<https://docs.python.org/3/library/stdtypes.html#str>* )

Alias for field number 2

#### project(*: Union\[[int](https://docs.python.org/3/library/functions.html#int), [str](https://docs.python.org/3/library/stdtypes.html#str)* )

Alias for field number 0

### *class* google.cloud.pubsublite.types.TopicPath(project, location, name)

Create new instance of TopicPath(project, location, name)

#### location(*: Union\[google.cloud.pubsublite.types.location.CloudRegion, google.cloud.pubsublite.types.location.CloudZone* )

Alias for field number 1

#### name(*: \[str\](<https://docs.python.org/3/library/stdtypes.html#str>* )

Alias for field number 2

#### project(*: Union\[[int](https://docs.python.org/3/library/functions.html#int), [str](https://docs.python.org/3/library/stdtypes.html#str)* )

Alias for field number 0

### *class* google.cloud.pubsublite_v1.Cursor(mapping=None, \*, ignore_unknown_fields=False, \*\*kwargs)

A cursor that describes the position of a message within a
topic partition.

#### offset()

The offset of a message within a topic
partition. Must be greater than or equal 0.

- **Type**

  [int](https://docs.python.org/3/library/functions.html#int)

### *class* google.cloud.pubsublite_v1.Subscription(mapping=None, \*, ignore_unknown_fields=False, \*\*kwargs)

Metadata about a subscription resource.

#### name()

The name of the subscription. Structured like:
projects/{project_number}/locations/{location}/subscriptions/{subscription_id}

- **Type**

  [str](https://docs.python.org/3/library/stdtypes.html#str)

#### topic()

The name of the topic this subscription is attached to.
Structured like:
projects/{project_number}/locations/{location}/topics/{topic_id}

- **Type**

  [str](https://docs.python.org/3/library/stdtypes.html#str)

#### delivery_config()

The settings for this subscription's message
delivery.

- **Type**

  google.cloud.pubsublite_v1.types.Subscription.DeliveryConfig

#### export_config()

If present, messages are automatically
written from the Pub/Sub Lite topic associated
with this subscription to a destination.

- **Type**

  google.cloud.pubsublite_v1.types.ExportConfig

#### *class* DeliveryConfig(mapping=None, \*, ignore_unknown_fields=False, \*\*kwargs)

The settings for a subscription's message delivery.

#### delivery_requirement()

The DeliveryRequirement for this
subscription.

- **Type**

  google.cloud.pubsublite_v1.types.Subscription.DeliveryConfig.DeliveryRequirement

#### *class* DeliveryRequirement(value)

When this subscription should send messages to subscribers relative
to messages persistence in storage. For details, see [Creating Lite
subscriptions](https://cloud.google.com/pubsub/lite/docs/subscriptions#creating_lite_subscriptions).

Values:

    DELIVERY_REQUIREMENT_UNSPECIFIED (0):

        Default value. This value is unused.

    DELIVER_IMMEDIATELY (1):

        The server does not wait for a published
        message to be successfully written to storage
        before delivering it to subscribers.

    DELIVER_AFTER_STORED (2):

        The server will not deliver a published
        message to subscribers until the message has
        been successfully written to storage. This will
        result in higher end-to-end latency, but
        consistent delivery.

### *class* google.cloud.pubsublite_v1.Topic(mapping=None, \*, ignore_unknown_fields=False, \*\*kwargs)

Metadata about a topic resource.

#### name()

The name of the topic. Structured like:
projects/{project_number}/locations/{location}/topics/{topic_id}

- **Type**

  [str](https://docs.python.org/3/library/stdtypes.html#str)

#### partition_config()

The settings for this topic's partitions.

- **Type**

  google.cloud.pubsublite_v1.types.Topic.PartitionConfig

#### retention_config()

The settings for this topic's message
retention.

- **Type**

  google.cloud.pubsublite_v1.types.Topic.RetentionConfig

#### reservation_config()

The settings for this topic's Reservation
usage.

- **Type**

  google.cloud.pubsublite_v1.types.Topic.ReservationConfig

#### *class* PartitionConfig(mapping=None, \*, ignore_unknown_fields=False, \*\*kwargs)

The settings for a topic's partitions.

This message has [oneof](https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields) fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.

#### count()

The number of partitions in the topic. Must be at least 1.

Once a topic has been created the number of partitions can
be increased but not decreased. Message ordering is not
guaranteed across a topic resize. For more information see
<https://cloud.google.com/pubsub/lite/docs/topics#scaling_capacity>

- **Type**

  [int](https://docs.python.org/3/library/functions.html#int)

#### scale()

DEPRECATED: Use capacity instead which can express a
superset of configurations.

Every partition in the topic is allocated throughput
equivalent to `scale` times the standard partition
throughput (4 MiB/s). This is also reflected in the cost of
this topic; a topic with `scale` of 2 and count of 10 is
charged for 20 partitions. This value must be in the range
\[1,4\].

This field is a member of [oneof](https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields) `dimension`.

- **Type**

  [int](https://docs.python.org/3/library/functions.html#int)

#### capacity()

The capacity configuration.

This field is a member of [oneof](https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields) `dimension`.

- **Type**

  google.cloud.pubsublite_v1.types.Topic.PartitionConfig.Capacity

#### *class* Capacity(mapping=None, \*, ignore_unknown_fields=False, \*\*kwargs)

The throughput capacity configuration for each partition.

#### publish_mib_per_sec()

Publish throughput capacity per partition in
MiB/s. Must be \>= 4 and \<= 16.

- **Type**

  [int](https://docs.python.org/3/library/functions.html#int)

#### subscribe_mib_per_sec()

Subscribe throughput capacity per partition
in MiB/s. Must be \>= 4 and \<= 32.

- **Type**

  [int](https://docs.python.org/3/library/functions.html#int)

#### *class* ReservationConfig(mapping=None, \*, ignore_unknown_fields=False, \*\*kwargs)

The settings for this topic's Reservation usage.

#### throughput_reservation()

The Reservation to use for this topic's throughput capacity.
Structured like:
projects/{project_number}/locations/{location}/reservations/{reservation_id}

- **Type**

  [str](https://docs.python.org/3/library/stdtypes.html#str)

#### *class* RetentionConfig(mapping=None, \*, ignore_unknown_fields=False, \*\*kwargs)

The settings for a topic's message retention.

#### per_partition_bytes()

The provisioned storage, in bytes, per partition. If the
number of bytes stored in any of the topic's partitions
grows beyond this value, older messages will be dropped to
make room for newer ones, regardless of the value of
`period`.

- **Type**

  [int](https://docs.python.org/3/library/functions.html#int)

#### period()

How long a published message is retained. If unset, messages
will be retained as long as the bytes retained for each
partition is below `per_partition_bytes`.

- **Type**

  [google.protobuf.duration_pb2.Duration](https://googleapis.dev/python/protobuf/latest/google/protobuf/duration_pb2.html#google.protobuf.duration_pb2.Duration)