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

416 statements  

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

2# Copyright 2025 Google LLC 

3# 

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

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

6# You may obtain a copy of the License at 

7# 

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

9# 

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

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

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

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

14# limitations under the License. 

15# 

16from __future__ import annotations 

17 

18from typing import MutableMapping, MutableSequence 

19 

20import proto # type: ignore 

21 

22from google.protobuf import duration_pb2 # type: ignore 

23from google.protobuf import field_mask_pb2 # type: ignore 

24from google.protobuf import timestamp_pb2 # type: ignore 

25from google.pubsub_v1.types import schema as gp_schema 

26 

27 

28__protobuf__ = proto.module( 

29 package="google.pubsub.v1", 

30 manifest={ 

31 "MessageStoragePolicy", 

32 "SchemaSettings", 

33 "IngestionDataSourceSettings", 

34 "PlatformLogsSettings", 

35 "IngestionFailureEvent", 

36 "JavaScriptUDF", 

37 "MessageTransform", 

38 "Topic", 

39 "PubsubMessage", 

40 "GetTopicRequest", 

41 "UpdateTopicRequest", 

42 "PublishRequest", 

43 "PublishResponse", 

44 "ListTopicsRequest", 

45 "ListTopicsResponse", 

46 "ListTopicSubscriptionsRequest", 

47 "ListTopicSubscriptionsResponse", 

48 "ListTopicSnapshotsRequest", 

49 "ListTopicSnapshotsResponse", 

50 "DeleteTopicRequest", 

51 "DetachSubscriptionRequest", 

52 "DetachSubscriptionResponse", 

53 "Subscription", 

54 "RetryPolicy", 

55 "DeadLetterPolicy", 

56 "ExpirationPolicy", 

57 "PushConfig", 

58 "BigQueryConfig", 

59 "CloudStorageConfig", 

60 "ReceivedMessage", 

61 "GetSubscriptionRequest", 

62 "UpdateSubscriptionRequest", 

63 "ListSubscriptionsRequest", 

64 "ListSubscriptionsResponse", 

65 "DeleteSubscriptionRequest", 

66 "ModifyPushConfigRequest", 

67 "PullRequest", 

68 "PullResponse", 

69 "ModifyAckDeadlineRequest", 

70 "AcknowledgeRequest", 

71 "StreamingPullRequest", 

72 "StreamingPullResponse", 

73 "CreateSnapshotRequest", 

74 "UpdateSnapshotRequest", 

75 "Snapshot", 

76 "GetSnapshotRequest", 

77 "ListSnapshotsRequest", 

78 "ListSnapshotsResponse", 

79 "DeleteSnapshotRequest", 

80 "SeekRequest", 

81 "SeekResponse", 

82 }, 

83) 

84 

85 

86class MessageStoragePolicy(proto.Message): 

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

88 the topic. 

89 

90 Attributes: 

91 allowed_persistence_regions (MutableSequence[str]): 

92 Optional. A list of IDs of Google Cloud 

93 regions where messages that are published to the 

94 topic may be persisted in storage. Messages 

95 published by publishers running in non-allowed 

96 Google Cloud regions (or running outside of 

97 Google Cloud altogether) are routed for storage 

98 in one of the allowed regions. An empty list 

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

100 valid configuration. 

101 enforce_in_transit (bool): 

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

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

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

105 subscribe operations on any subscription attached to this 

106 topic in any region that is not in 

107 ``allowed_persistence_regions``. 

108 """ 

109 

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

111 proto.STRING, 

112 number=1, 

113 ) 

114 enforce_in_transit: bool = proto.Field( 

115 proto.BOOL, 

116 number=2, 

117 ) 

118 

119 

120class SchemaSettings(proto.Message): 

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

122 

123 Attributes: 

124 schema (str): 

125 Required. The name of the schema that messages published 

126 should be validated against. Format is 

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

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

129 deleted. 

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

131 Optional. The encoding of messages validated against 

132 ``schema``. 

133 first_revision_id (str): 

134 Optional. The minimum (inclusive) revision allowed for 

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

136 revision to be validated against last_revision or any 

137 revision created before. 

138 last_revision_id (str): 

139 Optional. The maximum (inclusive) revision allowed for 

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

141 revision to be validated against first_revision or any 

142 revision created after. 

143 """ 

144 

145 schema: str = proto.Field( 

146 proto.STRING, 

147 number=1, 

148 ) 

149 encoding: gp_schema.Encoding = proto.Field( 

150 proto.ENUM, 

151 number=2, 

152 enum=gp_schema.Encoding, 

153 ) 

154 first_revision_id: str = proto.Field( 

155 proto.STRING, 

156 number=3, 

157 ) 

158 last_revision_id: str = proto.Field( 

159 proto.STRING, 

160 number=4, 

161 ) 

162 

163 

164class IngestionDataSourceSettings(proto.Message): 

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

166 

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

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

169 Setting any member of the oneof automatically clears all other 

170 members. 

171 

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

173 

174 Attributes: 

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

176 Optional. Amazon Kinesis Data Streams. 

177 

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

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

180 Optional. Cloud Storage. 

181 

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

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

184 Optional. Azure Event Hubs. 

185 

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

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

188 Optional. Amazon MSK. 

189 

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

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

192 Optional. Confluent Cloud. 

193 

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

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

196 Optional. Platform Logs settings. If unset, 

197 no Platform Logs will be generated. 

198 """ 

199 

200 class AwsKinesis(proto.Message): 

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

202 

203 Attributes: 

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

205 Output only. An output-only field that 

206 indicates the state of the Kinesis ingestion 

207 source. 

208 stream_arn (str): 

209 Required. The Kinesis stream ARN to ingest 

210 data from. 

211 consumer_arn (str): 

212 Required. The Kinesis consumer ARN to used 

213 for ingestion in Enhanced Fan-Out mode. The 

214 consumer must be already created and ready to be 

215 used. 

216 aws_role_arn (str): 

217 Required. AWS role ARN to be used for 

218 Federated Identity authentication with Kinesis. 

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

220 role and the required permissions that need to 

221 be attached to it. 

222 gcp_service_account (str): 

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

224 Identity authentication with Kinesis (via a 

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

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

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

228 number. 

229 """ 

230 

231 class State(proto.Enum): 

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

233 Streams. 

234 

235 Values: 

236 STATE_UNSPECIFIED (0): 

237 Default value. This value is unused. 

238 ACTIVE (1): 

239 Ingestion is active. 

240 KINESIS_PERMISSION_DENIED (2): 

241 Permission denied encountered while consuming data from 

242 Kinesis. This can happen if: 

243 

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

245 have the appropriate permissions attached. 

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

247 Identity Federation using ``gcp_service_account``. 

248 - The Pub/Sub SA is not granted the 

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

250 ``gcp_service_account``. 

251 PUBLISH_PERMISSION_DENIED (3): 

252 Permission denied encountered while publishing to the topic. 

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

254 `appropriate publish 

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

256 STREAM_NOT_FOUND (4): 

257 The Kinesis stream does not exist. 

258 CONSUMER_NOT_FOUND (5): 

259 The Kinesis consumer does not exist. 

260 """ 

261 STATE_UNSPECIFIED = 0 

262 ACTIVE = 1 

263 KINESIS_PERMISSION_DENIED = 2 

264 PUBLISH_PERMISSION_DENIED = 3 

265 STREAM_NOT_FOUND = 4 

266 CONSUMER_NOT_FOUND = 5 

267 

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

269 proto.ENUM, 

270 number=1, 

271 enum="IngestionDataSourceSettings.AwsKinesis.State", 

272 ) 

273 stream_arn: str = proto.Field( 

274 proto.STRING, 

275 number=2, 

276 ) 

277 consumer_arn: str = proto.Field( 

278 proto.STRING, 

279 number=3, 

280 ) 

281 aws_role_arn: str = proto.Field( 

282 proto.STRING, 

283 number=4, 

284 ) 

285 gcp_service_account: str = proto.Field( 

286 proto.STRING, 

287 number=5, 

288 ) 

289 

290 class CloudStorage(proto.Message): 

291 r"""Ingestion settings for Cloud Storage. 

292 

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

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

295 Setting any member of the oneof automatically clears all other 

296 members. 

297 

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

299 

300 Attributes: 

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

302 Output only. An output-only field that 

303 indicates the state of the Cloud Storage 

304 ingestion source. 

305 bucket (str): 

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

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

308 requirements] 

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

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

311 Optional. Data from Cloud Storage will be 

312 interpreted as text. 

313 

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

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

316 Optional. Data from Cloud Storage will be 

317 interpreted in Avro format. 

318 

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

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

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

322 written via `Cloud Storage 

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

324 

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

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

327 Optional. Only objects with a larger or equal 

328 creation timestamp will be ingested. 

329 match_glob (str): 

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

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

332 `supported 

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

334 """ 

335 

336 class State(proto.Enum): 

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

338 

339 Values: 

340 STATE_UNSPECIFIED (0): 

341 Default value. This value is unused. 

342 ACTIVE (1): 

343 Ingestion is active. 

344 CLOUD_STORAGE_PERMISSION_DENIED (2): 

345 Permission denied encountered while calling the Cloud 

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

347 granted the `appropriate 

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

349 

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

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

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

353 PUBLISH_PERMISSION_DENIED (3): 

354 Permission denied encountered while publishing to the topic. 

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

356 `appropriate publish 

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

358 BUCKET_NOT_FOUND (4): 

359 The provided Cloud Storage bucket doesn't 

360 exist. 

361 TOO_MANY_OBJECTS (5): 

362 The Cloud Storage bucket has too many 

363 objects, ingestion will be paused. 

364 """ 

365 STATE_UNSPECIFIED = 0 

366 ACTIVE = 1 

367 CLOUD_STORAGE_PERMISSION_DENIED = 2 

368 PUBLISH_PERMISSION_DENIED = 3 

369 BUCKET_NOT_FOUND = 4 

370 TOO_MANY_OBJECTS = 5 

371 

372 class TextFormat(proto.Message): 

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

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

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

376 

377 

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

379 

380 Attributes: 

381 delimiter (str): 

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

383 

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

385 """ 

386 

387 delimiter: str = proto.Field( 

388 proto.STRING, 

389 number=1, 

390 optional=True, 

391 ) 

392 

393 class AvroFormat(proto.Message): 

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

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

396 Pub/Sub message. 

397 

398 """ 

399 

400 class PubSubAvroFormat(proto.Message): 

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

402 Storage 

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

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

405 message will be restored when publishing. 

406 

407 """ 

408 

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

410 proto.ENUM, 

411 number=1, 

412 enum="IngestionDataSourceSettings.CloudStorage.State", 

413 ) 

414 bucket: str = proto.Field( 

415 proto.STRING, 

416 number=2, 

417 ) 

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

419 proto.Field( 

420 proto.MESSAGE, 

421 number=3, 

422 oneof="input_format", 

423 message="IngestionDataSourceSettings.CloudStorage.TextFormat", 

424 ) 

425 ) 

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

427 proto.Field( 

428 proto.MESSAGE, 

429 number=4, 

430 oneof="input_format", 

431 message="IngestionDataSourceSettings.CloudStorage.AvroFormat", 

432 ) 

433 ) 

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

435 proto.MESSAGE, 

436 number=5, 

437 oneof="input_format", 

438 message="IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat", 

439 ) 

440 minimum_object_create_time: timestamp_pb2.Timestamp = proto.Field( 

441 proto.MESSAGE, 

442 number=6, 

443 message=timestamp_pb2.Timestamp, 

444 ) 

445 match_glob: str = proto.Field( 

446 proto.STRING, 

447 number=9, 

448 ) 

449 

450 class AzureEventHubs(proto.Message): 

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

452 

453 Attributes: 

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

455 Output only. An output-only field that 

456 indicates the state of the Event Hubs ingestion 

457 source. 

458 resource_group (str): 

459 Optional. Name of the resource group within 

460 the azure subscription. 

461 namespace (str): 

462 Optional. The name of the Event Hubs 

463 namespace. 

464 event_hub (str): 

465 Optional. The name of the Event Hub. 

466 client_id (str): 

467 Optional. The client id of the Azure 

468 application that is being used to authenticate 

469 Pub/Sub. 

470 tenant_id (str): 

471 Optional. The tenant id of the Azure 

472 application that is being used to authenticate 

473 Pub/Sub. 

474 subscription_id (str): 

475 Optional. The Azure subscription id. 

476 gcp_service_account (str): 

477 Optional. The GCP service account to be used 

478 for Federated Identity authentication. 

479 """ 

480 

481 class State(proto.Enum): 

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

483 

484 Values: 

485 STATE_UNSPECIFIED (0): 

486 Default value. This value is unused. 

487 ACTIVE (1): 

488 Ingestion is active. 

489 EVENT_HUBS_PERMISSION_DENIED (2): 

490 Permission denied encountered while consuming data from 

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

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

493 been granted. 

494 PUBLISH_PERMISSION_DENIED (3): 

495 Permission denied encountered while 

496 publishing to the topic. 

497 NAMESPACE_NOT_FOUND (4): 

498 The provided Event Hubs namespace couldn't be 

499 found. 

500 EVENT_HUB_NOT_FOUND (5): 

501 The provided Event Hub couldn't be found. 

502 SUBSCRIPTION_NOT_FOUND (6): 

503 The provided Event Hubs subscription couldn't 

504 be found. 

505 RESOURCE_GROUP_NOT_FOUND (7): 

506 The provided Event Hubs resource group 

507 couldn't be found. 

508 """ 

509 STATE_UNSPECIFIED = 0 

510 ACTIVE = 1 

511 EVENT_HUBS_PERMISSION_DENIED = 2 

512 PUBLISH_PERMISSION_DENIED = 3 

513 NAMESPACE_NOT_FOUND = 4 

514 EVENT_HUB_NOT_FOUND = 5 

515 SUBSCRIPTION_NOT_FOUND = 6 

516 RESOURCE_GROUP_NOT_FOUND = 7 

517 

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

519 proto.ENUM, 

520 number=1, 

521 enum="IngestionDataSourceSettings.AzureEventHubs.State", 

522 ) 

523 resource_group: str = proto.Field( 

524 proto.STRING, 

525 number=2, 

526 ) 

527 namespace: str = proto.Field( 

528 proto.STRING, 

529 number=3, 

530 ) 

531 event_hub: str = proto.Field( 

532 proto.STRING, 

533 number=4, 

534 ) 

535 client_id: str = proto.Field( 

536 proto.STRING, 

537 number=5, 

538 ) 

539 tenant_id: str = proto.Field( 

540 proto.STRING, 

541 number=6, 

542 ) 

543 subscription_id: str = proto.Field( 

544 proto.STRING, 

545 number=7, 

546 ) 

547 gcp_service_account: str = proto.Field( 

548 proto.STRING, 

549 number=8, 

550 ) 

551 

552 class AwsMsk(proto.Message): 

553 r"""Ingestion settings for Amazon MSK. 

554 

555 Attributes: 

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

557 Output only. An output-only field that 

558 indicates the state of the Amazon MSK ingestion 

559 source. 

560 cluster_arn (str): 

561 Required. The Amazon Resource Name (ARN) that 

562 uniquely identifies the cluster. 

563 topic (str): 

564 Required. The name of the topic in the Amazon 

565 MSK cluster that Pub/Sub will import from. 

566 aws_role_arn (str): 

567 Required. AWS role ARN to be used for 

568 Federated Identity authentication with Amazon 

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

570 this role and the required permissions that need 

571 to be attached to it. 

572 gcp_service_account (str): 

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

574 Identity authentication with Amazon MSK (via a 

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

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

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

578 number. 

579 """ 

580 

581 class State(proto.Enum): 

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

583 

584 Values: 

585 STATE_UNSPECIFIED (0): 

586 Default value. This value is unused. 

587 ACTIVE (1): 

588 Ingestion is active. 

589 MSK_PERMISSION_DENIED (2): 

590 Permission denied encountered while consuming 

591 data from Amazon MSK. 

592 PUBLISH_PERMISSION_DENIED (3): 

593 Permission denied encountered while 

594 publishing to the topic. 

595 CLUSTER_NOT_FOUND (4): 

596 The provided MSK cluster wasn't found. 

597 TOPIC_NOT_FOUND (5): 

598 The provided topic wasn't found. 

599 """ 

600 STATE_UNSPECIFIED = 0 

601 ACTIVE = 1 

602 MSK_PERMISSION_DENIED = 2 

603 PUBLISH_PERMISSION_DENIED = 3 

604 CLUSTER_NOT_FOUND = 4 

605 TOPIC_NOT_FOUND = 5 

606 

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

608 proto.ENUM, 

609 number=1, 

610 enum="IngestionDataSourceSettings.AwsMsk.State", 

611 ) 

612 cluster_arn: str = proto.Field( 

613 proto.STRING, 

614 number=2, 

615 ) 

616 topic: str = proto.Field( 

617 proto.STRING, 

618 number=3, 

619 ) 

620 aws_role_arn: str = proto.Field( 

621 proto.STRING, 

622 number=4, 

623 ) 

624 gcp_service_account: str = proto.Field( 

625 proto.STRING, 

626 number=5, 

627 ) 

628 

629 class ConfluentCloud(proto.Message): 

630 r"""Ingestion settings for Confluent Cloud. 

631 

632 Attributes: 

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

634 Output only. An output-only field that 

635 indicates the state of the Confluent Cloud 

636 ingestion source. 

637 bootstrap_server (str): 

638 Required. The address of the bootstrap 

639 server. The format is url:port. 

640 cluster_id (str): 

641 Required. The id of the cluster. 

642 topic (str): 

643 Required. The name of the topic in the 

644 Confluent Cloud cluster that Pub/Sub will import 

645 from. 

646 identity_pool_id (str): 

647 Required. The id of the identity pool to be 

648 used for Federated Identity authentication with 

649 Confluent Cloud. See 

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

651 gcp_service_account (str): 

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

653 Identity authentication with ``identity_pool_id``. 

654 """ 

655 

656 class State(proto.Enum): 

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

658 

659 Values: 

660 STATE_UNSPECIFIED (0): 

661 Default value. This value is unused. 

662 ACTIVE (1): 

663 Ingestion is active. 

664 CONFLUENT_CLOUD_PERMISSION_DENIED (2): 

665 Permission denied encountered while consuming 

666 data from Confluent Cloud. 

667 PUBLISH_PERMISSION_DENIED (3): 

668 Permission denied encountered while 

669 publishing to the topic. 

670 UNREACHABLE_BOOTSTRAP_SERVER (4): 

671 The provided bootstrap server address is 

672 unreachable. 

673 CLUSTER_NOT_FOUND (5): 

674 The provided cluster wasn't found. 

675 TOPIC_NOT_FOUND (6): 

676 The provided topic wasn't found. 

677 """ 

678 STATE_UNSPECIFIED = 0 

679 ACTIVE = 1 

680 CONFLUENT_CLOUD_PERMISSION_DENIED = 2 

681 PUBLISH_PERMISSION_DENIED = 3 

682 UNREACHABLE_BOOTSTRAP_SERVER = 4 

683 CLUSTER_NOT_FOUND = 5 

684 TOPIC_NOT_FOUND = 6 

685 

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

687 proto.ENUM, 

688 number=1, 

689 enum="IngestionDataSourceSettings.ConfluentCloud.State", 

690 ) 

691 bootstrap_server: str = proto.Field( 

692 proto.STRING, 

693 number=2, 

694 ) 

695 cluster_id: str = proto.Field( 

696 proto.STRING, 

697 number=3, 

698 ) 

699 topic: str = proto.Field( 

700 proto.STRING, 

701 number=4, 

702 ) 

703 identity_pool_id: str = proto.Field( 

704 proto.STRING, 

705 number=5, 

706 ) 

707 gcp_service_account: str = proto.Field( 

708 proto.STRING, 

709 number=6, 

710 ) 

711 

712 aws_kinesis: AwsKinesis = proto.Field( 

713 proto.MESSAGE, 

714 number=1, 

715 oneof="source", 

716 message=AwsKinesis, 

717 ) 

718 cloud_storage: CloudStorage = proto.Field( 

719 proto.MESSAGE, 

720 number=2, 

721 oneof="source", 

722 message=CloudStorage, 

723 ) 

724 azure_event_hubs: AzureEventHubs = proto.Field( 

725 proto.MESSAGE, 

726 number=3, 

727 oneof="source", 

728 message=AzureEventHubs, 

729 ) 

730 aws_msk: AwsMsk = proto.Field( 

731 proto.MESSAGE, 

732 number=5, 

733 oneof="source", 

734 message=AwsMsk, 

735 ) 

736 confluent_cloud: ConfluentCloud = proto.Field( 

737 proto.MESSAGE, 

738 number=6, 

739 oneof="source", 

740 message=ConfluentCloud, 

741 ) 

742 platform_logs_settings: "PlatformLogsSettings" = proto.Field( 

743 proto.MESSAGE, 

744 number=4, 

745 message="PlatformLogsSettings", 

746 ) 

747 

748 

749class PlatformLogsSettings(proto.Message): 

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

751 

752 Attributes: 

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

754 Optional. The minimum severity level of 

755 Platform Logs that will be written. 

756 """ 

757 

758 class Severity(proto.Enum): 

759 r"""Severity levels of Platform Logs. 

760 

761 Values: 

762 SEVERITY_UNSPECIFIED (0): 

763 Default value. Logs level is unspecified. 

764 Logs will be disabled. 

765 DISABLED (1): 

766 Logs will be disabled. 

767 DEBUG (2): 

768 Debug logs and higher-severity logs will be 

769 written. 

770 INFO (3): 

771 Info logs and higher-severity logs will be 

772 written. 

773 WARNING (4): 

774 Warning logs and higher-severity logs will be 

775 written. 

776 ERROR (5): 

777 Only error logs will be written. 

778 """ 

779 SEVERITY_UNSPECIFIED = 0 

780 DISABLED = 1 

781 DEBUG = 2 

782 INFO = 3 

783 WARNING = 4 

784 ERROR = 5 

785 

786 severity: Severity = proto.Field( 

787 proto.ENUM, 

788 number=1, 

789 enum=Severity, 

790 ) 

791 

792 

793class IngestionFailureEvent(proto.Message): 

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

795 encountered while ingesting. 

796 

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

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

799 Setting any member of the oneof automatically clears all other 

800 members. 

801 

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

803 

804 Attributes: 

805 topic (str): 

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

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

808 error_message (str): 

809 Required. Error details explaining why 

810 ingestion to Pub/Sub has failed. 

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

812 Optional. Failure when ingesting from Cloud 

813 Storage. 

814 

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

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

817 Optional. Failure when ingesting from Amazon 

818 MSK. 

819 

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

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

822 Optional. Failure when ingesting from Azure 

823 Event Hubs. 

824 

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

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

827 Optional. Failure when ingesting from 

828 Confluent Cloud. 

829 

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

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

832 Optional. Failure when ingesting from AWS 

833 Kinesis. 

834 

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

836 """ 

837 

838 class ApiViolationReason(proto.Message): 

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

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

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

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

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

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

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

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

847 messages will proceed as normal. 

848 

849 """ 

850 

851 class AvroFailureReason(proto.Message): 

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

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

854 ingested. 

855 

856 """ 

857 

858 class SchemaViolationReason(proto.Message): 

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

860 schema validation violation. 

861 

862 """ 

863 

864 class MessageTransformationFailureReason(proto.Message): 

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

866 message transformation error. 

867 

868 """ 

869 

870 class CloudStorageFailure(proto.Message): 

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

872 

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

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

875 Setting any member of the oneof automatically clears all other 

876 members. 

877 

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

879 

880 Attributes: 

881 bucket (str): 

882 Optional. Name of the Cloud Storage bucket 

883 used for ingestion. 

884 object_name (str): 

885 Optional. Name of the Cloud Storage object 

886 which contained the section that couldn't be 

887 ingested. 

888 object_generation (int): 

889 Optional. Generation of the Cloud Storage 

890 object which contained the section that couldn't 

891 be ingested. 

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

893 Optional. Failure encountered when parsing an 

894 Avro file. 

895 

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

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

898 Optional. The Pub/Sub API limits prevented 

899 the desired message from being published. 

900 

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

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

903 Optional. The Pub/Sub message failed schema 

904 validation. 

905 

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

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

908 Optional. Failure encountered when applying a 

909 message transformation to the Pub/Sub message. 

910 

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

912 """ 

913 

914 bucket: str = proto.Field( 

915 proto.STRING, 

916 number=1, 

917 ) 

918 object_name: str = proto.Field( 

919 proto.STRING, 

920 number=2, 

921 ) 

922 object_generation: int = proto.Field( 

923 proto.INT64, 

924 number=3, 

925 ) 

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

927 proto.MESSAGE, 

928 number=5, 

929 oneof="reason", 

930 message="IngestionFailureEvent.AvroFailureReason", 

931 ) 

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

933 proto.MESSAGE, 

934 number=6, 

935 oneof="reason", 

936 message="IngestionFailureEvent.ApiViolationReason", 

937 ) 

938 schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( 

939 proto.Field( 

940 proto.MESSAGE, 

941 number=7, 

942 oneof="reason", 

943 message="IngestionFailureEvent.SchemaViolationReason", 

944 ) 

945 ) 

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

947 proto.MESSAGE, 

948 number=8, 

949 oneof="reason", 

950 message="IngestionFailureEvent.MessageTransformationFailureReason", 

951 ) 

952 

953 class AwsMskFailureReason(proto.Message): 

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

955 

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

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

958 Setting any member of the oneof automatically clears all other 

959 members. 

960 

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

962 

963 Attributes: 

964 cluster_arn (str): 

965 Optional. The ARN of the cluster of the topic 

966 being ingested from. 

967 kafka_topic (str): 

968 Optional. The name of the Kafka topic being 

969 ingested from. 

970 partition_id (int): 

971 Optional. The partition ID of the message 

972 that failed to be ingested. 

973 offset (int): 

974 Optional. The offset within the partition of 

975 the message that failed to be ingested. 

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

977 Optional. The Pub/Sub API limits prevented 

978 the desired message from being published. 

979 

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

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

982 Optional. The Pub/Sub message failed schema 

983 validation. 

984 

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

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

987 Optional. Failure encountered when applying a 

988 message transformation to the Pub/Sub message. 

989 

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

991 """ 

992 

993 cluster_arn: str = proto.Field( 

994 proto.STRING, 

995 number=1, 

996 ) 

997 kafka_topic: str = proto.Field( 

998 proto.STRING, 

999 number=2, 

1000 ) 

1001 partition_id: int = proto.Field( 

1002 proto.INT64, 

1003 number=3, 

1004 ) 

1005 offset: int = proto.Field( 

1006 proto.INT64, 

1007 number=4, 

1008 ) 

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

1010 proto.MESSAGE, 

1011 number=5, 

1012 oneof="reason", 

1013 message="IngestionFailureEvent.ApiViolationReason", 

1014 ) 

1015 schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( 

1016 proto.Field( 

1017 proto.MESSAGE, 

1018 number=6, 

1019 oneof="reason", 

1020 message="IngestionFailureEvent.SchemaViolationReason", 

1021 ) 

1022 ) 

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

1024 proto.MESSAGE, 

1025 number=7, 

1026 oneof="reason", 

1027 message="IngestionFailureEvent.MessageTransformationFailureReason", 

1028 ) 

1029 

1030 class AzureEventHubsFailureReason(proto.Message): 

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

1032 

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

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

1035 Setting any member of the oneof automatically clears all other 

1036 members. 

1037 

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

1039 

1040 Attributes: 

1041 namespace (str): 

1042 Optional. The namespace containing the event 

1043 hub being ingested from. 

1044 event_hub (str): 

1045 Optional. The name of the event hub being 

1046 ingested from. 

1047 partition_id (int): 

1048 Optional. The partition ID of the message 

1049 that failed to be ingested. 

1050 offset (int): 

1051 Optional. The offset within the partition of 

1052 the message that failed to be ingested. 

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

1054 Optional. The Pub/Sub API limits prevented 

1055 the desired message from being published. 

1056 

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

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

1059 Optional. The Pub/Sub message failed schema 

1060 validation. 

1061 

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

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

1064 Optional. Failure encountered when applying a 

1065 message transformation to the Pub/Sub message. 

1066 

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

1068 """ 

1069 

1070 namespace: str = proto.Field( 

1071 proto.STRING, 

1072 number=1, 

1073 ) 

1074 event_hub: str = proto.Field( 

1075 proto.STRING, 

1076 number=2, 

1077 ) 

1078 partition_id: int = proto.Field( 

1079 proto.INT64, 

1080 number=3, 

1081 ) 

1082 offset: int = proto.Field( 

1083 proto.INT64, 

1084 number=4, 

1085 ) 

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

1087 proto.MESSAGE, 

1088 number=5, 

1089 oneof="reason", 

1090 message="IngestionFailureEvent.ApiViolationReason", 

1091 ) 

1092 schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( 

1093 proto.Field( 

1094 proto.MESSAGE, 

1095 number=6, 

1096 oneof="reason", 

1097 message="IngestionFailureEvent.SchemaViolationReason", 

1098 ) 

1099 ) 

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

1101 proto.MESSAGE, 

1102 number=7, 

1103 oneof="reason", 

1104 message="IngestionFailureEvent.MessageTransformationFailureReason", 

1105 ) 

1106 

1107 class ConfluentCloudFailureReason(proto.Message): 

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

1109 

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

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

1112 Setting any member of the oneof automatically clears all other 

1113 members. 

1114 

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

1116 

1117 Attributes: 

1118 cluster_id (str): 

1119 Optional. The cluster ID containing the topic 

1120 being ingested from. 

1121 kafka_topic (str): 

1122 Optional. The name of the Kafka topic being 

1123 ingested from. 

1124 partition_id (int): 

1125 Optional. The partition ID of the message 

1126 that failed to be ingested. 

1127 offset (int): 

1128 Optional. The offset within the partition of 

1129 the message that failed to be ingested. 

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

1131 Optional. The Pub/Sub API limits prevented 

1132 the desired message from being published. 

1133 

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

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

1136 Optional. The Pub/Sub message failed schema 

1137 validation. 

1138 

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

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

1141 Optional. Failure encountered when applying a 

1142 message transformation to the Pub/Sub message. 

1143 

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

1145 """ 

1146 

1147 cluster_id: str = proto.Field( 

1148 proto.STRING, 

1149 number=1, 

1150 ) 

1151 kafka_topic: str = proto.Field( 

1152 proto.STRING, 

1153 number=2, 

1154 ) 

1155 partition_id: int = proto.Field( 

1156 proto.INT64, 

1157 number=3, 

1158 ) 

1159 offset: int = proto.Field( 

1160 proto.INT64, 

1161 number=4, 

1162 ) 

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

1164 proto.MESSAGE, 

1165 number=5, 

1166 oneof="reason", 

1167 message="IngestionFailureEvent.ApiViolationReason", 

1168 ) 

1169 schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( 

1170 proto.Field( 

1171 proto.MESSAGE, 

1172 number=6, 

1173 oneof="reason", 

1174 message="IngestionFailureEvent.SchemaViolationReason", 

1175 ) 

1176 ) 

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

1178 proto.MESSAGE, 

1179 number=7, 

1180 oneof="reason", 

1181 message="IngestionFailureEvent.MessageTransformationFailureReason", 

1182 ) 

1183 

1184 class AwsKinesisFailureReason(proto.Message): 

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

1186 

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

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

1189 Setting any member of the oneof automatically clears all other 

1190 members. 

1191 

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

1193 

1194 Attributes: 

1195 stream_arn (str): 

1196 Optional. The stream ARN of the Kinesis 

1197 stream being ingested from. 

1198 partition_key (str): 

1199 Optional. The partition key of the message 

1200 that failed to be ingested. 

1201 sequence_number (str): 

1202 Optional. The sequence number of the message 

1203 that failed to be ingested. 

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

1205 Optional. The Pub/Sub message failed schema 

1206 validation. 

1207 

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

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

1210 Optional. Failure encountered when applying a 

1211 message transformation to the Pub/Sub message. 

1212 

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

1214 """ 

1215 

1216 stream_arn: str = proto.Field( 

1217 proto.STRING, 

1218 number=1, 

1219 ) 

1220 partition_key: str = proto.Field( 

1221 proto.STRING, 

1222 number=2, 

1223 ) 

1224 sequence_number: str = proto.Field( 

1225 proto.STRING, 

1226 number=3, 

1227 ) 

1228 schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( 

1229 proto.Field( 

1230 proto.MESSAGE, 

1231 number=4, 

1232 oneof="reason", 

1233 message="IngestionFailureEvent.SchemaViolationReason", 

1234 ) 

1235 ) 

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

1237 proto.MESSAGE, 

1238 number=5, 

1239 oneof="reason", 

1240 message="IngestionFailureEvent.MessageTransformationFailureReason", 

1241 ) 

1242 

1243 topic: str = proto.Field( 

1244 proto.STRING, 

1245 number=1, 

1246 ) 

1247 error_message: str = proto.Field( 

1248 proto.STRING, 

1249 number=2, 

1250 ) 

1251 cloud_storage_failure: CloudStorageFailure = proto.Field( 

1252 proto.MESSAGE, 

1253 number=3, 

1254 oneof="failure", 

1255 message=CloudStorageFailure, 

1256 ) 

1257 aws_msk_failure: AwsMskFailureReason = proto.Field( 

1258 proto.MESSAGE, 

1259 number=4, 

1260 oneof="failure", 

1261 message=AwsMskFailureReason, 

1262 ) 

1263 azure_event_hubs_failure: AzureEventHubsFailureReason = proto.Field( 

1264 proto.MESSAGE, 

1265 number=5, 

1266 oneof="failure", 

1267 message=AzureEventHubsFailureReason, 

1268 ) 

1269 confluent_cloud_failure: ConfluentCloudFailureReason = proto.Field( 

1270 proto.MESSAGE, 

1271 number=6, 

1272 oneof="failure", 

1273 message=ConfluentCloudFailureReason, 

1274 ) 

1275 aws_kinesis_failure: AwsKinesisFailureReason = proto.Field( 

1276 proto.MESSAGE, 

1277 number=7, 

1278 oneof="failure", 

1279 message=AwsKinesisFailureReason, 

1280 ) 

1281 

1282 

1283class JavaScriptUDF(proto.Message): 

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

1285 a Pub/Sub message. 

1286 

1287 Attributes: 

1288 function_name (str): 

1289 Required. Name of the JavasScript function 

1290 that should applied to Pub/Sub messages. 

1291 code (str): 

1292 Required. JavaScript code that contains a function 

1293 ``function_name`` with the below signature: 

1294 

1295 :: 

1296 

1297 /** 

1298 * Transforms a Pub/Sub message. 

1299 

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

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

1302 * with the following keys: 

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

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

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

1306 * message. 

1307 * 

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

1309 * message. Keys: 

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

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

1312 * 

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

1314 * Keys: 

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

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

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

1318 */ 

1319 

1320 function <function_name>(message, metadata) { 

1321 } 

1322 """ 

1323 

1324 function_name: str = proto.Field( 

1325 proto.STRING, 

1326 number=1, 

1327 ) 

1328 code: str = proto.Field( 

1329 proto.STRING, 

1330 number=2, 

1331 ) 

1332 

1333 

1334class MessageTransform(proto.Message): 

1335 r"""All supported message transforms types. 

1336 

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

1338 

1339 Attributes: 

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

1341 Optional. JavaScript User Defined Function. If multiple 

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

1343 a unique ``function_name``. 

1344 

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

1346 enabled (bool): 

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

1348 field to disable transforms. 

1349 disabled (bool): 

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

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

1352 """ 

1353 

1354 javascript_udf: "JavaScriptUDF" = proto.Field( 

1355 proto.MESSAGE, 

1356 number=2, 

1357 oneof="transform", 

1358 message="JavaScriptUDF", 

1359 ) 

1360 enabled: bool = proto.Field( 

1361 proto.BOOL, 

1362 number=3, 

1363 ) 

1364 disabled: bool = proto.Field( 

1365 proto.BOOL, 

1366 number=4, 

1367 ) 

1368 

1369 

1370class Topic(proto.Message): 

1371 r"""A topic resource. 

1372 

1373 Attributes: 

1374 name (str): 

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

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

1377 start with a letter, and contain only letters 

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

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

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

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

1382 ``"goog"``. 

1383 labels (MutableMapping[str, str]): 

1384 Optional. See [Creating and managing labels] 

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

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

1387 Optional. Policy constraining the set of 

1388 Google Cloud Platform regions where messages 

1389 published to the topic may be stored. If not 

1390 present, then no constraints are in effect. 

1391 kms_key_name (str): 

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

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

1394 

1395 The expected format is 

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

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

1398 Optional. Settings for validating messages 

1399 published against a schema. 

1400 satisfies_pzs (bool): 

1401 Optional. Reserved for future use. This field 

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

1403 ignored if it is set in any requests. 

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

1405 Optional. Indicates the minimum duration to retain a message 

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

1407 messages published to the topic in the last 

1408 ``message_retention_duration`` are always available to 

1409 subscribers. For instance, it allows any attached 

1410 subscription to `seek to a 

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

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

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

1414 settings on individual subscriptions. Cannot be more than 31 

1415 days or less than 10 minutes. 

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

1417 Output only. An output-only field indicating 

1418 the state of the topic. 

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

1420 Optional. Settings for ingestion from a data 

1421 source into this topic. 

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

1423 Optional. Transforms to be applied to 

1424 messages published to the topic. Transforms are 

1425 applied in the order specified. 

1426 """ 

1427 

1428 class State(proto.Enum): 

1429 r"""The state of the topic. 

1430 

1431 Values: 

1432 STATE_UNSPECIFIED (0): 

1433 Default value. This value is unused. 

1434 ACTIVE (1): 

1435 The topic does not have any persistent 

1436 errors. 

1437 INGESTION_RESOURCE_ERROR (2): 

1438 Ingestion from the data source has 

1439 encountered a permanent error. See the more 

1440 detailed error state in the corresponding 

1441 ingestion source configuration. 

1442 """ 

1443 STATE_UNSPECIFIED = 0 

1444 ACTIVE = 1 

1445 INGESTION_RESOURCE_ERROR = 2 

1446 

1447 name: str = proto.Field( 

1448 proto.STRING, 

1449 number=1, 

1450 ) 

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

1452 proto.STRING, 

1453 proto.STRING, 

1454 number=2, 

1455 ) 

1456 message_storage_policy: "MessageStoragePolicy" = proto.Field( 

1457 proto.MESSAGE, 

1458 number=3, 

1459 message="MessageStoragePolicy", 

1460 ) 

1461 kms_key_name: str = proto.Field( 

1462 proto.STRING, 

1463 number=5, 

1464 ) 

1465 schema_settings: "SchemaSettings" = proto.Field( 

1466 proto.MESSAGE, 

1467 number=6, 

1468 message="SchemaSettings", 

1469 ) 

1470 satisfies_pzs: bool = proto.Field( 

1471 proto.BOOL, 

1472 number=7, 

1473 ) 

1474 message_retention_duration: duration_pb2.Duration = proto.Field( 

1475 proto.MESSAGE, 

1476 number=8, 

1477 message=duration_pb2.Duration, 

1478 ) 

1479 state: State = proto.Field( 

1480 proto.ENUM, 

1481 number=9, 

1482 enum=State, 

1483 ) 

1484 ingestion_data_source_settings: "IngestionDataSourceSettings" = proto.Field( 

1485 proto.MESSAGE, 

1486 number=10, 

1487 message="IngestionDataSourceSettings", 

1488 ) 

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

1490 proto.MESSAGE, 

1491 number=13, 

1492 message="MessageTransform", 

1493 ) 

1494 

1495 

1496class PubsubMessage(proto.Message): 

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

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

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

1500 object differently depending on the language. See the corresponding 

1501 `client library 

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

1503 for more information. See [quotas and limits] 

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

1505 message limits. 

1506 

1507 Attributes: 

1508 data (bytes): 

1509 Optional. The message data field. If this 

1510 field is empty, the message must contain at 

1511 least one attribute. 

1512 attributes (MutableMapping[str, str]): 

1513 Optional. Attributes for this message. If 

1514 this field is empty, the message must contain 

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

1516 messages on the subscription. 

1517 message_id (str): 

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

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

1520 value may be read by a subscriber that receives a 

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

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

1523 call. 

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

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

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

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

1528 ordering_key (str): 

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

1530 which publish order should be respected. If a 

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

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

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

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

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

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

1537 value. For more information, see `ordering 

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

1539 """ 

1540 

1541 data: bytes = proto.Field( 

1542 proto.BYTES, 

1543 number=1, 

1544 ) 

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

1546 proto.STRING, 

1547 proto.STRING, 

1548 number=2, 

1549 ) 

1550 message_id: str = proto.Field( 

1551 proto.STRING, 

1552 number=3, 

1553 ) 

1554 publish_time: timestamp_pb2.Timestamp = proto.Field( 

1555 proto.MESSAGE, 

1556 number=4, 

1557 message=timestamp_pb2.Timestamp, 

1558 ) 

1559 ordering_key: str = proto.Field( 

1560 proto.STRING, 

1561 number=5, 

1562 ) 

1563 

1564 

1565class GetTopicRequest(proto.Message): 

1566 r"""Request for the GetTopic method. 

1567 

1568 Attributes: 

1569 topic (str): 

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

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

1572 """ 

1573 

1574 topic: str = proto.Field( 

1575 proto.STRING, 

1576 number=1, 

1577 ) 

1578 

1579 

1580class UpdateTopicRequest(proto.Message): 

1581 r"""Request for the UpdateTopic method. 

1582 

1583 Attributes: 

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

1585 Required. The updated topic object. 

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

1587 Required. Indicates which fields in the provided topic to 

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

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

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

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

1592 policy configured at the project or organization level. 

1593 """ 

1594 

1595 topic: "Topic" = proto.Field( 

1596 proto.MESSAGE, 

1597 number=1, 

1598 message="Topic", 

1599 ) 

1600 update_mask: field_mask_pb2.FieldMask = proto.Field( 

1601 proto.MESSAGE, 

1602 number=2, 

1603 message=field_mask_pb2.FieldMask, 

1604 ) 

1605 

1606 

1607class PublishRequest(proto.Message): 

1608 r"""Request for the Publish method. 

1609 

1610 Attributes: 

1611 topic (str): 

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

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

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

1615 Required. The messages to publish. 

1616 """ 

1617 

1618 topic: str = proto.Field( 

1619 proto.STRING, 

1620 number=1, 

1621 ) 

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

1623 proto.MESSAGE, 

1624 number=2, 

1625 message="PubsubMessage", 

1626 ) 

1627 

1628 

1629class PublishResponse(proto.Message): 

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

1631 

1632 Attributes: 

1633 message_ids (MutableSequence[str]): 

1634 Optional. The server-assigned ID of each 

1635 published message, in the same order as the 

1636 messages in the request. IDs are guaranteed to 

1637 be unique within the topic. 

1638 """ 

1639 

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

1641 proto.STRING, 

1642 number=1, 

1643 ) 

1644 

1645 

1646class ListTopicsRequest(proto.Message): 

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

1648 

1649 Attributes: 

1650 project (str): 

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

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

1653 page_size (int): 

1654 Optional. Maximum number of topics to return. 

1655 page_token (str): 

1656 Optional. The value returned by the last 

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

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

1659 system should return the next page of data. 

1660 """ 

1661 

1662 project: str = proto.Field( 

1663 proto.STRING, 

1664 number=1, 

1665 ) 

1666 page_size: int = proto.Field( 

1667 proto.INT32, 

1668 number=2, 

1669 ) 

1670 page_token: str = proto.Field( 

1671 proto.STRING, 

1672 number=3, 

1673 ) 

1674 

1675 

1676class ListTopicsResponse(proto.Message): 

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

1678 

1679 Attributes: 

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

1681 Optional. The resulting topics. 

1682 next_page_token (str): 

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

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

1685 in a new ``ListTopicsRequest``. 

1686 """ 

1687 

1688 @property 

1689 def raw_page(self): 

1690 return self 

1691 

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

1693 proto.MESSAGE, 

1694 number=1, 

1695 message="Topic", 

1696 ) 

1697 next_page_token: str = proto.Field( 

1698 proto.STRING, 

1699 number=2, 

1700 ) 

1701 

1702 

1703class ListTopicSubscriptionsRequest(proto.Message): 

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

1705 

1706 Attributes: 

1707 topic (str): 

1708 Required. The name of the topic that subscriptions are 

1709 attached to. Format is 

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

1711 page_size (int): 

1712 Optional. Maximum number of subscription 

1713 names to return. 

1714 page_token (str): 

1715 Optional. The value returned by the last 

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

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

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

1719 """ 

1720 

1721 topic: str = proto.Field( 

1722 proto.STRING, 

1723 number=1, 

1724 ) 

1725 page_size: int = proto.Field( 

1726 proto.INT32, 

1727 number=2, 

1728 ) 

1729 page_token: str = proto.Field( 

1730 proto.STRING, 

1731 number=3, 

1732 ) 

1733 

1734 

1735class ListTopicSubscriptionsResponse(proto.Message): 

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

1737 

1738 Attributes: 

1739 subscriptions (MutableSequence[str]): 

1740 Optional. The names of subscriptions attached 

1741 to the topic specified in the request. 

1742 next_page_token (str): 

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

1744 subscriptions that match the request; this value should be 

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

1746 more subscriptions. 

1747 """ 

1748 

1749 @property 

1750 def raw_page(self): 

1751 return self 

1752 

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

1754 proto.STRING, 

1755 number=1, 

1756 ) 

1757 next_page_token: str = proto.Field( 

1758 proto.STRING, 

1759 number=2, 

1760 ) 

1761 

1762 

1763class ListTopicSnapshotsRequest(proto.Message): 

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

1765 

1766 Attributes: 

1767 topic (str): 

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

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

1770 page_size (int): 

1771 Optional. Maximum number of snapshot names to 

1772 return. 

1773 page_token (str): 

1774 Optional. The value returned by the last 

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

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

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

1778 """ 

1779 

1780 topic: str = proto.Field( 

1781 proto.STRING, 

1782 number=1, 

1783 ) 

1784 page_size: int = proto.Field( 

1785 proto.INT32, 

1786 number=2, 

1787 ) 

1788 page_token: str = proto.Field( 

1789 proto.STRING, 

1790 number=3, 

1791 ) 

1792 

1793 

1794class ListTopicSnapshotsResponse(proto.Message): 

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

1796 

1797 Attributes: 

1798 snapshots (MutableSequence[str]): 

1799 Optional. The names of the snapshots that 

1800 match the request. 

1801 next_page_token (str): 

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

1803 snapshots that match the request; this value should be 

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

1805 snapshots. 

1806 """ 

1807 

1808 @property 

1809 def raw_page(self): 

1810 return self 

1811 

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

1813 proto.STRING, 

1814 number=1, 

1815 ) 

1816 next_page_token: str = proto.Field( 

1817 proto.STRING, 

1818 number=2, 

1819 ) 

1820 

1821 

1822class DeleteTopicRequest(proto.Message): 

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

1824 

1825 Attributes: 

1826 topic (str): 

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

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

1829 """ 

1830 

1831 topic: str = proto.Field( 

1832 proto.STRING, 

1833 number=1, 

1834 ) 

1835 

1836 

1837class DetachSubscriptionRequest(proto.Message): 

1838 r"""Request for the DetachSubscription method. 

1839 

1840 Attributes: 

1841 subscription (str): 

1842 Required. The subscription to detach. Format is 

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

1844 """ 

1845 

1846 subscription: str = proto.Field( 

1847 proto.STRING, 

1848 number=1, 

1849 ) 

1850 

1851 

1852class DetachSubscriptionResponse(proto.Message): 

1853 r"""Response for the DetachSubscription method. 

1854 Reserved for future use. 

1855 

1856 """ 

1857 

1858 

1859class Subscription(proto.Message): 

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

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

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

1863 of these fields may be set. 

1864 

1865 Attributes: 

1866 name (str): 

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

1868 format 

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

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

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

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

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

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

1875 start with ``"goog"``. 

1876 topic (str): 

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

1878 is receiving messages. Format is 

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

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

1881 deleted. 

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

1883 Optional. If push delivery is used with this 

1884 subscription, this field is used to configure 

1885 it. 

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

1887 Optional. If delivery to BigQuery is used 

1888 with this subscription, this field is used to 

1889 configure it. 

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

1891 Optional. If delivery to Google Cloud Storage 

1892 is used with this subscription, this field is 

1893 used to configure it. 

1894 ack_deadline_seconds (int): 

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

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

1897 receipt before resending the message. In the interval after 

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

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

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

1901 basis). 

1902 

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

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

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

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

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

1908 using streaming pull. The minimum custom deadline you can 

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

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

1911 a default value of 10 seconds is used. 

1912 

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

1914 request timeout for the call to the push endpoint. 

1915 

1916 If the subscriber never acknowledges the message, the 

1917 Pub/Sub system will eventually redeliver the message. 

1918 retain_acked_messages (bool): 

1919 Optional. Indicates whether to retain acknowledged messages. 

1920 If true, then messages are not expunged from the 

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

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

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

1924 timestamp] 

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

1926 in the past to replay previously-acknowledged messages. 

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

1928 Optional. How long to retain unacknowledged messages in the 

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

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

1931 also configures the retention of acknowledged messages, and 

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

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

1934 10 minutes. 

1935 labels (MutableMapping[str, str]): 

1936 Optional. See `Creating and managing 

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

1938 enable_message_ordering (bool): 

1939 Optional. If true, messages published with the same 

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

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

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

1943 order. 

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

1945 Optional. A policy that specifies the conditions for this 

1946 subscription's expiration. A subscription is considered 

1947 active as long as any connected subscriber is successfully 

1948 consuming messages from the subscription or is issuing 

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

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

1951 used. The minimum allowed value for 

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

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

1954 subscription never expires. 

1955 filter (str): 

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

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

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

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

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

1961 out. 

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

1963 Optional. A policy that specifies the conditions for dead 

1964 lettering messages in this subscription. If 

1965 dead_letter_policy is not set, dead lettering is disabled. 

1966 

1967 The Pub/Sub service account associated with this 

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

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

1970 must have permission to Acknowledge() messages on this 

1971 subscription. 

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

1973 Optional. A policy that specifies how Pub/Sub 

1974 retries message delivery for this subscription. 

1975 

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

1977 This generally implies that messages will be 

1978 retried as soon as possible for healthy 

1979 subscribers. RetryPolicy will be triggered on 

1980 NACKs or acknowledgment deadline exceeded events 

1981 for a given message. 

1982 detached (bool): 

1983 Optional. Indicates whether the subscription is detached 

1984 from its topic. Detached subscriptions don't receive 

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

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

1987 FAILED_PRECONDITION. If the subscription is a push 

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

1989 enable_exactly_once_delivery (bool): 

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

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

1992 ``message_id`` on this subscription: 

1993 

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

1995 resent before the message's acknowledgment deadline 

1996 expires. 

1997 - An acknowledged message will not be resent to a 

1998 subscriber. 

1999 

2000 Note that subscribers may still receive multiple copies of a 

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

2002 message was published multiple times by a publisher client. 

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

2004 distinct ``message_id`` values. 

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

2006 Output only. Indicates the minimum duration for which a 

2007 message is retained after it is published to the 

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

2009 published to the subscription's topic in the last 

2010 ``topic_message_retention_duration`` are always available to 

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

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

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

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

2015 Output only. An output-only field indicating 

2016 whether or not the subscription can receive 

2017 messages. 

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

2019 Output only. Information about the associated 

2020 Analytics Hub subscription. Only set if the 

2021 subscritpion is created by Analytics Hub. 

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

2023 Optional. Transforms to be applied to 

2024 messages before they are delivered to 

2025 subscribers. Transforms are applied in the order 

2026 specified. 

2027 """ 

2028 

2029 class State(proto.Enum): 

2030 r"""Possible states for a subscription. 

2031 

2032 Values: 

2033 STATE_UNSPECIFIED (0): 

2034 Default value. This value is unused. 

2035 ACTIVE (1): 

2036 The subscription can actively receive 

2037 messages 

2038 RESOURCE_ERROR (2): 

2039 The subscription cannot receive messages 

2040 because of an error with the resource to which 

2041 it pushes messages. See the more detailed error 

2042 state in the corresponding configuration. 

2043 """ 

2044 STATE_UNSPECIFIED = 0 

2045 ACTIVE = 1 

2046 RESOURCE_ERROR = 2 

2047 

2048 class AnalyticsHubSubscriptionInfo(proto.Message): 

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

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

2051 

2052 Attributes: 

2053 listing (str): 

2054 Optional. The name of the associated Analytics Hub listing 

2055 resource. Pattern: 

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

2057 subscription (str): 

2058 Optional. The name of the associated 

2059 Analytics Hub subscription resource. Pattern: 

2060 

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

2062 """ 

2063 

2064 listing: str = proto.Field( 

2065 proto.STRING, 

2066 number=1, 

2067 ) 

2068 subscription: str = proto.Field( 

2069 proto.STRING, 

2070 number=2, 

2071 ) 

2072 

2073 name: str = proto.Field( 

2074 proto.STRING, 

2075 number=1, 

2076 ) 

2077 topic: str = proto.Field( 

2078 proto.STRING, 

2079 number=2, 

2080 ) 

2081 push_config: "PushConfig" = proto.Field( 

2082 proto.MESSAGE, 

2083 number=4, 

2084 message="PushConfig", 

2085 ) 

2086 bigquery_config: "BigQueryConfig" = proto.Field( 

2087 proto.MESSAGE, 

2088 number=18, 

2089 message="BigQueryConfig", 

2090 ) 

2091 cloud_storage_config: "CloudStorageConfig" = proto.Field( 

2092 proto.MESSAGE, 

2093 number=22, 

2094 message="CloudStorageConfig", 

2095 ) 

2096 ack_deadline_seconds: int = proto.Field( 

2097 proto.INT32, 

2098 number=5, 

2099 ) 

2100 retain_acked_messages: bool = proto.Field( 

2101 proto.BOOL, 

2102 number=7, 

2103 ) 

2104 message_retention_duration: duration_pb2.Duration = proto.Field( 

2105 proto.MESSAGE, 

2106 number=8, 

2107 message=duration_pb2.Duration, 

2108 ) 

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

2110 proto.STRING, 

2111 proto.STRING, 

2112 number=9, 

2113 ) 

2114 enable_message_ordering: bool = proto.Field( 

2115 proto.BOOL, 

2116 number=10, 

2117 ) 

2118 expiration_policy: "ExpirationPolicy" = proto.Field( 

2119 proto.MESSAGE, 

2120 number=11, 

2121 message="ExpirationPolicy", 

2122 ) 

2123 filter: str = proto.Field( 

2124 proto.STRING, 

2125 number=12, 

2126 ) 

2127 dead_letter_policy: "DeadLetterPolicy" = proto.Field( 

2128 proto.MESSAGE, 

2129 number=13, 

2130 message="DeadLetterPolicy", 

2131 ) 

2132 retry_policy: "RetryPolicy" = proto.Field( 

2133 proto.MESSAGE, 

2134 number=14, 

2135 message="RetryPolicy", 

2136 ) 

2137 detached: bool = proto.Field( 

2138 proto.BOOL, 

2139 number=15, 

2140 ) 

2141 enable_exactly_once_delivery: bool = proto.Field( 

2142 proto.BOOL, 

2143 number=16, 

2144 ) 

2145 topic_message_retention_duration: duration_pb2.Duration = proto.Field( 

2146 proto.MESSAGE, 

2147 number=17, 

2148 message=duration_pb2.Duration, 

2149 ) 

2150 state: State = proto.Field( 

2151 proto.ENUM, 

2152 number=19, 

2153 enum=State, 

2154 ) 

2155 analytics_hub_subscription_info: AnalyticsHubSubscriptionInfo = proto.Field( 

2156 proto.MESSAGE, 

2157 number=23, 

2158 message=AnalyticsHubSubscriptionInfo, 

2159 ) 

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

2161 proto.MESSAGE, 

2162 number=25, 

2163 message="MessageTransform", 

2164 ) 

2165 

2166 

2167class RetryPolicy(proto.Message): 

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

2169 

2170 Retry delay will be exponential based on provided minimum and 

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

2172 

2173 RetryPolicy will be triggered on NACKs or acknowledgment deadline 

2174 exceeded events for a given message. 

2175 

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

2177 delay between consecutive deliveries may not match the 

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

2179 backoff. 

2180 

2181 Attributes: 

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

2183 Optional. The minimum delay between 

2184 consecutive deliveries of a given message. Value 

2185 should be between 0 and 600 seconds. Defaults to 

2186 10 seconds. 

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

2188 Optional. The maximum delay between 

2189 consecutive deliveries of a given message. Value 

2190 should be between 0 and 600 seconds. Defaults to 

2191 600 seconds. 

2192 """ 

2193 

2194 minimum_backoff: duration_pb2.Duration = proto.Field( 

2195 proto.MESSAGE, 

2196 number=1, 

2197 message=duration_pb2.Duration, 

2198 ) 

2199 maximum_backoff: duration_pb2.Duration = proto.Field( 

2200 proto.MESSAGE, 

2201 number=2, 

2202 message=duration_pb2.Duration, 

2203 ) 

2204 

2205 

2206class DeadLetterPolicy(proto.Message): 

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

2208 message might be dead lettered multiple times. 

2209 

2210 If validation on any of the fields fails at subscription 

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

2212 fail. 

2213 

2214 Attributes: 

2215 dead_letter_topic (str): 

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

2217 messages should be published. Format is 

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

2219 account associated with the enclosing subscription's parent 

2220 project (i.e., 

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

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

2223 

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

2225 should ensure that there is a subscription attached to this 

2226 topic since messages published to a topic with no 

2227 subscriptions are lost. 

2228 max_delivery_attempts (int): 

2229 Optional. The maximum number of delivery attempts for any 

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

2231 

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

2233 of number of NACKs and number of times the acknowledgment 

2234 deadline has been exceeded for the message). 

2235 

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

2237 Note that client libraries may automatically extend 

2238 ack_deadlines. 

2239 

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

2241 

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

2243 """ 

2244 

2245 dead_letter_topic: str = proto.Field( 

2246 proto.STRING, 

2247 number=1, 

2248 ) 

2249 max_delivery_attempts: int = proto.Field( 

2250 proto.INT32, 

2251 number=2, 

2252 ) 

2253 

2254 

2255class ExpirationPolicy(proto.Message): 

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

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

2258 

2259 Attributes: 

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

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

2262 associated resource. The resource expires if it is not 

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

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

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

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

2267 associated resource never expires. 

2268 """ 

2269 

2270 ttl: duration_pb2.Duration = proto.Field( 

2271 proto.MESSAGE, 

2272 number=1, 

2273 message=duration_pb2.Duration, 

2274 ) 

2275 

2276 

2277class PushConfig(proto.Message): 

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

2279 

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

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

2282 Setting any member of the oneof automatically clears all other 

2283 members. 

2284 

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

2286 

2287 Attributes: 

2288 push_endpoint (str): 

2289 Optional. A URL locating the endpoint to which messages 

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

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

2292 attributes (MutableMapping[str, str]): 

2293 Optional. Endpoint configuration attributes that can be used 

2294 to control different aspects of the message delivery. 

2295 

2296 The only currently supported attribute is 

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

2298 of the pushed message. This attribute indicates the version 

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

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

2301 

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

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

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

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

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

2307 was created without this attribute. 

2308 

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

2310 attribute are: 

2311 

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

2313 Pub/Sub API. 

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

2315 v1 Pub/Sub API. 

2316 

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

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

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

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

2321 request for every pushed message. 

2322 

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

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

2325 Optional. When set, the payload to the push 

2326 endpoint is in the form of the JSON 

2327 representation of a PubsubMessage 

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

2329 

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

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

2332 Optional. When set, the payload to the push 

2333 endpoint is not wrapped. 

2334 

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

2336 """ 

2337 

2338 class OidcToken(proto.Message): 

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

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

2341 

2342 Attributes: 

2343 service_account_email (str): 

2344 Optional. `Service account 

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

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

2347 setting up authentication, see `Push 

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

2349 audience (str): 

2350 Optional. Audience to be used when generating 

2351 OIDC token. The audience claim identifies the 

2352 recipients that the JWT is intended for. The 

2353 audience value is a single case-sensitive 

2354 string. Having multiple values (array) for the 

2355 audience field is not supported. More info about 

2356 the OIDC JWT token audience here: 

2357 

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

2359 Note: if not specified, the Push endpoint URL 

2360 will be used. 

2361 """ 

2362 

2363 service_account_email: str = proto.Field( 

2364 proto.STRING, 

2365 number=1, 

2366 ) 

2367 audience: str = proto.Field( 

2368 proto.STRING, 

2369 number=2, 

2370 ) 

2371 

2372 class PubsubWrapper(proto.Message): 

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

2374 representation of a PubsubMessage 

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

2376 

2377 """ 

2378 

2379 class NoWrapper(proto.Message): 

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

2381 

2382 Attributes: 

2383 write_metadata (bool): 

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

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

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

2387 headers of the HTTP request. 

2388 """ 

2389 

2390 write_metadata: bool = proto.Field( 

2391 proto.BOOL, 

2392 number=1, 

2393 ) 

2394 

2395 push_endpoint: str = proto.Field( 

2396 proto.STRING, 

2397 number=1, 

2398 ) 

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

2400 proto.STRING, 

2401 proto.STRING, 

2402 number=2, 

2403 ) 

2404 oidc_token: OidcToken = proto.Field( 

2405 proto.MESSAGE, 

2406 number=3, 

2407 oneof="authentication_method", 

2408 message=OidcToken, 

2409 ) 

2410 pubsub_wrapper: PubsubWrapper = proto.Field( 

2411 proto.MESSAGE, 

2412 number=4, 

2413 oneof="wrapper", 

2414 message=PubsubWrapper, 

2415 ) 

2416 no_wrapper: NoWrapper = proto.Field( 

2417 proto.MESSAGE, 

2418 number=5, 

2419 oneof="wrapper", 

2420 message=NoWrapper, 

2421 ) 

2422 

2423 

2424class BigQueryConfig(proto.Message): 

2425 r"""Configuration for a BigQuery subscription. 

2426 

2427 Attributes: 

2428 table (str): 

2429 Optional. The name of the table to which to 

2430 write data, of the form 

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

2432 use_topic_schema (bool): 

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

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

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

2436 write_metadata (bool): 

2437 Optional. When true, write the subscription name, 

2438 message_id, publish_time, attributes, and ordering_key to 

2439 additional columns in the table. The subscription name, 

2440 message_id, and publish_time fields are put in their own 

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

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

2443 drop_unknown_fields (bool): 

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

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

2446 BigQuery table schema are dropped when writing to BigQuery. 

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

2448 with extra fields are not written and remain in the 

2449 subscription's backlog. 

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

2451 Output only. An output-only field that 

2452 indicates whether or not the subscription can 

2453 receive messages. 

2454 use_table_schema (bool): 

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

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

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

2458 service_account_email (str): 

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

2460 The subscription creator or updater that specifies this 

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

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

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

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

2465 is used. 

2466 """ 

2467 

2468 class State(proto.Enum): 

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

2470 

2471 Values: 

2472 STATE_UNSPECIFIED (0): 

2473 Default value. This value is unused. 

2474 ACTIVE (1): 

2475 The subscription can actively send messages 

2476 to BigQuery 

2477 PERMISSION_DENIED (2): 

2478 Cannot write to the BigQuery table because of permission 

2479 denied errors. This can happen if 

2480 

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

2482 IAM 

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

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

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

2486 NOT_FOUND (3): 

2487 Cannot write to the BigQuery table because it 

2488 does not exist. 

2489 SCHEMA_MISMATCH (4): 

2490 Cannot write to the BigQuery table due to a 

2491 schema mismatch. 

2492 IN_TRANSIT_LOCATION_RESTRICTION (5): 

2493 Cannot write to the destination because enforce_in_transit 

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

2495 allowed regions. 

2496 """ 

2497 STATE_UNSPECIFIED = 0 

2498 ACTIVE = 1 

2499 PERMISSION_DENIED = 2 

2500 NOT_FOUND = 3 

2501 SCHEMA_MISMATCH = 4 

2502 IN_TRANSIT_LOCATION_RESTRICTION = 5 

2503 

2504 table: str = proto.Field( 

2505 proto.STRING, 

2506 number=1, 

2507 ) 

2508 use_topic_schema: bool = proto.Field( 

2509 proto.BOOL, 

2510 number=2, 

2511 ) 

2512 write_metadata: bool = proto.Field( 

2513 proto.BOOL, 

2514 number=3, 

2515 ) 

2516 drop_unknown_fields: bool = proto.Field( 

2517 proto.BOOL, 

2518 number=4, 

2519 ) 

2520 state: State = proto.Field( 

2521 proto.ENUM, 

2522 number=5, 

2523 enum=State, 

2524 ) 

2525 use_table_schema: bool = proto.Field( 

2526 proto.BOOL, 

2527 number=6, 

2528 ) 

2529 service_account_email: str = proto.Field( 

2530 proto.STRING, 

2531 number=7, 

2532 ) 

2533 

2534 

2535class CloudStorageConfig(proto.Message): 

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

2537 

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

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

2540 Setting any member of the oneof automatically clears all other 

2541 members. 

2542 

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

2544 

2545 Attributes: 

2546 bucket (str): 

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

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

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

2550 requirements] 

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

2552 filename_prefix (str): 

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

2554 See the `object naming 

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

2556 filename_suffix (str): 

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

2558 See the `object naming 

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

2560 Must not end in "/". 

2561 filename_datetime_format (str): 

2562 Optional. User-provided format string specifying how to 

2563 represent datetimes in Cloud Storage filenames. See the 

2564 `datetime format 

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

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

2567 Optional. If set, message data will be 

2568 written to Cloud Storage in text format. 

2569 

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

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

2572 Optional. If set, message data will be 

2573 written to Cloud Storage in Avro format. 

2574 

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

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

2577 Optional. The maximum duration that can 

2578 elapse before a new Cloud Storage file is 

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

2580 minutes. May not exceed the subscription's 

2581 acknowledgment deadline. 

2582 max_bytes (int): 

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

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

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

2586 messages are larger than the limit. 

2587 max_messages (int): 

2588 Optional. The maximum number of messages that 

2589 can be written to a Cloud Storage file before a 

2590 new file is created. Min 1000 messages. 

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

2592 Output only. An output-only field that 

2593 indicates whether or not the subscription can 

2594 receive messages. 

2595 service_account_email (str): 

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

2597 Storage. The subscription creator or updater that specifies 

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

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

2600 Pub/Sub `service 

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

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

2603 is used. 

2604 """ 

2605 

2606 class State(proto.Enum): 

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

2608 

2609 Values: 

2610 STATE_UNSPECIFIED (0): 

2611 Default value. This value is unused. 

2612 ACTIVE (1): 

2613 The subscription can actively send messages 

2614 to Cloud Storage. 

2615 PERMISSION_DENIED (2): 

2616 Cannot write to the Cloud Storage bucket 

2617 because of permission denied errors. 

2618 NOT_FOUND (3): 

2619 Cannot write to the Cloud Storage bucket 

2620 because it does not exist. 

2621 IN_TRANSIT_LOCATION_RESTRICTION (4): 

2622 Cannot write to the destination because enforce_in_transit 

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

2624 allowed regions. 

2625 SCHEMA_MISMATCH (5): 

2626 Cannot write to the Cloud Storage bucket due 

2627 to an incompatibility between the topic schema 

2628 and subscription settings. 

2629 """ 

2630 STATE_UNSPECIFIED = 0 

2631 ACTIVE = 1 

2632 PERMISSION_DENIED = 2 

2633 NOT_FOUND = 3 

2634 IN_TRANSIT_LOCATION_RESTRICTION = 4 

2635 SCHEMA_MISMATCH = 5 

2636 

2637 class TextConfig(proto.Message): 

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

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

2640 by a newline. 

2641 

2642 """ 

2643 

2644 class AvroConfig(proto.Message): 

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

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

2647 Avro binary. 

2648 

2649 Attributes: 

2650 write_metadata (bool): 

2651 Optional. When true, write the subscription name, 

2652 message_id, publish_time, attributes, and ordering_key as 

2653 additional fields in the output. The subscription name, 

2654 message_id, and publish_time fields are put in their own 

2655 fields while all other message properties other than data 

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

2657 entries in the attributes map. 

2658 use_topic_schema (bool): 

2659 Optional. When true, the output Cloud Storage 

2660 file will be serialized using the topic schema, 

2661 if it exists. 

2662 """ 

2663 

2664 write_metadata: bool = proto.Field( 

2665 proto.BOOL, 

2666 number=1, 

2667 ) 

2668 use_topic_schema: bool = proto.Field( 

2669 proto.BOOL, 

2670 number=2, 

2671 ) 

2672 

2673 bucket: str = proto.Field( 

2674 proto.STRING, 

2675 number=1, 

2676 ) 

2677 filename_prefix: str = proto.Field( 

2678 proto.STRING, 

2679 number=2, 

2680 ) 

2681 filename_suffix: str = proto.Field( 

2682 proto.STRING, 

2683 number=3, 

2684 ) 

2685 filename_datetime_format: str = proto.Field( 

2686 proto.STRING, 

2687 number=10, 

2688 ) 

2689 text_config: TextConfig = proto.Field( 

2690 proto.MESSAGE, 

2691 number=4, 

2692 oneof="output_format", 

2693 message=TextConfig, 

2694 ) 

2695 avro_config: AvroConfig = proto.Field( 

2696 proto.MESSAGE, 

2697 number=5, 

2698 oneof="output_format", 

2699 message=AvroConfig, 

2700 ) 

2701 max_duration: duration_pb2.Duration = proto.Field( 

2702 proto.MESSAGE, 

2703 number=6, 

2704 message=duration_pb2.Duration, 

2705 ) 

2706 max_bytes: int = proto.Field( 

2707 proto.INT64, 

2708 number=7, 

2709 ) 

2710 max_messages: int = proto.Field( 

2711 proto.INT64, 

2712 number=8, 

2713 ) 

2714 state: State = proto.Field( 

2715 proto.ENUM, 

2716 number=9, 

2717 enum=State, 

2718 ) 

2719 service_account_email: str = proto.Field( 

2720 proto.STRING, 

2721 number=11, 

2722 ) 

2723 

2724 

2725class ReceivedMessage(proto.Message): 

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

2727 

2728 Attributes: 

2729 ack_id (str): 

2730 Optional. This ID can be used to acknowledge 

2731 the received message. 

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

2733 Optional. The message. 

2734 delivery_attempt (int): 

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

2736 attempted to deliver the associated message to a subscriber. 

2737 

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

2739 ack_deadline exceeds) for this message. 

2740 

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

2742 An ack_deadline exceeds event is whenever a message is not 

2743 acknowledged within ack_deadline. Note that ack_deadline is 

2744 initially Subscription.ackDeadlineSeconds, but may get 

2745 extended automatically by the client library. 

2746 

2747 Upon the first delivery of a given message, 

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

2749 calculated at best effort and is approximate. 

2750 

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

2752 will be 0. 

2753 """ 

2754 

2755 ack_id: str = proto.Field( 

2756 proto.STRING, 

2757 number=1, 

2758 ) 

2759 message: "PubsubMessage" = proto.Field( 

2760 proto.MESSAGE, 

2761 number=2, 

2762 message="PubsubMessage", 

2763 ) 

2764 delivery_attempt: int = proto.Field( 

2765 proto.INT32, 

2766 number=3, 

2767 ) 

2768 

2769 

2770class GetSubscriptionRequest(proto.Message): 

2771 r"""Request for the GetSubscription method. 

2772 

2773 Attributes: 

2774 subscription (str): 

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

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

2777 """ 

2778 

2779 subscription: str = proto.Field( 

2780 proto.STRING, 

2781 number=1, 

2782 ) 

2783 

2784 

2785class UpdateSubscriptionRequest(proto.Message): 

2786 r"""Request for the UpdateSubscription method. 

2787 

2788 Attributes: 

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

2790 Required. The updated subscription object. 

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

2792 Required. Indicates which fields in the 

2793 provided subscription to update. Must be 

2794 specified and non-empty. 

2795 """ 

2796 

2797 subscription: "Subscription" = proto.Field( 

2798 proto.MESSAGE, 

2799 number=1, 

2800 message="Subscription", 

2801 ) 

2802 update_mask: field_mask_pb2.FieldMask = proto.Field( 

2803 proto.MESSAGE, 

2804 number=2, 

2805 message=field_mask_pb2.FieldMask, 

2806 ) 

2807 

2808 

2809class ListSubscriptionsRequest(proto.Message): 

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

2811 

2812 Attributes: 

2813 project (str): 

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

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

2816 page_size (int): 

2817 Optional. Maximum number of subscriptions to 

2818 return. 

2819 page_token (str): 

2820 Optional. The value returned by the last 

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

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

2823 the system should return the next page of data. 

2824 """ 

2825 

2826 project: str = proto.Field( 

2827 proto.STRING, 

2828 number=1, 

2829 ) 

2830 page_size: int = proto.Field( 

2831 proto.INT32, 

2832 number=2, 

2833 ) 

2834 page_token: str = proto.Field( 

2835 proto.STRING, 

2836 number=3, 

2837 ) 

2838 

2839 

2840class ListSubscriptionsResponse(proto.Message): 

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

2842 

2843 Attributes: 

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

2845 Optional. The subscriptions that match the 

2846 request. 

2847 next_page_token (str): 

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

2849 subscriptions that match the request; this value should be 

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

2851 subscriptions. 

2852 """ 

2853 

2854 @property 

2855 def raw_page(self): 

2856 return self 

2857 

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

2859 proto.MESSAGE, 

2860 number=1, 

2861 message="Subscription", 

2862 ) 

2863 next_page_token: str = proto.Field( 

2864 proto.STRING, 

2865 number=2, 

2866 ) 

2867 

2868 

2869class DeleteSubscriptionRequest(proto.Message): 

2870 r"""Request for the DeleteSubscription method. 

2871 

2872 Attributes: 

2873 subscription (str): 

2874 Required. The subscription to delete. Format is 

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

2876 """ 

2877 

2878 subscription: str = proto.Field( 

2879 proto.STRING, 

2880 number=1, 

2881 ) 

2882 

2883 

2884class ModifyPushConfigRequest(proto.Message): 

2885 r"""Request for the ModifyPushConfig method. 

2886 

2887 Attributes: 

2888 subscription (str): 

2889 Required. The name of the subscription. Format is 

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

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

2892 Required. The push configuration for future deliveries. 

2893 

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

2895 should stop pushing messages from the given subscription and 

2896 allow messages to be pulled and acknowledged - effectively 

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

2898 not called. 

2899 """ 

2900 

2901 subscription: str = proto.Field( 

2902 proto.STRING, 

2903 number=1, 

2904 ) 

2905 push_config: "PushConfig" = proto.Field( 

2906 proto.MESSAGE, 

2907 number=2, 

2908 message="PushConfig", 

2909 ) 

2910 

2911 

2912class PullRequest(proto.Message): 

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

2914 

2915 Attributes: 

2916 subscription (str): 

2917 Required. The subscription from which messages should be 

2918 pulled. Format is 

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

2920 return_immediately (bool): 

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

2922 immediately even if it there are no messages available to 

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

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

2925 message is available, rather than returning no messages. 

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

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

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

2929 max_messages (int): 

2930 Required. The maximum number of messages to 

2931 return for this request. Must be a positive 

2932 integer. The Pub/Sub system may return fewer 

2933 than the number specified. 

2934 """ 

2935 

2936 subscription: str = proto.Field( 

2937 proto.STRING, 

2938 number=1, 

2939 ) 

2940 return_immediately: bool = proto.Field( 

2941 proto.BOOL, 

2942 number=2, 

2943 ) 

2944 max_messages: int = proto.Field( 

2945 proto.INT32, 

2946 number=3, 

2947 ) 

2948 

2949 

2950class PullResponse(proto.Message): 

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

2952 

2953 Attributes: 

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

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

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

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

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

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

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

2961 """ 

2962 

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

2964 proto.MESSAGE, 

2965 number=1, 

2966 message="ReceivedMessage", 

2967 ) 

2968 

2969 

2970class ModifyAckDeadlineRequest(proto.Message): 

2971 r"""Request for the ModifyAckDeadline method. 

2972 

2973 Attributes: 

2974 subscription (str): 

2975 Required. The name of the subscription. Format is 

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

2977 ack_ids (MutableSequence[str]): 

2978 Required. List of acknowledgment IDs. 

2979 ack_deadline_seconds (int): 

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

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

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

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

2984 zero might immediately make the message available for 

2985 delivery to another subscriber client. This typically 

2986 results in an increase in the rate of message redeliveries 

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

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

2989 single request is 600 seconds (10 minutes). 

2990 """ 

2991 

2992 subscription: str = proto.Field( 

2993 proto.STRING, 

2994 number=1, 

2995 ) 

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

2997 proto.STRING, 

2998 number=4, 

2999 ) 

3000 ack_deadline_seconds: int = proto.Field( 

3001 proto.INT32, 

3002 number=3, 

3003 ) 

3004 

3005 

3006class AcknowledgeRequest(proto.Message): 

3007 r"""Request for the Acknowledge method. 

3008 

3009 Attributes: 

3010 subscription (str): 

3011 Required. The subscription whose message is being 

3012 acknowledged. Format is 

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

3014 ack_ids (MutableSequence[str]): 

3015 Required. The acknowledgment ID for the messages being 

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

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

3018 """ 

3019 

3020 subscription: str = proto.Field( 

3021 proto.STRING, 

3022 number=1, 

3023 ) 

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

3025 proto.STRING, 

3026 number=2, 

3027 ) 

3028 

3029 

3030class StreamingPullRequest(proto.Message): 

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

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

3033 acknowledgments and ack deadline modifications from the client to 

3034 the server. 

3035 

3036 Attributes: 

3037 subscription (str): 

3038 Required. The subscription for which to initialize the new 

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

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

3041 client to server. Format is 

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

3043 ack_ids (MutableSequence[str]): 

3044 Optional. List of acknowledgment IDs for acknowledging 

3045 previously received messages (received on this stream or a 

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

3047 corresponding message may be redelivered later. 

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

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

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

3051 modify_deadline_seconds (MutableSequence[int]): 

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

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

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

3055 it differs the stream will be aborted with 

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

3057 to the element in the same position in 

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

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

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

3061 new ack deadline will expire 10 seconds after this request 

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

3063 made available for another streaming or non-streaming pull 

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

3065 aborted with status ``INVALID_ARGUMENT``. 

3066 modify_deadline_ack_ids (MutableSequence[str]): 

3067 Optional. List of acknowledgment IDs whose deadline will be 

3068 modified based on the corresponding element in 

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

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

3071 the subscriber, or to make the message available for 

3072 redelivery if the processing was interrupted. 

3073 stream_ack_deadline_seconds (int): 

3074 Required. The ack deadline to use for the 

3075 stream. This must be provided in the first 

3076 request on the stream, but it can also be 

3077 updated on subsequent requests from client to 

3078 server. The minimum deadline you can specify is 

3079 10 seconds. The maximum deadline you can specify 

3080 is 600 seconds (10 minutes). 

3081 client_id (str): 

3082 Optional. A unique identifier that is used to distinguish 

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

3084 on the initial request. When a stream disconnects and 

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

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

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

3088 client_id should not be used for different client instances. 

3089 max_outstanding_messages (int): 

3090 Optional. Flow control settings for the maximum number of 

3091 outstanding messages. When there are 

3092 ``max_outstanding_messages`` currently sent to the streaming 

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

3094 server stops sending more messages. The sending of messages 

3095 resumes once the number of outstanding messages is less than 

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

3097 number of outstanding messages. This property can only be 

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

3099 subsequent request, the stream will be aborted with status 

3100 ``INVALID_ARGUMENT``. 

3101 max_outstanding_bytes (int): 

3102 Optional. Flow control settings for the maximum number of 

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

3104 or more worth of messages currently sent to the streaming 

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

3106 server will stop sending more messages. The sending of 

3107 messages resumes once the number of outstanding bytes is 

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

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

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

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

3112 status ``INVALID_ARGUMENT``. 

3113 protocol_version (int): 

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

3115 property can only be set on the initial 

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

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

3118 """ 

3119 

3120 subscription: str = proto.Field( 

3121 proto.STRING, 

3122 number=1, 

3123 ) 

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

3125 proto.STRING, 

3126 number=2, 

3127 ) 

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

3129 proto.INT32, 

3130 number=3, 

3131 ) 

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

3133 proto.STRING, 

3134 number=4, 

3135 ) 

3136 stream_ack_deadline_seconds: int = proto.Field( 

3137 proto.INT32, 

3138 number=5, 

3139 ) 

3140 client_id: str = proto.Field( 

3141 proto.STRING, 

3142 number=6, 

3143 ) 

3144 max_outstanding_messages: int = proto.Field( 

3145 proto.INT64, 

3146 number=7, 

3147 ) 

3148 max_outstanding_bytes: int = proto.Field( 

3149 proto.INT64, 

3150 number=8, 

3151 ) 

3152 protocol_version: int = proto.Field( 

3153 proto.INT64, 

3154 number=10, 

3155 ) 

3156 

3157 

3158class StreamingPullResponse(proto.Message): 

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

3160 stream messages from the server to the client. 

3161 

3162 Attributes: 

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

3164 Optional. Received Pub/Sub messages. This 

3165 will not be empty. 

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

3167 Optional. This field will only be set if 

3168 ``enable_exactly_once_delivery`` is set to ``true`` and is 

3169 not guaranteed to be populated. 

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

3171 Optional. This field will only be set if 

3172 ``enable_exactly_once_delivery`` is set to ``true`` and is 

3173 not guaranteed to be populated. 

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

3175 Optional. Properties associated with this 

3176 subscription. 

3177 """ 

3178 

3179 class AcknowledgeConfirmation(proto.Message): 

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

3181 acknowledge a previously received message. 

3182 

3183 Attributes: 

3184 ack_ids (MutableSequence[str]): 

3185 Optional. Successfully processed 

3186 acknowledgment IDs. 

3187 invalid_ack_ids (MutableSequence[str]): 

3188 Optional. List of acknowledgment IDs that 

3189 were malformed or whose acknowledgment deadline 

3190 has expired. 

3191 unordered_ack_ids (MutableSequence[str]): 

3192 Optional. List of acknowledgment IDs that 

3193 were out of order. 

3194 temporary_failed_ack_ids (MutableSequence[str]): 

3195 Optional. List of acknowledgment IDs that 

3196 failed processing with temporary issues. 

3197 """ 

3198 

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

3200 proto.STRING, 

3201 number=1, 

3202 ) 

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

3204 proto.STRING, 

3205 number=2, 

3206 ) 

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

3208 proto.STRING, 

3209 number=3, 

3210 ) 

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

3212 proto.STRING, 

3213 number=4, 

3214 ) 

3215 

3216 class ModifyAckDeadlineConfirmation(proto.Message): 

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

3218 modify the deadline for a specific message. 

3219 

3220 Attributes: 

3221 ack_ids (MutableSequence[str]): 

3222 Optional. Successfully processed 

3223 acknowledgment IDs. 

3224 invalid_ack_ids (MutableSequence[str]): 

3225 Optional. List of acknowledgment IDs that 

3226 were malformed or whose acknowledgment deadline 

3227 has expired. 

3228 temporary_failed_ack_ids (MutableSequence[str]): 

3229 Optional. List of acknowledgment IDs that 

3230 failed processing with temporary issues. 

3231 """ 

3232 

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

3234 proto.STRING, 

3235 number=1, 

3236 ) 

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

3238 proto.STRING, 

3239 number=2, 

3240 ) 

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

3242 proto.STRING, 

3243 number=3, 

3244 ) 

3245 

3246 class SubscriptionProperties(proto.Message): 

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

3248 

3249 Attributes: 

3250 exactly_once_delivery_enabled (bool): 

3251 Optional. True iff exactly once delivery is 

3252 enabled for this subscription. 

3253 message_ordering_enabled (bool): 

3254 Optional. True iff message ordering is 

3255 enabled for this subscription. 

3256 """ 

3257 

3258 exactly_once_delivery_enabled: bool = proto.Field( 

3259 proto.BOOL, 

3260 number=1, 

3261 ) 

3262 message_ordering_enabled: bool = proto.Field( 

3263 proto.BOOL, 

3264 number=2, 

3265 ) 

3266 

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

3268 proto.MESSAGE, 

3269 number=1, 

3270 message="ReceivedMessage", 

3271 ) 

3272 acknowledge_confirmation: AcknowledgeConfirmation = proto.Field( 

3273 proto.MESSAGE, 

3274 number=5, 

3275 message=AcknowledgeConfirmation, 

3276 ) 

3277 modify_ack_deadline_confirmation: ModifyAckDeadlineConfirmation = proto.Field( 

3278 proto.MESSAGE, 

3279 number=3, 

3280 message=ModifyAckDeadlineConfirmation, 

3281 ) 

3282 subscription_properties: SubscriptionProperties = proto.Field( 

3283 proto.MESSAGE, 

3284 number=4, 

3285 message=SubscriptionProperties, 

3286 ) 

3287 

3288 

3289class CreateSnapshotRequest(proto.Message): 

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

3291 

3292 Attributes: 

3293 name (str): 

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

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

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

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

3298 specify a name. See the `resource name 

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

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

3301 subscription (str): 

3302 Required. The subscription whose backlog the snapshot 

3303 retains. Specifically, the created snapshot is guaranteed to 

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

3305 precisely, this is defined as the messages in the 

3306 subscription's backlog that are unacknowledged upon the 

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

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

3309 topic following the successful completion of the 

3310 CreateSnapshot request. Format is 

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

3312 labels (MutableMapping[str, str]): 

3313 Optional. See `Creating and managing 

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

3315 """ 

3316 

3317 name: str = proto.Field( 

3318 proto.STRING, 

3319 number=1, 

3320 ) 

3321 subscription: str = proto.Field( 

3322 proto.STRING, 

3323 number=2, 

3324 ) 

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

3326 proto.STRING, 

3327 proto.STRING, 

3328 number=3, 

3329 ) 

3330 

3331 

3332class UpdateSnapshotRequest(proto.Message): 

3333 r"""Request for the UpdateSnapshot method. 

3334 

3335 Attributes: 

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

3337 Required. The updated snapshot object. 

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

3339 Required. Indicates which fields in the 

3340 provided snapshot to update. Must be specified 

3341 and non-empty. 

3342 """ 

3343 

3344 snapshot: "Snapshot" = proto.Field( 

3345 proto.MESSAGE, 

3346 number=1, 

3347 message="Snapshot", 

3348 ) 

3349 update_mask: field_mask_pb2.FieldMask = proto.Field( 

3350 proto.MESSAGE, 

3351 number=2, 

3352 message=field_mask_pb2.FieldMask, 

3353 ) 

3354 

3355 

3356class Snapshot(proto.Message): 

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

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

3359 operations, which allow you to manage message acknowledgments in 

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

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

3362 

3363 Attributes: 

3364 name (str): 

3365 Optional. The name of the snapshot. 

3366 topic (str): 

3367 Optional. The name of the topic from which 

3368 this snapshot is retaining messages. 

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

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

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

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

3373 determined at creation by the existing backlog in the source 

3374 subscription. Specifically, the lifetime of the snapshot is 

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

3376 For example, consider a subscription whose oldest unacked 

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

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

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

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

3381 snapshot that would expire in less than 1 hour after 

3382 creation. 

3383 labels (MutableMapping[str, str]): 

3384 Optional. See [Creating and managing labels] 

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

3386 """ 

3387 

3388 name: str = proto.Field( 

3389 proto.STRING, 

3390 number=1, 

3391 ) 

3392 topic: str = proto.Field( 

3393 proto.STRING, 

3394 number=2, 

3395 ) 

3396 expire_time: timestamp_pb2.Timestamp = proto.Field( 

3397 proto.MESSAGE, 

3398 number=3, 

3399 message=timestamp_pb2.Timestamp, 

3400 ) 

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

3402 proto.STRING, 

3403 proto.STRING, 

3404 number=4, 

3405 ) 

3406 

3407 

3408class GetSnapshotRequest(proto.Message): 

3409 r"""Request for the GetSnapshot method. 

3410 

3411 Attributes: 

3412 snapshot (str): 

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

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

3415 """ 

3416 

3417 snapshot: str = proto.Field( 

3418 proto.STRING, 

3419 number=1, 

3420 ) 

3421 

3422 

3423class ListSnapshotsRequest(proto.Message): 

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

3425 

3426 Attributes: 

3427 project (str): 

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

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

3430 page_size (int): 

3431 Optional. Maximum number of snapshots to 

3432 return. 

3433 page_token (str): 

3434 Optional. The value returned by the last 

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

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

3437 system should return the next page of data. 

3438 """ 

3439 

3440 project: str = proto.Field( 

3441 proto.STRING, 

3442 number=1, 

3443 ) 

3444 page_size: int = proto.Field( 

3445 proto.INT32, 

3446 number=2, 

3447 ) 

3448 page_token: str = proto.Field( 

3449 proto.STRING, 

3450 number=3, 

3451 ) 

3452 

3453 

3454class ListSnapshotsResponse(proto.Message): 

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

3456 

3457 Attributes: 

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

3459 Optional. The resulting snapshots. 

3460 next_page_token (str): 

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

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

3463 in a new ``ListSnapshotsRequest``. 

3464 """ 

3465 

3466 @property 

3467 def raw_page(self): 

3468 return self 

3469 

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

3471 proto.MESSAGE, 

3472 number=1, 

3473 message="Snapshot", 

3474 ) 

3475 next_page_token: str = proto.Field( 

3476 proto.STRING, 

3477 number=2, 

3478 ) 

3479 

3480 

3481class DeleteSnapshotRequest(proto.Message): 

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

3483 

3484 Attributes: 

3485 snapshot (str): 

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

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

3488 """ 

3489 

3490 snapshot: str = proto.Field( 

3491 proto.STRING, 

3492 number=1, 

3493 ) 

3494 

3495 

3496class SeekRequest(proto.Message): 

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

3498 

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

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

3501 Setting any member of the oneof automatically clears all other 

3502 members. 

3503 

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

3505 

3506 Attributes: 

3507 subscription (str): 

3508 Required. The subscription to affect. 

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

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

3511 subscription that were published before this time are marked 

3512 as acknowledged, and messages retained in the subscription 

3513 that were published after this time are marked as 

3514 unacknowledged. Note that this operation affects only those 

3515 messages retained in the subscription (configured by the 

3516 combination of ``message_retention_duration`` and 

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

3518 corresponds to a point before the message retention window 

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

3520 subscription creation time), only retained messages will be 

3521 marked as unacknowledged, and already-expunged messages will 

3522 not be restored. 

3523 

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

3525 snapshot (str): 

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

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

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

3529 

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

3531 """ 

3532 

3533 subscription: str = proto.Field( 

3534 proto.STRING, 

3535 number=1, 

3536 ) 

3537 time: timestamp_pb2.Timestamp = proto.Field( 

3538 proto.MESSAGE, 

3539 number=2, 

3540 oneof="target", 

3541 message=timestamp_pb2.Timestamp, 

3542 ) 

3543 snapshot: str = proto.Field( 

3544 proto.STRING, 

3545 number=3, 

3546 oneof="target", 

3547 ) 

3548 

3549 

3550class SeekResponse(proto.Message): 

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

3552 

3553 

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