@@ -95,11 +95,10 @@ def create_variation(
95
95
}
96
96
)
97
97
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 {})}
103
102
return self ._post (
104
103
"/images/variations" ,
105
104
body = maybe_transform (body , image_create_variation_params .ImageCreateVariationParams ),
@@ -179,11 +178,10 @@ def edit(
179
178
}
180
179
)
181
180
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 {})}
187
185
return self ._post (
188
186
"/images/edits" ,
189
187
body = maybe_transform (body , image_edit_params .ImageEditParams ),
@@ -343,11 +341,10 @@ async def create_variation(
343
341
}
344
342
)
345
343
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 {})}
351
348
return await self ._post (
352
349
"/images/variations" ,
353
350
body = await async_maybe_transform (body , image_create_variation_params .ImageCreateVariationParams ),
@@ -427,11 +424,10 @@ async def edit(
427
424
}
428
425
)
429
426
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 {})}
435
431
return await self ._post (
436
432
"/images/edits" ,
437
433
body = await async_maybe_transform (body , image_edit_params .ImageEditParams ),
0 commit comments