@@ -60,7 +60,7 @@ def create_topic(project_id: str, topic_id: str) -> None:
60
60
# [END pubsub_create_topic]
61
61
62
62
63
- def create_topic_kinesis_ingestion (
63
+ def create_topic_with_kinesis_ingestion (
64
64
project_id : str ,
65
65
topic_id : str ,
66
66
stream_arn : str ,
@@ -69,7 +69,7 @@ def create_topic_kinesis_ingestion(
69
69
gcp_service_account : str ,
70
70
) -> None :
71
71
"""Create a new Pub/Sub topic with AWS Kinesis Ingestion Settings."""
72
- # [START pubsub_create_topic_kinesis_ingestion ]
72
+ # [START pubsub_create_topic_with_kinesis_ingestion ]
73
73
from google .cloud import pubsub_v1
74
74
from google .pubsub_v1 .types import Topic
75
75
from google .pubsub_v1 .types import IngestionDataSourceSettings
@@ -100,10 +100,10 @@ def create_topic_kinesis_ingestion(
100
100
topic = publisher .create_topic (request = request )
101
101
102
102
print (f"Created topic: { topic .name } with AWS Kinesis Ingestion Settings" )
103
- # [END pubsub_create_topic_kinesis_ingestion ]
103
+ # [END pubsub_create_topic_with_kinesis_ingestion ]
104
104
105
105
106
- def update_topic_kinesis_ingestion (
106
+ def update_topic_type (
107
107
project_id : str ,
108
108
topic_id : str ,
109
109
stream_arn : str ,
@@ -112,7 +112,7 @@ def update_topic_kinesis_ingestion(
112
112
gcp_service_account : str ,
113
113
) -> None :
114
114
"""Update Pub/Sub topic with AWS Kinesis Ingestion Settings."""
115
- # [START pubsub_update_topic_kinesis_ingestion ]
115
+ # [START pubsub_update_topic_type ]
116
116
from google .cloud import pubsub_v1
117
117
from google .pubsub_v1 .types import Topic
118
118
from google .pubsub_v1 .types import IngestionDataSourceSettings
@@ -149,7 +149,7 @@ def update_topic_kinesis_ingestion(
149
149
print (f"Updated topic: { topic .name } with AWS Kinesis Ingestion Settings" )
150
150
151
151
152
- # [END pubsub_update_topic_kinesis_ingestion ]
152
+ # [END pubsub_update_topic_type ]
153
153
154
154
155
155
def delete_topic (project_id : str , topic_id : str ) -> None :
@@ -522,23 +522,23 @@ def detach_subscription(project_id: str, subscription_id: str) -> None:
522
522
create_parser = subparsers .add_parser ("create" , help = create_topic .__doc__ )
523
523
create_parser .add_argument ("topic_id" )
524
524
525
- create_topic_kinesis_ingestion_parser = subparsers .add_parser (
526
- "create_kinesis_ingestion" , help = create_topic_kinesis_ingestion .__doc__
525
+ create_topic_with_kinesis_ingestion_parser = subparsers .add_parser (
526
+ "create_kinesis_ingestion" , help = create_topic_with_kinesis_ingestion .__doc__
527
527
)
528
- create_topic_kinesis_ingestion_parser .add_argument ("topic_id" )
529
- create_topic_kinesis_ingestion_parser .add_argument ("stream_arn" )
530
- create_topic_kinesis_ingestion_parser .add_argument ("consumer_arn" )
531
- create_topic_kinesis_ingestion_parser .add_argument ("aws_role_arn" )
532
- create_topic_kinesis_ingestion_parser .add_argument ("gcp_service_account" )
533
-
534
- update_topic_kinesis_ingestion_parser = subparsers .add_parser (
535
- "update_kinesis_ingestion" , help = update_topic_kinesis_ingestion .__doc__
528
+ create_topic_with_kinesis_ingestion_parser .add_argument ("topic_id" )
529
+ create_topic_with_kinesis_ingestion_parser .add_argument ("stream_arn" )
530
+ create_topic_with_kinesis_ingestion_parser .add_argument ("consumer_arn" )
531
+ create_topic_with_kinesis_ingestion_parser .add_argument ("aws_role_arn" )
532
+ create_topic_with_kinesis_ingestion_parser .add_argument ("gcp_service_account" )
533
+
534
+ update_topic_type_parser = subparsers .add_parser (
535
+ "update_kinesis_ingestion" , help = update_topic_type .__doc__
536
536
)
537
- update_topic_kinesis_ingestion_parser .add_argument ("topic_id" )
538
- update_topic_kinesis_ingestion_parser .add_argument ("stream_arn" )
539
- update_topic_kinesis_ingestion_parser .add_argument ("consumer_arn" )
540
- update_topic_kinesis_ingestion_parser .add_argument ("aws_role_arn" )
541
- update_topic_kinesis_ingestion_parser .add_argument ("gcp_service_account" )
537
+ update_topic_type_parser .add_argument ("topic_id" )
538
+ update_topic_type_parser .add_argument ("stream_arn" )
539
+ update_topic_type_parser .add_argument ("consumer_arn" )
540
+ update_topic_type_parser .add_argument ("aws_role_arn" )
541
+ update_topic_type_parser .add_argument ("gcp_service_account" )
542
542
543
543
delete_parser = subparsers .add_parser ("delete" , help = delete_topic .__doc__ )
544
544
delete_parser .add_argument ("topic_id" )
@@ -601,7 +601,7 @@ def detach_subscription(project_id: str, subscription_id: str) -> None:
601
601
elif args .command == "create" :
602
602
create_topic (args .project_id , args .topic_id )
603
603
elif args .command == "create_kinesis_ingestion" :
604
- create_topic_kinesis_ingestion (
604
+ create_topic_with_kinesis_ingestion (
605
605
args .project_id ,
606
606
args .topic_id ,
607
607
args .stream_arn ,
@@ -610,7 +610,7 @@ def detach_subscription(project_id: str, subscription_id: str) -> None:
610
610
args .gcp_service_account ,
611
611
)
612
612
elif args .command == "update_kinesis_ingestion" :
613
- update_topic_kinesis_ingestion (
613
+ update_topic_type (
614
614
args .project_id ,
615
615
args .topic_id ,
616
616
args .stream_arn ,
0 commit comments