@@ -95,11 +95,10 @@ def create_variation(
9595 }
9696 )
9797 files = extract_files (cast (Mapping [str , object ], body ), paths = [["image" ]])
98- if files :
99- # It should be noted that the actual Content-Type header that will be
100- # sent to the server will contain a `boundary` parameter, e.g.
101- # multipart/form-data; boundary=---abc--
102- extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
98+ # It should be noted that the actual Content-Type header that will be
99+ # sent to the server will contain a `boundary` parameter, e.g.
100+ # multipart/form-data; boundary=---abc--
101+ extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
103102 return self ._post (
104103 "/images/variations" ,
105104 body = maybe_transform (body , image_create_variation_params .ImageCreateVariationParams ),
@@ -179,11 +178,10 @@ def edit(
179178 }
180179 )
181180 files = extract_files (cast (Mapping [str , object ], body ), paths = [["image" ], ["mask" ]])
182- if files :
183- # It should be noted that the actual Content-Type header that will be
184- # sent to the server will contain a `boundary` parameter, e.g.
185- # multipart/form-data; boundary=---abc--
186- extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
181+ # It should be noted that the actual Content-Type header that will be
182+ # sent to the server will contain a `boundary` parameter, e.g.
183+ # multipart/form-data; boundary=---abc--
184+ extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
187185 return self ._post (
188186 "/images/edits" ,
189187 body = maybe_transform (body , image_edit_params .ImageEditParams ),
@@ -343,11 +341,10 @@ async def create_variation(
343341 }
344342 )
345343 files = extract_files (cast (Mapping [str , object ], body ), paths = [["image" ]])
346- if files :
347- # It should be noted that the actual Content-Type header that will be
348- # sent to the server will contain a `boundary` parameter, e.g.
349- # multipart/form-data; boundary=---abc--
350- extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
344+ # It should be noted that the actual Content-Type header that will be
345+ # sent to the server will contain a `boundary` parameter, e.g.
346+ # multipart/form-data; boundary=---abc--
347+ extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
351348 return await self ._post (
352349 "/images/variations" ,
353350 body = await async_maybe_transform (body , image_create_variation_params .ImageCreateVariationParams ),
@@ -427,11 +424,10 @@ async def edit(
427424 }
428425 )
429426 files = extract_files (cast (Mapping [str , object ], body ), paths = [["image" ], ["mask" ]])
430- if files :
431- # It should be noted that the actual Content-Type header that will be
432- # sent to the server will contain a `boundary` parameter, e.g.
433- # multipart/form-data; boundary=---abc--
434- extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
427+ # It should be noted that the actual Content-Type header that will be
428+ # sent to the server will contain a `boundary` parameter, e.g.
429+ # multipart/form-data; boundary=---abc--
430+ extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
435431 return await self ._post (
436432 "/images/edits" ,
437433 body = await async_maybe_transform (body , image_edit_params .ImageEditParams ),
0 commit comments