@@ -75,15 +75,15 @@ class Message(object):
75
75
:class:`~.pubsub_v1.subscriber._consumer.Consumer`.)
76
76
77
77
Attributes:
78
- message_id:
78
+ message_id (str) :
79
79
The message ID. In general, you should not need to use this directly.
80
- data:
80
+ data (bytes) :
81
81
The data in the message. Note that this will be a :class:`bytes`,
82
82
not a text string.
83
- attributes:
83
+ attributes (MutableMapping[str, str]) :
84
84
The attributes sent along with the message. See :attr:`attributes` for more
85
85
information on this type.
86
- publish_time:
86
+ publish_time (google.protobuf.timestamp_pb2.Timestamp) :
87
87
The time that this message was originally published.
88
88
"""
89
89
@@ -103,21 +103,21 @@ def __init__(
103
103
responsibility of :class:`BasePolicy` subclasses to do so.
104
104
105
105
Args:
106
- message:
106
+ message (types.PubsubMessage._meta._pb) :
107
107
The message received from Pub/Sub. For performance reasons it should be
108
108
the raw protobuf message normally wrapped by
109
109
:class:`~pubsub_v1.types.PubsubMessage`. A raw message can be obtained
110
110
from a :class:`~pubsub_v1.types.PubsubMessage` instance through the
111
111
latter's ``._pb`` attribute.
112
- ack_id:
112
+ ack_id (str) :
113
113
The ack_id received from Pub/Sub.
114
- delivery_attempt:
114
+ delivery_attempt (int) :
115
115
The delivery attempt counter received from Pub/Sub if a DeadLetterPolicy
116
116
is set on the subscription, and zero otherwise.
117
- request_queue:
117
+ request_queue (queue.Queue) :
118
118
A queue provided by the policy that can accept requests; the policy is
119
119
responsible for handling those requests.
120
- exactly_once_delivery_enabled_func:
120
+ exactly_once_delivery_enabled_func (Callable[[], bool]) :
121
121
A Callable that returns whether exactly-once delivery is currently-enabled. Defaults to a lambda that always returns False.
122
122
"""
123
123
self ._message = message
@@ -172,8 +172,8 @@ def attributes(self) -> "containers.ScalarMap":
172
172
to just cast the map to a ``dict`` or to one use ``map.get``.
173
173
174
174
Returns:
175
- The message's attributes. This is a ``dict``-like object provided by
176
- ``google.protobuf``.
175
+ containers.ScalarMap: The message's attributes. This is a
176
+ ``dict``-like object provided by `` google.protobuf``.
177
177
"""
178
178
return self ._attributes
179
179
@@ -182,8 +182,8 @@ def data(self) -> bytes:
182
182
"""Return the data for the underlying Pub/Sub Message.
183
183
184
184
Returns:
185
- The message data. This is always a bytestring; if you want a text string,
186
- call :meth:`bytes.decode`.
185
+ bytes: The message data. This is always a bytestring; if you want
186
+ a text string, call :meth:`bytes.decode`.
187
187
"""
188
188
return self ._data
189
189
@@ -192,7 +192,8 @@ def publish_time(self) -> "datetime.datetime":
192
192
"""Return the time that the message was originally published.
193
193
194
194
Returns:
195
- The date and time that the message was published.
195
+ datetime.datetime: The date and time that the message was
196
+ published.
196
197
"""
197
198
return self ._publish_time
198
199
@@ -227,7 +228,7 @@ def delivery_attempt(self) -> Optional[int]:
227
228
is calculated at best effort and is approximate.
228
229
229
230
Returns:
230
- The delivery attempt counter or ``None``.
231
+ Optional[int]: The delivery attempt counter or ``None``.
231
232
"""
232
233
return self ._delivery_attempt
233
234
@@ -290,7 +291,8 @@ def ack_with_response(self) -> "futures.Future":
290
291
see https://cloud.google.com/pubsub/docs/exactly-once-delivery."
291
292
292
293
Returns:
293
- A :class:`~google.cloud.pubsub_v1.subscriber.futures.Future`
294
+ futures.Future: A
295
+ :class:`~google.cloud.pubsub_v1.subscriber.futures.Future`
294
296
instance that conforms to Python Standard library's
295
297
:class:`~concurrent.futures.Future` interface (but not an
296
298
instance of that class). Call `result()` to get the result
@@ -349,7 +351,7 @@ def modify_ack_deadline(self, seconds: int) -> None:
349
351
:class:`~.pubsub_v1.subcriber._consumer.Consumer`.
350
352
351
353
Args:
352
- seconds:
354
+ seconds (int) :
353
355
The number of seconds to set the lease deadline to. This should be
354
356
between 0 and 600. Due to network latency, values below 10 are advised
355
357
against.
@@ -387,12 +389,13 @@ def modify_ack_deadline_with_response(self, seconds: int) -> "futures.Future":
387
389
see https://cloud.google.com/pubsub/docs/exactly-once-delivery."
388
390
389
391
Args:
390
- seconds:
392
+ seconds (int) :
391
393
The number of seconds to set the lease deadline to. This should be
392
394
between 0 and 600. Due to network latency, values below 10 are advised
393
395
against.
394
396
Returns:
395
- A :class:`~google.cloud.pubsub_v1.subscriber.futures.Future`
397
+ futures.Future: A
398
+ :class:`~google.cloud.pubsub_v1.subscriber.futures.Future`
396
399
instance that conforms to Python Standard library's
397
400
:class:`~concurrent.futures.Future` interface (but not an
398
401
instance of that class). Call `result()` to get the result
@@ -457,7 +460,8 @@ def nack_with_response(self) -> "futures.Future":
457
460
see https://cloud.google.com/pubsub/docs/exactly-once-delivery."
458
461
459
462
Returns:
460
- A :class:`~google.cloud.pubsub_v1.subscriber.futures.Future`
463
+ futures.Future: A
464
+ :class:`~google.cloud.pubsub_v1.subscriber.futures.Future`
461
465
instance that conforms to Python Standard library's
462
466
:class:`~concurrent.futures.Future` interface (but not an
463
467
instance of that class). Call `result()` to get the result
0 commit comments