@@ -60,7 +60,7 @@ def create_topic(project_id: str, topic_id: str) -> None:
6060 # [END pubsub_create_topic]
6161
6262
63- def create_topic_kinesis_ingestion (
63+ def create_topic_with_kinesis_ingestion (
6464 project_id : str ,
6565 topic_id : str ,
6666 stream_arn : str ,
@@ -69,7 +69,7 @@ def create_topic_kinesis_ingestion(
6969 gcp_service_account : str ,
7070) -> None :
7171 """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 ]
7373 from google .cloud import pubsub_v1
7474 from google .pubsub_v1 .types import Topic
7575 from google .pubsub_v1 .types import IngestionDataSourceSettings
@@ -100,10 +100,10 @@ def create_topic_kinesis_ingestion(
100100 topic = publisher .create_topic (request = request )
101101
102102 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 ]
104104
105105
106- def update_topic_kinesis_ingestion (
106+ def update_topic_type (
107107 project_id : str ,
108108 topic_id : str ,
109109 stream_arn : str ,
@@ -112,7 +112,7 @@ def update_topic_kinesis_ingestion(
112112 gcp_service_account : str ,
113113) -> None :
114114 """Update Pub/Sub topic with AWS Kinesis Ingestion Settings."""
115- # [START pubsub_update_topic_kinesis_ingestion ]
115+ # [START pubsub_update_topic_type ]
116116 from google .cloud import pubsub_v1
117117 from google .pubsub_v1 .types import Topic
118118 from google .pubsub_v1 .types import IngestionDataSourceSettings
@@ -149,7 +149,7 @@ def update_topic_kinesis_ingestion(
149149 print (f"Updated topic: { topic .name } with AWS Kinesis Ingestion Settings" )
150150
151151
152- # [END pubsub_update_topic_kinesis_ingestion ]
152+ # [END pubsub_update_topic_type ]
153153
154154
155155def delete_topic (project_id : str , topic_id : str ) -> None :
@@ -522,23 +522,23 @@ def detach_subscription(project_id: str, subscription_id: str) -> None:
522522 create_parser = subparsers .add_parser ("create" , help = create_topic .__doc__ )
523523 create_parser .add_argument ("topic_id" )
524524
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__
527527 )
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__
536536 )
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" )
542542
543543 delete_parser = subparsers .add_parser ("delete" , help = delete_topic .__doc__ )
544544 delete_parser .add_argument ("topic_id" )
@@ -601,7 +601,7 @@ def detach_subscription(project_id: str, subscription_id: str) -> None:
601601 elif args .command == "create" :
602602 create_topic (args .project_id , args .topic_id )
603603 elif args .command == "create_kinesis_ingestion" :
604- create_topic_kinesis_ingestion (
604+ create_topic_with_kinesis_ingestion (
605605 args .project_id ,
606606 args .topic_id ,
607607 args .stream_arn ,
@@ -610,7 +610,7 @@ def detach_subscription(project_id: str, subscription_id: str) -> None:
610610 args .gcp_service_account ,
611611 )
612612 elif args .command == "update_kinesis_ingestion" :
613- update_topic_kinesis_ingestion (
613+ update_topic_type (
614614 args .project_id ,
615615 args .topic_id ,
616616 args .stream_arn ,
0 commit comments