1616 },
1717)
1818
19+ _UpdateParamsFrom = TypedDict (
20+ "_UpdateParamsFrom" ,
21+ {
22+ "from" : NotRequired [str ],
23+ },
24+ )
25+
1926
2027class _CreateResponse (TypedDict ):
2128 id : str
@@ -24,6 +31,13 @@ class _CreateResponse(TypedDict):
2431 """
2532
2633
34+ class _UpdateResponse (TypedDict ):
35+ id : str
36+ """
37+ id of the updated broadcast
38+ """
39+
40+
2741class _SendResponse (_CreateResponse ):
2842 pass
2943
@@ -81,6 +95,37 @@ class _CreateParamsDefault(_CreateParamsFrom):
8195 """
8296
8397
98+ class _UpdateParamsDefault (_UpdateParamsFrom ):
99+ broadcast_id : str
100+ """
101+ The ID of the broadcast you want to update.
102+ """
103+ audience_id : str
104+ """
105+ The ID of the audience you want to send to.
106+ """
107+ subject : NotRequired [str ]
108+ """
109+ Email subject.
110+ """
111+ reply_to : NotRequired [Union [List [str ], str ]]
112+ """
113+ Reply-to email address. For multiple addresses, send as an array of strings.
114+ """
115+ html : NotRequired [str ]
116+ """
117+ The HTML version of the message.
118+ """
119+ text : NotRequired [str ]
120+ """
121+ The text version of the message.
122+ """
123+ name : NotRequired [str ]
124+ """
125+ The friendly name of the broadcast. Only used for internal reference.
126+ """
127+
128+
84129class _SendBroadcastParams (TypedDict ):
85130 broadcast_id : str
86131 """
@@ -108,6 +153,20 @@ class CreateParams(_CreateParamsDefault):
108153 name (NotRequired[str]): The friendly name of the broadcast. Only used for internal reference.
109154 """
110155
156+ class UpdateParams (_UpdateParamsDefault ):
157+ """UpdateParams is the class that wraps the parameters for the update method.
158+
159+ Attributes:
160+ broadcast_id (str): The ID of the broadcast you want to update.
161+ audience_id (str): The ID of the audience you want to send to.
162+ from (str): The sender email address
163+ subject (NotRequired[str]): Email subject.
164+ reply_to (NotRequired[Union[List[str], str]]): Reply-to email address(es).
165+ html (NotRequired[str]): The HTML version of the message.
166+ text (NotRequired[str]): The text version of the message.
167+ name (NotRequired[str]): The friendly name of the broadcast. Only used for internal reference.
168+ """
169+
111170 class SendParams (_SendBroadcastParams ):
112171 """SendParams is the class that wraps the parameters for the send method.
113172
@@ -125,6 +184,14 @@ class CreateResponse(_CreateResponse):
125184 id (str): id of the created broadcast
126185 """
127186
187+ class UpdateResponse (_UpdateResponse ):
188+ """
189+ UpdateResponse is the class that wraps the response of the update method.
190+
191+ Attributes:
192+ id (str): id of the updated broadcast
193+ """
194+
128195 class SendResponse (_SendResponse ):
129196 """
130197 SendResponse is the class that wraps the response of the send method.
@@ -170,6 +237,24 @@ def create(cls, params: CreateParams) -> CreateResponse:
170237 ).perform_with_content ()
171238 return resp
172239
240+ @classmethod
241+ def update (cls , params : UpdateParams ) -> UpdateResponse :
242+ """
243+ Update a broadcast.
244+ see more: https://resend.com/docs/api-reference/broadcasts/update-broadcast
245+
246+ Args:
247+ params (UpdateParams): The broadcast update parameters
248+
249+ Returns:
250+ UpdateResponse: The updated broadcast object response
251+ """
252+ path = f"/broadcasts/{ params ['broadcast_id' ]} "
253+ resp = request .Request [_UpdateResponse ](
254+ path = path , params = cast (Dict [Any , Any ], params ), verb = "patch"
255+ ).perform_with_content ()
256+ return resp
257+
173258 @classmethod
174259 def send (cls , params : SendParams ) -> SendResponse :
175260 """
0 commit comments