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

420 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 api_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.ApiViolationReason): 

1215 Optional. The message failed to be published 

1216 due to an API violation. This is only set when 

1217 the size of the data field of the Kinesis record 

1218 is zero. 

1219 

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

1221 """ 

1222 

1223 stream_arn: str = proto.Field( 

1224 proto.STRING, 

1225 number=1, 

1226 ) 

1227 partition_key: str = proto.Field( 

1228 proto.STRING, 

1229 number=2, 

1230 ) 

1231 sequence_number: str = proto.Field( 

1232 proto.STRING, 

1233 number=3, 

1234 ) 

1235 schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( 

1236 proto.Field( 

1237 proto.MESSAGE, 

1238 number=4, 

1239 oneof="reason", 

1240 message="IngestionFailureEvent.SchemaViolationReason", 

1241 ) 

1242 ) 

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

1244 proto.MESSAGE, 

1245 number=5, 

1246 oneof="reason", 

1247 message="IngestionFailureEvent.MessageTransformationFailureReason", 

1248 ) 

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

1250 proto.MESSAGE, 

1251 number=6, 

1252 oneof="reason", 

1253 message="IngestionFailureEvent.ApiViolationReason", 

1254 ) 

1255 

1256 topic: str = proto.Field( 

1257 proto.STRING, 

1258 number=1, 

1259 ) 

1260 error_message: str = proto.Field( 

1261 proto.STRING, 

1262 number=2, 

1263 ) 

1264 cloud_storage_failure: CloudStorageFailure = proto.Field( 

1265 proto.MESSAGE, 

1266 number=3, 

1267 oneof="failure", 

1268 message=CloudStorageFailure, 

1269 ) 

1270 aws_msk_failure: AwsMskFailureReason = proto.Field( 

1271 proto.MESSAGE, 

1272 number=4, 

1273 oneof="failure", 

1274 message=AwsMskFailureReason, 

1275 ) 

1276 azure_event_hubs_failure: AzureEventHubsFailureReason = proto.Field( 

1277 proto.MESSAGE, 

1278 number=5, 

1279 oneof="failure", 

1280 message=AzureEventHubsFailureReason, 

1281 ) 

1282 confluent_cloud_failure: ConfluentCloudFailureReason = proto.Field( 

1283 proto.MESSAGE, 

1284 number=6, 

1285 oneof="failure", 

1286 message=ConfluentCloudFailureReason, 

1287 ) 

1288 aws_kinesis_failure: AwsKinesisFailureReason = proto.Field( 

1289 proto.MESSAGE, 

1290 number=7, 

1291 oneof="failure", 

1292 message=AwsKinesisFailureReason, 

1293 ) 

1294 

1295 

1296class JavaScriptUDF(proto.Message): 

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

1298 a Pub/Sub message. 

1299 

1300 Attributes: 

1301 function_name (str): 

1302 Required. Name of the JavasScript function 

1303 that should applied to Pub/Sub messages. 

1304 code (str): 

1305 Required. JavaScript code that contains a function 

1306 ``function_name`` with the below signature: 

1307 

1308 :: 

1309 

1310 /** 

1311 * Transforms a Pub/Sub message. 

1312 

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

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

1315 * with the following keys: 

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

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

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

1319 * message. 

1320 * 

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

1322 * message. Keys: 

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

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

1325 * 

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

1327 * Keys: 

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

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

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

1331 */ 

1332 

1333 function <function_name>(message, metadata) { 

1334 } 

1335 """ 

1336 

1337 function_name: str = proto.Field( 

1338 proto.STRING, 

1339 number=1, 

1340 ) 

1341 code: str = proto.Field( 

1342 proto.STRING, 

1343 number=2, 

1344 ) 

1345 

1346 

1347class MessageTransform(proto.Message): 

1348 r"""All supported message transforms types. 

1349 

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

1351 

1352 Attributes: 

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

1354 Optional. JavaScript User Defined Function. If multiple 

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

1356 a unique ``function_name``. 

1357 

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

1359 enabled (bool): 

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

1361 field to disable transforms. 

1362 disabled (bool): 

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

1364 applied to messages. Defaults to ``false``. 

1365 """ 

1366 

1367 javascript_udf: "JavaScriptUDF" = proto.Field( 

1368 proto.MESSAGE, 

1369 number=2, 

1370 oneof="transform", 

1371 message="JavaScriptUDF", 

1372 ) 

1373 enabled: bool = proto.Field( 

1374 proto.BOOL, 

1375 number=3, 

1376 ) 

1377 disabled: bool = proto.Field( 

1378 proto.BOOL, 

1379 number=4, 

1380 ) 

1381 

1382 

1383class Topic(proto.Message): 

1384 r"""A topic resource. 

1385 

1386 Attributes: 

1387 name (str): 

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

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

1390 start with a letter, and contain only letters 

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

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

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

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

1395 ``"goog"``. 

1396 labels (MutableMapping[str, str]): 

1397 Optional. See [Creating and managing labels] 

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

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

1400 Optional. Policy constraining the set of 

1401 Google Cloud Platform regions where messages 

1402 published to the topic may be stored. If not 

1403 present, then no constraints are in effect. 

1404 kms_key_name (str): 

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

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

1407 

1408 The expected format is 

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

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

1411 Optional. Settings for validating messages 

1412 published against a schema. 

1413 satisfies_pzs (bool): 

1414 Optional. Reserved for future use. This field 

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

1416 ignored if it is set in any requests. 

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

1418 Optional. Indicates the minimum duration to retain a message 

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

1420 messages published to the topic in the last 

1421 ``message_retention_duration`` are always available to 

1422 subscribers. For instance, it allows any attached 

1423 subscription to `seek to a 

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

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

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

1427 settings on individual subscriptions. Cannot be more than 31 

1428 days or less than 10 minutes. 

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

1430 Output only. An output-only field indicating 

1431 the state of the topic. 

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

1433 Optional. Settings for ingestion from a data 

1434 source into this topic. 

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

1436 Optional. Transforms to be applied to 

1437 messages published to the topic. Transforms are 

1438 applied in the order specified. 

1439 tags (MutableMapping[str, str]): 

1440 Optional. Input only. Immutable. Tag 

1441 keys/values directly bound to this resource. For 

1442 example: 

1443 

1444 "123/environment": "production", 

1445 "123/costCenter": "marketing". 

1446 """ 

1447 

1448 class State(proto.Enum): 

1449 r"""The state of the topic. 

1450 

1451 Values: 

1452 STATE_UNSPECIFIED (0): 

1453 Default value. This value is unused. 

1454 ACTIVE (1): 

1455 The topic does not have any persistent 

1456 errors. 

1457 INGESTION_RESOURCE_ERROR (2): 

1458 Ingestion from the data source has 

1459 encountered a permanent error. See the more 

1460 detailed error state in the corresponding 

1461 ingestion source configuration. 

1462 """ 

1463 STATE_UNSPECIFIED = 0 

1464 ACTIVE = 1 

1465 INGESTION_RESOURCE_ERROR = 2 

1466 

1467 name: str = proto.Field( 

1468 proto.STRING, 

1469 number=1, 

1470 ) 

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

1472 proto.STRING, 

1473 proto.STRING, 

1474 number=2, 

1475 ) 

1476 message_storage_policy: "MessageStoragePolicy" = proto.Field( 

1477 proto.MESSAGE, 

1478 number=3, 

1479 message="MessageStoragePolicy", 

1480 ) 

1481 kms_key_name: str = proto.Field( 

1482 proto.STRING, 

1483 number=5, 

1484 ) 

1485 schema_settings: "SchemaSettings" = proto.Field( 

1486 proto.MESSAGE, 

1487 number=6, 

1488 message="SchemaSettings", 

1489 ) 

1490 satisfies_pzs: bool = proto.Field( 

1491 proto.BOOL, 

1492 number=7, 

1493 ) 

1494 message_retention_duration: duration_pb2.Duration = proto.Field( 

1495 proto.MESSAGE, 

1496 number=8, 

1497 message=duration_pb2.Duration, 

1498 ) 

1499 state: State = proto.Field( 

1500 proto.ENUM, 

1501 number=9, 

1502 enum=State, 

1503 ) 

1504 ingestion_data_source_settings: "IngestionDataSourceSettings" = proto.Field( 

1505 proto.MESSAGE, 

1506 number=10, 

1507 message="IngestionDataSourceSettings", 

1508 ) 

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

1510 proto.MESSAGE, 

1511 number=13, 

1512 message="MessageTransform", 

1513 ) 

1514 tags: MutableMapping[str, str] = proto.MapField( 

1515 proto.STRING, 

1516 proto.STRING, 

1517 number=14, 

1518 ) 

1519 

1520 

1521class PubsubMessage(proto.Message): 

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

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

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

1525 object differently depending on the language. See the corresponding 

1526 `client library 

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

1528 for more information. See [quotas and limits] 

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

1530 message limits. 

1531 

1532 Attributes: 

1533 data (bytes): 

1534 Optional. The message data field. If this 

1535 field is empty, the message must contain at 

1536 least one attribute. 

1537 attributes (MutableMapping[str, str]): 

1538 Optional. Attributes for this message. If 

1539 this field is empty, the message must contain 

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

1541 messages on the subscription. 

1542 message_id (str): 

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

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

1545 value may be read by a subscriber that receives a 

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

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

1548 call. 

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

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

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

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

1553 ordering_key (str): 

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

1555 which publish order should be respected. If a 

1556 ``Subscription`` has ``enable_message_ordering`` set to 

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

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

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

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

1561 ``PublishRequest`` must specify the same ``ordering_key`` 

1562 value. For more information, see `ordering 

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

1564 """ 

1565 

1566 data: bytes = proto.Field( 

1567 proto.BYTES, 

1568 number=1, 

1569 ) 

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

1571 proto.STRING, 

1572 proto.STRING, 

1573 number=2, 

1574 ) 

1575 message_id: str = proto.Field( 

1576 proto.STRING, 

1577 number=3, 

1578 ) 

1579 publish_time: timestamp_pb2.Timestamp = proto.Field( 

1580 proto.MESSAGE, 

1581 number=4, 

1582 message=timestamp_pb2.Timestamp, 

1583 ) 

1584 ordering_key: str = proto.Field( 

1585 proto.STRING, 

1586 number=5, 

1587 ) 

1588 

1589 

1590class GetTopicRequest(proto.Message): 

1591 r"""Request for the GetTopic method. 

1592 

1593 Attributes: 

1594 topic (str): 

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

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

1597 """ 

1598 

1599 topic: str = proto.Field( 

1600 proto.STRING, 

1601 number=1, 

1602 ) 

1603 

1604 

1605class UpdateTopicRequest(proto.Message): 

1606 r"""Request for the UpdateTopic method. 

1607 

1608 Attributes: 

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

1610 Required. The updated topic object. 

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

1612 Required. Indicates which fields in the provided topic to 

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

1614 ``update_mask`` contains "message_storage_policy" but the 

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

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

1617 policy configured at the project or organization level. 

1618 """ 

1619 

1620 topic: "Topic" = proto.Field( 

1621 proto.MESSAGE, 

1622 number=1, 

1623 message="Topic", 

1624 ) 

1625 update_mask: field_mask_pb2.FieldMask = proto.Field( 

1626 proto.MESSAGE, 

1627 number=2, 

1628 message=field_mask_pb2.FieldMask, 

1629 ) 

1630 

1631 

1632class PublishRequest(proto.Message): 

1633 r"""Request for the Publish method. 

1634 

1635 Attributes: 

1636 topic (str): 

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

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

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

1640 Required. The messages to publish. 

1641 """ 

1642 

1643 topic: str = proto.Field( 

1644 proto.STRING, 

1645 number=1, 

1646 ) 

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

1648 proto.MESSAGE, 

1649 number=2, 

1650 message="PubsubMessage", 

1651 ) 

1652 

1653 

1654class PublishResponse(proto.Message): 

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

1656 

1657 Attributes: 

1658 message_ids (MutableSequence[str]): 

1659 Optional. The server-assigned ID of each 

1660 published message, in the same order as the 

1661 messages in the request. IDs are guaranteed to 

1662 be unique within the topic. 

1663 """ 

1664 

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

1666 proto.STRING, 

1667 number=1, 

1668 ) 

1669 

1670 

1671class ListTopicsRequest(proto.Message): 

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

1673 

1674 Attributes: 

1675 project (str): 

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

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

1678 page_size (int): 

1679 Optional. Maximum number of topics to return. 

1680 page_token (str): 

1681 Optional. The value returned by the last 

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

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

1684 system should return the next page of data. 

1685 """ 

1686 

1687 project: str = proto.Field( 

1688 proto.STRING, 

1689 number=1, 

1690 ) 

1691 page_size: int = proto.Field( 

1692 proto.INT32, 

1693 number=2, 

1694 ) 

1695 page_token: str = proto.Field( 

1696 proto.STRING, 

1697 number=3, 

1698 ) 

1699 

1700 

1701class ListTopicsResponse(proto.Message): 

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

1703 

1704 Attributes: 

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

1706 Optional. The resulting topics. 

1707 next_page_token (str): 

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

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

1710 in a new ``ListTopicsRequest``. 

1711 """ 

1712 

1713 @property 

1714 def raw_page(self): 

1715 return self 

1716 

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

1718 proto.MESSAGE, 

1719 number=1, 

1720 message="Topic", 

1721 ) 

1722 next_page_token: str = proto.Field( 

1723 proto.STRING, 

1724 number=2, 

1725 ) 

1726 

1727 

1728class ListTopicSubscriptionsRequest(proto.Message): 

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

1730 

1731 Attributes: 

1732 topic (str): 

1733 Required. The name of the topic that subscriptions are 

1734 attached to. Format is 

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

1736 page_size (int): 

1737 Optional. Maximum number of subscription 

1738 names to return. 

1739 page_token (str): 

1740 Optional. The value returned by the last 

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

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

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

1744 """ 

1745 

1746 topic: str = proto.Field( 

1747 proto.STRING, 

1748 number=1, 

1749 ) 

1750 page_size: int = proto.Field( 

1751 proto.INT32, 

1752 number=2, 

1753 ) 

1754 page_token: str = proto.Field( 

1755 proto.STRING, 

1756 number=3, 

1757 ) 

1758 

1759 

1760class ListTopicSubscriptionsResponse(proto.Message): 

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

1762 

1763 Attributes: 

1764 subscriptions (MutableSequence[str]): 

1765 Optional. The names of subscriptions attached 

1766 to the topic specified in the request. 

1767 next_page_token (str): 

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

1769 subscriptions that match the request; this value should be 

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

1771 more subscriptions. 

1772 """ 

1773 

1774 @property 

1775 def raw_page(self): 

1776 return self 

1777 

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

1779 proto.STRING, 

1780 number=1, 

1781 ) 

1782 next_page_token: str = proto.Field( 

1783 proto.STRING, 

1784 number=2, 

1785 ) 

1786 

1787 

1788class ListTopicSnapshotsRequest(proto.Message): 

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

1790 

1791 Attributes: 

1792 topic (str): 

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

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

1795 page_size (int): 

1796 Optional. Maximum number of snapshot names to 

1797 return. 

1798 page_token (str): 

1799 Optional. The value returned by the last 

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

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

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

1803 """ 

1804 

1805 topic: str = proto.Field( 

1806 proto.STRING, 

1807 number=1, 

1808 ) 

1809 page_size: int = proto.Field( 

1810 proto.INT32, 

1811 number=2, 

1812 ) 

1813 page_token: str = proto.Field( 

1814 proto.STRING, 

1815 number=3, 

1816 ) 

1817 

1818 

1819class ListTopicSnapshotsResponse(proto.Message): 

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

1821 

1822 Attributes: 

1823 snapshots (MutableSequence[str]): 

1824 Optional. The names of the snapshots that 

1825 match the request. 

1826 next_page_token (str): 

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

1828 snapshots that match the request; this value should be 

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

1830 snapshots. 

1831 """ 

1832 

1833 @property 

1834 def raw_page(self): 

1835 return self 

1836 

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

1838 proto.STRING, 

1839 number=1, 

1840 ) 

1841 next_page_token: str = proto.Field( 

1842 proto.STRING, 

1843 number=2, 

1844 ) 

1845 

1846 

1847class DeleteTopicRequest(proto.Message): 

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

1849 

1850 Attributes: 

1851 topic (str): 

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

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

1854 """ 

1855 

1856 topic: str = proto.Field( 

1857 proto.STRING, 

1858 number=1, 

1859 ) 

1860 

1861 

1862class DetachSubscriptionRequest(proto.Message): 

1863 r"""Request for the DetachSubscription method. 

1864 

1865 Attributes: 

1866 subscription (str): 

1867 Required. The subscription to detach. Format is 

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

1869 """ 

1870 

1871 subscription: str = proto.Field( 

1872 proto.STRING, 

1873 number=1, 

1874 ) 

1875 

1876 

1877class DetachSubscriptionResponse(proto.Message): 

1878 r"""Response for the DetachSubscription method. 

1879 Reserved for future use. 

1880 

1881 """ 

1882 

1883 

1884class Subscription(proto.Message): 

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

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

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

1888 of these fields may be set. 

1889 

1890 Attributes: 

1891 name (str): 

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

1893 format 

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

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

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

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

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

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

1900 start with ``"goog"``. 

1901 topic (str): 

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

1903 is receiving messages. Format is 

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

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

1906 deleted. 

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

1908 Optional. If push delivery is used with this 

1909 subscription, this field is used to configure 

1910 it. 

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

1912 Optional. If delivery to BigQuery is used 

1913 with this subscription, this field is used to 

1914 configure it. 

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

1916 Optional. If delivery to Google Cloud Storage 

1917 is used with this subscription, this field is 

1918 used to configure it. 

1919 ack_deadline_seconds (int): 

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

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

1922 receipt before resending the message. In the interval after 

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

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

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

1926 basis). 

1927 

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

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

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

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

1932 the ``ack_id`` in a ``StreamingModifyAckDeadlineRequest`` if 

1933 using streaming pull. The minimum custom deadline you can 

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

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

1936 a default value of 10 seconds is used. 

1937 

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

1939 request timeout for the call to the push endpoint. 

1940 

1941 If the subscriber never acknowledges the message, the 

1942 Pub/Sub system will eventually redeliver the message. 

1943 retain_acked_messages (bool): 

1944 Optional. Indicates whether to retain acknowledged messages. 

1945 If true, then messages are not expunged from the 

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

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

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

1949 timestamp] 

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

1951 in the past to replay previously-acknowledged messages. 

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

1953 Optional. How long to retain unacknowledged messages in the 

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

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

1956 also configures the retention of acknowledged messages, and 

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

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

1959 10 minutes. 

1960 labels (MutableMapping[str, str]): 

1961 Optional. See `Creating and managing 

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

1963 enable_message_ordering (bool): 

1964 Optional. If true, messages published with the same 

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

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

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

1968 order. 

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

1970 Optional. A policy that specifies the conditions for this 

1971 subscription's expiration. A subscription is considered 

1972 active as long as any connected subscriber is successfully 

1973 consuming messages from the subscription or is issuing 

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

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

1976 used. The minimum allowed value for 

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

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

1979 subscription never expires. 

1980 filter (str): 

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

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

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

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

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

1986 out. 

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

1988 Optional. A policy that specifies the conditions for dead 

1989 lettering messages in this subscription. If 

1990 dead_letter_policy is not set, dead lettering is disabled. 

1991 

1992 The Pub/Sub service account associated with this 

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

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

1995 must have permission to Acknowledge() messages on this 

1996 subscription. 

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

1998 Optional. A policy that specifies how Pub/Sub 

1999 retries message delivery for this subscription. 

2000 

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

2002 This generally implies that messages will be 

2003 retried as soon as possible for healthy 

2004 subscribers. RetryPolicy will be triggered on 

2005 NACKs or acknowledgment deadline exceeded events 

2006 for a given message. 

2007 detached (bool): 

2008 Optional. Indicates whether the subscription is detached 

2009 from its topic. Detached subscriptions don't receive 

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

2011 ``Pull`` and ``StreamingPull`` requests will return 

2012 FAILED_PRECONDITION. If the subscription is a push 

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

2014 enable_exactly_once_delivery (bool): 

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

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

2017 ``message_id`` on this subscription: 

2018 

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

2020 resent before the message's acknowledgment deadline 

2021 expires. 

2022 - An acknowledged message will not be resent to a 

2023 subscriber. 

2024 

2025 Note that subscribers may still receive multiple copies of a 

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

2027 message was published multiple times by a publisher client. 

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

2029 distinct ``message_id`` values. 

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

2031 Output only. Indicates the minimum duration for which a 

2032 message is retained after it is published to the 

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

2034 published to the subscription's topic in the last 

2035 ``topic_message_retention_duration`` are always available to 

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

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

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

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

2040 Output only. An output-only field indicating 

2041 whether or not the subscription can receive 

2042 messages. 

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

2044 Output only. Information about the associated 

2045 Analytics Hub subscription. Only set if the 

2046 subscritpion is created by Analytics Hub. 

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

2048 Optional. Transforms to be applied to 

2049 messages before they are delivered to 

2050 subscribers. Transforms are applied in the order 

2051 specified. 

2052 tags (MutableMapping[str, str]): 

2053 Optional. Input only. Immutable. Tag 

2054 keys/values directly bound to this resource. For 

2055 example: 

2056 

2057 "123/environment": "production", 

2058 "123/costCenter": "marketing". 

2059 """ 

2060 

2061 class State(proto.Enum): 

2062 r"""Possible states for a subscription. 

2063 

2064 Values: 

2065 STATE_UNSPECIFIED (0): 

2066 Default value. This value is unused. 

2067 ACTIVE (1): 

2068 The subscription can actively receive 

2069 messages 

2070 RESOURCE_ERROR (2): 

2071 The subscription cannot receive messages 

2072 because of an error with the resource to which 

2073 it pushes messages. See the more detailed error 

2074 state in the corresponding configuration. 

2075 """ 

2076 STATE_UNSPECIFIED = 0 

2077 ACTIVE = 1 

2078 RESOURCE_ERROR = 2 

2079 

2080 class AnalyticsHubSubscriptionInfo(proto.Message): 

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

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

2083 

2084 Attributes: 

2085 listing (str): 

2086 Optional. The name of the associated Analytics Hub listing 

2087 resource. Pattern: 

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

2089 subscription (str): 

2090 Optional. The name of the associated 

2091 Analytics Hub subscription resource. Pattern: 

2092 

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

2094 """ 

2095 

2096 listing: str = proto.Field( 

2097 proto.STRING, 

2098 number=1, 

2099 ) 

2100 subscription: str = proto.Field( 

2101 proto.STRING, 

2102 number=2, 

2103 ) 

2104 

2105 name: str = proto.Field( 

2106 proto.STRING, 

2107 number=1, 

2108 ) 

2109 topic: str = proto.Field( 

2110 proto.STRING, 

2111 number=2, 

2112 ) 

2113 push_config: "PushConfig" = proto.Field( 

2114 proto.MESSAGE, 

2115 number=4, 

2116 message="PushConfig", 

2117 ) 

2118 bigquery_config: "BigQueryConfig" = proto.Field( 

2119 proto.MESSAGE, 

2120 number=18, 

2121 message="BigQueryConfig", 

2122 ) 

2123 cloud_storage_config: "CloudStorageConfig" = proto.Field( 

2124 proto.MESSAGE, 

2125 number=22, 

2126 message="CloudStorageConfig", 

2127 ) 

2128 ack_deadline_seconds: int = proto.Field( 

2129 proto.INT32, 

2130 number=5, 

2131 ) 

2132 retain_acked_messages: bool = proto.Field( 

2133 proto.BOOL, 

2134 number=7, 

2135 ) 

2136 message_retention_duration: duration_pb2.Duration = proto.Field( 

2137 proto.MESSAGE, 

2138 number=8, 

2139 message=duration_pb2.Duration, 

2140 ) 

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

2142 proto.STRING, 

2143 proto.STRING, 

2144 number=9, 

2145 ) 

2146 enable_message_ordering: bool = proto.Field( 

2147 proto.BOOL, 

2148 number=10, 

2149 ) 

2150 expiration_policy: "ExpirationPolicy" = proto.Field( 

2151 proto.MESSAGE, 

2152 number=11, 

2153 message="ExpirationPolicy", 

2154 ) 

2155 filter: str = proto.Field( 

2156 proto.STRING, 

2157 number=12, 

2158 ) 

2159 dead_letter_policy: "DeadLetterPolicy" = proto.Field( 

2160 proto.MESSAGE, 

2161 number=13, 

2162 message="DeadLetterPolicy", 

2163 ) 

2164 retry_policy: "RetryPolicy" = proto.Field( 

2165 proto.MESSAGE, 

2166 number=14, 

2167 message="RetryPolicy", 

2168 ) 

2169 detached: bool = proto.Field( 

2170 proto.BOOL, 

2171 number=15, 

2172 ) 

2173 enable_exactly_once_delivery: bool = proto.Field( 

2174 proto.BOOL, 

2175 number=16, 

2176 ) 

2177 topic_message_retention_duration: duration_pb2.Duration = proto.Field( 

2178 proto.MESSAGE, 

2179 number=17, 

2180 message=duration_pb2.Duration, 

2181 ) 

2182 state: State = proto.Field( 

2183 proto.ENUM, 

2184 number=19, 

2185 enum=State, 

2186 ) 

2187 analytics_hub_subscription_info: AnalyticsHubSubscriptionInfo = proto.Field( 

2188 proto.MESSAGE, 

2189 number=23, 

2190 message=AnalyticsHubSubscriptionInfo, 

2191 ) 

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

2193 proto.MESSAGE, 

2194 number=25, 

2195 message="MessageTransform", 

2196 ) 

2197 tags: MutableMapping[str, str] = proto.MapField( 

2198 proto.STRING, 

2199 proto.STRING, 

2200 number=26, 

2201 ) 

2202 

2203 

2204class RetryPolicy(proto.Message): 

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

2206 

2207 Retry delay will be exponential based on provided minimum and 

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

2209 

2210 RetryPolicy will be triggered on NACKs or acknowledgment deadline 

2211 exceeded events for a given message. 

2212 

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

2214 delay between consecutive deliveries may not match the 

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

2216 backoff. 

2217 

2218 Attributes: 

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

2220 Optional. The minimum delay between 

2221 consecutive deliveries of a given message. Value 

2222 should be between 0 and 600 seconds. Defaults to 

2223 10 seconds. 

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

2225 Optional. The maximum delay between 

2226 consecutive deliveries of a given message. Value 

2227 should be between 0 and 600 seconds. Defaults to 

2228 600 seconds. 

2229 """ 

2230 

2231 minimum_backoff: duration_pb2.Duration = proto.Field( 

2232 proto.MESSAGE, 

2233 number=1, 

2234 message=duration_pb2.Duration, 

2235 ) 

2236 maximum_backoff: duration_pb2.Duration = proto.Field( 

2237 proto.MESSAGE, 

2238 number=2, 

2239 message=duration_pb2.Duration, 

2240 ) 

2241 

2242 

2243class DeadLetterPolicy(proto.Message): 

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

2245 message might be dead lettered multiple times. 

2246 

2247 If validation on any of the fields fails at subscription 

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

2249 fail. 

2250 

2251 Attributes: 

2252 dead_letter_topic (str): 

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

2254 messages should be published. Format is 

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

2256 account associated with the enclosing subscription's parent 

2257 project (i.e., 

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

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

2260 

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

2262 should ensure that there is a subscription attached to this 

2263 topic since messages published to a topic with no 

2264 subscriptions are lost. 

2265 max_delivery_attempts (int): 

2266 Optional. The maximum number of delivery attempts for any 

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

2268 

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

2270 of number of NACKs and number of times the acknowledgment 

2271 deadline has been exceeded for the message). 

2272 

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

2274 Note that client libraries may automatically extend 

2275 ack_deadlines. 

2276 

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

2278 

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

2280 """ 

2281 

2282 dead_letter_topic: str = proto.Field( 

2283 proto.STRING, 

2284 number=1, 

2285 ) 

2286 max_delivery_attempts: int = proto.Field( 

2287 proto.INT32, 

2288 number=2, 

2289 ) 

2290 

2291 

2292class ExpirationPolicy(proto.Message): 

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

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

2295 

2296 Attributes: 

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

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

2299 associated resource. The resource expires if it is not 

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

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

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

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

2304 associated resource never expires. 

2305 """ 

2306 

2307 ttl: duration_pb2.Duration = proto.Field( 

2308 proto.MESSAGE, 

2309 number=1, 

2310 message=duration_pb2.Duration, 

2311 ) 

2312 

2313 

2314class PushConfig(proto.Message): 

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

2316 

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

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

2319 Setting any member of the oneof automatically clears all other 

2320 members. 

2321 

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

2323 

2324 Attributes: 

2325 push_endpoint (str): 

2326 Optional. A URL locating the endpoint to which messages 

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

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

2329 attributes (MutableMapping[str, str]): 

2330 Optional. Endpoint configuration attributes that can be used 

2331 to control different aspects of the message delivery. 

2332 

2333 The only currently supported attribute is 

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

2335 of the pushed message. This attribute indicates the version 

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

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

2338 

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

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

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

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

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

2344 was created without this attribute. 

2345 

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

2347 attribute are: 

2348 

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

2350 Pub/Sub API. 

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

2352 v1 Pub/Sub API. 

2353 

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

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

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

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

2358 request for every pushed message. 

2359 

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

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

2362 Optional. When set, the payload to the push 

2363 endpoint is in the form of the JSON 

2364 representation of a PubsubMessage 

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

2366 

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

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

2369 Optional. When set, the payload to the push 

2370 endpoint is not wrapped. 

2371 

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

2373 """ 

2374 

2375 class OidcToken(proto.Message): 

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

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

2378 

2379 Attributes: 

2380 service_account_email (str): 

2381 Optional. `Service account 

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

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

2384 setting up authentication, see `Push 

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

2386 audience (str): 

2387 Optional. Audience to be used when generating 

2388 OIDC token. The audience claim identifies the 

2389 recipients that the JWT is intended for. The 

2390 audience value is a single case-sensitive 

2391 string. Having multiple values (array) for the 

2392 audience field is not supported. More info about 

2393 the OIDC JWT token audience here: 

2394 

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

2396 Note: if not specified, the Push endpoint URL 

2397 will be used. 

2398 """ 

2399 

2400 service_account_email: str = proto.Field( 

2401 proto.STRING, 

2402 number=1, 

2403 ) 

2404 audience: str = proto.Field( 

2405 proto.STRING, 

2406 number=2, 

2407 ) 

2408 

2409 class PubsubWrapper(proto.Message): 

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

2411 representation of a PubsubMessage 

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

2413 

2414 """ 

2415 

2416 class NoWrapper(proto.Message): 

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

2418 

2419 Attributes: 

2420 write_metadata (bool): 

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

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

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

2424 headers of the HTTP request. 

2425 """ 

2426 

2427 write_metadata: bool = proto.Field( 

2428 proto.BOOL, 

2429 number=1, 

2430 ) 

2431 

2432 push_endpoint: str = proto.Field( 

2433 proto.STRING, 

2434 number=1, 

2435 ) 

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

2437 proto.STRING, 

2438 proto.STRING, 

2439 number=2, 

2440 ) 

2441 oidc_token: OidcToken = proto.Field( 

2442 proto.MESSAGE, 

2443 number=3, 

2444 oneof="authentication_method", 

2445 message=OidcToken, 

2446 ) 

2447 pubsub_wrapper: PubsubWrapper = proto.Field( 

2448 proto.MESSAGE, 

2449 number=4, 

2450 oneof="wrapper", 

2451 message=PubsubWrapper, 

2452 ) 

2453 no_wrapper: NoWrapper = proto.Field( 

2454 proto.MESSAGE, 

2455 number=5, 

2456 oneof="wrapper", 

2457 message=NoWrapper, 

2458 ) 

2459 

2460 

2461class BigQueryConfig(proto.Message): 

2462 r"""Configuration for a BigQuery subscription. 

2463 

2464 Attributes: 

2465 table (str): 

2466 Optional. The name of the table to which to 

2467 write data, of the form 

2468 {projectId}.{datasetId}.{tableId} 

2469 use_topic_schema (bool): 

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

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

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

2473 write_metadata (bool): 

2474 Optional. When true, write the subscription name, 

2475 message_id, publish_time, attributes, and ordering_key to 

2476 additional columns in the table. The subscription name, 

2477 message_id, and publish_time fields are put in their own 

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

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

2480 drop_unknown_fields (bool): 

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

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

2483 BigQuery table schema are dropped when writing to BigQuery. 

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

2485 with extra fields are not written and remain in the 

2486 subscription's backlog. 

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

2488 Output only. An output-only field that 

2489 indicates whether or not the subscription can 

2490 receive messages. 

2491 use_table_schema (bool): 

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

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

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

2495 service_account_email (str): 

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

2497 The subscription creator or updater that specifies this 

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

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

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

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

2502 is used. 

2503 """ 

2504 

2505 class State(proto.Enum): 

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

2507 

2508 Values: 

2509 STATE_UNSPECIFIED (0): 

2510 Default value. This value is unused. 

2511 ACTIVE (1): 

2512 The subscription can actively send messages 

2513 to BigQuery 

2514 PERMISSION_DENIED (2): 

2515 Cannot write to the BigQuery table because of permission 

2516 denied errors. This can happen if 

2517 

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

2519 IAM 

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

2521 - bigquery.googleapis.com API is not enabled for the project 

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

2523 NOT_FOUND (3): 

2524 Cannot write to the BigQuery table because it 

2525 does not exist. 

2526 SCHEMA_MISMATCH (4): 

2527 Cannot write to the BigQuery table due to a 

2528 schema mismatch. 

2529 IN_TRANSIT_LOCATION_RESTRICTION (5): 

2530 Cannot write to the destination because enforce_in_transit 

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

2532 allowed regions. 

2533 """ 

2534 STATE_UNSPECIFIED = 0 

2535 ACTIVE = 1 

2536 PERMISSION_DENIED = 2 

2537 NOT_FOUND = 3 

2538 SCHEMA_MISMATCH = 4 

2539 IN_TRANSIT_LOCATION_RESTRICTION = 5 

2540 

2541 table: str = proto.Field( 

2542 proto.STRING, 

2543 number=1, 

2544 ) 

2545 use_topic_schema: bool = proto.Field( 

2546 proto.BOOL, 

2547 number=2, 

2548 ) 

2549 write_metadata: bool = proto.Field( 

2550 proto.BOOL, 

2551 number=3, 

2552 ) 

2553 drop_unknown_fields: bool = proto.Field( 

2554 proto.BOOL, 

2555 number=4, 

2556 ) 

2557 state: State = proto.Field( 

2558 proto.ENUM, 

2559 number=5, 

2560 enum=State, 

2561 ) 

2562 use_table_schema: bool = proto.Field( 

2563 proto.BOOL, 

2564 number=6, 

2565 ) 

2566 service_account_email: str = proto.Field( 

2567 proto.STRING, 

2568 number=7, 

2569 ) 

2570 

2571 

2572class CloudStorageConfig(proto.Message): 

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

2574 

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

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

2577 Setting any member of the oneof automatically clears all other 

2578 members. 

2579 

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

2581 

2582 Attributes: 

2583 bucket (str): 

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

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

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

2587 requirements] 

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

2589 filename_prefix (str): 

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

2591 See the `object naming 

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

2593 filename_suffix (str): 

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

2595 See the `object naming 

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

2597 Must not end in "/". 

2598 filename_datetime_format (str): 

2599 Optional. User-provided format string specifying how to 

2600 represent datetimes in Cloud Storage filenames. See the 

2601 `datetime format 

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

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

2604 Optional. If set, message data will be 

2605 written to Cloud Storage in text format. 

2606 

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

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

2609 Optional. If set, message data will be 

2610 written to Cloud Storage in Avro format. 

2611 

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

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

2614 Optional. The maximum duration that can 

2615 elapse before a new Cloud Storage file is 

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

2617 minutes. May not exceed the subscription's 

2618 acknowledgment deadline. 

2619 max_bytes (int): 

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

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

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

2623 messages are larger than the limit. 

2624 max_messages (int): 

2625 Optional. The maximum number of messages that 

2626 can be written to a Cloud Storage file before a 

2627 new file is created. Min 1000 messages. 

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

2629 Output only. An output-only field that 

2630 indicates whether or not the subscription can 

2631 receive messages. 

2632 service_account_email (str): 

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

2634 Storage. The subscription creator or updater that specifies 

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

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

2637 Pub/Sub `service 

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

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

2640 is used. 

2641 """ 

2642 

2643 class State(proto.Enum): 

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

2645 

2646 Values: 

2647 STATE_UNSPECIFIED (0): 

2648 Default value. This value is unused. 

2649 ACTIVE (1): 

2650 The subscription can actively send messages 

2651 to Cloud Storage. 

2652 PERMISSION_DENIED (2): 

2653 Cannot write to the Cloud Storage bucket 

2654 because of permission denied errors. 

2655 NOT_FOUND (3): 

2656 Cannot write to the Cloud Storage bucket 

2657 because it does not exist. 

2658 IN_TRANSIT_LOCATION_RESTRICTION (4): 

2659 Cannot write to the destination because enforce_in_transit 

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

2661 allowed regions. 

2662 SCHEMA_MISMATCH (5): 

2663 Cannot write to the Cloud Storage bucket due 

2664 to an incompatibility between the topic schema 

2665 and subscription settings. 

2666 """ 

2667 STATE_UNSPECIFIED = 0 

2668 ACTIVE = 1 

2669 PERMISSION_DENIED = 2 

2670 NOT_FOUND = 3 

2671 IN_TRANSIT_LOCATION_RESTRICTION = 4 

2672 SCHEMA_MISMATCH = 5 

2673 

2674 class TextConfig(proto.Message): 

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

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

2677 by a newline. 

2678 

2679 """ 

2680 

2681 class AvroConfig(proto.Message): 

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

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

2684 Avro binary. 

2685 

2686 Attributes: 

2687 write_metadata (bool): 

2688 Optional. When true, write the subscription name, 

2689 message_id, publish_time, attributes, and ordering_key as 

2690 additional fields in the output. The subscription name, 

2691 message_id, and publish_time fields are put in their own 

2692 fields while all other message properties other than data 

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

2694 entries in the attributes map. 

2695 use_topic_schema (bool): 

2696 Optional. When true, the output Cloud Storage 

2697 file will be serialized using the topic schema, 

2698 if it exists. 

2699 """ 

2700 

2701 write_metadata: bool = proto.Field( 

2702 proto.BOOL, 

2703 number=1, 

2704 ) 

2705 use_topic_schema: bool = proto.Field( 

2706 proto.BOOL, 

2707 number=2, 

2708 ) 

2709 

2710 bucket: str = proto.Field( 

2711 proto.STRING, 

2712 number=1, 

2713 ) 

2714 filename_prefix: str = proto.Field( 

2715 proto.STRING, 

2716 number=2, 

2717 ) 

2718 filename_suffix: str = proto.Field( 

2719 proto.STRING, 

2720 number=3, 

2721 ) 

2722 filename_datetime_format: str = proto.Field( 

2723 proto.STRING, 

2724 number=10, 

2725 ) 

2726 text_config: TextConfig = proto.Field( 

2727 proto.MESSAGE, 

2728 number=4, 

2729 oneof="output_format", 

2730 message=TextConfig, 

2731 ) 

2732 avro_config: AvroConfig = proto.Field( 

2733 proto.MESSAGE, 

2734 number=5, 

2735 oneof="output_format", 

2736 message=AvroConfig, 

2737 ) 

2738 max_duration: duration_pb2.Duration = proto.Field( 

2739 proto.MESSAGE, 

2740 number=6, 

2741 message=duration_pb2.Duration, 

2742 ) 

2743 max_bytes: int = proto.Field( 

2744 proto.INT64, 

2745 number=7, 

2746 ) 

2747 max_messages: int = proto.Field( 

2748 proto.INT64, 

2749 number=8, 

2750 ) 

2751 state: State = proto.Field( 

2752 proto.ENUM, 

2753 number=9, 

2754 enum=State, 

2755 ) 

2756 service_account_email: str = proto.Field( 

2757 proto.STRING, 

2758 number=11, 

2759 ) 

2760 

2761 

2762class ReceivedMessage(proto.Message): 

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

2764 

2765 Attributes: 

2766 ack_id (str): 

2767 Optional. This ID can be used to acknowledge 

2768 the received message. 

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

2770 Optional. The message. 

2771 delivery_attempt (int): 

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

2773 attempted to deliver the associated message to a subscriber. 

2774 

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

2776 ack_deadline exceeds) for this message. 

2777 

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

2779 An ack_deadline exceeds event is whenever a message is not 

2780 acknowledged within ack_deadline. Note that ack_deadline is 

2781 initially Subscription.ackDeadlineSeconds, but may get 

2782 extended automatically by the client library. 

2783 

2784 Upon the first delivery of a given message, 

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

2786 calculated at best effort and is approximate. 

2787 

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

2789 will be 0. 

2790 """ 

2791 

2792 ack_id: str = proto.Field( 

2793 proto.STRING, 

2794 number=1, 

2795 ) 

2796 message: "PubsubMessage" = proto.Field( 

2797 proto.MESSAGE, 

2798 number=2, 

2799 message="PubsubMessage", 

2800 ) 

2801 delivery_attempt: int = proto.Field( 

2802 proto.INT32, 

2803 number=3, 

2804 ) 

2805 

2806 

2807class GetSubscriptionRequest(proto.Message): 

2808 r"""Request for the GetSubscription method. 

2809 

2810 Attributes: 

2811 subscription (str): 

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

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

2814 """ 

2815 

2816 subscription: str = proto.Field( 

2817 proto.STRING, 

2818 number=1, 

2819 ) 

2820 

2821 

2822class UpdateSubscriptionRequest(proto.Message): 

2823 r"""Request for the UpdateSubscription method. 

2824 

2825 Attributes: 

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

2827 Required. The updated subscription object. 

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

2829 Required. Indicates which fields in the 

2830 provided subscription to update. Must be 

2831 specified and non-empty. 

2832 """ 

2833 

2834 subscription: "Subscription" = proto.Field( 

2835 proto.MESSAGE, 

2836 number=1, 

2837 message="Subscription", 

2838 ) 

2839 update_mask: field_mask_pb2.FieldMask = proto.Field( 

2840 proto.MESSAGE, 

2841 number=2, 

2842 message=field_mask_pb2.FieldMask, 

2843 ) 

2844 

2845 

2846class ListSubscriptionsRequest(proto.Message): 

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

2848 

2849 Attributes: 

2850 project (str): 

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

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

2853 page_size (int): 

2854 Optional. Maximum number of subscriptions to 

2855 return. 

2856 page_token (str): 

2857 Optional. The value returned by the last 

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

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

2860 the system should return the next page of data. 

2861 """ 

2862 

2863 project: str = proto.Field( 

2864 proto.STRING, 

2865 number=1, 

2866 ) 

2867 page_size: int = proto.Field( 

2868 proto.INT32, 

2869 number=2, 

2870 ) 

2871 page_token: str = proto.Field( 

2872 proto.STRING, 

2873 number=3, 

2874 ) 

2875 

2876 

2877class ListSubscriptionsResponse(proto.Message): 

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

2879 

2880 Attributes: 

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

2882 Optional. The subscriptions that match the 

2883 request. 

2884 next_page_token (str): 

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

2886 subscriptions that match the request; this value should be 

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

2888 subscriptions. 

2889 """ 

2890 

2891 @property 

2892 def raw_page(self): 

2893 return self 

2894 

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

2896 proto.MESSAGE, 

2897 number=1, 

2898 message="Subscription", 

2899 ) 

2900 next_page_token: str = proto.Field( 

2901 proto.STRING, 

2902 number=2, 

2903 ) 

2904 

2905 

2906class DeleteSubscriptionRequest(proto.Message): 

2907 r"""Request for the DeleteSubscription method. 

2908 

2909 Attributes: 

2910 subscription (str): 

2911 Required. The subscription to delete. Format is 

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

2913 """ 

2914 

2915 subscription: str = proto.Field( 

2916 proto.STRING, 

2917 number=1, 

2918 ) 

2919 

2920 

2921class ModifyPushConfigRequest(proto.Message): 

2922 r"""Request for the ModifyPushConfig method. 

2923 

2924 Attributes: 

2925 subscription (str): 

2926 Required. The name of the subscription. Format is 

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

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

2929 Required. The push configuration for future deliveries. 

2930 

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

2932 should stop pushing messages from the given subscription and 

2933 allow messages to be pulled and acknowledged - effectively 

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

2935 not called. 

2936 """ 

2937 

2938 subscription: str = proto.Field( 

2939 proto.STRING, 

2940 number=1, 

2941 ) 

2942 push_config: "PushConfig" = proto.Field( 

2943 proto.MESSAGE, 

2944 number=2, 

2945 message="PushConfig", 

2946 ) 

2947 

2948 

2949class PullRequest(proto.Message): 

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

2951 

2952 Attributes: 

2953 subscription (str): 

2954 Required. The subscription from which messages should be 

2955 pulled. Format is 

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

2957 return_immediately (bool): 

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

2959 immediately even if it there are no messages available to 

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

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

2962 message is available, rather than returning no messages. 

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

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

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

2966 max_messages (int): 

2967 Required. The maximum number of messages to 

2968 return for this request. Must be a positive 

2969 integer. The Pub/Sub system may return fewer 

2970 than the number specified. 

2971 """ 

2972 

2973 subscription: str = proto.Field( 

2974 proto.STRING, 

2975 number=1, 

2976 ) 

2977 return_immediately: bool = proto.Field( 

2978 proto.BOOL, 

2979 number=2, 

2980 ) 

2981 max_messages: int = proto.Field( 

2982 proto.INT32, 

2983 number=3, 

2984 ) 

2985 

2986 

2987class PullResponse(proto.Message): 

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

2989 

2990 Attributes: 

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

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

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

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

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

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

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

2998 """ 

2999 

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

3001 proto.MESSAGE, 

3002 number=1, 

3003 message="ReceivedMessage", 

3004 ) 

3005 

3006 

3007class ModifyAckDeadlineRequest(proto.Message): 

3008 r"""Request for the ModifyAckDeadline method. 

3009 

3010 Attributes: 

3011 subscription (str): 

3012 Required. The name of the subscription. Format is 

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

3014 ack_ids (MutableSequence[str]): 

3015 Required. List of acknowledgment IDs. 

3016 ack_deadline_seconds (int): 

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

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

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

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

3021 zero might immediately make the message available for 

3022 delivery to another subscriber client. This typically 

3023 results in an increase in the rate of message redeliveries 

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

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

3026 single request is 600 seconds (10 minutes). 

3027 """ 

3028 

3029 subscription: str = proto.Field( 

3030 proto.STRING, 

3031 number=1, 

3032 ) 

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

3034 proto.STRING, 

3035 number=4, 

3036 ) 

3037 ack_deadline_seconds: int = proto.Field( 

3038 proto.INT32, 

3039 number=3, 

3040 ) 

3041 

3042 

3043class AcknowledgeRequest(proto.Message): 

3044 r"""Request for the Acknowledge method. 

3045 

3046 Attributes: 

3047 subscription (str): 

3048 Required. The subscription whose message is being 

3049 acknowledged. Format is 

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

3051 ack_ids (MutableSequence[str]): 

3052 Required. The acknowledgment ID for the messages being 

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

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

3055 """ 

3056 

3057 subscription: str = proto.Field( 

3058 proto.STRING, 

3059 number=1, 

3060 ) 

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

3062 proto.STRING, 

3063 number=2, 

3064 ) 

3065 

3066 

3067class StreamingPullRequest(proto.Message): 

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

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

3070 acknowledgments and ack deadline modifications from the client to 

3071 the server. 

3072 

3073 Attributes: 

3074 subscription (str): 

3075 Required. The subscription for which to initialize the new 

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

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

3078 client to server. Format is 

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

3080 ack_ids (MutableSequence[str]): 

3081 Optional. List of acknowledgment IDs for acknowledging 

3082 previously received messages (received on this stream or a 

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

3084 corresponding message may be redelivered later. 

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

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

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

3088 modify_deadline_seconds (MutableSequence[int]): 

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

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

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

3092 it differs the stream will be aborted with 

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

3094 to the element in the same position in 

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

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

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

3098 new ack deadline will expire 10 seconds after this request 

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

3100 made available for another streaming or non-streaming pull 

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

3102 aborted with status ``INVALID_ARGUMENT``. 

3103 modify_deadline_ack_ids (MutableSequence[str]): 

3104 Optional. List of acknowledgment IDs whose deadline will be 

3105 modified based on the corresponding element in 

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

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

3108 the subscriber, or to make the message available for 

3109 redelivery if the processing was interrupted. 

3110 stream_ack_deadline_seconds (int): 

3111 Required. The ack deadline to use for the 

3112 stream. This must be provided in the first 

3113 request on the stream, but it can also be 

3114 updated on subsequent requests from client to 

3115 server. The minimum deadline you can specify is 

3116 10 seconds. The maximum deadline you can specify 

3117 is 600 seconds (10 minutes). 

3118 client_id (str): 

3119 Optional. A unique identifier that is used to distinguish 

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

3121 on the initial request. When a stream disconnects and 

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

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

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

3125 client_id should not be used for different client instances. 

3126 max_outstanding_messages (int): 

3127 Optional. Flow control settings for the maximum number of 

3128 outstanding messages. When there are 

3129 ``max_outstanding_messages`` currently sent to the streaming 

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

3131 server stops sending more messages. The sending of messages 

3132 resumes once the number of outstanding messages is less than 

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

3134 number of outstanding messages. This property can only be 

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

3136 subsequent request, the stream will be aborted with status 

3137 ``INVALID_ARGUMENT``. 

3138 max_outstanding_bytes (int): 

3139 Optional. Flow control settings for the maximum number of 

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

3141 or more worth of messages currently sent to the streaming 

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

3143 server will stop sending more messages. The sending of 

3144 messages resumes once the number of outstanding bytes is 

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

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

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

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

3149 status ``INVALID_ARGUMENT``. 

3150 protocol_version (int): 

3151 Optional. The protocol version used by the client. This 

3152 property can only be set on the initial 

3153 StreamingPullRequest. If it is set on a subsequent request, 

3154 the stream will be aborted with status ``INVALID_ARGUMENT``. 

3155 """ 

3156 

3157 subscription: str = proto.Field( 

3158 proto.STRING, 

3159 number=1, 

3160 ) 

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

3162 proto.STRING, 

3163 number=2, 

3164 ) 

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

3166 proto.INT32, 

3167 number=3, 

3168 ) 

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

3170 proto.STRING, 

3171 number=4, 

3172 ) 

3173 stream_ack_deadline_seconds: int = proto.Field( 

3174 proto.INT32, 

3175 number=5, 

3176 ) 

3177 client_id: str = proto.Field( 

3178 proto.STRING, 

3179 number=6, 

3180 ) 

3181 max_outstanding_messages: int = proto.Field( 

3182 proto.INT64, 

3183 number=7, 

3184 ) 

3185 max_outstanding_bytes: int = proto.Field( 

3186 proto.INT64, 

3187 number=8, 

3188 ) 

3189 protocol_version: int = proto.Field( 

3190 proto.INT64, 

3191 number=10, 

3192 ) 

3193 

3194 

3195class StreamingPullResponse(proto.Message): 

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

3197 stream messages from the server to the client. 

3198 

3199 Attributes: 

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

3201 Optional. Received Pub/Sub messages. 

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

3203 Optional. This field will only be set if 

3204 ``enable_exactly_once_delivery`` is set to ``true`` and is 

3205 not guaranteed to be populated. 

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

3207 Optional. This field will only be set if 

3208 ``enable_exactly_once_delivery`` is set to ``true`` and is 

3209 not guaranteed to be populated. 

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

3211 Optional. Properties associated with this 

3212 subscription. 

3213 """ 

3214 

3215 class AcknowledgeConfirmation(proto.Message): 

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

3217 acknowledge a previously received message. 

3218 

3219 Attributes: 

3220 ack_ids (MutableSequence[str]): 

3221 Optional. Successfully processed 

3222 acknowledgment IDs. 

3223 invalid_ack_ids (MutableSequence[str]): 

3224 Optional. List of acknowledgment IDs that 

3225 were malformed or whose acknowledgment deadline 

3226 has expired. 

3227 unordered_ack_ids (MutableSequence[str]): 

3228 Optional. List of acknowledgment IDs that 

3229 were out of order. 

3230 temporary_failed_ack_ids (MutableSequence[str]): 

3231 Optional. List of acknowledgment IDs that 

3232 failed processing with temporary issues. 

3233 """ 

3234 

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

3236 proto.STRING, 

3237 number=1, 

3238 ) 

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

3240 proto.STRING, 

3241 number=2, 

3242 ) 

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

3244 proto.STRING, 

3245 number=3, 

3246 ) 

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

3248 proto.STRING, 

3249 number=4, 

3250 ) 

3251 

3252 class ModifyAckDeadlineConfirmation(proto.Message): 

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

3254 modify the deadline for a specific message. 

3255 

3256 Attributes: 

3257 ack_ids (MutableSequence[str]): 

3258 Optional. Successfully processed 

3259 acknowledgment IDs. 

3260 invalid_ack_ids (MutableSequence[str]): 

3261 Optional. List of acknowledgment IDs that 

3262 were malformed or whose acknowledgment deadline 

3263 has expired. 

3264 temporary_failed_ack_ids (MutableSequence[str]): 

3265 Optional. List of acknowledgment IDs that 

3266 failed processing with temporary issues. 

3267 """ 

3268 

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

3270 proto.STRING, 

3271 number=1, 

3272 ) 

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

3274 proto.STRING, 

3275 number=2, 

3276 ) 

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

3278 proto.STRING, 

3279 number=3, 

3280 ) 

3281 

3282 class SubscriptionProperties(proto.Message): 

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

3284 

3285 Attributes: 

3286 exactly_once_delivery_enabled (bool): 

3287 Optional. True iff exactly once delivery is 

3288 enabled for this subscription. 

3289 message_ordering_enabled (bool): 

3290 Optional. True iff message ordering is 

3291 enabled for this subscription. 

3292 """ 

3293 

3294 exactly_once_delivery_enabled: bool = proto.Field( 

3295 proto.BOOL, 

3296 number=1, 

3297 ) 

3298 message_ordering_enabled: bool = proto.Field( 

3299 proto.BOOL, 

3300 number=2, 

3301 ) 

3302 

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

3304 proto.MESSAGE, 

3305 number=1, 

3306 message="ReceivedMessage", 

3307 ) 

3308 acknowledge_confirmation: AcknowledgeConfirmation = proto.Field( 

3309 proto.MESSAGE, 

3310 number=5, 

3311 message=AcknowledgeConfirmation, 

3312 ) 

3313 modify_ack_deadline_confirmation: ModifyAckDeadlineConfirmation = proto.Field( 

3314 proto.MESSAGE, 

3315 number=3, 

3316 message=ModifyAckDeadlineConfirmation, 

3317 ) 

3318 subscription_properties: SubscriptionProperties = proto.Field( 

3319 proto.MESSAGE, 

3320 number=4, 

3321 message=SubscriptionProperties, 

3322 ) 

3323 

3324 

3325class CreateSnapshotRequest(proto.Message): 

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

3327 

3328 Attributes: 

3329 name (str): 

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

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

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

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

3334 specify a name. See the `resource name 

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

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

3337 subscription (str): 

3338 Required. The subscription whose backlog the snapshot 

3339 retains. Specifically, the created snapshot is guaranteed to 

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

3341 precisely, this is defined as the messages in the 

3342 subscription's backlog that are unacknowledged upon the 

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

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

3345 topic following the successful completion of the 

3346 CreateSnapshot request. Format is 

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

3348 labels (MutableMapping[str, str]): 

3349 Optional. See `Creating and managing 

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

3351 tags (MutableMapping[str, str]): 

3352 Optional. Input only. Immutable. Tag 

3353 keys/values directly bound to this resource. For 

3354 example: 

3355 

3356 "123/environment": "production", 

3357 "123/costCenter": "marketing". 

3358 """ 

3359 

3360 name: str = proto.Field( 

3361 proto.STRING, 

3362 number=1, 

3363 ) 

3364 subscription: str = proto.Field( 

3365 proto.STRING, 

3366 number=2, 

3367 ) 

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

3369 proto.STRING, 

3370 proto.STRING, 

3371 number=3, 

3372 ) 

3373 tags: MutableMapping[str, str] = proto.MapField( 

3374 proto.STRING, 

3375 proto.STRING, 

3376 number=4, 

3377 ) 

3378 

3379 

3380class UpdateSnapshotRequest(proto.Message): 

3381 r"""Request for the UpdateSnapshot method. 

3382 

3383 Attributes: 

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

3385 Required. The updated snapshot object. 

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

3387 Required. Indicates which fields in the 

3388 provided snapshot to update. Must be specified 

3389 and non-empty. 

3390 """ 

3391 

3392 snapshot: "Snapshot" = proto.Field( 

3393 proto.MESSAGE, 

3394 number=1, 

3395 message="Snapshot", 

3396 ) 

3397 update_mask: field_mask_pb2.FieldMask = proto.Field( 

3398 proto.MESSAGE, 

3399 number=2, 

3400 message=field_mask_pb2.FieldMask, 

3401 ) 

3402 

3403 

3404class Snapshot(proto.Message): 

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

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

3407 operations, which allow you to manage message acknowledgments in 

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

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

3410 

3411 Attributes: 

3412 name (str): 

3413 Optional. The name of the snapshot. 

3414 topic (str): 

3415 Optional. The name of the topic from which 

3416 this snapshot is retaining messages. 

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

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

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

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

3421 determined at creation by the existing backlog in the source 

3422 subscription. Specifically, the lifetime of the snapshot is 

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

3424 For example, consider a subscription whose oldest unacked 

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

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

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

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

3429 snapshot that would expire in less than 1 hour after 

3430 creation. 

3431 labels (MutableMapping[str, str]): 

3432 Optional. See [Creating and managing labels] 

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

3434 """ 

3435 

3436 name: str = proto.Field( 

3437 proto.STRING, 

3438 number=1, 

3439 ) 

3440 topic: str = proto.Field( 

3441 proto.STRING, 

3442 number=2, 

3443 ) 

3444 expire_time: timestamp_pb2.Timestamp = proto.Field( 

3445 proto.MESSAGE, 

3446 number=3, 

3447 message=timestamp_pb2.Timestamp, 

3448 ) 

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

3450 proto.STRING, 

3451 proto.STRING, 

3452 number=4, 

3453 ) 

3454 

3455 

3456class GetSnapshotRequest(proto.Message): 

3457 r"""Request for the GetSnapshot method. 

3458 

3459 Attributes: 

3460 snapshot (str): 

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

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

3463 """ 

3464 

3465 snapshot: str = proto.Field( 

3466 proto.STRING, 

3467 number=1, 

3468 ) 

3469 

3470 

3471class ListSnapshotsRequest(proto.Message): 

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

3473 

3474 Attributes: 

3475 project (str): 

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

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

3478 page_size (int): 

3479 Optional. Maximum number of snapshots to 

3480 return. 

3481 page_token (str): 

3482 Optional. The value returned by the last 

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

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

3485 system should return the next page of data. 

3486 """ 

3487 

3488 project: str = proto.Field( 

3489 proto.STRING, 

3490 number=1, 

3491 ) 

3492 page_size: int = proto.Field( 

3493 proto.INT32, 

3494 number=2, 

3495 ) 

3496 page_token: str = proto.Field( 

3497 proto.STRING, 

3498 number=3, 

3499 ) 

3500 

3501 

3502class ListSnapshotsResponse(proto.Message): 

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

3504 

3505 Attributes: 

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

3507 Optional. The resulting snapshots. 

3508 next_page_token (str): 

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

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

3511 in a new ``ListSnapshotsRequest``. 

3512 """ 

3513 

3514 @property 

3515 def raw_page(self): 

3516 return self 

3517 

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

3519 proto.MESSAGE, 

3520 number=1, 

3521 message="Snapshot", 

3522 ) 

3523 next_page_token: str = proto.Field( 

3524 proto.STRING, 

3525 number=2, 

3526 ) 

3527 

3528 

3529class DeleteSnapshotRequest(proto.Message): 

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

3531 

3532 Attributes: 

3533 snapshot (str): 

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

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

3536 """ 

3537 

3538 snapshot: str = proto.Field( 

3539 proto.STRING, 

3540 number=1, 

3541 ) 

3542 

3543 

3544class SeekRequest(proto.Message): 

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

3546 

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

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

3549 Setting any member of the oneof automatically clears all other 

3550 members. 

3551 

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

3553 

3554 Attributes: 

3555 subscription (str): 

3556 Required. The subscription to affect. 

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

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

3559 subscription that were published before this time are marked 

3560 as acknowledged, and messages retained in the subscription 

3561 that were published after this time are marked as 

3562 unacknowledged. Note that this operation affects only those 

3563 messages retained in the subscription (configured by the 

3564 combination of ``message_retention_duration`` and 

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

3566 corresponds to a point before the message retention window 

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

3568 subscription creation time), only retained messages will be 

3569 marked as unacknowledged, and already-expunged messages will 

3570 not be restored. 

3571 

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

3573 snapshot (str): 

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

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

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

3577 

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

3579 """ 

3580 

3581 subscription: str = proto.Field( 

3582 proto.STRING, 

3583 number=1, 

3584 ) 

3585 time: timestamp_pb2.Timestamp = proto.Field( 

3586 proto.MESSAGE, 

3587 number=2, 

3588 oneof="target", 

3589 message=timestamp_pb2.Timestamp, 

3590 ) 

3591 snapshot: str = proto.Field( 

3592 proto.STRING, 

3593 number=3, 

3594 oneof="target", 

3595 ) 

3596 

3597 

3598class SeekResponse(proto.Message): 

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

3600 

3601 

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