API documentation for pubsub_v1.types
module.
Classes
AcknowledgeRequest
Request for the Acknowledge method.
.. attribute:: subscription
Required. The subscription whose message is being
acknowledged. Format is
projects/{project}/subscriptions/{sub}
.
AuditConfigDelta
One delta entry for AuditConfig. Each individual change (only one exempted_member in each entry) to a AuditConfig will be a separate entry.
.. attribute:: action
The action that was performed on an audit configuration in a policy. Required
A single identity that is exempted from “data access” audit
logging for the service
specified above. Follows the same
format of Binding.members.
AuditData
Audit log information specific to Cloud IAM. This message is serialized
as an Any
type in the ServiceData
message of an AuditLog
message.
.. attribute:: policy_delta
Policy delta between the original policy and the newly set policy.
BatchSettings
BatchSettings(max_bytes=1000000, max_latency=0.01, max_messages=100)
The settings for batch publishing the messages.
Binding
Associates members
with a role
.
.. attribute:: role
Role that is assigned to members
. For example,
roles/viewer
, roles/editor
, or roles/owner
.
The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
BindingDelta
One delta entry for Binding. Each individual change (only one member in each entry) to a binding will be a separate entry.
.. attribute:: action
The action that was performed on a Binding. Required
A single identity requesting access for a Cloud Platform resource. Follows the same format of Binding.members. Required
CreateSnapshotRequest
Request for the CreateSnapshot
method.
.. attribute:: name
Required. User-provided name for this snapshot. If the name is
not provided in the request, the server will assign a random
name for this snapshot on the same project as the
subscription. Note that for REST API requests, you must
specify a name. See the resource name rules. Format is
projects/{project}/snapshots/{snap}
.
See Creating and managing labels.
CustomHttpPattern
API documentation for pubsub_v1.types.CustomHttpPattern
class.
DeadLetterPolicy
Dead lettering is done on a best effort basis. The same message might be dead lettered multiple times.
If validation on any of the fields fails at subscription creation/updation, the create/update subscription request will fail.
.. attribute:: dead_letter_topic
The name of the topic to which dead letter messages should be
published. Format is projects/{project}/topics/{topic}
.The
Cloud Pub/Sub service account associated with the enclosing
subscription's parent project (i.e.,
service-{project_number}@gcp-sa-
pubsub.iam.gserviceaccount.com) must have permission to
Publish() to this topic. The operation will fail if the topic
does not exist. Users should ensure that there is a
subscription attached to this topic since messages published
to a topic with no subscriptions are lost.
DeleteSnapshotRequest
Request for the DeleteSnapshot
method.
.. attribute:: snapshot
Required. The name of the snapshot to delete. Format is
projects/{project}/snapshots/{snap}
.
DeleteSubscriptionRequest
Request for the DeleteSubscription method.
.. attribute:: subscription
Required. The subscription to delete. Format is
projects/{project}/subscriptions/{sub}
.
DeleteTopicRequest
Request for the DeleteTopic
method.
.. attribute:: topic
Required. Name of the topic to delete. Format is
projects/{project}/topics/{topic}
.
DescriptorProto
API documentation for pubsub_v1.types.DescriptorProto
class.
Duration
API documentation for pubsub_v1.types.Duration
class.
Empty
API documentation for pubsub_v1.types.Empty
class.
EnumDescriptorProto
API documentation for pubsub_v1.types.EnumDescriptorProto
class.
EnumOptions
API documentation for pubsub_v1.types.EnumOptions
class.
EnumValueDescriptorProto
API documentation for pubsub_v1.types.EnumValueDescriptorProto
class.
EnumValueOptions
API documentation for pubsub_v1.types.EnumValueOptions
class.
ExpirationPolicy
A policy that specifies the conditions for resource expiration (i.e., automatic resource deletion).
.. attribute:: ttl
Specifies the "time-to-live" duration for an associated
resource. The resource expires if it is not active for a
period of ttl
. The definition of "activity" depends on the
type of the associated resource. The minimum and maximum
allowed values for ttl
depend on the type of the
associated resource, as well. If ttl
is not set, the
associated resource never expires.
ExtensionRangeOptions
API documentation for pubsub_v1.types.ExtensionRangeOptions
class.
FieldDescriptorProto
API documentation for pubsub_v1.types.FieldDescriptorProto
class.
FieldMask
API documentation for pubsub_v1.types.FieldMask
class.
FieldOptions
API documentation for pubsub_v1.types.FieldOptions
class.
FileDescriptorProto
API documentation for pubsub_v1.types.FileDescriptorProto
class.
FileDescriptorSet
API documentation for pubsub_v1.types.FileDescriptorSet
class.
FileOptions
API documentation for pubsub_v1.types.FileOptions
class.
FlowControl
FlowControl(
max_bytes=104857600,
max_messages=1000,
max_lease_duration=3600,
max_duration_per_lease_extension=0,
)
The settings for controlling the rate at which messages are pulled with an asynchronous subscription.
GeneratedCodeInfo
API documentation for pubsub_v1.types.GeneratedCodeInfo
class.
GetIamPolicyRequest
Request message for GetIamPolicy
method.
.. attribute:: resource
REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
GetSnapshotRequest
Request for the GetSnapshot method.
.. attribute:: snapshot
Required. The name of the snapshot to get. Format is
projects/{project}/snapshots/{snap}
.
GetSubscriptionRequest
Request for the GetSubscription method.
.. attribute:: subscription
Required. The name of the subscription to get. Format is
projects/{project}/subscriptions/{sub}
.
GetTopicRequest
Request for the GetTopic method.
.. attribute:: topic
Required. The name of the topic to get. Format is
projects/{project}/topics/{topic}
.
Http
API documentation for pubsub_v1.types.Http
class.
HttpRule
API documentation for pubsub_v1.types.HttpRule
class.
ListSnapshotsRequest
Request for the ListSnapshots
method.
.. attribute:: project
Required. The name of the project in which to list snapshots.
Format is projects/{project-id}
.
The value returned by the last ListSnapshotsResponse
;
indicates that this is a continuation of a prior
ListSnapshots
call, and that the system should return the
next page of data.
ListSnapshotsResponse
Response for the ListSnapshots
method.
.. attribute:: snapshots
The resulting snapshots.
ListSubscriptionsRequest
Request for the ListSubscriptions
method.
.. attribute:: project
Required. The name of the project in which to list
subscriptions. Format is projects/{project-id}
.
The value returned by the last ListSubscriptionsResponse
;
indicates that this is a continuation of a prior
ListSubscriptions
call, and that the system should return
the next page of data.
ListSubscriptionsResponse
Response for the ListSubscriptions
method.
.. attribute:: subscriptions
The subscriptions that match the request.
ListTopicSnapshotsRequest
Request for the ListTopicSnapshots
method.
.. attribute:: topic
The name of the topic that snapshots are attached to. Format
is projects/{project}/topics/{topic}
.
The value returned by the last ListTopicSnapshotsResponse
;
indicates that this is a continuation of a prior
ListTopicSnapshots
call, and that the system should return
the next page of data.
ListTopicSnapshotsResponse
Response for the ListTopicSnapshots
method.
.. attribute:: snapshots
The names of the snapshots that match the request.
ListTopicSubscriptionsRequest
Request for the ListTopicSubscriptions
method.
.. attribute:: topic
Required. The name of the topic that subscriptions are
attached to. Format is projects/{project}/topics/{topic}
.
The value returned by the last
ListTopicSubscriptionsResponse
; indicates that this is a
continuation of a prior ListTopicSubscriptions
call, and
that the system should return the next page of data.
ListTopicSubscriptionsResponse
Response for the ListTopicSubscriptions
method.
.. attribute:: subscriptions
The names of the subscriptions that match the request.
ListTopicsRequest
Request for the ListTopics
method.
.. attribute:: project
Required. The name of the project in which to list topics.
Format is projects/{project-id}
.
The value returned by the last ListTopicsResponse
;
indicates that this is a continuation of a prior
ListTopics
call, and that the system should return the
next page of data.
ListTopicsResponse
Response for the ListTopics
method.
.. attribute:: topics
The resulting topics.
MessageOptions
API documentation for pubsub_v1.types.MessageOptions
class.
MessageStoragePolicy
A message storage policy.
.. attribute:: allowed_persistence_regions
A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
MethodDescriptorProto
API documentation for pubsub_v1.types.MethodDescriptorProto
class.
MethodOptions
API documentation for pubsub_v1.types.MethodOptions
class.
ModifyAckDeadlineRequest
Request for the ModifyAckDeadline method.
.. attribute:: subscription
Required. The name of the subscription. Format is
projects/{project}/subscriptions/{sub}
.
Required. The new ack deadline with respect to the time this
request was sent to the Pub/Sub system. For example, if the
value is 10, the new ack deadline will expire 10 seconds after
the ModifyAckDeadline
call was made. Specifying zero might
immediately make the message available for delivery to another
subscriber client. This typically results in an increase in
the rate of message redeliveries (that is, duplicates). The
minimum deadline you can specify is 0 seconds. The maximum
deadline you can specify is 600 seconds (10 minutes).
ModifyPushConfigRequest
Request for the ModifyPushConfig method.
.. attribute:: subscription
Required. The name of the subscription. Format is
projects/{project}/subscriptions/{sub}
.
OneofDescriptorProto
API documentation for pubsub_v1.types.OneofDescriptorProto
class.
OneofOptions
API documentation for pubsub_v1.types.OneofOptions
class.
Policy
Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.
A Policy
consists of a list of bindings
. A binding
binds a
list of members
to a role
, where the members can be user
accounts, Google groups, Google domains, and service accounts. A
role
is a named list of permissions defined by IAM.
JSON Example
::
{ "bindings": [ { "role": "roles/owner", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { "role": "roles/viewer", "members": ["user:sean@example.com"] } ] }
YAML Example
::
bindings:
- members:
- user:mike@example.com
- group:admins@example.com
- domain:google.com
- serviceAccount:my-other-app@appspot.gserviceaccount.com role: roles/owner
- members:
- user:sean@example.com role: roles/viewer
For a description of IAM and its features, see the IAM developer’s
guide <https://cloud.google.com/iam/docs>
__.
.. attribute:: version
Deprecated.
etag
is used for optimistic concurrency control as a way
to help prevent simultaneous updates of a policy from
overwriting each other. It is strongly suggested that systems
make use of the etag
in the read-modify-write cycle to
perform policy updates in order to avoid race conditions: An
etag
is returned in the response to getIamPolicy
, and
systems are expected to put that etag in the request to
setIamPolicy
to ensure that their change will be applied
to the same version of the policy. If no etag
is provided
in the call to setIamPolicy
, then the existing policy is
overwritten blindly.
PolicyDelta
The difference delta between two policies.
.. attribute:: binding_deltas
The delta for Bindings between two policies.
PublishRequest
Request for the Publish method.
.. attribute:: topic
Required. The messages in the request will be published on
this topic. Format is projects/{project}/topics/{topic}
.
PublishResponse
Response for the Publish
method.
.. attribute:: message_ids
The server-assigned ID of each published message, in the same order as the messages in the request. IDs are guaranteed to be unique within the topic.
PubsubMessage
A message that is published by publishers and consumed by subscribers. The message must contain either a non-empty data field or at least one attribute. Note that client libraries represent this object differently depending on the language. See the corresponding client library documentation for more information. See Quotas and limits for more information about message limits.
.. attribute:: data
The message data field. If this field is empty, the message must contain at least one attribute.
ID of this message, assigned by the server when the message is
published. Guaranteed to be unique within the topic. This
value may be read by a subscriber that receives a
PubsubMessage
via a Pull
call or a push delivery. It
must not be populated by the publisher in a Publish
call.
If non-empty, identifies related messages for which publish
order should be respected. If a Subscription
has
enable_message_ordering
set to true
, messages
published with the same non-empty ordering_key
value will
be delivered to subscribers in the order in which they are
received by the Pub/Sub system. All PubsubMessage
\ s
published in a given PublishRequest
must specify the same
ordering_key
value. EXPERIMENTAL: This feature is part of
a closed alpha release. This API might be changed in backward-
incompatible ways and is not recommended for production use.
It is not subject to any SLA or deprecation policy.
PullRequest
Request for the Pull
method.
.. attribute:: subscription
Required. The subscription from which messages should be
pulled. Format is projects/{project}/subscriptions/{sub}
.
Required. The maximum number of messages to return for this request. Must be a positive integer. The Pub/Sub system may return fewer than the number specified.
PullResponse
Response for the Pull
method.
.. attribute:: received_messages
Received Pub/Sub messages. The list will be empty if there are
no more messages available in the backlog. For JSON, the
response can be entirely empty. The Pub/Sub system may return
fewer than the maxMessages
requested even if there are
more messages available in the backlog.
PushConfig
Configuration for a push delivery endpoint.
.. attribute:: push_endpoint
A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push".
An authentication method used by push endpoints to verify the source of push requests. This can be used with push endpoints that are private by default to allow requests only from the Cloud Pub/Sub system, for example. This field is optional and should be set only by users interested in authenticated push.
ReceivedMessage
A message and its corresponding acknowledgment ID.
.. attribute:: ack_id
This ID can be used to acknowledge the received message.
Delivery attempt counter is 1 + (the sum of number of NACKs and number of ack_deadline exceeds) for this message. A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline exceeds event is whenever a message is not acknowledged within ack_deadline. Note that ack_deadline is initially Subscription.ackDeadlineSeconds, but may get extended automatically by the client library. The first delivery of a given message will have this value as 1. The value is calculated at best effort and is approximate. If a DeadLetterPolicy is not set on the subscription, this will be
- EXPERIMENTAL: This feature is part of a closed alpha release. This API might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
SeekRequest
Request for the Seek
method.
.. attribute:: subscription
Required. The subscription to affect.
The snapshot to seek to. The snapshot's topic must be the same
as that of the provided subscription. Format is
projects/{project}/snapshots/{snap}
.
SeekResponse
Response for the Seek
method (this response is empty).
ServiceDescriptorProto
API documentation for pubsub_v1.types.ServiceDescriptorProto
class.
ServiceOptions
API documentation for pubsub_v1.types.ServiceOptions
class.
SetIamPolicyRequest
Request message for SetIamPolicy
method.
.. attribute:: resource
REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
Snapshot
A snapshot resource. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.
.. attribute:: name
The name of the snapshot.
The snapshot is guaranteed to exist up until this time. A
newly-created snapshot expires no later than 7 days from the
time of its creation. Its exact lifetime is determined at
creation by the existing backlog in the source subscription.
Specifically, the lifetime of the snapshot is 7 days - (age
of oldest unacked message in the subscription)
. For example,
consider a subscription whose oldest unacked message is 3 days
old. If a snapshot is created from this subscription, the
snapshot -- which will always capture this 3-day-old backlog
as long as the snapshot exists -- will expire in 4 days. The
service will refuse to create a snapshot that would expire in
less than 1 hour after creation.
SourceCodeInfo
API documentation for pubsub_v1.types.SourceCodeInfo
class.
StreamingPullRequest
Request for the StreamingPull
streaming RPC method.
This request is used to establish the initial stream as well as to
stream acknowledgements and ack deadline modifications from the client
to the server.
.. attribute:: subscription
Required. The subscription for which to initialize the new
stream. This must be provided in the first request on the
stream, and must not be set in subsequent requests from client
to server. Format is
projects/{project}/subscriptions/{sub}
.
The list of new ack deadlines for the IDs listed in
modify_deadline_ack_ids
. The size of this list must be the
same as the size of modify_deadline_ack_ids
. If it differs
the stream will be aborted with INVALID_ARGUMENT
. Each
element in this list is applied to the element in the same
position in modify_deadline_ack_ids
. The new ack deadline
is with respect to the time this request was sent to the
Pub/Sub system. Must be >= 0. For example, if the value is 10,
the new ack deadline will expire 10 seconds after this request
is received. If the value is 0, the message is immediately
made available for another streaming or non-streaming pull
request. If the value is < 0 (an error), the stream will be
aborted with status INVALID_ARGUMENT
.
Required. The ack deadline to use for the stream. This must be provided in the first request on the stream, but it can also be updated on subsequent requests from client to server. The minimum deadline you can specify is 10 seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
StreamingPullResponse
Response for the StreamingPull
method. This response
is used to stream messages from the server to the client.
.. attribute:: received_messages
Received Pub/Sub messages. This will not be empty.
Subscription
A subscription resource.
.. attribute:: name
Required. The name of the subscription. It must have the
format "projects/{project}/subscriptions/{subscription}"
.
{subscription}
must start with a letter, and contain only
letters ([A-Za-z]
), numbers ([0-9]
), dashes (-
),
underscores (_
), periods (.
), tildes (````), plus
(
+) or percent signs (
%). It must be between 3 and 255
characters in length, and it must not start with
"goog"``.
If push delivery is used with this subscription, this field is
used to configure it. An empty pushConfig
signifies that
the subscriber will pull and ack messages using API methods.
Indicates whether to retain acknowledged messages. If true,
then messages are not expunged from the subscription's
backlog, even if they are acknowledged, until they fall out of
the message_retention_duration
window. This must be true
if you would like to Seek to a timestamp.
See Creating and managing labels.
A policy that specifies the conditions for this subscription's
expiration. A subscription is considered active as long as any
connected subscriber is successfully consuming messages from
the subscription or is issuing operations on the subscription.
If expiration_policy
is not set, a default policy with
ttl
of 31 days will be used. The minimum allowed value for
expiration_policy.ttl
is 1 day.
TestIamPermissionsRequest
Request message for TestIamPermissions
method.
.. attribute:: resource
REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
TestIamPermissionsResponse
Response message for TestIamPermissions
method.
.. attribute:: permissions
A subset of TestPermissionsRequest.permissions
that the
caller is allowed.
Timestamp
API documentation for pubsub_v1.types.Timestamp
class.
Topic
A topic resource.
.. attribute:: name
Required. The name of the topic. It must have the format
"projects/{project}/topics/{topic}"
. {topic}
must
start with a letter, and contain only letters ([A-Za-z]
),
numbers ([0-9]
), dashes (-
), underscores (_
),
periods (.
), tildes (````), plus (
+) or percent signs
(
%). It must be between 3 and 255 characters in length,
and it must not start with
"goog"``.
Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
UninterpretedOption
API documentation for pubsub_v1.types.UninterpretedOption
class.
UpdateSnapshotRequest
Request for the UpdateSnapshot method.
.. attribute:: snapshot
Required. The updated snapshot object.
UpdateSubscriptionRequest
Request for the UpdateSubscription method.
.. attribute:: subscription
Required. The updated subscription object.
UpdateTopicRequest
Request for the UpdateTopic method.
.. attribute:: topic
Required. The updated topic object.