Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/google/pubsub_v1/types/pubsub.py: 99%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

415 statements  

1# -*- coding: utf-8 -*- 

2# Copyright 2025 Google LLC 

3# 

4# Licensed under the Apache License, Version 2.0 (the "License"); 

5# you may not use this file except in compliance with the License. 

6# You may obtain a copy of the License at 

7# 

8# http://www.apache.org/licenses/LICENSE-2.0 

9# 

10# Unless required by applicable law or agreed to in writing, software 

11# distributed under the License is distributed on an "AS IS" BASIS, 

12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

13# See the License for the specific language governing permissions and 

14# limitations under the License. 

15# 

16from __future__ import annotations 

17 

18from typing import MutableMapping, MutableSequence 

19 

20import proto # type: ignore 

21 

22from google.protobuf import duration_pb2 # type: ignore 

23from google.protobuf import field_mask_pb2 # type: ignore 

24from google.protobuf import timestamp_pb2 # type: ignore 

25from google.pubsub_v1.types import schema as gp_schema 

26 

27 

28__protobuf__ = proto.module( 

29 package="google.pubsub.v1", 

30 manifest={ 

31 "MessageStoragePolicy", 

32 "SchemaSettings", 

33 "IngestionDataSourceSettings", 

34 "PlatformLogsSettings", 

35 "IngestionFailureEvent", 

36 "JavaScriptUDF", 

37 "MessageTransform", 

38 "Topic", 

39 "PubsubMessage", 

40 "GetTopicRequest", 

41 "UpdateTopicRequest", 

42 "PublishRequest", 

43 "PublishResponse", 

44 "ListTopicsRequest", 

45 "ListTopicsResponse", 

46 "ListTopicSubscriptionsRequest", 

47 "ListTopicSubscriptionsResponse", 

48 "ListTopicSnapshotsRequest", 

49 "ListTopicSnapshotsResponse", 

50 "DeleteTopicRequest", 

51 "DetachSubscriptionRequest", 

52 "DetachSubscriptionResponse", 

53 "Subscription", 

54 "RetryPolicy", 

55 "DeadLetterPolicy", 

56 "ExpirationPolicy", 

57 "PushConfig", 

58 "BigQueryConfig", 

59 "CloudStorageConfig", 

60 "ReceivedMessage", 

61 "GetSubscriptionRequest", 

62 "UpdateSubscriptionRequest", 

63 "ListSubscriptionsRequest", 

64 "ListSubscriptionsResponse", 

65 "DeleteSubscriptionRequest", 

66 "ModifyPushConfigRequest", 

67 "PullRequest", 

68 "PullResponse", 

69 "ModifyAckDeadlineRequest", 

70 "AcknowledgeRequest", 

71 "StreamingPullRequest", 

72 "StreamingPullResponse", 

73 "CreateSnapshotRequest", 

74 "UpdateSnapshotRequest", 

75 "Snapshot", 

76 "GetSnapshotRequest", 

77 "ListSnapshotsRequest", 

78 "ListSnapshotsResponse", 

79 "DeleteSnapshotRequest", 

80 "SeekRequest", 

81 "SeekResponse", 

82 }, 

83) 

84 

85 

86class MessageStoragePolicy(proto.Message): 

87 r"""A policy constraining the storage of messages published to 

88 the topic. 

89 

90 Attributes: 

91 allowed_persistence_regions (MutableSequence[str]): 

92 Optional. A list of IDs of Google Cloud 

93 regions where messages that are published to the 

94 topic may be persisted in storage. Messages 

95 published by publishers running in non-allowed 

96 Google Cloud regions (or running outside of 

97 Google Cloud altogether) are routed for storage 

98 in one of the allowed regions. An empty list 

99 means that no regions are allowed, and is not a 

100 valid configuration. 

101 enforce_in_transit (bool): 

102 Optional. If true, ``allowed_persistence_regions`` is also 

103 used to enforce in-transit guarantees for messages. That is, 

104 Pub/Sub will fail Publish operations on this topic and 

105 subscribe operations on any subscription attached to this 

106 topic in any region that is not in 

107 ``allowed_persistence_regions``. 

108 """ 

109 

110 allowed_persistence_regions: MutableSequence[str] = proto.RepeatedField( 

111 proto.STRING, 

112 number=1, 

113 ) 

114 enforce_in_transit: bool = proto.Field( 

115 proto.BOOL, 

116 number=2, 

117 ) 

118 

119 

120class SchemaSettings(proto.Message): 

121 r"""Settings for validating messages published against a schema. 

122 

123 Attributes: 

124 schema (str): 

125 Required. The name of the schema that messages published 

126 should be validated against. Format is 

127 ``projects/{project}/schemas/{schema}``. The value of this 

128 field will be ``_deleted-schema_`` if the schema has been 

129 deleted. 

130 encoding (google.pubsub_v1.types.Encoding): 

131 Optional. The encoding of messages validated against 

132 ``schema``. 

133 first_revision_id (str): 

134 Optional. The minimum (inclusive) revision allowed for 

135 validating messages. If empty or not present, allow any 

136 revision to be validated against last_revision or any 

137 revision created before. 

138 last_revision_id (str): 

139 Optional. The maximum (inclusive) revision allowed for 

140 validating messages. If empty or not present, allow any 

141 revision to be validated against first_revision or any 

142 revision created after. 

143 """ 

144 

145 schema: str = proto.Field( 

146 proto.STRING, 

147 number=1, 

148 ) 

149 encoding: gp_schema.Encoding = proto.Field( 

150 proto.ENUM, 

151 number=2, 

152 enum=gp_schema.Encoding, 

153 ) 

154 first_revision_id: str = proto.Field( 

155 proto.STRING, 

156 number=3, 

157 ) 

158 last_revision_id: str = proto.Field( 

159 proto.STRING, 

160 number=4, 

161 ) 

162 

163 

164class IngestionDataSourceSettings(proto.Message): 

165 r"""Settings for an ingestion data source on a topic. 

166 

167 This message has `oneof`_ fields (mutually exclusive fields). 

168 For each oneof, at most one member field can be set at the same time. 

169 Setting any member of the oneof automatically clears all other 

170 members. 

171 

172 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields 

173 

174 Attributes: 

175 aws_kinesis (google.pubsub_v1.types.IngestionDataSourceSettings.AwsKinesis): 

176 Optional. Amazon Kinesis Data Streams. 

177 

178 This field is a member of `oneof`_ ``source``. 

179 cloud_storage (google.pubsub_v1.types.IngestionDataSourceSettings.CloudStorage): 

180 Optional. Cloud Storage. 

181 

182 This field is a member of `oneof`_ ``source``. 

183 azure_event_hubs (google.pubsub_v1.types.IngestionDataSourceSettings.AzureEventHubs): 

184 Optional. Azure Event Hubs. 

185 

186 This field is a member of `oneof`_ ``source``. 

187 aws_msk (google.pubsub_v1.types.IngestionDataSourceSettings.AwsMsk): 

188 Optional. Amazon MSK. 

189 

190 This field is a member of `oneof`_ ``source``. 

191 confluent_cloud (google.pubsub_v1.types.IngestionDataSourceSettings.ConfluentCloud): 

192 Optional. Confluent Cloud. 

193 

194 This field is a member of `oneof`_ ``source``. 

195 platform_logs_settings (google.pubsub_v1.types.PlatformLogsSettings): 

196 Optional. Platform Logs settings. If unset, 

197 no Platform Logs will be generated. 

198 """ 

199 

200 class AwsKinesis(proto.Message): 

201 r"""Ingestion settings for Amazon Kinesis Data Streams. 

202 

203 Attributes: 

204 state (google.pubsub_v1.types.IngestionDataSourceSettings.AwsKinesis.State): 

205 Output only. An output-only field that 

206 indicates the state of the Kinesis ingestion 

207 source. 

208 stream_arn (str): 

209 Required. The Kinesis stream ARN to ingest 

210 data from. 

211 consumer_arn (str): 

212 Required. The Kinesis consumer ARN to used 

213 for ingestion in Enhanced Fan-Out mode. The 

214 consumer must be already created and ready to be 

215 used. 

216 aws_role_arn (str): 

217 Required. AWS role ARN to be used for 

218 Federated Identity authentication with Kinesis. 

219 Check the Pub/Sub docs for how to set up this 

220 role and the required permissions that need to 

221 be attached to it. 

222 gcp_service_account (str): 

223 Required. The GCP service account to be used for Federated 

224 Identity authentication with Kinesis (via a 

225 ``AssumeRoleWithWebIdentity`` call for the provided role). 

226 The ``aws_role_arn`` must be set up with 

227 ``accounts.google.com:sub`` equals to this service account 

228 number. 

229 """ 

230 

231 class State(proto.Enum): 

232 r"""Possible states for ingestion from Amazon Kinesis Data 

233 Streams. 

234 

235 Values: 

236 STATE_UNSPECIFIED (0): 

237 Default value. This value is unused. 

238 ACTIVE (1): 

239 Ingestion is active. 

240 KINESIS_PERMISSION_DENIED (2): 

241 Permission denied encountered while consuming data from 

242 Kinesis. This can happen if: 

243 

244 - The provided ``aws_role_arn`` does not exist or does not 

245 have the appropriate permissions attached. 

246 - The provided ``aws_role_arn`` is not set up properly for 

247 Identity Federation using ``gcp_service_account``. 

248 - The Pub/Sub SA is not granted the 

249 ``iam.serviceAccounts.getOpenIdToken`` permission on 

250 ``gcp_service_account``. 

251 PUBLISH_PERMISSION_DENIED (3): 

252 Permission denied encountered while publishing to the topic. 

253 This can happen if the Pub/Sub SA has not been granted the 

254 `appropriate publish 

255 permissions <https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher>`__ 

256 STREAM_NOT_FOUND (4): 

257 The Kinesis stream does not exist. 

258 CONSUMER_NOT_FOUND (5): 

259 The Kinesis consumer does not exist. 

260 """ 

261 STATE_UNSPECIFIED = 0 

262 ACTIVE = 1 

263 KINESIS_PERMISSION_DENIED = 2 

264 PUBLISH_PERMISSION_DENIED = 3 

265 STREAM_NOT_FOUND = 4 

266 CONSUMER_NOT_FOUND = 5 

267 

268 state: "IngestionDataSourceSettings.AwsKinesis.State" = proto.Field( 

269 proto.ENUM, 

270 number=1, 

271 enum="IngestionDataSourceSettings.AwsKinesis.State", 

272 ) 

273 stream_arn: str = proto.Field( 

274 proto.STRING, 

275 number=2, 

276 ) 

277 consumer_arn: str = proto.Field( 

278 proto.STRING, 

279 number=3, 

280 ) 

281 aws_role_arn: str = proto.Field( 

282 proto.STRING, 

283 number=4, 

284 ) 

285 gcp_service_account: str = proto.Field( 

286 proto.STRING, 

287 number=5, 

288 ) 

289 

290 class CloudStorage(proto.Message): 

291 r"""Ingestion settings for Cloud Storage. 

292 

293 This message has `oneof`_ fields (mutually exclusive fields). 

294 For each oneof, at most one member field can be set at the same time. 

295 Setting any member of the oneof automatically clears all other 

296 members. 

297 

298 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields 

299 

300 Attributes: 

301 state (google.pubsub_v1.types.IngestionDataSourceSettings.CloudStorage.State): 

302 Output only. An output-only field that 

303 indicates the state of the Cloud Storage 

304 ingestion source. 

305 bucket (str): 

306 Optional. Cloud Storage bucket. The bucket name must be 

307 without any prefix like "gs://". See the [bucket naming 

308 requirements] 

309 (https://cloud.google.com/storage/docs/buckets#naming). 

310 text_format (google.pubsub_v1.types.IngestionDataSourceSettings.CloudStorage.TextFormat): 

311 Optional. Data from Cloud Storage will be 

312 interpreted as text. 

313 

314 This field is a member of `oneof`_ ``input_format``. 

315 avro_format (google.pubsub_v1.types.IngestionDataSourceSettings.CloudStorage.AvroFormat): 

316 Optional. Data from Cloud Storage will be 

317 interpreted in Avro format. 

318 

319 This field is a member of `oneof`_ ``input_format``. 

320 pubsub_avro_format (google.pubsub_v1.types.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat): 

321 Optional. It will be assumed data from Cloud Storage was 

322 written via `Cloud Storage 

323 subscriptions <https://cloud.google.com/pubsub/docs/cloudstorage>`__. 

324 

325 This field is a member of `oneof`_ ``input_format``. 

326 minimum_object_create_time (google.protobuf.timestamp_pb2.Timestamp): 

327 Optional. Only objects with a larger or equal 

328 creation timestamp will be ingested. 

329 match_glob (str): 

330 Optional. Glob pattern used to match objects that will be 

331 ingested. If unset, all objects will be ingested. See the 

332 `supported 

333 patterns <https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob>`__. 

334 """ 

335 

336 class State(proto.Enum): 

337 r"""Possible states for ingestion from Cloud Storage. 

338 

339 Values: 

340 STATE_UNSPECIFIED (0): 

341 Default value. This value is unused. 

342 ACTIVE (1): 

343 Ingestion is active. 

344 CLOUD_STORAGE_PERMISSION_DENIED (2): 

345 Permission denied encountered while calling the Cloud 

346 Storage API. This can happen if the Pub/Sub SA has not been 

347 granted the `appropriate 

348 permissions <https://cloud.google.com/storage/docs/access-control/iam-permissions>`__: 

349 

350 - storage.objects.list: to list the objects in a bucket. 

351 - storage.objects.get: to read the objects in a bucket. 

352 - storage.buckets.get: to verify the bucket exists. 

353 PUBLISH_PERMISSION_DENIED (3): 

354 Permission denied encountered while publishing to the topic. 

355 This can happen if the Pub/Sub SA has not been granted the 

356 `appropriate publish 

357 permissions <https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher>`__ 

358 BUCKET_NOT_FOUND (4): 

359 The provided Cloud Storage bucket doesn't 

360 exist. 

361 TOO_MANY_OBJECTS (5): 

362 The Cloud Storage bucket has too many 

363 objects, ingestion will be paused. 

364 """ 

365 STATE_UNSPECIFIED = 0 

366 ACTIVE = 1 

367 CLOUD_STORAGE_PERMISSION_DENIED = 2 

368 PUBLISH_PERMISSION_DENIED = 3 

369 BUCKET_NOT_FOUND = 4 

370 TOO_MANY_OBJECTS = 5 

371 

372 class TextFormat(proto.Message): 

373 r"""Configuration for reading Cloud Storage data in text format. Each 

374 line of text as specified by the delimiter will be set to the 

375 ``data`` field of a Pub/Sub message. 

376 

377 

378 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields 

379 

380 Attributes: 

381 delimiter (str): 

382 Optional. When unset, '\n' is used. 

383 

384 This field is a member of `oneof`_ ``_delimiter``. 

385 """ 

386 

387 delimiter: str = proto.Field( 

388 proto.STRING, 

389 number=1, 

390 optional=True, 

391 ) 

392 

393 class AvroFormat(proto.Message): 

394 r"""Configuration for reading Cloud Storage data in Avro binary format. 

395 The bytes of each object will be set to the ``data`` field of a 

396 Pub/Sub message. 

397 

398 """ 

399 

400 class PubSubAvroFormat(proto.Message): 

401 r"""Configuration for reading Cloud Storage data written via `Cloud 

402 Storage 

403 subscriptions <https://cloud.google.com/pubsub/docs/cloudstorage>`__. 

404 The data and attributes fields of the originally exported Pub/Sub 

405 message will be restored when publishing. 

406 

407 """ 

408 

409 state: "IngestionDataSourceSettings.CloudStorage.State" = proto.Field( 

410 proto.ENUM, 

411 number=1, 

412 enum="IngestionDataSourceSettings.CloudStorage.State", 

413 ) 

414 bucket: str = proto.Field( 

415 proto.STRING, 

416 number=2, 

417 ) 

418 text_format: "IngestionDataSourceSettings.CloudStorage.TextFormat" = ( 

419 proto.Field( 

420 proto.MESSAGE, 

421 number=3, 

422 oneof="input_format", 

423 message="IngestionDataSourceSettings.CloudStorage.TextFormat", 

424 ) 

425 ) 

426 avro_format: "IngestionDataSourceSettings.CloudStorage.AvroFormat" = ( 

427 proto.Field( 

428 proto.MESSAGE, 

429 number=4, 

430 oneof="input_format", 

431 message="IngestionDataSourceSettings.CloudStorage.AvroFormat", 

432 ) 

433 ) 

434 pubsub_avro_format: "IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat" = proto.Field( 

435 proto.MESSAGE, 

436 number=5, 

437 oneof="input_format", 

438 message="IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat", 

439 ) 

440 minimum_object_create_time: timestamp_pb2.Timestamp = proto.Field( 

441 proto.MESSAGE, 

442 number=6, 

443 message=timestamp_pb2.Timestamp, 

444 ) 

445 match_glob: str = proto.Field( 

446 proto.STRING, 

447 number=9, 

448 ) 

449 

450 class AzureEventHubs(proto.Message): 

451 r"""Ingestion settings for Azure Event Hubs. 

452 

453 Attributes: 

454 state (google.pubsub_v1.types.IngestionDataSourceSettings.AzureEventHubs.State): 

455 Output only. An output-only field that 

456 indicates the state of the Event Hubs ingestion 

457 source. 

458 resource_group (str): 

459 Optional. Name of the resource group within 

460 the azure subscription. 

461 namespace (str): 

462 Optional. The name of the Event Hubs 

463 namespace. 

464 event_hub (str): 

465 Optional. The name of the Event Hub. 

466 client_id (str): 

467 Optional. The client id of the Azure 

468 application that is being used to authenticate 

469 Pub/Sub. 

470 tenant_id (str): 

471 Optional. The tenant id of the Azure 

472 application that is being used to authenticate 

473 Pub/Sub. 

474 subscription_id (str): 

475 Optional. The Azure subscription id. 

476 gcp_service_account (str): 

477 Optional. The GCP service account to be used 

478 for Federated Identity authentication. 

479 """ 

480 

481 class State(proto.Enum): 

482 r"""Possible states for managed ingestion from Event Hubs. 

483 

484 Values: 

485 STATE_UNSPECIFIED (0): 

486 Default value. This value is unused. 

487 ACTIVE (1): 

488 Ingestion is active. 

489 EVENT_HUBS_PERMISSION_DENIED (2): 

490 Permission denied encountered while consuming data from 

491 Event Hubs. This can happen when ``client_id``, or 

492 ``tenant_id`` are invalid. Or the right permissions haven't 

493 been granted. 

494 PUBLISH_PERMISSION_DENIED (3): 

495 Permission denied encountered while 

496 publishing to the topic. 

497 NAMESPACE_NOT_FOUND (4): 

498 The provided Event Hubs namespace couldn't be 

499 found. 

500 EVENT_HUB_NOT_FOUND (5): 

501 The provided Event Hub couldn't be found. 

502 SUBSCRIPTION_NOT_FOUND (6): 

503 The provided Event Hubs subscription couldn't 

504 be found. 

505 RESOURCE_GROUP_NOT_FOUND (7): 

506 The provided Event Hubs resource group 

507 couldn't be found. 

508 """ 

509 STATE_UNSPECIFIED = 0 

510 ACTIVE = 1 

511 EVENT_HUBS_PERMISSION_DENIED = 2 

512 PUBLISH_PERMISSION_DENIED = 3 

513 NAMESPACE_NOT_FOUND = 4 

514 EVENT_HUB_NOT_FOUND = 5 

515 SUBSCRIPTION_NOT_FOUND = 6 

516 RESOURCE_GROUP_NOT_FOUND = 7 

517 

518 state: "IngestionDataSourceSettings.AzureEventHubs.State" = proto.Field( 

519 proto.ENUM, 

520 number=1, 

521 enum="IngestionDataSourceSettings.AzureEventHubs.State", 

522 ) 

523 resource_group: str = proto.Field( 

524 proto.STRING, 

525 number=2, 

526 ) 

527 namespace: str = proto.Field( 

528 proto.STRING, 

529 number=3, 

530 ) 

531 event_hub: str = proto.Field( 

532 proto.STRING, 

533 number=4, 

534 ) 

535 client_id: str = proto.Field( 

536 proto.STRING, 

537 number=5, 

538 ) 

539 tenant_id: str = proto.Field( 

540 proto.STRING, 

541 number=6, 

542 ) 

543 subscription_id: str = proto.Field( 

544 proto.STRING, 

545 number=7, 

546 ) 

547 gcp_service_account: str = proto.Field( 

548 proto.STRING, 

549 number=8, 

550 ) 

551 

552 class AwsMsk(proto.Message): 

553 r"""Ingestion settings for Amazon MSK. 

554 

555 Attributes: 

556 state (google.pubsub_v1.types.IngestionDataSourceSettings.AwsMsk.State): 

557 Output only. An output-only field that 

558 indicates the state of the Amazon MSK ingestion 

559 source. 

560 cluster_arn (str): 

561 Required. The Amazon Resource Name (ARN) that 

562 uniquely identifies the cluster. 

563 topic (str): 

564 Required. The name of the topic in the Amazon 

565 MSK cluster that Pub/Sub will import from. 

566 aws_role_arn (str): 

567 Required. AWS role ARN to be used for 

568 Federated Identity authentication with Amazon 

569 MSK. Check the Pub/Sub docs for how to set up 

570 this role and the required permissions that need 

571 to be attached to it. 

572 gcp_service_account (str): 

573 Required. The GCP service account to be used for Federated 

574 Identity authentication with Amazon MSK (via a 

575 ``AssumeRoleWithWebIdentity`` call for the provided role). 

576 The ``aws_role_arn`` must be set up with 

577 ``accounts.google.com:sub`` equals to this service account 

578 number. 

579 """ 

580 

581 class State(proto.Enum): 

582 r"""Possible states for managed ingestion from Amazon MSK. 

583 

584 Values: 

585 STATE_UNSPECIFIED (0): 

586 Default value. This value is unused. 

587 ACTIVE (1): 

588 Ingestion is active. 

589 MSK_PERMISSION_DENIED (2): 

590 Permission denied encountered while consuming 

591 data from Amazon MSK. 

592 PUBLISH_PERMISSION_DENIED (3): 

593 Permission denied encountered while 

594 publishing to the topic. 

595 CLUSTER_NOT_FOUND (4): 

596 The provided MSK cluster wasn't found. 

597 TOPIC_NOT_FOUND (5): 

598 The provided topic wasn't found. 

599 """ 

600 STATE_UNSPECIFIED = 0 

601 ACTIVE = 1 

602 MSK_PERMISSION_DENIED = 2 

603 PUBLISH_PERMISSION_DENIED = 3 

604 CLUSTER_NOT_FOUND = 4 

605 TOPIC_NOT_FOUND = 5 

606 

607 state: "IngestionDataSourceSettings.AwsMsk.State" = proto.Field( 

608 proto.ENUM, 

609 number=1, 

610 enum="IngestionDataSourceSettings.AwsMsk.State", 

611 ) 

612 cluster_arn: str = proto.Field( 

613 proto.STRING, 

614 number=2, 

615 ) 

616 topic: str = proto.Field( 

617 proto.STRING, 

618 number=3, 

619 ) 

620 aws_role_arn: str = proto.Field( 

621 proto.STRING, 

622 number=4, 

623 ) 

624 gcp_service_account: str = proto.Field( 

625 proto.STRING, 

626 number=5, 

627 ) 

628 

629 class ConfluentCloud(proto.Message): 

630 r"""Ingestion settings for Confluent Cloud. 

631 

632 Attributes: 

633 state (google.pubsub_v1.types.IngestionDataSourceSettings.ConfluentCloud.State): 

634 Output only. An output-only field that 

635 indicates the state of the Confluent Cloud 

636 ingestion source. 

637 bootstrap_server (str): 

638 Required. The address of the bootstrap 

639 server. The format is url:port. 

640 cluster_id (str): 

641 Required. The id of the cluster. 

642 topic (str): 

643 Required. The name of the topic in the 

644 Confluent Cloud cluster that Pub/Sub will import 

645 from. 

646 identity_pool_id (str): 

647 Required. The id of the identity pool to be 

648 used for Federated Identity authentication with 

649 Confluent Cloud. See 

650 https://docs.confluent.io/cloud/current/security/authenticate/workload-identities/identity-providers/oauth/identity-pools.html#add-oauth-identity-pools. 

651 gcp_service_account (str): 

652 Required. The GCP service account to be used for Federated 

653 Identity authentication with ``identity_pool_id``. 

654 """ 

655 

656 class State(proto.Enum): 

657 r"""Possible states for managed ingestion from Confluent Cloud. 

658 

659 Values: 

660 STATE_UNSPECIFIED (0): 

661 Default value. This value is unused. 

662 ACTIVE (1): 

663 Ingestion is active. 

664 CONFLUENT_CLOUD_PERMISSION_DENIED (2): 

665 Permission denied encountered while consuming 

666 data from Confluent Cloud. 

667 PUBLISH_PERMISSION_DENIED (3): 

668 Permission denied encountered while 

669 publishing to the topic. 

670 UNREACHABLE_BOOTSTRAP_SERVER (4): 

671 The provided bootstrap server address is 

672 unreachable. 

673 CLUSTER_NOT_FOUND (5): 

674 The provided cluster wasn't found. 

675 TOPIC_NOT_FOUND (6): 

676 The provided topic wasn't found. 

677 """ 

678 STATE_UNSPECIFIED = 0 

679 ACTIVE = 1 

680 CONFLUENT_CLOUD_PERMISSION_DENIED = 2 

681 PUBLISH_PERMISSION_DENIED = 3 

682 UNREACHABLE_BOOTSTRAP_SERVER = 4 

683 CLUSTER_NOT_FOUND = 5 

684 TOPIC_NOT_FOUND = 6 

685 

686 state: "IngestionDataSourceSettings.ConfluentCloud.State" = proto.Field( 

687 proto.ENUM, 

688 number=1, 

689 enum="IngestionDataSourceSettings.ConfluentCloud.State", 

690 ) 

691 bootstrap_server: str = proto.Field( 

692 proto.STRING, 

693 number=2, 

694 ) 

695 cluster_id: str = proto.Field( 

696 proto.STRING, 

697 number=3, 

698 ) 

699 topic: str = proto.Field( 

700 proto.STRING, 

701 number=4, 

702 ) 

703 identity_pool_id: str = proto.Field( 

704 proto.STRING, 

705 number=5, 

706 ) 

707 gcp_service_account: str = proto.Field( 

708 proto.STRING, 

709 number=6, 

710 ) 

711 

712 aws_kinesis: AwsKinesis = proto.Field( 

713 proto.MESSAGE, 

714 number=1, 

715 oneof="source", 

716 message=AwsKinesis, 

717 ) 

718 cloud_storage: CloudStorage = proto.Field( 

719 proto.MESSAGE, 

720 number=2, 

721 oneof="source", 

722 message=CloudStorage, 

723 ) 

724 azure_event_hubs: AzureEventHubs = proto.Field( 

725 proto.MESSAGE, 

726 number=3, 

727 oneof="source", 

728 message=AzureEventHubs, 

729 ) 

730 aws_msk: AwsMsk = proto.Field( 

731 proto.MESSAGE, 

732 number=5, 

733 oneof="source", 

734 message=AwsMsk, 

735 ) 

736 confluent_cloud: ConfluentCloud = proto.Field( 

737 proto.MESSAGE, 

738 number=6, 

739 oneof="source", 

740 message=ConfluentCloud, 

741 ) 

742 platform_logs_settings: "PlatformLogsSettings" = proto.Field( 

743 proto.MESSAGE, 

744 number=4, 

745 message="PlatformLogsSettings", 

746 ) 

747 

748 

749class PlatformLogsSettings(proto.Message): 

750 r"""Settings for Platform Logs produced by Pub/Sub. 

751 

752 Attributes: 

753 severity (google.pubsub_v1.types.PlatformLogsSettings.Severity): 

754 Optional. The minimum severity level of 

755 Platform Logs that will be written. 

756 """ 

757 

758 class Severity(proto.Enum): 

759 r"""Severity levels of Platform Logs. 

760 

761 Values: 

762 SEVERITY_UNSPECIFIED (0): 

763 Default value. Logs level is unspecified. 

764 Logs will be disabled. 

765 DISABLED (1): 

766 Logs will be disabled. 

767 DEBUG (2): 

768 Debug logs and higher-severity logs will be 

769 written. 

770 INFO (3): 

771 Info logs and higher-severity logs will be 

772 written. 

773 WARNING (4): 

774 Warning logs and higher-severity logs will be 

775 written. 

776 ERROR (5): 

777 Only error logs will be written. 

778 """ 

779 SEVERITY_UNSPECIFIED = 0 

780 DISABLED = 1 

781 DEBUG = 2 

782 INFO = 3 

783 WARNING = 4 

784 ERROR = 5 

785 

786 severity: Severity = proto.Field( 

787 proto.ENUM, 

788 number=1, 

789 enum=Severity, 

790 ) 

791 

792 

793class IngestionFailureEvent(proto.Message): 

794 r"""Payload of the Platform Log entry sent when a failure is 

795 encountered while ingesting. 

796 

797 This message has `oneof`_ fields (mutually exclusive fields). 

798 For each oneof, at most one member field can be set at the same time. 

799 Setting any member of the oneof automatically clears all other 

800 members. 

801 

802 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields 

803 

804 Attributes: 

805 topic (str): 

806 Required. Name of the import topic. Format is: 

807 projects/{project_name}/topics/{topic_name}. 

808 error_message (str): 

809 Required. Error details explaining why 

810 ingestion to Pub/Sub has failed. 

811 cloud_storage_failure (google.pubsub_v1.types.IngestionFailureEvent.CloudStorageFailure): 

812 Optional. Failure when ingesting from Cloud 

813 Storage. 

814 

815 This field is a member of `oneof`_ ``failure``. 

816 aws_msk_failure (google.pubsub_v1.types.IngestionFailureEvent.AwsMskFailureReason): 

817 Optional. Failure when ingesting from Amazon 

818 MSK. 

819 

820 This field is a member of `oneof`_ ``failure``. 

821 azure_event_hubs_failure (google.pubsub_v1.types.IngestionFailureEvent.AzureEventHubsFailureReason): 

822 Optional. Failure when ingesting from Azure 

823 Event Hubs. 

824 

825 This field is a member of `oneof`_ ``failure``. 

826 confluent_cloud_failure (google.pubsub_v1.types.IngestionFailureEvent.ConfluentCloudFailureReason): 

827 Optional. Failure when ingesting from 

828 Confluent Cloud. 

829 

830 This field is a member of `oneof`_ ``failure``. 

831 aws_kinesis_failure (google.pubsub_v1.types.IngestionFailureEvent.AwsKinesisFailureReason): 

832 Optional. Failure when ingesting from AWS 

833 Kinesis. 

834 

835 This field is a member of `oneof`_ ``failure``. 

836 """ 

837 

838 class ApiViolationReason(proto.Message): 

839 r"""Specifies the reason why some data may have been left out of the 

840 desired Pub/Sub message due to the API message limits 

841 (https://cloud.google.com/pubsub/quotas#resource_limits). For 

842 example, when the number of attributes is larger than 100, the 

843 number of attributes is truncated to 100 to respect the limit on the 

844 attribute count. Other attribute limits are treated similarly. When 

845 the size of the desired message would've been larger than 10MB, the 

846 message won't be published at all, and ingestion of the subsequent 

847 messages will proceed as normal. 

848 

849 """ 

850 

851 class AvroFailureReason(proto.Message): 

852 r"""Set when an Avro file is unsupported or its format is not 

853 valid. When this occurs, one or more Avro objects won't be 

854 ingested. 

855 

856 """ 

857 

858 class SchemaViolationReason(proto.Message): 

859 r"""Set when a Pub/Sub message fails to get published due to a 

860 schema validation violation. 

861 

862 """ 

863 

864 class MessageTransformationFailureReason(proto.Message): 

865 r"""Set when a Pub/Sub message fails to get published due to a 

866 message transformation error. 

867 

868 """ 

869 

870 class CloudStorageFailure(proto.Message): 

871 r"""Failure when ingesting from a Cloud Storage source. 

872 

873 This message has `oneof`_ fields (mutually exclusive fields). 

874 For each oneof, at most one member field can be set at the same time. 

875 Setting any member of the oneof automatically clears all other 

876 members. 

877 

878 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields 

879 

880 Attributes: 

881 bucket (str): 

882 Optional. Name of the Cloud Storage bucket 

883 used for ingestion. 

884 object_name (str): 

885 Optional. Name of the Cloud Storage object 

886 which contained the section that couldn't be 

887 ingested. 

888 object_generation (int): 

889 Optional. Generation of the Cloud Storage 

890 object which contained the section that couldn't 

891 be ingested. 

892 avro_failure_reason (google.pubsub_v1.types.IngestionFailureEvent.AvroFailureReason): 

893 Optional. Failure encountered when parsing an 

894 Avro file. 

895 

896 This field is a member of `oneof`_ ``reason``. 

897 api_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.ApiViolationReason): 

898 Optional. The Pub/Sub API limits prevented 

899 the desired message from being published. 

900 

901 This field is a member of `oneof`_ ``reason``. 

902 schema_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.SchemaViolationReason): 

903 Optional. The Pub/Sub message failed schema 

904 validation. 

905 

906 This field is a member of `oneof`_ ``reason``. 

907 message_transformation_failure_reason (google.pubsub_v1.types.IngestionFailureEvent.MessageTransformationFailureReason): 

908 Optional. Failure encountered when applying a 

909 message transformation to the Pub/Sub message. 

910 

911 This field is a member of `oneof`_ ``reason``. 

912 """ 

913 

914 bucket: str = proto.Field( 

915 proto.STRING, 

916 number=1, 

917 ) 

918 object_name: str = proto.Field( 

919 proto.STRING, 

920 number=2, 

921 ) 

922 object_generation: int = proto.Field( 

923 proto.INT64, 

924 number=3, 

925 ) 

926 avro_failure_reason: "IngestionFailureEvent.AvroFailureReason" = proto.Field( 

927 proto.MESSAGE, 

928 number=5, 

929 oneof="reason", 

930 message="IngestionFailureEvent.AvroFailureReason", 

931 ) 

932 api_violation_reason: "IngestionFailureEvent.ApiViolationReason" = proto.Field( 

933 proto.MESSAGE, 

934 number=6, 

935 oneof="reason", 

936 message="IngestionFailureEvent.ApiViolationReason", 

937 ) 

938 schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( 

939 proto.Field( 

940 proto.MESSAGE, 

941 number=7, 

942 oneof="reason", 

943 message="IngestionFailureEvent.SchemaViolationReason", 

944 ) 

945 ) 

946 message_transformation_failure_reason: "IngestionFailureEvent.MessageTransformationFailureReason" = proto.Field( 

947 proto.MESSAGE, 

948 number=8, 

949 oneof="reason", 

950 message="IngestionFailureEvent.MessageTransformationFailureReason", 

951 ) 

952 

953 class AwsMskFailureReason(proto.Message): 

954 r"""Failure when ingesting from an Amazon MSK source. 

955 

956 This message has `oneof`_ fields (mutually exclusive fields). 

957 For each oneof, at most one member field can be set at the same time. 

958 Setting any member of the oneof automatically clears all other 

959 members. 

960 

961 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields 

962 

963 Attributes: 

964 cluster_arn (str): 

965 Optional. The ARN of the cluster of the topic 

966 being ingested from. 

967 kafka_topic (str): 

968 Optional. The name of the Kafka topic being 

969 ingested from. 

970 partition_id (int): 

971 Optional. The partition ID of the message 

972 that failed to be ingested. 

973 offset (int): 

974 Optional. The offset within the partition of 

975 the message that failed to be ingested. 

976 api_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.ApiViolationReason): 

977 Optional. The Pub/Sub API limits prevented 

978 the desired message from being published. 

979 

980 This field is a member of `oneof`_ ``reason``. 

981 schema_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.SchemaViolationReason): 

982 Optional. The Pub/Sub message failed schema 

983 validation. 

984 

985 This field is a member of `oneof`_ ``reason``. 

986 message_transformation_failure_reason (google.pubsub_v1.types.IngestionFailureEvent.MessageTransformationFailureReason): 

987 Optional. Failure encountered when applying a 

988 message transformation to the Pub/Sub message. 

989 

990 This field is a member of `oneof`_ ``reason``. 

991 """ 

992 

993 cluster_arn: str = proto.Field( 

994 proto.STRING, 

995 number=1, 

996 ) 

997 kafka_topic: str = proto.Field( 

998 proto.STRING, 

999 number=2, 

1000 ) 

1001 partition_id: int = proto.Field( 

1002 proto.INT64, 

1003 number=3, 

1004 ) 

1005 offset: int = proto.Field( 

1006 proto.INT64, 

1007 number=4, 

1008 ) 

1009 api_violation_reason: "IngestionFailureEvent.ApiViolationReason" = proto.Field( 

1010 proto.MESSAGE, 

1011 number=5, 

1012 oneof="reason", 

1013 message="IngestionFailureEvent.ApiViolationReason", 

1014 ) 

1015 schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( 

1016 proto.Field( 

1017 proto.MESSAGE, 

1018 number=6, 

1019 oneof="reason", 

1020 message="IngestionFailureEvent.SchemaViolationReason", 

1021 ) 

1022 ) 

1023 message_transformation_failure_reason: "IngestionFailureEvent.MessageTransformationFailureReason" = proto.Field( 

1024 proto.MESSAGE, 

1025 number=7, 

1026 oneof="reason", 

1027 message="IngestionFailureEvent.MessageTransformationFailureReason", 

1028 ) 

1029 

1030 class AzureEventHubsFailureReason(proto.Message): 

1031 r"""Failure when ingesting from an Azure Event Hubs source. 

1032 

1033 This message has `oneof`_ fields (mutually exclusive fields). 

1034 For each oneof, at most one member field can be set at the same time. 

1035 Setting any member of the oneof automatically clears all other 

1036 members. 

1037 

1038 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields 

1039 

1040 Attributes: 

1041 namespace (str): 

1042 Optional. The namespace containing the event 

1043 hub being ingested from. 

1044 event_hub (str): 

1045 Optional. The name of the event hub being 

1046 ingested from. 

1047 partition_id (int): 

1048 Optional. The partition ID of the message 

1049 that failed to be ingested. 

1050 offset (int): 

1051 Optional. The offset within the partition of 

1052 the message that failed to be ingested. 

1053 api_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.ApiViolationReason): 

1054 Optional. The Pub/Sub API limits prevented 

1055 the desired message from being published. 

1056 

1057 This field is a member of `oneof`_ ``reason``. 

1058 schema_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.SchemaViolationReason): 

1059 Optional. The Pub/Sub message failed schema 

1060 validation. 

1061 

1062 This field is a member of `oneof`_ ``reason``. 

1063 message_transformation_failure_reason (google.pubsub_v1.types.IngestionFailureEvent.MessageTransformationFailureReason): 

1064 Optional. Failure encountered when applying a 

1065 message transformation to the Pub/Sub message. 

1066 

1067 This field is a member of `oneof`_ ``reason``. 

1068 """ 

1069 

1070 namespace: str = proto.Field( 

1071 proto.STRING, 

1072 number=1, 

1073 ) 

1074 event_hub: str = proto.Field( 

1075 proto.STRING, 

1076 number=2, 

1077 ) 

1078 partition_id: int = proto.Field( 

1079 proto.INT64, 

1080 number=3, 

1081 ) 

1082 offset: int = proto.Field( 

1083 proto.INT64, 

1084 number=4, 

1085 ) 

1086 api_violation_reason: "IngestionFailureEvent.ApiViolationReason" = proto.Field( 

1087 proto.MESSAGE, 

1088 number=5, 

1089 oneof="reason", 

1090 message="IngestionFailureEvent.ApiViolationReason", 

1091 ) 

1092 schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( 

1093 proto.Field( 

1094 proto.MESSAGE, 

1095 number=6, 

1096 oneof="reason", 

1097 message="IngestionFailureEvent.SchemaViolationReason", 

1098 ) 

1099 ) 

1100 message_transformation_failure_reason: "IngestionFailureEvent.MessageTransformationFailureReason" = proto.Field( 

1101 proto.MESSAGE, 

1102 number=7, 

1103 oneof="reason", 

1104 message="IngestionFailureEvent.MessageTransformationFailureReason", 

1105 ) 

1106 

1107 class ConfluentCloudFailureReason(proto.Message): 

1108 r"""Failure when ingesting from a Confluent Cloud source. 

1109 

1110 This message has `oneof`_ fields (mutually exclusive fields). 

1111 For each oneof, at most one member field can be set at the same time. 

1112 Setting any member of the oneof automatically clears all other 

1113 members. 

1114 

1115 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields 

1116 

1117 Attributes: 

1118 cluster_id (str): 

1119 Optional. The cluster ID containing the topic 

1120 being ingested from. 

1121 kafka_topic (str): 

1122 Optional. The name of the Kafka topic being 

1123 ingested from. 

1124 partition_id (int): 

1125 Optional. The partition ID of the message 

1126 that failed to be ingested. 

1127 offset (int): 

1128 Optional. The offset within the partition of 

1129 the message that failed to be ingested. 

1130 api_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.ApiViolationReason): 

1131 Optional. The Pub/Sub API limits prevented 

1132 the desired message from being published. 

1133 

1134 This field is a member of `oneof`_ ``reason``. 

1135 schema_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.SchemaViolationReason): 

1136 Optional. The Pub/Sub message failed schema 

1137 validation. 

1138 

1139 This field is a member of `oneof`_ ``reason``. 

1140 message_transformation_failure_reason (google.pubsub_v1.types.IngestionFailureEvent.MessageTransformationFailureReason): 

1141 Optional. Failure encountered when applying a 

1142 message transformation to the Pub/Sub message. 

1143 

1144 This field is a member of `oneof`_ ``reason``. 

1145 """ 

1146 

1147 cluster_id: str = proto.Field( 

1148 proto.STRING, 

1149 number=1, 

1150 ) 

1151 kafka_topic: str = proto.Field( 

1152 proto.STRING, 

1153 number=2, 

1154 ) 

1155 partition_id: int = proto.Field( 

1156 proto.INT64, 

1157 number=3, 

1158 ) 

1159 offset: int = proto.Field( 

1160 proto.INT64, 

1161 number=4, 

1162 ) 

1163 api_violation_reason: "IngestionFailureEvent.ApiViolationReason" = proto.Field( 

1164 proto.MESSAGE, 

1165 number=5, 

1166 oneof="reason", 

1167 message="IngestionFailureEvent.ApiViolationReason", 

1168 ) 

1169 schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( 

1170 proto.Field( 

1171 proto.MESSAGE, 

1172 number=6, 

1173 oneof="reason", 

1174 message="IngestionFailureEvent.SchemaViolationReason", 

1175 ) 

1176 ) 

1177 message_transformation_failure_reason: "IngestionFailureEvent.MessageTransformationFailureReason" = proto.Field( 

1178 proto.MESSAGE, 

1179 number=7, 

1180 oneof="reason", 

1181 message="IngestionFailureEvent.MessageTransformationFailureReason", 

1182 ) 

1183 

1184 class AwsKinesisFailureReason(proto.Message): 

1185 r"""Failure when ingesting from an AWS Kinesis source. 

1186 

1187 This message has `oneof`_ fields (mutually exclusive fields). 

1188 For each oneof, at most one member field can be set at the same time. 

1189 Setting any member of the oneof automatically clears all other 

1190 members. 

1191 

1192 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields 

1193 

1194 Attributes: 

1195 stream_arn (str): 

1196 Optional. The stream ARN of the Kinesis 

1197 stream being ingested from. 

1198 partition_key (str): 

1199 Optional. The partition key of the message 

1200 that failed to be ingested. 

1201 sequence_number (str): 

1202 Optional. The sequence number of the message 

1203 that failed to be ingested. 

1204 schema_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.SchemaViolationReason): 

1205 Optional. The Pub/Sub message failed schema 

1206 validation. 

1207 

1208 This field is a member of `oneof`_ ``reason``. 

1209 message_transformation_failure_reason (google.pubsub_v1.types.IngestionFailureEvent.MessageTransformationFailureReason): 

1210 Optional. Failure encountered when applying a 

1211 message transformation to the Pub/Sub message. 

1212 

1213 This field is a member of `oneof`_ ``reason``. 

1214 """ 

1215 

1216 stream_arn: str = proto.Field( 

1217 proto.STRING, 

1218 number=1, 

1219 ) 

1220 partition_key: str = proto.Field( 

1221 proto.STRING, 

1222 number=2, 

1223 ) 

1224 sequence_number: str = proto.Field( 

1225 proto.STRING, 

1226 number=3, 

1227 ) 

1228 schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( 

1229 proto.Field( 

1230 proto.MESSAGE, 

1231 number=4, 

1232 oneof="reason", 

1233 message="IngestionFailureEvent.SchemaViolationReason", 

1234 ) 

1235 ) 

1236 message_transformation_failure_reason: "IngestionFailureEvent.MessageTransformationFailureReason" = proto.Field( 

1237 proto.MESSAGE, 

1238 number=5, 

1239 oneof="reason", 

1240 message="IngestionFailureEvent.MessageTransformationFailureReason", 

1241 ) 

1242 

1243 topic: str = proto.Field( 

1244 proto.STRING, 

1245 number=1, 

1246 ) 

1247 error_message: str = proto.Field( 

1248 proto.STRING, 

1249 number=2, 

1250 ) 

1251 cloud_storage_failure: CloudStorageFailure = proto.Field( 

1252 proto.MESSAGE, 

1253 number=3, 

1254 oneof="failure", 

1255 message=CloudStorageFailure, 

1256 ) 

1257 aws_msk_failure: AwsMskFailureReason = proto.Field( 

1258 proto.MESSAGE, 

1259 number=4, 

1260 oneof="failure", 

1261 message=AwsMskFailureReason, 

1262 ) 

1263 azure_event_hubs_failure: AzureEventHubsFailureReason = proto.Field( 

1264 proto.MESSAGE, 

1265 number=5, 

1266 oneof="failure", 

1267 message=AzureEventHubsFailureReason, 

1268 ) 

1269 confluent_cloud_failure: ConfluentCloudFailureReason = proto.Field( 

1270 proto.MESSAGE, 

1271 number=6, 

1272 oneof="failure", 

1273 message=ConfluentCloudFailureReason, 

1274 ) 

1275 aws_kinesis_failure: AwsKinesisFailureReason = proto.Field( 

1276 proto.MESSAGE, 

1277 number=7, 

1278 oneof="failure", 

1279 message=AwsKinesisFailureReason, 

1280 ) 

1281 

1282 

1283class JavaScriptUDF(proto.Message): 

1284 r"""User-defined JavaScript function that can transform or filter 

1285 a Pub/Sub message. 

1286 

1287 Attributes: 

1288 function_name (str): 

1289 Required. Name of the JavasScript function 

1290 that should applied to Pub/Sub messages. 

1291 code (str): 

1292 Required. JavaScript code that contains a function 

1293 ``function_name`` with the below signature: 

1294 

1295 :: 

1296 

1297 /** 

1298 * Transforms a Pub/Sub message. 

1299 

1300 * @return {(Object<string, (string | Object<string, string>)>|null)} - To 

1301 * filter a message, return `null`. To transform a message return a map 

1302 * with the following keys: 

1303 * - (required) 'data' : {string} 

1304 * - (optional) 'attributes' : {Object<string, string>} 

1305 * Returning empty `attributes` will remove all attributes from the 

1306 * message. 

1307 * 

1308 * @param {(Object<string, (string | Object<string, string>)>} Pub/Sub 

1309 * message. Keys: 

1310 * - (required) 'data' : {string} 

1311 * - (required) 'attributes' : {Object<string, string>} 

1312 * 

1313 * @param {Object<string, any>} metadata - Pub/Sub message metadata. 

1314 * Keys: 

1315 * - (optional) 'message_id' : {string} 

1316 * - (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format 

1317 * - (optional) 'ordering_key': {string} 

1318 */ 

1319 

1320 function <function_name>(message, metadata) { 

1321 } 

1322 """ 

1323 

1324 function_name: str = proto.Field( 

1325 proto.STRING, 

1326 number=1, 

1327 ) 

1328 code: str = proto.Field( 

1329 proto.STRING, 

1330 number=2, 

1331 ) 

1332 

1333 

1334class MessageTransform(proto.Message): 

1335 r"""All supported message transforms types. 

1336 

1337 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields 

1338 

1339 Attributes: 

1340 javascript_udf (google.pubsub_v1.types.JavaScriptUDF): 

1341 Optional. JavaScript User Defined Function. If multiple 

1342 JavaScriptUDF's are specified on a resource, each must have 

1343 a unique ``function_name``. 

1344 

1345 This field is a member of `oneof`_ ``transform``. 

1346 enabled (bool): 

1347 Optional. This field is deprecated, use the ``disabled`` 

1348 field to disable transforms. 

1349 disabled (bool): 

1350 Optional. If true, the transform is disabled and will not be 

1351 applied to messages. Defaults to ``false``. 

1352 """ 

1353 

1354 javascript_udf: "JavaScriptUDF" = proto.Field( 

1355 proto.MESSAGE, 

1356 number=2, 

1357 oneof="transform", 

1358 message="JavaScriptUDF", 

1359 ) 

1360 enabled: bool = proto.Field( 

1361 proto.BOOL, 

1362 number=3, 

1363 ) 

1364 disabled: bool = proto.Field( 

1365 proto.BOOL, 

1366 number=4, 

1367 ) 

1368 

1369 

1370class Topic(proto.Message): 

1371 r"""A topic resource. 

1372 

1373 Attributes: 

1374 name (str): 

1375 Required. The name of the topic. It must have the format 

1376 ``"projects/{project}/topics/{topic}"``. ``{topic}`` must 

1377 start with a letter, and contain only letters 

1378 (``[A-Za-z]``), numbers (``[0-9]``), dashes (``-``), 

1379 underscores (``_``), periods (``.``), tildes (``~``), plus 

1380 (``+``) or percent signs (``%``). It must be between 3 and 

1381 255 characters in length, and it must not start with 

1382 ``"goog"``. 

1383 labels (MutableMapping[str, str]): 

1384 Optional. See [Creating and managing labels] 

1385 (https://cloud.google.com/pubsub/docs/labels). 

1386 message_storage_policy (google.pubsub_v1.types.MessageStoragePolicy): 

1387 Optional. Policy constraining the set of 

1388 Google Cloud Platform regions where messages 

1389 published to the topic may be stored. If not 

1390 present, then no constraints are in effect. 

1391 kms_key_name (str): 

1392 Optional. The resource name of the Cloud KMS CryptoKey to be 

1393 used to protect access to messages published on this topic. 

1394 

1395 The expected format is 

1396 ``projects/*/locations/*/keyRings/*/cryptoKeys/*``. 

1397 schema_settings (google.pubsub_v1.types.SchemaSettings): 

1398 Optional. Settings for validating messages 

1399 published against a schema. 

1400 satisfies_pzs (bool): 

1401 Optional. Reserved for future use. This field 

1402 is set only in responses from the server; it is 

1403 ignored if it is set in any requests. 

1404 message_retention_duration (google.protobuf.duration_pb2.Duration): 

1405 Optional. Indicates the minimum duration to retain a message 

1406 after it is published to the topic. If this field is set, 

1407 messages published to the topic in the last 

1408 ``message_retention_duration`` are always available to 

1409 subscribers. For instance, it allows any attached 

1410 subscription to `seek to a 

1411 timestamp <https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time>`__ 

1412 that is up to ``message_retention_duration`` in the past. If 

1413 this field is not set, message retention is controlled by 

1414 settings on individual subscriptions. Cannot be more than 31 

1415 days or less than 10 minutes. 

1416 state (google.pubsub_v1.types.Topic.State): 

1417 Output only. An output-only field indicating 

1418 the state of the topic. 

1419 ingestion_data_source_settings (google.pubsub_v1.types.IngestionDataSourceSettings): 

1420 Optional. Settings for ingestion from a data 

1421 source into this topic. 

1422 message_transforms (MutableSequence[google.pubsub_v1.types.MessageTransform]): 

1423 Optional. Transforms to be applied to 

1424 messages published to the topic. Transforms are 

1425 applied in the order specified. 

1426 """ 

1427 

1428 class State(proto.Enum): 

1429 r"""The state of the topic. 

1430 

1431 Values: 

1432 STATE_UNSPECIFIED (0): 

1433 Default value. This value is unused. 

1434 ACTIVE (1): 

1435 The topic does not have any persistent 

1436 errors. 

1437 INGESTION_RESOURCE_ERROR (2): 

1438 Ingestion from the data source has 

1439 encountered a permanent error. See the more 

1440 detailed error state in the corresponding 

1441 ingestion source configuration. 

1442 """ 

1443 STATE_UNSPECIFIED = 0 

1444 ACTIVE = 1 

1445 INGESTION_RESOURCE_ERROR = 2 

1446 

1447 name: str = proto.Field( 

1448 proto.STRING, 

1449 number=1, 

1450 ) 

1451 labels: MutableMapping[str, str] = proto.MapField( 

1452 proto.STRING, 

1453 proto.STRING, 

1454 number=2, 

1455 ) 

1456 message_storage_policy: "MessageStoragePolicy" = proto.Field( 

1457 proto.MESSAGE, 

1458 number=3, 

1459 message="MessageStoragePolicy", 

1460 ) 

1461 kms_key_name: str = proto.Field( 

1462 proto.STRING, 

1463 number=5, 

1464 ) 

1465 schema_settings: "SchemaSettings" = proto.Field( 

1466 proto.MESSAGE, 

1467 number=6, 

1468 message="SchemaSettings", 

1469 ) 

1470 satisfies_pzs: bool = proto.Field( 

1471 proto.BOOL, 

1472 number=7, 

1473 ) 

1474 message_retention_duration: duration_pb2.Duration = proto.Field( 

1475 proto.MESSAGE, 

1476 number=8, 

1477 message=duration_pb2.Duration, 

1478 ) 

1479 state: State = proto.Field( 

1480 proto.ENUM, 

1481 number=9, 

1482 enum=State, 

1483 ) 

1484 ingestion_data_source_settings: "IngestionDataSourceSettings" = proto.Field( 

1485 proto.MESSAGE, 

1486 number=10, 

1487 message="IngestionDataSourceSettings", 

1488 ) 

1489 message_transforms: MutableSequence["MessageTransform"] = proto.RepeatedField( 

1490 proto.MESSAGE, 

1491 number=13, 

1492 message="MessageTransform", 

1493 ) 

1494 

1495 

1496class PubsubMessage(proto.Message): 

1497 r"""A message that is published by publishers and consumed by 

1498 subscribers. The message must contain either a non-empty data field 

1499 or at least one attribute. Note that client libraries represent this 

1500 object differently depending on the language. See the corresponding 

1501 `client library 

1502 documentation <https://cloud.google.com/pubsub/docs/reference/libraries>`__ 

1503 for more information. See [quotas and limits] 

1504 (https://cloud.google.com/pubsub/quotas) for more information about 

1505 message limits. 

1506 

1507 Attributes: 

1508 data (bytes): 

1509 Optional. The message data field. If this 

1510 field is empty, the message must contain at 

1511 least one attribute. 

1512 attributes (MutableMapping[str, str]): 

1513 Optional. Attributes for this message. If 

1514 this field is empty, the message must contain 

1515 non-empty data. This can be used to filter 

1516 messages on the subscription. 

1517 message_id (str): 

1518 ID of this message, assigned by the server when the message 

1519 is published. Guaranteed to be unique within the topic. This 

1520 value may be read by a subscriber that receives a 

1521 ``PubsubMessage`` via a ``Pull`` call or a push delivery. It 

1522 must not be populated by the publisher in a ``Publish`` 

1523 call. 

1524 publish_time (google.protobuf.timestamp_pb2.Timestamp): 

1525 The time at which the message was published, populated by 

1526 the server when it receives the ``Publish`` call. It must 

1527 not be populated by the publisher in a ``Publish`` call. 

1528 ordering_key (str): 

1529 Optional. If non-empty, identifies related messages for 

1530 which publish order should be respected. If a 

1531 ``Subscription`` has ``enable_message_ordering`` set to 

1532 ``true``, messages published with the same non-empty 

1533 ``ordering_key`` value will be delivered to subscribers in 

1534 the order in which they are received by the Pub/Sub system. 

1535 All ``PubsubMessage``\ s published in a given 

1536 ``PublishRequest`` must specify the same ``ordering_key`` 

1537 value. For more information, see `ordering 

1538 messages <https://cloud.google.com/pubsub/docs/ordering>`__. 

1539 """ 

1540 

1541 data: bytes = proto.Field( 

1542 proto.BYTES, 

1543 number=1, 

1544 ) 

1545 attributes: MutableMapping[str, str] = proto.MapField( 

1546 proto.STRING, 

1547 proto.STRING, 

1548 number=2, 

1549 ) 

1550 message_id: str = proto.Field( 

1551 proto.STRING, 

1552 number=3, 

1553 ) 

1554 publish_time: timestamp_pb2.Timestamp = proto.Field( 

1555 proto.MESSAGE, 

1556 number=4, 

1557 message=timestamp_pb2.Timestamp, 

1558 ) 

1559 ordering_key: str = proto.Field( 

1560 proto.STRING, 

1561 number=5, 

1562 ) 

1563 

1564 

1565class GetTopicRequest(proto.Message): 

1566 r"""Request for the GetTopic method. 

1567 

1568 Attributes: 

1569 topic (str): 

1570 Required. The name of the topic to get. Format is 

1571 ``projects/{project}/topics/{topic}``. 

1572 """ 

1573 

1574 topic: str = proto.Field( 

1575 proto.STRING, 

1576 number=1, 

1577 ) 

1578 

1579 

1580class UpdateTopicRequest(proto.Message): 

1581 r"""Request for the UpdateTopic method. 

1582 

1583 Attributes: 

1584 topic (google.pubsub_v1.types.Topic): 

1585 Required. The updated topic object. 

1586 update_mask (google.protobuf.field_mask_pb2.FieldMask): 

1587 Required. Indicates which fields in the provided topic to 

1588 update. Must be specified and non-empty. Note that if 

1589 ``update_mask`` contains "message_storage_policy" but the 

1590 ``message_storage_policy`` is not set in the ``topic`` 

1591 provided above, then the updated value is determined by the 

1592 policy configured at the project or organization level. 

1593 """ 

1594 

1595 topic: "Topic" = proto.Field( 

1596 proto.MESSAGE, 

1597 number=1, 

1598 message="Topic", 

1599 ) 

1600 update_mask: field_mask_pb2.FieldMask = proto.Field( 

1601 proto.MESSAGE, 

1602 number=2, 

1603 message=field_mask_pb2.FieldMask, 

1604 ) 

1605 

1606 

1607class PublishRequest(proto.Message): 

1608 r"""Request for the Publish method. 

1609 

1610 Attributes: 

1611 topic (str): 

1612 Required. The messages in the request will be published on 

1613 this topic. Format is ``projects/{project}/topics/{topic}``. 

1614 messages (MutableSequence[google.pubsub_v1.types.PubsubMessage]): 

1615 Required. The messages to publish. 

1616 """ 

1617 

1618 topic: str = proto.Field( 

1619 proto.STRING, 

1620 number=1, 

1621 ) 

1622 messages: MutableSequence["PubsubMessage"] = proto.RepeatedField( 

1623 proto.MESSAGE, 

1624 number=2, 

1625 message="PubsubMessage", 

1626 ) 

1627 

1628 

1629class PublishResponse(proto.Message): 

1630 r"""Response for the ``Publish`` method. 

1631 

1632 Attributes: 

1633 message_ids (MutableSequence[str]): 

1634 Optional. The server-assigned ID of each 

1635 published message, in the same order as the 

1636 messages in the request. IDs are guaranteed to 

1637 be unique within the topic. 

1638 """ 

1639 

1640 message_ids: MutableSequence[str] = proto.RepeatedField( 

1641 proto.STRING, 

1642 number=1, 

1643 ) 

1644 

1645 

1646class ListTopicsRequest(proto.Message): 

1647 r"""Request for the ``ListTopics`` method. 

1648 

1649 Attributes: 

1650 project (str): 

1651 Required. The name of the project in which to list topics. 

1652 Format is ``projects/{project-id}``. 

1653 page_size (int): 

1654 Optional. Maximum number of topics to return. 

1655 page_token (str): 

1656 Optional. The value returned by the last 

1657 ``ListTopicsResponse``; indicates that this is a 

1658 continuation of a prior ``ListTopics`` call, and that the 

1659 system should return the next page of data. 

1660 """ 

1661 

1662 project: str = proto.Field( 

1663 proto.STRING, 

1664 number=1, 

1665 ) 

1666 page_size: int = proto.Field( 

1667 proto.INT32, 

1668 number=2, 

1669 ) 

1670 page_token: str = proto.Field( 

1671 proto.STRING, 

1672 number=3, 

1673 ) 

1674 

1675 

1676class ListTopicsResponse(proto.Message): 

1677 r"""Response for the ``ListTopics`` method. 

1678 

1679 Attributes: 

1680 topics (MutableSequence[google.pubsub_v1.types.Topic]): 

1681 Optional. The resulting topics. 

1682 next_page_token (str): 

1683 Optional. If not empty, indicates that there may be more 

1684 topics that match the request; this value should be passed 

1685 in a new ``ListTopicsRequest``. 

1686 """ 

1687 

1688 @property 

1689 def raw_page(self): 

1690 return self 

1691 

1692 topics: MutableSequence["Topic"] = proto.RepeatedField( 

1693 proto.MESSAGE, 

1694 number=1, 

1695 message="Topic", 

1696 ) 

1697 next_page_token: str = proto.Field( 

1698 proto.STRING, 

1699 number=2, 

1700 ) 

1701 

1702 

1703class ListTopicSubscriptionsRequest(proto.Message): 

1704 r"""Request for the ``ListTopicSubscriptions`` method. 

1705 

1706 Attributes: 

1707 topic (str): 

1708 Required. The name of the topic that subscriptions are 

1709 attached to. Format is 

1710 ``projects/{project}/topics/{topic}``. 

1711 page_size (int): 

1712 Optional. Maximum number of subscription 

1713 names to return. 

1714 page_token (str): 

1715 Optional. The value returned by the last 

1716 ``ListTopicSubscriptionsResponse``; indicates that this is a 

1717 continuation of a prior ``ListTopicSubscriptions`` call, and 

1718 that the system should return the next page of data. 

1719 """ 

1720 

1721 topic: str = proto.Field( 

1722 proto.STRING, 

1723 number=1, 

1724 ) 

1725 page_size: int = proto.Field( 

1726 proto.INT32, 

1727 number=2, 

1728 ) 

1729 page_token: str = proto.Field( 

1730 proto.STRING, 

1731 number=3, 

1732 ) 

1733 

1734 

1735class ListTopicSubscriptionsResponse(proto.Message): 

1736 r"""Response for the ``ListTopicSubscriptions`` method. 

1737 

1738 Attributes: 

1739 subscriptions (MutableSequence[str]): 

1740 Optional. The names of subscriptions attached 

1741 to the topic specified in the request. 

1742 next_page_token (str): 

1743 Optional. If not empty, indicates that there may be more 

1744 subscriptions that match the request; this value should be 

1745 passed in a new ``ListTopicSubscriptionsRequest`` to get 

1746 more subscriptions. 

1747 """ 

1748 

1749 @property 

1750 def raw_page(self): 

1751 return self 

1752 

1753 subscriptions: MutableSequence[str] = proto.RepeatedField( 

1754 proto.STRING, 

1755 number=1, 

1756 ) 

1757 next_page_token: str = proto.Field( 

1758 proto.STRING, 

1759 number=2, 

1760 ) 

1761 

1762 

1763class ListTopicSnapshotsRequest(proto.Message): 

1764 r"""Request for the ``ListTopicSnapshots`` method. 

1765 

1766 Attributes: 

1767 topic (str): 

1768 Required. The name of the topic that snapshots are attached 

1769 to. Format is ``projects/{project}/topics/{topic}``. 

1770 page_size (int): 

1771 Optional. Maximum number of snapshot names to 

1772 return. 

1773 page_token (str): 

1774 Optional. The value returned by the last 

1775 ``ListTopicSnapshotsResponse``; indicates that this is a 

1776 continuation of a prior ``ListTopicSnapshots`` call, and 

1777 that the system should return the next page of data. 

1778 """ 

1779 

1780 topic: str = proto.Field( 

1781 proto.STRING, 

1782 number=1, 

1783 ) 

1784 page_size: int = proto.Field( 

1785 proto.INT32, 

1786 number=2, 

1787 ) 

1788 page_token: str = proto.Field( 

1789 proto.STRING, 

1790 number=3, 

1791 ) 

1792 

1793 

1794class ListTopicSnapshotsResponse(proto.Message): 

1795 r"""Response for the ``ListTopicSnapshots`` method. 

1796 

1797 Attributes: 

1798 snapshots (MutableSequence[str]): 

1799 Optional. The names of the snapshots that 

1800 match the request. 

1801 next_page_token (str): 

1802 Optional. If not empty, indicates that there may be more 

1803 snapshots that match the request; this value should be 

1804 passed in a new ``ListTopicSnapshotsRequest`` to get more 

1805 snapshots. 

1806 """ 

1807 

1808 @property 

1809 def raw_page(self): 

1810 return self 

1811 

1812 snapshots: MutableSequence[str] = proto.RepeatedField( 

1813 proto.STRING, 

1814 number=1, 

1815 ) 

1816 next_page_token: str = proto.Field( 

1817 proto.STRING, 

1818 number=2, 

1819 ) 

1820 

1821 

1822class DeleteTopicRequest(proto.Message): 

1823 r"""Request for the ``DeleteTopic`` method. 

1824 

1825 Attributes: 

1826 topic (str): 

1827 Required. Name of the topic to delete. Format is 

1828 ``projects/{project}/topics/{topic}``. 

1829 """ 

1830 

1831 topic: str = proto.Field( 

1832 proto.STRING, 

1833 number=1, 

1834 ) 

1835 

1836 

1837class DetachSubscriptionRequest(proto.Message): 

1838 r"""Request for the DetachSubscription method. 

1839 

1840 Attributes: 

1841 subscription (str): 

1842 Required. The subscription to detach. Format is 

1843 ``projects/{project}/subscriptions/{subscription}``. 

1844 """ 

1845 

1846 subscription: str = proto.Field( 

1847 proto.STRING, 

1848 number=1, 

1849 ) 

1850 

1851 

1852class DetachSubscriptionResponse(proto.Message): 

1853 r"""Response for the DetachSubscription method. 

1854 Reserved for future use. 

1855 

1856 """ 

1857 

1858 

1859class Subscription(proto.Message): 

1860 r"""A subscription resource. If none of ``push_config``, 

1861 ``bigquery_config``, or ``cloud_storage_config`` is set, then the 

1862 subscriber will pull and ack messages using API methods. At most one 

1863 of these fields may be set. 

1864 

1865 Attributes: 

1866 name (str): 

1867 Required. The name of the subscription. It must have the 

1868 format 

1869 ``"projects/{project}/subscriptions/{subscription}"``. 

1870 ``{subscription}`` must start with a letter, and contain 

1871 only letters (``[A-Za-z]``), numbers (``[0-9]``), dashes 

1872 (``-``), underscores (``_``), periods (``.``), tildes 

1873 (``~``), plus (``+``) or percent signs (``%``). It must be 

1874 between 3 and 255 characters in length, and it must not 

1875 start with ``"goog"``. 

1876 topic (str): 

1877 Required. The name of the topic from which this subscription 

1878 is receiving messages. Format is 

1879 ``projects/{project}/topics/{topic}``. The value of this 

1880 field will be ``_deleted-topic_`` if the topic has been 

1881 deleted. 

1882 push_config (google.pubsub_v1.types.PushConfig): 

1883 Optional. If push delivery is used with this 

1884 subscription, this field is used to configure 

1885 it. 

1886 bigquery_config (google.pubsub_v1.types.BigQueryConfig): 

1887 Optional. If delivery to BigQuery is used 

1888 with this subscription, this field is used to 

1889 configure it. 

1890 cloud_storage_config (google.pubsub_v1.types.CloudStorageConfig): 

1891 Optional. If delivery to Google Cloud Storage 

1892 is used with this subscription, this field is 

1893 used to configure it. 

1894 ack_deadline_seconds (int): 

1895 Optional. The approximate amount of time (on a best-effort 

1896 basis) Pub/Sub waits for the subscriber to acknowledge 

1897 receipt before resending the message. In the interval after 

1898 the message is delivered and before it is acknowledged, it 

1899 is considered to be *outstanding*. During that time period, 

1900 the message will not be redelivered (on a best-effort 

1901 basis). 

1902 

1903 For pull subscriptions, this value is used as the initial 

1904 value for the ack deadline. To override this value for a 

1905 given message, call ``ModifyAckDeadline`` with the 

1906 corresponding ``ack_id`` if using non-streaming pull or send 

1907 the ``ack_id`` in a ``StreamingModifyAckDeadlineRequest`` if 

1908 using streaming pull. The minimum custom deadline you can 

1909 specify is 10 seconds. The maximum custom deadline you can 

1910 specify is 600 seconds (10 minutes). If this parameter is 0, 

1911 a default value of 10 seconds is used. 

1912 

1913 For push delivery, this value is also used to set the 

1914 request timeout for the call to the push endpoint. 

1915 

1916 If the subscriber never acknowledges the message, the 

1917 Pub/Sub system will eventually redeliver the message. 

1918 retain_acked_messages (bool): 

1919 Optional. Indicates whether to retain acknowledged messages. 

1920 If true, then messages are not expunged from the 

1921 subscription's backlog, even if they are acknowledged, until 

1922 they fall out of the ``message_retention_duration`` window. 

1923 This must be true if you would like to [``Seek`` to a 

1924 timestamp] 

1925 (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) 

1926 in the past to replay previously-acknowledged messages. 

1927 message_retention_duration (google.protobuf.duration_pb2.Duration): 

1928 Optional. How long to retain unacknowledged messages in the 

1929 subscription's backlog, from the moment a message is 

1930 published. If ``retain_acked_messages`` is true, then this 

1931 also configures the retention of acknowledged messages, and 

1932 thus configures how far back in time a ``Seek`` can be done. 

1933 Defaults to 7 days. Cannot be more than 31 days or less than 

1934 10 minutes. 

1935 labels (MutableMapping[str, str]): 

1936 Optional. See `Creating and managing 

1937 labels <https://cloud.google.com/pubsub/docs/labels>`__. 

1938 enable_message_ordering (bool): 

1939 Optional. If true, messages published with the same 

1940 ``ordering_key`` in ``PubsubMessage`` will be delivered to 

1941 the subscribers in the order in which they are received by 

1942 the Pub/Sub system. Otherwise, they may be delivered in any 

1943 order. 

1944 expiration_policy (google.pubsub_v1.types.ExpirationPolicy): 

1945 Optional. A policy that specifies the conditions for this 

1946 subscription's expiration. A subscription is considered 

1947 active as long as any connected subscriber is successfully 

1948 consuming messages from the subscription or is issuing 

1949 operations on the subscription. If ``expiration_policy`` is 

1950 not set, a *default policy* with ``ttl`` of 31 days will be 

1951 used. The minimum allowed value for 

1952 ``expiration_policy.ttl`` is 1 day. If ``expiration_policy`` 

1953 is set, but ``expiration_policy.ttl`` is not set, the 

1954 subscription never expires. 

1955 filter (str): 

1956 Optional. An expression written in the Pub/Sub `filter 

1957 language <https://cloud.google.com/pubsub/docs/filtering>`__. 

1958 If non-empty, then only ``PubsubMessage``\ s whose 

1959 ``attributes`` field matches the filter are delivered on 

1960 this subscription. If empty, then no messages are filtered 

1961 out. 

1962 dead_letter_policy (google.pubsub_v1.types.DeadLetterPolicy): 

1963 Optional. A policy that specifies the conditions for dead 

1964 lettering messages in this subscription. If 

1965 dead_letter_policy is not set, dead lettering is disabled. 

1966 

1967 The Pub/Sub service account associated with this 

1968 subscriptions's parent project (i.e., 

1969 service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) 

1970 must have permission to Acknowledge() messages on this 

1971 subscription. 

1972 retry_policy (google.pubsub_v1.types.RetryPolicy): 

1973 Optional. A policy that specifies how Pub/Sub 

1974 retries message delivery for this subscription. 

1975 

1976 If not set, the default retry policy is applied. 

1977 This generally implies that messages will be 

1978 retried as soon as possible for healthy 

1979 subscribers. RetryPolicy will be triggered on 

1980 NACKs or acknowledgment deadline exceeded events 

1981 for a given message. 

1982 detached (bool): 

1983 Optional. Indicates whether the subscription is detached 

1984 from its topic. Detached subscriptions don't receive 

1985 messages from their topic and don't retain any backlog. 

1986 ``Pull`` and ``StreamingPull`` requests will return 

1987 FAILED_PRECONDITION. If the subscription is a push 

1988 subscription, pushes to the endpoint will not be made. 

1989 enable_exactly_once_delivery (bool): 

1990 Optional. If true, Pub/Sub provides the following guarantees 

1991 for the delivery of a message with a given value of 

1992 ``message_id`` on this subscription: 

1993 

1994 - The message sent to a subscriber is guaranteed not to be 

1995 resent before the message's acknowledgment deadline 

1996 expires. 

1997 - An acknowledged message will not be resent to a 

1998 subscriber. 

1999 

2000 Note that subscribers may still receive multiple copies of a 

2001 message when ``enable_exactly_once_delivery`` is true if the 

2002 message was published multiple times by a publisher client. 

2003 These copies are considered distinct by Pub/Sub and have 

2004 distinct ``message_id`` values. 

2005 topic_message_retention_duration (google.protobuf.duration_pb2.Duration): 

2006 Output only. Indicates the minimum duration for which a 

2007 message is retained after it is published to the 

2008 subscription's topic. If this field is set, messages 

2009 published to the subscription's topic in the last 

2010 ``topic_message_retention_duration`` are always available to 

2011 subscribers. See the ``message_retention_duration`` field in 

2012 ``Topic``. This field is set only in responses from the 

2013 server; it is ignored if it is set in any requests. 

2014 state (google.pubsub_v1.types.Subscription.State): 

2015 Output only. An output-only field indicating 

2016 whether or not the subscription can receive 

2017 messages. 

2018 analytics_hub_subscription_info (google.pubsub_v1.types.Subscription.AnalyticsHubSubscriptionInfo): 

2019 Output only. Information about the associated 

2020 Analytics Hub subscription. Only set if the 

2021 subscritpion is created by Analytics Hub. 

2022 message_transforms (MutableSequence[google.pubsub_v1.types.MessageTransform]): 

2023 Optional. Transforms to be applied to 

2024 messages before they are delivered to 

2025 subscribers. Transforms are applied in the order 

2026 specified. 

2027 """ 

2028 

2029 class State(proto.Enum): 

2030 r"""Possible states for a subscription. 

2031 

2032 Values: 

2033 STATE_UNSPECIFIED (0): 

2034 Default value. This value is unused. 

2035 ACTIVE (1): 

2036 The subscription can actively receive 

2037 messages 

2038 RESOURCE_ERROR (2): 

2039 The subscription cannot receive messages 

2040 because of an error with the resource to which 

2041 it pushes messages. See the more detailed error 

2042 state in the corresponding configuration. 

2043 """ 

2044 STATE_UNSPECIFIED = 0 

2045 ACTIVE = 1 

2046 RESOURCE_ERROR = 2 

2047 

2048 class AnalyticsHubSubscriptionInfo(proto.Message): 

2049 r"""Information about an associated `Analytics Hub 

2050 subscription <https://cloud.google.com/bigquery/docs/analytics-hub-manage-subscriptions>`__. 

2051 

2052 Attributes: 

2053 listing (str): 

2054 Optional. The name of the associated Analytics Hub listing 

2055 resource. Pattern: 

2056 "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}". 

2057 subscription (str): 

2058 Optional. The name of the associated 

2059 Analytics Hub subscription resource. Pattern: 

2060 

2061 "projects/{project}/locations/{location}/subscriptions/{subscription}". 

2062 """ 

2063 

2064 listing: str = proto.Field( 

2065 proto.STRING, 

2066 number=1, 

2067 ) 

2068 subscription: str = proto.Field( 

2069 proto.STRING, 

2070 number=2, 

2071 ) 

2072 

2073 name: str = proto.Field( 

2074 proto.STRING, 

2075 number=1, 

2076 ) 

2077 topic: str = proto.Field( 

2078 proto.STRING, 

2079 number=2, 

2080 ) 

2081 push_config: "PushConfig" = proto.Field( 

2082 proto.MESSAGE, 

2083 number=4, 

2084 message="PushConfig", 

2085 ) 

2086 bigquery_config: "BigQueryConfig" = proto.Field( 

2087 proto.MESSAGE, 

2088 number=18, 

2089 message="BigQueryConfig", 

2090 ) 

2091 cloud_storage_config: "CloudStorageConfig" = proto.Field( 

2092 proto.MESSAGE, 

2093 number=22, 

2094 message="CloudStorageConfig", 

2095 ) 

2096 ack_deadline_seconds: int = proto.Field( 

2097 proto.INT32, 

2098 number=5, 

2099 ) 

2100 retain_acked_messages: bool = proto.Field( 

2101 proto.BOOL, 

2102 number=7, 

2103 ) 

2104 message_retention_duration: duration_pb2.Duration = proto.Field( 

2105 proto.MESSAGE, 

2106 number=8, 

2107 message=duration_pb2.Duration, 

2108 ) 

2109 labels: MutableMapping[str, str] = proto.MapField( 

2110 proto.STRING, 

2111 proto.STRING, 

2112 number=9, 

2113 ) 

2114 enable_message_ordering: bool = proto.Field( 

2115 proto.BOOL, 

2116 number=10, 

2117 ) 

2118 expiration_policy: "ExpirationPolicy" = proto.Field( 

2119 proto.MESSAGE, 

2120 number=11, 

2121 message="ExpirationPolicy", 

2122 ) 

2123 filter: str = proto.Field( 

2124 proto.STRING, 

2125 number=12, 

2126 ) 

2127 dead_letter_policy: "DeadLetterPolicy" = proto.Field( 

2128 proto.MESSAGE, 

2129 number=13, 

2130 message="DeadLetterPolicy", 

2131 ) 

2132 retry_policy: "RetryPolicy" = proto.Field( 

2133 proto.MESSAGE, 

2134 number=14, 

2135 message="RetryPolicy", 

2136 ) 

2137 detached: bool = proto.Field( 

2138 proto.BOOL, 

2139 number=15, 

2140 ) 

2141 enable_exactly_once_delivery: bool = proto.Field( 

2142 proto.BOOL, 

2143 number=16, 

2144 ) 

2145 topic_message_retention_duration: duration_pb2.Duration = proto.Field( 

2146 proto.MESSAGE, 

2147 number=17, 

2148 message=duration_pb2.Duration, 

2149 ) 

2150 state: State = proto.Field( 

2151 proto.ENUM, 

2152 number=19, 

2153 enum=State, 

2154 ) 

2155 analytics_hub_subscription_info: AnalyticsHubSubscriptionInfo = proto.Field( 

2156 proto.MESSAGE, 

2157 number=23, 

2158 message=AnalyticsHubSubscriptionInfo, 

2159 ) 

2160 message_transforms: MutableSequence["MessageTransform"] = proto.RepeatedField( 

2161 proto.MESSAGE, 

2162 number=25, 

2163 message="MessageTransform", 

2164 ) 

2165 

2166 

2167class RetryPolicy(proto.Message): 

2168 r"""A policy that specifies how Pub/Sub retries message delivery. 

2169 

2170 Retry delay will be exponential based on provided minimum and 

2171 maximum backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. 

2172 

2173 RetryPolicy will be triggered on NACKs or acknowledgment deadline 

2174 exceeded events for a given message. 

2175 

2176 Retry Policy is implemented on a best effort basis. At times, the 

2177 delay between consecutive deliveries may not match the 

2178 configuration. That is, delay can be more or less than configured 

2179 backoff. 

2180 

2181 Attributes: 

2182 minimum_backoff (google.protobuf.duration_pb2.Duration): 

2183 Optional. The minimum delay between 

2184 consecutive deliveries of a given message. Value 

2185 should be between 0 and 600 seconds. Defaults to 

2186 10 seconds. 

2187 maximum_backoff (google.protobuf.duration_pb2.Duration): 

2188 Optional. The maximum delay between 

2189 consecutive deliveries of a given message. Value 

2190 should be between 0 and 600 seconds. Defaults to 

2191 600 seconds. 

2192 """ 

2193 

2194 minimum_backoff: duration_pb2.Duration = proto.Field( 

2195 proto.MESSAGE, 

2196 number=1, 

2197 message=duration_pb2.Duration, 

2198 ) 

2199 maximum_backoff: duration_pb2.Duration = proto.Field( 

2200 proto.MESSAGE, 

2201 number=2, 

2202 message=duration_pb2.Duration, 

2203 ) 

2204 

2205 

2206class DeadLetterPolicy(proto.Message): 

2207 r"""Dead lettering is done on a best effort basis. The same 

2208 message might be dead lettered multiple times. 

2209 

2210 If validation on any of the fields fails at subscription 

2211 creation/updation, the create/update subscription request will 

2212 fail. 

2213 

2214 Attributes: 

2215 dead_letter_topic (str): 

2216 Optional. The name of the topic to which dead letter 

2217 messages should be published. Format is 

2218 ``projects/{project}/topics/{topic}``.The Pub/Sub service 

2219 account associated with the enclosing subscription's parent 

2220 project (i.e., 

2221 service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) 

2222 must have permission to Publish() to this topic. 

2223 

2224 The operation will fail if the topic does not exist. Users 

2225 should ensure that there is a subscription attached to this 

2226 topic since messages published to a topic with no 

2227 subscriptions are lost. 

2228 max_delivery_attempts (int): 

2229 Optional. The maximum number of delivery attempts for any 

2230 message. The value must be between 5 and 100. 

2231 

2232 The number of delivery attempts is defined as 1 + (the sum 

2233 of number of NACKs and number of times the acknowledgment 

2234 deadline has been exceeded for the message). 

2235 

2236 A NACK is any call to ModifyAckDeadline with a 0 deadline. 

2237 Note that client libraries may automatically extend 

2238 ack_deadlines. 

2239 

2240 This field will be honored on a best effort basis. 

2241 

2242 If this parameter is 0, a default value of 5 is used. 

2243 """ 

2244 

2245 dead_letter_topic: str = proto.Field( 

2246 proto.STRING, 

2247 number=1, 

2248 ) 

2249 max_delivery_attempts: int = proto.Field( 

2250 proto.INT32, 

2251 number=2, 

2252 ) 

2253 

2254 

2255class ExpirationPolicy(proto.Message): 

2256 r"""A policy that specifies the conditions for resource 

2257 expiration (i.e., automatic resource deletion). 

2258 

2259 Attributes: 

2260 ttl (google.protobuf.duration_pb2.Duration): 

2261 Optional. Specifies the "time-to-live" duration for an 

2262 associated resource. The resource expires if it is not 

2263 active for a period of ``ttl``. The definition of "activity" 

2264 depends on the type of the associated resource. The minimum 

2265 and maximum allowed values for ``ttl`` depend on the type of 

2266 the associated resource, as well. If ``ttl`` is not set, the 

2267 associated resource never expires. 

2268 """ 

2269 

2270 ttl: duration_pb2.Duration = proto.Field( 

2271 proto.MESSAGE, 

2272 number=1, 

2273 message=duration_pb2.Duration, 

2274 ) 

2275 

2276 

2277class PushConfig(proto.Message): 

2278 r"""Configuration for a push delivery endpoint. 

2279 

2280 This message has `oneof`_ fields (mutually exclusive fields). 

2281 For each oneof, at most one member field can be set at the same time. 

2282 Setting any member of the oneof automatically clears all other 

2283 members. 

2284 

2285 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields 

2286 

2287 Attributes: 

2288 push_endpoint (str): 

2289 Optional. A URL locating the endpoint to which messages 

2290 should be pushed. For example, a Webhook endpoint might use 

2291 ``https://example.com/push``. 

2292 attributes (MutableMapping[str, str]): 

2293 Optional. Endpoint configuration attributes that can be used 

2294 to control different aspects of the message delivery. 

2295 

2296 The only currently supported attribute is 

2297 ``x-goog-version``, which you can use to change the format 

2298 of the pushed message. This attribute indicates the version 

2299 of the data expected by the endpoint. This controls the 

2300 shape of the pushed message (i.e., its fields and metadata). 

2301 

2302 If not present during the ``CreateSubscription`` call, it 

2303 will default to the version of the Pub/Sub API used to make 

2304 such call. If not present in a ``ModifyPushConfig`` call, 

2305 its value will not be changed. ``GetSubscription`` calls 

2306 will always return a valid version, even if the subscription 

2307 was created without this attribute. 

2308 

2309 The only supported values for the ``x-goog-version`` 

2310 attribute are: 

2311 

2312 - ``v1beta1``: uses the push format defined in the v1beta1 

2313 Pub/Sub API. 

2314 - ``v1`` or ``v1beta2``: uses the push format defined in 

2315 the v1 Pub/Sub API. 

2316 

2317 For example: ``attributes { "x-goog-version": "v1" }`` 

2318 oidc_token (google.pubsub_v1.types.PushConfig.OidcToken): 

2319 Optional. If specified, Pub/Sub will generate and attach an 

2320 OIDC JWT token as an ``Authorization`` header in the HTTP 

2321 request for every pushed message. 

2322 

2323 This field is a member of `oneof`_ ``authentication_method``. 

2324 pubsub_wrapper (google.pubsub_v1.types.PushConfig.PubsubWrapper): 

2325 Optional. When set, the payload to the push 

2326 endpoint is in the form of the JSON 

2327 representation of a PubsubMessage 

2328 (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). 

2329 

2330 This field is a member of `oneof`_ ``wrapper``. 

2331 no_wrapper (google.pubsub_v1.types.PushConfig.NoWrapper): 

2332 Optional. When set, the payload to the push 

2333 endpoint is not wrapped. 

2334 

2335 This field is a member of `oneof`_ ``wrapper``. 

2336 """ 

2337 

2338 class OidcToken(proto.Message): 

2339 r"""Contains information needed for generating an `OpenID Connect 

2340 token <https://developers.google.com/identity/protocols/OpenIDConnect>`__. 

2341 

2342 Attributes: 

2343 service_account_email (str): 

2344 Optional. `Service account 

2345 email <https://cloud.google.com/iam/docs/service-accounts>`__ 

2346 used for generating the OIDC token. For more information on 

2347 setting up authentication, see `Push 

2348 subscriptions <https://cloud.google.com/pubsub/docs/push>`__. 

2349 audience (str): 

2350 Optional. Audience to be used when generating 

2351 OIDC token. The audience claim identifies the 

2352 recipients that the JWT is intended for. The 

2353 audience value is a single case-sensitive 

2354 string. Having multiple values (array) for the 

2355 audience field is not supported. More info about 

2356 the OIDC JWT token audience here: 

2357 

2358 https://tools.ietf.org/html/rfc7519#section-4.1.3 

2359 Note: if not specified, the Push endpoint URL 

2360 will be used. 

2361 """ 

2362 

2363 service_account_email: str = proto.Field( 

2364 proto.STRING, 

2365 number=1, 

2366 ) 

2367 audience: str = proto.Field( 

2368 proto.STRING, 

2369 number=2, 

2370 ) 

2371 

2372 class PubsubWrapper(proto.Message): 

2373 r"""The payload to the push endpoint is in the form of the JSON 

2374 representation of a PubsubMessage 

2375 (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). 

2376 

2377 """ 

2378 

2379 class NoWrapper(proto.Message): 

2380 r"""Sets the ``data`` field as the HTTP body for delivery. 

2381 

2382 Attributes: 

2383 write_metadata (bool): 

2384 Optional. When true, writes the Pub/Sub message metadata to 

2385 ``x-goog-pubsub-<KEY>:<VAL>`` headers of the HTTP request. 

2386 Writes the Pub/Sub message attributes to ``<KEY>:<VAL>`` 

2387 headers of the HTTP request. 

2388 """ 

2389 

2390 write_metadata: bool = proto.Field( 

2391 proto.BOOL, 

2392 number=1, 

2393 ) 

2394 

2395 push_endpoint: str = proto.Field( 

2396 proto.STRING, 

2397 number=1, 

2398 ) 

2399 attributes: MutableMapping[str, str] = proto.MapField( 

2400 proto.STRING, 

2401 proto.STRING, 

2402 number=2, 

2403 ) 

2404 oidc_token: OidcToken = proto.Field( 

2405 proto.MESSAGE, 

2406 number=3, 

2407 oneof="authentication_method", 

2408 message=OidcToken, 

2409 ) 

2410 pubsub_wrapper: PubsubWrapper = proto.Field( 

2411 proto.MESSAGE, 

2412 number=4, 

2413 oneof="wrapper", 

2414 message=PubsubWrapper, 

2415 ) 

2416 no_wrapper: NoWrapper = proto.Field( 

2417 proto.MESSAGE, 

2418 number=5, 

2419 oneof="wrapper", 

2420 message=NoWrapper, 

2421 ) 

2422 

2423 

2424class BigQueryConfig(proto.Message): 

2425 r"""Configuration for a BigQuery subscription. 

2426 

2427 Attributes: 

2428 table (str): 

2429 Optional. The name of the table to which to 

2430 write data, of the form 

2431 {projectId}.{datasetId}.{tableId} 

2432 use_topic_schema (bool): 

2433 Optional. When true, use the topic's schema as the columns 

2434 to write to in BigQuery, if it exists. ``use_topic_schema`` 

2435 and ``use_table_schema`` cannot be enabled at the same time. 

2436 write_metadata (bool): 

2437 Optional. When true, write the subscription name, 

2438 message_id, publish_time, attributes, and ordering_key to 

2439 additional columns in the table. The subscription name, 

2440 message_id, and publish_time fields are put in their own 

2441 columns while all other message properties (other than data) 

2442 are written to a JSON object in the attributes column. 

2443 drop_unknown_fields (bool): 

2444 Optional. When true and use_topic_schema is true, any fields 

2445 that are a part of the topic schema that are not part of the 

2446 BigQuery table schema are dropped when writing to BigQuery. 

2447 Otherwise, the schemas must be kept in sync and any messages 

2448 with extra fields are not written and remain in the 

2449 subscription's backlog. 

2450 state (google.pubsub_v1.types.BigQueryConfig.State): 

2451 Output only. An output-only field that 

2452 indicates whether or not the subscription can 

2453 receive messages. 

2454 use_table_schema (bool): 

2455 Optional. When true, use the BigQuery table's schema as the 

2456 columns to write to in BigQuery. ``use_table_schema`` and 

2457 ``use_topic_schema`` cannot be enabled at the same time. 

2458 service_account_email (str): 

2459 Optional. The service account to use to write to BigQuery. 

2460 The subscription creator or updater that specifies this 

2461 field must have ``iam.serviceAccounts.actAs`` permission on 

2462 the service account. If not specified, the Pub/Sub `service 

2463 agent <https://cloud.google.com/iam/docs/service-agents>`__, 

2464 service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, 

2465 is used. 

2466 """ 

2467 

2468 class State(proto.Enum): 

2469 r"""Possible states for a BigQuery subscription. 

2470 

2471 Values: 

2472 STATE_UNSPECIFIED (0): 

2473 Default value. This value is unused. 

2474 ACTIVE (1): 

2475 The subscription can actively send messages 

2476 to BigQuery 

2477 PERMISSION_DENIED (2): 

2478 Cannot write to the BigQuery table because of permission 

2479 denied errors. This can happen if 

2480 

2481 - Pub/Sub SA has not been granted the `appropriate BigQuery 

2482 IAM 

2483 permissions <https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account>`__ 

2484 - bigquery.googleapis.com API is not enabled for the 

2485 project 

2486 (`instructions <https://cloud.google.com/service-usage/docs/enable-disable>`__) 

2487 NOT_FOUND (3): 

2488 Cannot write to the BigQuery table because it 

2489 does not exist. 

2490 SCHEMA_MISMATCH (4): 

2491 Cannot write to the BigQuery table due to a 

2492 schema mismatch. 

2493 IN_TRANSIT_LOCATION_RESTRICTION (5): 

2494 Cannot write to the destination because enforce_in_transit 

2495 is set to true and the destination locations are not in the 

2496 allowed regions. 

2497 """ 

2498 STATE_UNSPECIFIED = 0 

2499 ACTIVE = 1 

2500 PERMISSION_DENIED = 2 

2501 NOT_FOUND = 3 

2502 SCHEMA_MISMATCH = 4 

2503 IN_TRANSIT_LOCATION_RESTRICTION = 5 

2504 

2505 table: str = proto.Field( 

2506 proto.STRING, 

2507 number=1, 

2508 ) 

2509 use_topic_schema: bool = proto.Field( 

2510 proto.BOOL, 

2511 number=2, 

2512 ) 

2513 write_metadata: bool = proto.Field( 

2514 proto.BOOL, 

2515 number=3, 

2516 ) 

2517 drop_unknown_fields: bool = proto.Field( 

2518 proto.BOOL, 

2519 number=4, 

2520 ) 

2521 state: State = proto.Field( 

2522 proto.ENUM, 

2523 number=5, 

2524 enum=State, 

2525 ) 

2526 use_table_schema: bool = proto.Field( 

2527 proto.BOOL, 

2528 number=6, 

2529 ) 

2530 service_account_email: str = proto.Field( 

2531 proto.STRING, 

2532 number=7, 

2533 ) 

2534 

2535 

2536class CloudStorageConfig(proto.Message): 

2537 r"""Configuration for a Cloud Storage subscription. 

2538 

2539 This message has `oneof`_ fields (mutually exclusive fields). 

2540 For each oneof, at most one member field can be set at the same time. 

2541 Setting any member of the oneof automatically clears all other 

2542 members. 

2543 

2544 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields 

2545 

2546 Attributes: 

2547 bucket (str): 

2548 Required. User-provided name for the Cloud Storage bucket. 

2549 The bucket must be created by the user. The bucket name must 

2550 be without any prefix like "gs://". See the [bucket naming 

2551 requirements] 

2552 (https://cloud.google.com/storage/docs/buckets#naming). 

2553 filename_prefix (str): 

2554 Optional. User-provided prefix for Cloud Storage filename. 

2555 See the `object naming 

2556 requirements <https://cloud.google.com/storage/docs/objects#naming>`__. 

2557 filename_suffix (str): 

2558 Optional. User-provided suffix for Cloud Storage filename. 

2559 See the `object naming 

2560 requirements <https://cloud.google.com/storage/docs/objects#naming>`__. 

2561 Must not end in "/". 

2562 filename_datetime_format (str): 

2563 Optional. User-provided format string specifying how to 

2564 represent datetimes in Cloud Storage filenames. See the 

2565 `datetime format 

2566 guidance <https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names>`__. 

2567 text_config (google.pubsub_v1.types.CloudStorageConfig.TextConfig): 

2568 Optional. If set, message data will be 

2569 written to Cloud Storage in text format. 

2570 

2571 This field is a member of `oneof`_ ``output_format``. 

2572 avro_config (google.pubsub_v1.types.CloudStorageConfig.AvroConfig): 

2573 Optional. If set, message data will be 

2574 written to Cloud Storage in Avro format. 

2575 

2576 This field is a member of `oneof`_ ``output_format``. 

2577 max_duration (google.protobuf.duration_pb2.Duration): 

2578 Optional. The maximum duration that can 

2579 elapse before a new Cloud Storage file is 

2580 created. Min 1 minute, max 10 minutes, default 5 

2581 minutes. May not exceed the subscription's 

2582 acknowledgment deadline. 

2583 max_bytes (int): 

2584 Optional. The maximum bytes that can be written to a Cloud 

2585 Storage file before a new file is created. Min 1 KB, max 10 

2586 GiB. The max_bytes limit may be exceeded in cases where 

2587 messages are larger than the limit. 

2588 max_messages (int): 

2589 Optional. The maximum number of messages that 

2590 can be written to a Cloud Storage file before a 

2591 new file is created. Min 1000 messages. 

2592 state (google.pubsub_v1.types.CloudStorageConfig.State): 

2593 Output only. An output-only field that 

2594 indicates whether or not the subscription can 

2595 receive messages. 

2596 service_account_email (str): 

2597 Optional. The service account to use to write to Cloud 

2598 Storage. The subscription creator or updater that specifies 

2599 this field must have ``iam.serviceAccounts.actAs`` 

2600 permission on the service account. If not specified, the 

2601 Pub/Sub `service 

2602 agent <https://cloud.google.com/iam/docs/service-agents>`__, 

2603 service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, 

2604 is used. 

2605 """ 

2606 

2607 class State(proto.Enum): 

2608 r"""Possible states for a Cloud Storage subscription. 

2609 

2610 Values: 

2611 STATE_UNSPECIFIED (0): 

2612 Default value. This value is unused. 

2613 ACTIVE (1): 

2614 The subscription can actively send messages 

2615 to Cloud Storage. 

2616 PERMISSION_DENIED (2): 

2617 Cannot write to the Cloud Storage bucket 

2618 because of permission denied errors. 

2619 NOT_FOUND (3): 

2620 Cannot write to the Cloud Storage bucket 

2621 because it does not exist. 

2622 IN_TRANSIT_LOCATION_RESTRICTION (4): 

2623 Cannot write to the destination because enforce_in_transit 

2624 is set to true and the destination locations are not in the 

2625 allowed regions. 

2626 SCHEMA_MISMATCH (5): 

2627 Cannot write to the Cloud Storage bucket due 

2628 to an incompatibility between the topic schema 

2629 and subscription settings. 

2630 """ 

2631 STATE_UNSPECIFIED = 0 

2632 ACTIVE = 1 

2633 PERMISSION_DENIED = 2 

2634 NOT_FOUND = 3 

2635 IN_TRANSIT_LOCATION_RESTRICTION = 4 

2636 SCHEMA_MISMATCH = 5 

2637 

2638 class TextConfig(proto.Message): 

2639 r"""Configuration for writing message data in text format. 

2640 Message payloads will be written to files as raw text, separated 

2641 by a newline. 

2642 

2643 """ 

2644 

2645 class AvroConfig(proto.Message): 

2646 r"""Configuration for writing message data in Avro format. 

2647 Message payloads and metadata will be written to files as an 

2648 Avro binary. 

2649 

2650 Attributes: 

2651 write_metadata (bool): 

2652 Optional. When true, write the subscription name, 

2653 message_id, publish_time, attributes, and ordering_key as 

2654 additional fields in the output. The subscription name, 

2655 message_id, and publish_time fields are put in their own 

2656 fields while all other message properties other than data 

2657 (for example, an ordering_key, if present) are added as 

2658 entries in the attributes map. 

2659 use_topic_schema (bool): 

2660 Optional. When true, the output Cloud Storage 

2661 file will be serialized using the topic schema, 

2662 if it exists. 

2663 """ 

2664 

2665 write_metadata: bool = proto.Field( 

2666 proto.BOOL, 

2667 number=1, 

2668 ) 

2669 use_topic_schema: bool = proto.Field( 

2670 proto.BOOL, 

2671 number=2, 

2672 ) 

2673 

2674 bucket: str = proto.Field( 

2675 proto.STRING, 

2676 number=1, 

2677 ) 

2678 filename_prefix: str = proto.Field( 

2679 proto.STRING, 

2680 number=2, 

2681 ) 

2682 filename_suffix: str = proto.Field( 

2683 proto.STRING, 

2684 number=3, 

2685 ) 

2686 filename_datetime_format: str = proto.Field( 

2687 proto.STRING, 

2688 number=10, 

2689 ) 

2690 text_config: TextConfig = proto.Field( 

2691 proto.MESSAGE, 

2692 number=4, 

2693 oneof="output_format", 

2694 message=TextConfig, 

2695 ) 

2696 avro_config: AvroConfig = proto.Field( 

2697 proto.MESSAGE, 

2698 number=5, 

2699 oneof="output_format", 

2700 message=AvroConfig, 

2701 ) 

2702 max_duration: duration_pb2.Duration = proto.Field( 

2703 proto.MESSAGE, 

2704 number=6, 

2705 message=duration_pb2.Duration, 

2706 ) 

2707 max_bytes: int = proto.Field( 

2708 proto.INT64, 

2709 number=7, 

2710 ) 

2711 max_messages: int = proto.Field( 

2712 proto.INT64, 

2713 number=8, 

2714 ) 

2715 state: State = proto.Field( 

2716 proto.ENUM, 

2717 number=9, 

2718 enum=State, 

2719 ) 

2720 service_account_email: str = proto.Field( 

2721 proto.STRING, 

2722 number=11, 

2723 ) 

2724 

2725 

2726class ReceivedMessage(proto.Message): 

2727 r"""A message and its corresponding acknowledgment ID. 

2728 

2729 Attributes: 

2730 ack_id (str): 

2731 Optional. This ID can be used to acknowledge 

2732 the received message. 

2733 message (google.pubsub_v1.types.PubsubMessage): 

2734 Optional. The message. 

2735 delivery_attempt (int): 

2736 Optional. The approximate number of times that Pub/Sub has 

2737 attempted to deliver the associated message to a subscriber. 

2738 

2739 More precisely, this is 1 + (number of NACKs) + (number of 

2740 ack_deadline exceeds) for this message. 

2741 

2742 A NACK is any call to ModifyAckDeadline with a 0 deadline. 

2743 An ack_deadline exceeds event is whenever a message is not 

2744 acknowledged within ack_deadline. Note that ack_deadline is 

2745 initially Subscription.ackDeadlineSeconds, but may get 

2746 extended automatically by the client library. 

2747 

2748 Upon the first delivery of a given message, 

2749 ``delivery_attempt`` will have a value of 1. The value is 

2750 calculated at best effort and is approximate. 

2751 

2752 If a DeadLetterPolicy is not set on the subscription, this 

2753 will be 0. 

2754 """ 

2755 

2756 ack_id: str = proto.Field( 

2757 proto.STRING, 

2758 number=1, 

2759 ) 

2760 message: "PubsubMessage" = proto.Field( 

2761 proto.MESSAGE, 

2762 number=2, 

2763 message="PubsubMessage", 

2764 ) 

2765 delivery_attempt: int = proto.Field( 

2766 proto.INT32, 

2767 number=3, 

2768 ) 

2769 

2770 

2771class GetSubscriptionRequest(proto.Message): 

2772 r"""Request for the GetSubscription method. 

2773 

2774 Attributes: 

2775 subscription (str): 

2776 Required. The name of the subscription to get. Format is 

2777 ``projects/{project}/subscriptions/{sub}``. 

2778 """ 

2779 

2780 subscription: str = proto.Field( 

2781 proto.STRING, 

2782 number=1, 

2783 ) 

2784 

2785 

2786class UpdateSubscriptionRequest(proto.Message): 

2787 r"""Request for the UpdateSubscription method. 

2788 

2789 Attributes: 

2790 subscription (google.pubsub_v1.types.Subscription): 

2791 Required. The updated subscription object. 

2792 update_mask (google.protobuf.field_mask_pb2.FieldMask): 

2793 Required. Indicates which fields in the 

2794 provided subscription to update. Must be 

2795 specified and non-empty. 

2796 """ 

2797 

2798 subscription: "Subscription" = proto.Field( 

2799 proto.MESSAGE, 

2800 number=1, 

2801 message="Subscription", 

2802 ) 

2803 update_mask: field_mask_pb2.FieldMask = proto.Field( 

2804 proto.MESSAGE, 

2805 number=2, 

2806 message=field_mask_pb2.FieldMask, 

2807 ) 

2808 

2809 

2810class ListSubscriptionsRequest(proto.Message): 

2811 r"""Request for the ``ListSubscriptions`` method. 

2812 

2813 Attributes: 

2814 project (str): 

2815 Required. The name of the project in which to list 

2816 subscriptions. Format is ``projects/{project-id}``. 

2817 page_size (int): 

2818 Optional. Maximum number of subscriptions to 

2819 return. 

2820 page_token (str): 

2821 Optional. The value returned by the last 

2822 ``ListSubscriptionsResponse``; indicates that this is a 

2823 continuation of a prior ``ListSubscriptions`` call, and that 

2824 the system should return the next page of data. 

2825 """ 

2826 

2827 project: str = proto.Field( 

2828 proto.STRING, 

2829 number=1, 

2830 ) 

2831 page_size: int = proto.Field( 

2832 proto.INT32, 

2833 number=2, 

2834 ) 

2835 page_token: str = proto.Field( 

2836 proto.STRING, 

2837 number=3, 

2838 ) 

2839 

2840 

2841class ListSubscriptionsResponse(proto.Message): 

2842 r"""Response for the ``ListSubscriptions`` method. 

2843 

2844 Attributes: 

2845 subscriptions (MutableSequence[google.pubsub_v1.types.Subscription]): 

2846 Optional. The subscriptions that match the 

2847 request. 

2848 next_page_token (str): 

2849 Optional. If not empty, indicates that there may be more 

2850 subscriptions that match the request; this value should be 

2851 passed in a new ``ListSubscriptionsRequest`` to get more 

2852 subscriptions. 

2853 """ 

2854 

2855 @property 

2856 def raw_page(self): 

2857 return self 

2858 

2859 subscriptions: MutableSequence["Subscription"] = proto.RepeatedField( 

2860 proto.MESSAGE, 

2861 number=1, 

2862 message="Subscription", 

2863 ) 

2864 next_page_token: str = proto.Field( 

2865 proto.STRING, 

2866 number=2, 

2867 ) 

2868 

2869 

2870class DeleteSubscriptionRequest(proto.Message): 

2871 r"""Request for the DeleteSubscription method. 

2872 

2873 Attributes: 

2874 subscription (str): 

2875 Required. The subscription to delete. Format is 

2876 ``projects/{project}/subscriptions/{sub}``. 

2877 """ 

2878 

2879 subscription: str = proto.Field( 

2880 proto.STRING, 

2881 number=1, 

2882 ) 

2883 

2884 

2885class ModifyPushConfigRequest(proto.Message): 

2886 r"""Request for the ModifyPushConfig method. 

2887 

2888 Attributes: 

2889 subscription (str): 

2890 Required. The name of the subscription. Format is 

2891 ``projects/{project}/subscriptions/{sub}``. 

2892 push_config (google.pubsub_v1.types.PushConfig): 

2893 Required. The push configuration for future deliveries. 

2894 

2895 An empty ``pushConfig`` indicates that the Pub/Sub system 

2896 should stop pushing messages from the given subscription and 

2897 allow messages to be pulled and acknowledged - effectively 

2898 pausing the subscription if ``Pull`` or ``StreamingPull`` is 

2899 not called. 

2900 """ 

2901 

2902 subscription: str = proto.Field( 

2903 proto.STRING, 

2904 number=1, 

2905 ) 

2906 push_config: "PushConfig" = proto.Field( 

2907 proto.MESSAGE, 

2908 number=2, 

2909 message="PushConfig", 

2910 ) 

2911 

2912 

2913class PullRequest(proto.Message): 

2914 r"""Request for the ``Pull`` method. 

2915 

2916 Attributes: 

2917 subscription (str): 

2918 Required. The subscription from which messages should be 

2919 pulled. Format is 

2920 ``projects/{project}/subscriptions/{sub}``. 

2921 return_immediately (bool): 

2922 Optional. If this field set to true, the system will respond 

2923 immediately even if it there are no messages available to 

2924 return in the ``Pull`` response. Otherwise, the system may 

2925 wait (for a bounded amount of time) until at least one 

2926 message is available, rather than returning no messages. 

2927 Warning: setting this field to ``true`` is discouraged 

2928 because it adversely impacts the performance of ``Pull`` 

2929 operations. We recommend that users do not set this field. 

2930 max_messages (int): 

2931 Required. The maximum number of messages to 

2932 return for this request. Must be a positive 

2933 integer. The Pub/Sub system may return fewer 

2934 than the number specified. 

2935 """ 

2936 

2937 subscription: str = proto.Field( 

2938 proto.STRING, 

2939 number=1, 

2940 ) 

2941 return_immediately: bool = proto.Field( 

2942 proto.BOOL, 

2943 number=2, 

2944 ) 

2945 max_messages: int = proto.Field( 

2946 proto.INT32, 

2947 number=3, 

2948 ) 

2949 

2950 

2951class PullResponse(proto.Message): 

2952 r"""Response for the ``Pull`` method. 

2953 

2954 Attributes: 

2955 received_messages (MutableSequence[google.pubsub_v1.types.ReceivedMessage]): 

2956 Optional. Received Pub/Sub messages. The list will be empty 

2957 if there are no more messages available in the backlog, or 

2958 if no messages could be returned before the request timeout. 

2959 For JSON, the response can be entirely empty. The Pub/Sub 

2960 system may return fewer than the ``maxMessages`` requested 

2961 even if there are more messages available in the backlog. 

2962 """ 

2963 

2964 received_messages: MutableSequence["ReceivedMessage"] = proto.RepeatedField( 

2965 proto.MESSAGE, 

2966 number=1, 

2967 message="ReceivedMessage", 

2968 ) 

2969 

2970 

2971class ModifyAckDeadlineRequest(proto.Message): 

2972 r"""Request for the ModifyAckDeadline method. 

2973 

2974 Attributes: 

2975 subscription (str): 

2976 Required. The name of the subscription. Format is 

2977 ``projects/{project}/subscriptions/{sub}``. 

2978 ack_ids (MutableSequence[str]): 

2979 Required. List of acknowledgment IDs. 

2980 ack_deadline_seconds (int): 

2981 Required. The new ack deadline with respect to the time this 

2982 request was sent to the Pub/Sub system. For example, if the 

2983 value is 10, the new ack deadline will expire 10 seconds 

2984 after the ``ModifyAckDeadline`` call was made. Specifying 

2985 zero might immediately make the message available for 

2986 delivery to another subscriber client. This typically 

2987 results in an increase in the rate of message redeliveries 

2988 (that is, duplicates). The minimum deadline you can specify 

2989 is 0 seconds. The maximum deadline you can specify in a 

2990 single request is 600 seconds (10 minutes). 

2991 """ 

2992 

2993 subscription: str = proto.Field( 

2994 proto.STRING, 

2995 number=1, 

2996 ) 

2997 ack_ids: MutableSequence[str] = proto.RepeatedField( 

2998 proto.STRING, 

2999 number=4, 

3000 ) 

3001 ack_deadline_seconds: int = proto.Field( 

3002 proto.INT32, 

3003 number=3, 

3004 ) 

3005 

3006 

3007class AcknowledgeRequest(proto.Message): 

3008 r"""Request for the Acknowledge method. 

3009 

3010 Attributes: 

3011 subscription (str): 

3012 Required. The subscription whose message is being 

3013 acknowledged. Format is 

3014 ``projects/{project}/subscriptions/{sub}``. 

3015 ack_ids (MutableSequence[str]): 

3016 Required. The acknowledgment ID for the messages being 

3017 acknowledged that was returned by the Pub/Sub system in the 

3018 ``Pull`` response. Must not be empty. 

3019 """ 

3020 

3021 subscription: str = proto.Field( 

3022 proto.STRING, 

3023 number=1, 

3024 ) 

3025 ack_ids: MutableSequence[str] = proto.RepeatedField( 

3026 proto.STRING, 

3027 number=2, 

3028 ) 

3029 

3030 

3031class StreamingPullRequest(proto.Message): 

3032 r"""Request for the ``StreamingPull`` streaming RPC method. This request 

3033 is used to establish the initial stream as well as to stream 

3034 acknowledgments and ack deadline modifications from the client to 

3035 the server. 

3036 

3037 Attributes: 

3038 subscription (str): 

3039 Required. The subscription for which to initialize the new 

3040 stream. This must be provided in the first request on the 

3041 stream, and must not be set in subsequent requests from 

3042 client to server. Format is 

3043 ``projects/{project}/subscriptions/{sub}``. 

3044 ack_ids (MutableSequence[str]): 

3045 Optional. List of acknowledgment IDs for acknowledging 

3046 previously received messages (received on this stream or a 

3047 different stream). If an ack ID has expired, the 

3048 corresponding message may be redelivered later. 

3049 Acknowledging a message more than once will not result in an 

3050 error. If the acknowledgment ID is malformed, the stream 

3051 will be aborted with status ``INVALID_ARGUMENT``. 

3052 modify_deadline_seconds (MutableSequence[int]): 

3053 Optional. The list of new ack deadlines for the IDs listed 

3054 in ``modify_deadline_ack_ids``. The size of this list must 

3055 be the same as the size of ``modify_deadline_ack_ids``. If 

3056 it differs the stream will be aborted with 

3057 ``INVALID_ARGUMENT``. Each element in this list is applied 

3058 to the element in the same position in 

3059 ``modify_deadline_ack_ids``. The new ack deadline is with 

3060 respect to the time this request was sent to the Pub/Sub 

3061 system. Must be >= 0. For example, if the value is 10, the 

3062 new ack deadline will expire 10 seconds after this request 

3063 is received. If the value is 0, the message is immediately 

3064 made available for another streaming or non-streaming pull 

3065 request. If the value is < 0 (an error), the stream will be 

3066 aborted with status ``INVALID_ARGUMENT``. 

3067 modify_deadline_ack_ids (MutableSequence[str]): 

3068 Optional. List of acknowledgment IDs whose deadline will be 

3069 modified based on the corresponding element in 

3070 ``modify_deadline_seconds``. This field can be used to 

3071 indicate that more time is needed to process a message by 

3072 the subscriber, or to make the message available for 

3073 redelivery if the processing was interrupted. 

3074 stream_ack_deadline_seconds (int): 

3075 Required. The ack deadline to use for the 

3076 stream. This must be provided in the first 

3077 request on the stream, but it can also be 

3078 updated on subsequent requests from client to 

3079 server. The minimum deadline you can specify is 

3080 10 seconds. The maximum deadline you can specify 

3081 is 600 seconds (10 minutes). 

3082 client_id (str): 

3083 Optional. A unique identifier that is used to distinguish 

3084 client instances from each other. Only needs to be provided 

3085 on the initial request. When a stream disconnects and 

3086 reconnects for the same stream, the client_id should be set 

3087 to the same value so that state associated with the old 

3088 stream can be transferred to the new stream. The same 

3089 client_id should not be used for different client instances. 

3090 max_outstanding_messages (int): 

3091 Optional. Flow control settings for the maximum number of 

3092 outstanding messages. When there are 

3093 ``max_outstanding_messages`` currently sent to the streaming 

3094 pull client that have not yet been acked or nacked, the 

3095 server stops sending more messages. The sending of messages 

3096 resumes once the number of outstanding messages is less than 

3097 this value. If the value is <= 0, there is no limit to the 

3098 number of outstanding messages. This property can only be 

3099 set on the initial StreamingPullRequest. If it is set on a 

3100 subsequent request, the stream will be aborted with status 

3101 ``INVALID_ARGUMENT``. 

3102 max_outstanding_bytes (int): 

3103 Optional. Flow control settings for the maximum number of 

3104 outstanding bytes. When there are ``max_outstanding_bytes`` 

3105 or more worth of messages currently sent to the streaming 

3106 pull client that have not yet been acked or nacked, the 

3107 server will stop sending more messages. The sending of 

3108 messages resumes once the number of outstanding bytes is 

3109 less than this value. If the value is <= 0, there is no 

3110 limit to the number of outstanding bytes. This property can 

3111 only be set on the initial StreamingPullRequest. If it is 

3112 set on a subsequent request, the stream will be aborted with 

3113 status ``INVALID_ARGUMENT``. 

3114 """ 

3115 

3116 subscription: str = proto.Field( 

3117 proto.STRING, 

3118 number=1, 

3119 ) 

3120 ack_ids: MutableSequence[str] = proto.RepeatedField( 

3121 proto.STRING, 

3122 number=2, 

3123 ) 

3124 modify_deadline_seconds: MutableSequence[int] = proto.RepeatedField( 

3125 proto.INT32, 

3126 number=3, 

3127 ) 

3128 modify_deadline_ack_ids: MutableSequence[str] = proto.RepeatedField( 

3129 proto.STRING, 

3130 number=4, 

3131 ) 

3132 stream_ack_deadline_seconds: int = proto.Field( 

3133 proto.INT32, 

3134 number=5, 

3135 ) 

3136 client_id: str = proto.Field( 

3137 proto.STRING, 

3138 number=6, 

3139 ) 

3140 max_outstanding_messages: int = proto.Field( 

3141 proto.INT64, 

3142 number=7, 

3143 ) 

3144 max_outstanding_bytes: int = proto.Field( 

3145 proto.INT64, 

3146 number=8, 

3147 ) 

3148 

3149 

3150class StreamingPullResponse(proto.Message): 

3151 r"""Response for the ``StreamingPull`` method. This response is used to 

3152 stream messages from the server to the client. 

3153 

3154 Attributes: 

3155 received_messages (MutableSequence[google.pubsub_v1.types.ReceivedMessage]): 

3156 Optional. Received Pub/Sub messages. This 

3157 will not be empty. 

3158 acknowledge_confirmation (google.pubsub_v1.types.StreamingPullResponse.AcknowledgeConfirmation): 

3159 Optional. This field will only be set if 

3160 ``enable_exactly_once_delivery`` is set to ``true`` and is 

3161 not guaranteed to be populated. 

3162 modify_ack_deadline_confirmation (google.pubsub_v1.types.StreamingPullResponse.ModifyAckDeadlineConfirmation): 

3163 Optional. This field will only be set if 

3164 ``enable_exactly_once_delivery`` is set to ``true`` and is 

3165 not guaranteed to be populated. 

3166 subscription_properties (google.pubsub_v1.types.StreamingPullResponse.SubscriptionProperties): 

3167 Optional. Properties associated with this 

3168 subscription. 

3169 """ 

3170 

3171 class AcknowledgeConfirmation(proto.Message): 

3172 r"""Acknowledgment IDs sent in one or more previous requests to 

3173 acknowledge a previously received message. 

3174 

3175 Attributes: 

3176 ack_ids (MutableSequence[str]): 

3177 Optional. Successfully processed 

3178 acknowledgment IDs. 

3179 invalid_ack_ids (MutableSequence[str]): 

3180 Optional. List of acknowledgment IDs that 

3181 were malformed or whose acknowledgment deadline 

3182 has expired. 

3183 unordered_ack_ids (MutableSequence[str]): 

3184 Optional. List of acknowledgment IDs that 

3185 were out of order. 

3186 temporary_failed_ack_ids (MutableSequence[str]): 

3187 Optional. List of acknowledgment IDs that 

3188 failed processing with temporary issues. 

3189 """ 

3190 

3191 ack_ids: MutableSequence[str] = proto.RepeatedField( 

3192 proto.STRING, 

3193 number=1, 

3194 ) 

3195 invalid_ack_ids: MutableSequence[str] = proto.RepeatedField( 

3196 proto.STRING, 

3197 number=2, 

3198 ) 

3199 unordered_ack_ids: MutableSequence[str] = proto.RepeatedField( 

3200 proto.STRING, 

3201 number=3, 

3202 ) 

3203 temporary_failed_ack_ids: MutableSequence[str] = proto.RepeatedField( 

3204 proto.STRING, 

3205 number=4, 

3206 ) 

3207 

3208 class ModifyAckDeadlineConfirmation(proto.Message): 

3209 r"""Acknowledgment IDs sent in one or more previous requests to 

3210 modify the deadline for a specific message. 

3211 

3212 Attributes: 

3213 ack_ids (MutableSequence[str]): 

3214 Optional. Successfully processed 

3215 acknowledgment IDs. 

3216 invalid_ack_ids (MutableSequence[str]): 

3217 Optional. List of acknowledgment IDs that 

3218 were malformed or whose acknowledgment deadline 

3219 has expired. 

3220 temporary_failed_ack_ids (MutableSequence[str]): 

3221 Optional. List of acknowledgment IDs that 

3222 failed processing with temporary issues. 

3223 """ 

3224 

3225 ack_ids: MutableSequence[str] = proto.RepeatedField( 

3226 proto.STRING, 

3227 number=1, 

3228 ) 

3229 invalid_ack_ids: MutableSequence[str] = proto.RepeatedField( 

3230 proto.STRING, 

3231 number=2, 

3232 ) 

3233 temporary_failed_ack_ids: MutableSequence[str] = proto.RepeatedField( 

3234 proto.STRING, 

3235 number=3, 

3236 ) 

3237 

3238 class SubscriptionProperties(proto.Message): 

3239 r"""Subscription properties sent as part of the response. 

3240 

3241 Attributes: 

3242 exactly_once_delivery_enabled (bool): 

3243 Optional. True iff exactly once delivery is 

3244 enabled for this subscription. 

3245 message_ordering_enabled (bool): 

3246 Optional. True iff message ordering is 

3247 enabled for this subscription. 

3248 """ 

3249 

3250 exactly_once_delivery_enabled: bool = proto.Field( 

3251 proto.BOOL, 

3252 number=1, 

3253 ) 

3254 message_ordering_enabled: bool = proto.Field( 

3255 proto.BOOL, 

3256 number=2, 

3257 ) 

3258 

3259 received_messages: MutableSequence["ReceivedMessage"] = proto.RepeatedField( 

3260 proto.MESSAGE, 

3261 number=1, 

3262 message="ReceivedMessage", 

3263 ) 

3264 acknowledge_confirmation: AcknowledgeConfirmation = proto.Field( 

3265 proto.MESSAGE, 

3266 number=5, 

3267 message=AcknowledgeConfirmation, 

3268 ) 

3269 modify_ack_deadline_confirmation: ModifyAckDeadlineConfirmation = proto.Field( 

3270 proto.MESSAGE, 

3271 number=3, 

3272 message=ModifyAckDeadlineConfirmation, 

3273 ) 

3274 subscription_properties: SubscriptionProperties = proto.Field( 

3275 proto.MESSAGE, 

3276 number=4, 

3277 message=SubscriptionProperties, 

3278 ) 

3279 

3280 

3281class CreateSnapshotRequest(proto.Message): 

3282 r"""Request for the ``CreateSnapshot`` method. 

3283 

3284 Attributes: 

3285 name (str): 

3286 Required. User-provided name for this snapshot. If the name 

3287 is not provided in the request, the server will assign a 

3288 random name for this snapshot on the same project as the 

3289 subscription. Note that for REST API requests, you must 

3290 specify a name. See the `resource name 

3291 rules <https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names>`__. 

3292 Format is ``projects/{project}/snapshots/{snap}``. 

3293 subscription (str): 

3294 Required. The subscription whose backlog the snapshot 

3295 retains. Specifically, the created snapshot is guaranteed to 

3296 retain: (a) The existing backlog on the subscription. More 

3297 precisely, this is defined as the messages in the 

3298 subscription's backlog that are unacknowledged upon the 

3299 successful completion of the ``CreateSnapshot`` request; as 

3300 well as: (b) Any messages published to the subscription's 

3301 topic following the successful completion of the 

3302 CreateSnapshot request. Format is 

3303 ``projects/{project}/subscriptions/{sub}``. 

3304 labels (MutableMapping[str, str]): 

3305 Optional. See `Creating and managing 

3306 labels <https://cloud.google.com/pubsub/docs/labels>`__. 

3307 """ 

3308 

3309 name: str = proto.Field( 

3310 proto.STRING, 

3311 number=1, 

3312 ) 

3313 subscription: str = proto.Field( 

3314 proto.STRING, 

3315 number=2, 

3316 ) 

3317 labels: MutableMapping[str, str] = proto.MapField( 

3318 proto.STRING, 

3319 proto.STRING, 

3320 number=3, 

3321 ) 

3322 

3323 

3324class UpdateSnapshotRequest(proto.Message): 

3325 r"""Request for the UpdateSnapshot method. 

3326 

3327 Attributes: 

3328 snapshot (google.pubsub_v1.types.Snapshot): 

3329 Required. The updated snapshot object. 

3330 update_mask (google.protobuf.field_mask_pb2.FieldMask): 

3331 Required. Indicates which fields in the 

3332 provided snapshot to update. Must be specified 

3333 and non-empty. 

3334 """ 

3335 

3336 snapshot: "Snapshot" = proto.Field( 

3337 proto.MESSAGE, 

3338 number=1, 

3339 message="Snapshot", 

3340 ) 

3341 update_mask: field_mask_pb2.FieldMask = proto.Field( 

3342 proto.MESSAGE, 

3343 number=2, 

3344 message=field_mask_pb2.FieldMask, 

3345 ) 

3346 

3347 

3348class Snapshot(proto.Message): 

3349 r"""A snapshot resource. Snapshots are used in 

3350 `Seek <https://cloud.google.com/pubsub/docs/replay-overview>`__ 

3351 operations, which allow you to manage message acknowledgments in 

3352 bulk. That is, you can set the acknowledgment state of messages in 

3353 an existing subscription to the state captured by a snapshot. 

3354 

3355 Attributes: 

3356 name (str): 

3357 Optional. The name of the snapshot. 

3358 topic (str): 

3359 Optional. The name of the topic from which 

3360 this snapshot is retaining messages. 

3361 expire_time (google.protobuf.timestamp_pb2.Timestamp): 

3362 Optional. The snapshot is guaranteed to exist up until this 

3363 time. A newly-created snapshot expires no later than 7 days 

3364 from the time of its creation. Its exact lifetime is 

3365 determined at creation by the existing backlog in the source 

3366 subscription. Specifically, the lifetime of the snapshot is 

3367 ``7 days - (age of oldest unacked message in the subscription)``. 

3368 For example, consider a subscription whose oldest unacked 

3369 message is 3 days old. If a snapshot is created from this 

3370 subscription, the snapshot -- which will always capture this 

3371 3-day-old backlog as long as the snapshot exists -- will 

3372 expire in 4 days. The service will refuse to create a 

3373 snapshot that would expire in less than 1 hour after 

3374 creation. 

3375 labels (MutableMapping[str, str]): 

3376 Optional. See [Creating and managing labels] 

3377 (https://cloud.google.com/pubsub/docs/labels). 

3378 """ 

3379 

3380 name: str = proto.Field( 

3381 proto.STRING, 

3382 number=1, 

3383 ) 

3384 topic: str = proto.Field( 

3385 proto.STRING, 

3386 number=2, 

3387 ) 

3388 expire_time: timestamp_pb2.Timestamp = proto.Field( 

3389 proto.MESSAGE, 

3390 number=3, 

3391 message=timestamp_pb2.Timestamp, 

3392 ) 

3393 labels: MutableMapping[str, str] = proto.MapField( 

3394 proto.STRING, 

3395 proto.STRING, 

3396 number=4, 

3397 ) 

3398 

3399 

3400class GetSnapshotRequest(proto.Message): 

3401 r"""Request for the GetSnapshot method. 

3402 

3403 Attributes: 

3404 snapshot (str): 

3405 Required. The name of the snapshot to get. Format is 

3406 ``projects/{project}/snapshots/{snap}``. 

3407 """ 

3408 

3409 snapshot: str = proto.Field( 

3410 proto.STRING, 

3411 number=1, 

3412 ) 

3413 

3414 

3415class ListSnapshotsRequest(proto.Message): 

3416 r"""Request for the ``ListSnapshots`` method. 

3417 

3418 Attributes: 

3419 project (str): 

3420 Required. The name of the project in which to list 

3421 snapshots. Format is ``projects/{project-id}``. 

3422 page_size (int): 

3423 Optional. Maximum number of snapshots to 

3424 return. 

3425 page_token (str): 

3426 Optional. The value returned by the last 

3427 ``ListSnapshotsResponse``; indicates that this is a 

3428 continuation of a prior ``ListSnapshots`` call, and that the 

3429 system should return the next page of data. 

3430 """ 

3431 

3432 project: str = proto.Field( 

3433 proto.STRING, 

3434 number=1, 

3435 ) 

3436 page_size: int = proto.Field( 

3437 proto.INT32, 

3438 number=2, 

3439 ) 

3440 page_token: str = proto.Field( 

3441 proto.STRING, 

3442 number=3, 

3443 ) 

3444 

3445 

3446class ListSnapshotsResponse(proto.Message): 

3447 r"""Response for the ``ListSnapshots`` method. 

3448 

3449 Attributes: 

3450 snapshots (MutableSequence[google.pubsub_v1.types.Snapshot]): 

3451 Optional. The resulting snapshots. 

3452 next_page_token (str): 

3453 Optional. If not empty, indicates that there may be more 

3454 snapshot that match the request; this value should be passed 

3455 in a new ``ListSnapshotsRequest``. 

3456 """ 

3457 

3458 @property 

3459 def raw_page(self): 

3460 return self 

3461 

3462 snapshots: MutableSequence["Snapshot"] = proto.RepeatedField( 

3463 proto.MESSAGE, 

3464 number=1, 

3465 message="Snapshot", 

3466 ) 

3467 next_page_token: str = proto.Field( 

3468 proto.STRING, 

3469 number=2, 

3470 ) 

3471 

3472 

3473class DeleteSnapshotRequest(proto.Message): 

3474 r"""Request for the ``DeleteSnapshot`` method. 

3475 

3476 Attributes: 

3477 snapshot (str): 

3478 Required. The name of the snapshot to delete. Format is 

3479 ``projects/{project}/snapshots/{snap}``. 

3480 """ 

3481 

3482 snapshot: str = proto.Field( 

3483 proto.STRING, 

3484 number=1, 

3485 ) 

3486 

3487 

3488class SeekRequest(proto.Message): 

3489 r"""Request for the ``Seek`` method. 

3490 

3491 This message has `oneof`_ fields (mutually exclusive fields). 

3492 For each oneof, at most one member field can be set at the same time. 

3493 Setting any member of the oneof automatically clears all other 

3494 members. 

3495 

3496 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields 

3497 

3498 Attributes: 

3499 subscription (str): 

3500 Required. The subscription to affect. 

3501 time (google.protobuf.timestamp_pb2.Timestamp): 

3502 Optional. The time to seek to. Messages retained in the 

3503 subscription that were published before this time are marked 

3504 as acknowledged, and messages retained in the subscription 

3505 that were published after this time are marked as 

3506 unacknowledged. Note that this operation affects only those 

3507 messages retained in the subscription (configured by the 

3508 combination of ``message_retention_duration`` and 

3509 ``retain_acked_messages``). For example, if ``time`` 

3510 corresponds to a point before the message retention window 

3511 (or to a point before the system's notion of the 

3512 subscription creation time), only retained messages will be 

3513 marked as unacknowledged, and already-expunged messages will 

3514 not be restored. 

3515 

3516 This field is a member of `oneof`_ ``target``. 

3517 snapshot (str): 

3518 Optional. The snapshot to seek to. The snapshot's topic must 

3519 be the same as that of the provided subscription. Format is 

3520 ``projects/{project}/snapshots/{snap}``. 

3521 

3522 This field is a member of `oneof`_ ``target``. 

3523 """ 

3524 

3525 subscription: str = proto.Field( 

3526 proto.STRING, 

3527 number=1, 

3528 ) 

3529 time: timestamp_pb2.Timestamp = proto.Field( 

3530 proto.MESSAGE, 

3531 number=2, 

3532 oneof="target", 

3533 message=timestamp_pb2.Timestamp, 

3534 ) 

3535 snapshot: str = proto.Field( 

3536 proto.STRING, 

3537 number=3, 

3538 oneof="target", 

3539 ) 

3540 

3541 

3542class SeekResponse(proto.Message): 

3543 r"""Response for the ``Seek`` method (this response is empty).""" 

3544 

3545 

3546__all__ = tuple(sorted(__protobuf__.manifest))