1818import  argparse 
1919
2020
21- def  create_feed (project_id , feed_id , asset_names , topic ):
21+ def  create_feed (project_id , feed_id , asset_names , topic ,  content_type ):
2222 # [START asset_quickstart_create_feed] 
2323 from  google .cloud  import  asset_v1 
2424
2525 # TODO project_id = 'Your Google Cloud Project ID' 
2626 # TODO feed_id = 'Feed ID you want to create' 
2727 # TODO asset_names = 'List of asset names the feed listen to' 
2828 # TODO topic = "Topic name of the feed" 
29+  # TODO content_type ="Content type of the feed" 
2930
3031 client  =  asset_v1 .AssetServiceClient ()
3132 parent  =  "projects/{}" .format (project_id )
3233 feed  =  asset_v1 .Feed ()
3334 feed .asset_names .extend (asset_names )
3435 feed .feed_output_config .pubsub_destination .topic  =  topic 
36+  feed .content_type  =  content_type 
3537 response  =  client .create_feed (
3638 request = {"parent" : parent , "feed_id" : feed_id , "feed" : feed }
3739 )
@@ -48,5 +50,6 @@ def create_feed(project_id, feed_id, asset_names, topic):
4850 parser .add_argument ("feed_id" , help = "Feed ID you want to create" )
4951 parser .add_argument ("asset_names" , help = "List of asset names the feed listen to" )
5052 parser .add_argument ("topic" , help = "Topic name of the feed" )
53+  parser .add_argument ("content_type" , help = "Content type of the feed" )
5154 args  =  parser .parse_args ()
52-  create_feed (args .project_id , args .feed_id , args .asset_names , args .topic )
55+  create_feed (args .project_id , args .feed_id , args .asset_names , args .topic ,  args . content_type )
0 commit comments