@@ -162,9 +162,6 @@ with Novu(
162162
163163 res = novu.trigger(trigger_event_request_dto = novu_py.TriggerEventRequestDto(
164164 workflow_id = " workflow_identifier" ,
165- to = novu_py.SubscriberPayloadDto(
166- subscriber_id = " <id>" ,
167- ),
168165 payload = {
169166 " comment_id" : " string" ,
170167 " post" : {
@@ -178,6 +175,9 @@ with Novu(
178175 },
179176 },
180177 },
178+ to = novu_py.SubscriberPayloadDto(
179+ subscriber_id = " <id>" ,
180+ ),
181181 ))
182182
183183 # Handle response
@@ -201,9 +201,6 @@ async def main():
201201
202202 res = await novu.trigger_async(trigger_event_request_dto = novu_py.TriggerEventRequestDto(
203203 workflow_id = " workflow_identifier" ,
204- to = novu_py.SubscriberPayloadDto(
205- subscriber_id = " <id>" ,
206- ),
207204 payload = {
208205 " comment_id" : " string" ,
209206 " post" : {
@@ -217,6 +214,9 @@ async def main():
217214 },
218215 },
219216 },
217+ to = novu_py.SubscriberPayloadDto(
218+ subscriber_id = " <id>" ,
219+ ),
220220 ))
221221
222222 # Handle response
@@ -335,9 +335,6 @@ with Novu(
335335 " events" : [
336336 novu_py.TriggerEventRequestDto(
337337 workflow_id = " workflow_identifier" ,
338- to = novu_py.SubscriberPayloadDto(
339- subscriber_id = " <id>" ,
340- ),
341338 payload = {
342339 " comment_id" : " string" ,
343340 " post" : {
@@ -351,15 +348,12 @@ with Novu(
351348 },
352349 },
353350 },
351+ to = novu_py.SubscriberPayloadDto(
352+ subscriber_id = " <id>" ,
353+ ),
354354 ),
355355 novu_py.TriggerEventRequestDto(
356356 workflow_id = " workflow_identifier" ,
357- to = [
358- novu_py.TopicPayloadDto(
359- topic_key = " <value>" ,
360- type = novu_py.TriggerRecipientsTypeEnum.SUBSCRIBER ,
361- ),
362- ],
363357 payload = {
364358 " comment_id" : " string" ,
365359 " post" : {
@@ -373,13 +367,15 @@ with Novu(
373367 },
374368 },
375369 },
370+ to = [
371+ novu_py.TopicPayloadDto(
372+ topic_key = " <value>" ,
373+ type = novu_py.TriggerRecipientsTypeEnum.SUBSCRIBER ,
374+ ),
375+ ],
376376 ),
377377 novu_py.TriggerEventRequestDto(
378378 workflow_id = " workflow_identifier" ,
379- to = [
380- " SUBSCRIBER_ID" ,
381- " SUBSCRIBER_ID" ,
382- ],
383379 payload = {
384380 " comment_id" : " string" ,
385381 " post" : {
@@ -393,6 +389,10 @@ with Novu(
393389 },
394390 },
395391 },
392+ to = [
393+ " SUBSCRIBER_ID" ,
394+ " SUBSCRIBER_ID" ,
395+ ],
396396 ),
397397 ],
398398 })
@@ -420,9 +420,6 @@ async def main():
420420 " events" : [
421421 novu_py.TriggerEventRequestDto(
422422 workflow_id = " workflow_identifier" ,
423- to = novu_py.SubscriberPayloadDto(
424- subscriber_id = " <id>" ,
425- ),
426423 payload = {
427424 " comment_id" : " string" ,
428425 " post" : {
@@ -436,15 +433,12 @@ async def main():
436433 },
437434 },
438435 },
436+ to = novu_py.SubscriberPayloadDto(
437+ subscriber_id = " <id>" ,
438+ ),
439439 ),
440440 novu_py.TriggerEventRequestDto(
441441 workflow_id = " workflow_identifier" ,
442- to = [
443- novu_py.TopicPayloadDto(
444- topic_key = " <value>" ,
445- type = novu_py.TriggerRecipientsTypeEnum.SUBSCRIBER ,
446- ),
447- ],
448442 payload = {
449443 " comment_id" : " string" ,
450444 " post" : {
@@ -458,13 +452,15 @@ async def main():
458452 },
459453 },
460454 },
455+ to = [
456+ novu_py.TopicPayloadDto(
457+ topic_key = " <value>" ,
458+ type = novu_py.TriggerRecipientsTypeEnum.SUBSCRIBER ,
459+ ),
460+ ],
461461 ),
462462 novu_py.TriggerEventRequestDto(
463463 workflow_id = " workflow_identifier" ,
464- to = [
465- " SUBSCRIBER_ID" ,
466- " SUBSCRIBER_ID" ,
467- ],
468464 payload = {
469465 " comment_id" : " string" ,
470466 " post" : {
@@ -478,6 +474,10 @@ async def main():
478474 },
479475 },
480476 },
477+ to = [
478+ " SUBSCRIBER_ID" ,
479+ " SUBSCRIBER_ID" ,
480+ ],
481481 ),
482482 ],
483483 })
@@ -539,6 +539,7 @@ asyncio.run(main())
539539* [ patch] ( docs/sdks/subscribers/README.md#patch ) - Patch subscriber
540540* [ delete] ( docs/sdks/subscribers/README.md#delete ) - Delete subscriber
541541* [ list] ( docs/sdks/subscribers/README.md#list ) - Get subscribers
542+ * [ upsert] ( docs/sdks/subscribers/README.md#upsert ) - Upsert subscriber
542543* [ create_bulk] ( docs/sdks/subscribers/README.md#create_bulk ) - Bulk create subscribers
543544
544545#### [ subscribers.authentication] ( docs/sdks/authentication/README.md )
@@ -633,9 +634,6 @@ with Novu(
633634
634635 res = novu.trigger(trigger_event_request_dto = novu_py.TriggerEventRequestDto(
635636 workflow_id = " workflow_identifier" ,
636- to = novu_py.SubscriberPayloadDto(
637- subscriber_id = " <id>" ,
638- ),
639637 payload = {
640638 " comment_id" : " string" ,
641639 " post" : {
@@ -649,6 +647,9 @@ with Novu(
649647 },
650648 },
651649 },
650+ to = novu_py.SubscriberPayloadDto(
651+ subscriber_id = " <id>" ,
652+ ),
652653 ),
653654 RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ))
654655
@@ -671,9 +672,6 @@ with Novu(
671672
672673 res = novu.trigger(trigger_event_request_dto = novu_py.TriggerEventRequestDto(
673674 workflow_id = " workflow_identifier" ,
674- to = novu_py.SubscriberPayloadDto(
675- subscriber_id = " <id>" ,
676- ),
677675 payload = {
678676 " comment_id" : " string" ,
679677 " post" : {
@@ -687,6 +685,9 @@ with Novu(
687685 },
688686 },
689687 },
688+ to = novu_py.SubscriberPayloadDto(
689+ subscriber_id = " <id>" ,
690+ ),
690691 ))
691692
692693 # Handle response
@@ -734,9 +735,6 @@ with Novu(
734735
735736 res = novu.trigger(trigger_event_request_dto = novu_py.TriggerEventRequestDto(
736737 workflow_id = " workflow_identifier" ,
737- to = novu_py.SubscriberPayloadDto(
738- subscriber_id = " <id>" ,
739- ),
740738 payload = {
741739 " comment_id" : " string" ,
742740 " post" : {
@@ -750,6 +748,9 @@ with Novu(
750748 },
751749 },
752750 },
751+ to = novu_py.SubscriberPayloadDto(
752+ subscriber_id = " <id>" ,
753+ ),
753754 ))
754755
755756 # Handle response
@@ -799,9 +800,6 @@ with Novu(
799800
800801 res = novu.trigger(trigger_event_request_dto = novu_py.TriggerEventRequestDto(
801802 workflow_id = " workflow_identifier" ,
802- to = novu_py.SubscriberPayloadDto(
803- subscriber_id = " <id>" ,
804- ),
805803 payload = {
806804 " comment_id" : " string" ,
807805 " post" : {
@@ -815,6 +813,9 @@ with Novu(
815813 },
816814 },
817815 },
816+ to = novu_py.SubscriberPayloadDto(
817+ subscriber_id = " <id>" ,
818+ ),
818819 ))
819820
820821 # Handle response
@@ -837,9 +838,6 @@ with Novu(
837838
838839 res = novu.trigger(trigger_event_request_dto = novu_py.TriggerEventRequestDto(
839840 workflow_id = " workflow_identifier" ,
840- to = novu_py.SubscriberPayloadDto(
841- subscriber_id = " <id>" ,
842- ),
843841 payload = {
844842 " comment_id" : " string" ,
845843 " post" : {
@@ -853,6 +851,9 @@ with Novu(
853851 },
854852 },
855853 },
854+ to = novu_py.SubscriberPayloadDto(
855+ subscriber_id = " <id>" ,
856+ ),
856857 ))
857858
858859 # Handle response
@@ -965,9 +966,6 @@ with Novu(
965966
966967 res = novu.trigger(trigger_event_request_dto = novu_py.TriggerEventRequestDto(
967968 workflow_id = " workflow_identifier" ,
968- to = novu_py.SubscriberPayloadDto(
969- subscriber_id = " <id>" ,
970- ),
971969 payload = {
972970 " comment_id" : " string" ,
973971 " post" : {
@@ -981,6 +979,9 @@ with Novu(
981979 },
982980 },
983981 },
982+ to = novu_py.SubscriberPayloadDto(
983+ subscriber_id = " <id>" ,
984+ ),
984985 ))
985986
986987 # Handle response
0 commit comments