etsy-python 1.2.0__tar.gz → 1.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {etsy_python-1.2.0/etsy_python.egg-info → etsy_python-1.2.1}/PKG-INFO +1 -1
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/_version.py +1 -1
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/enums/Listing.py +1 -1
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/models/Listing.py +82 -2
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/ListingVideo.py +16 -3
- {etsy_python-1.2.0 → etsy_python-1.2.1/etsy_python.egg-info}/PKG-INFO +1 -1
- {etsy_python-1.2.0 → etsy_python-1.2.1}/LICENSE +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/MANIFEST.in +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/README.md +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/__init__.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/__init__.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/auth/OAuth.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/auth/__init__.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/common/Env.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/common/Request.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/common/Utils.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/common/__init__.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/enums/HolidayPreferences.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/enums/Language.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/enums/ListingInventory.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/enums/ProcessingProfile.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/enums/ShippingProfile.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/enums/ShopReceipt.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/enums/__init__.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/exceptions/BaseAPIException.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/exceptions/RequestException.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/exceptions/__init__.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/models/FileRequest.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/models/HolidayPreferences.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/models/Miscellaneous.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/models/ProcessingProfile.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/models/Product.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/models/Receipt.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/models/Request.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/models/ShippingProfile.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/models/Shop.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/models/ShopReturnPolicy.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/models/Utils.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/models/__init__.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/HolidayPreferences.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/Listing.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/ListingFile.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/ListingImage.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/ListingInventory.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/ListingOffering.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/ListingProduct.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/ListingTranslation.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/ListingVariationImages.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/Miscellaneous.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/Payment.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/PaymentLedgerEntry.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/ProcessingProfile.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/Receipt.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/ReceiptTransactions.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/Response.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/Review.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/Session.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/ShippingProfile.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/Shop.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/ShopProductionPartner.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/ShopReturnPolicy.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/ShopSection.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/Taxonomy.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/User.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/UserAddress.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/__init__.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/enums/RateLimit.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/enums/Request.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python/v3/resources/enums/__init__.py +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python.egg-info/SOURCES.txt +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python.egg-info/dependency_links.txt +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python.egg-info/requires.txt +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/etsy_python.egg-info/top_level.txt +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/setup.cfg +0 -0
- {etsy_python-1.2.0 → etsy_python-1.2.1}/setup.py +0 -0
|
@@ -127,7 +127,53 @@ class _PersonalizationFieldsMixin:
|
|
|
127
127
|
)
|
|
128
128
|
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
#: EU commercial guarantee / GPSR fields (ECGT), shared by createDraftListing
|
|
131
|
+
#: and updateListing. All are optional and nullable. Etsy silently ignores them
|
|
132
|
+
#: for sellers who are not eligible EU traders. ``ecgt_software_update_details``
|
|
133
|
+
#: is ignored for physical listings; the other six are ignored for digital ones.
|
|
134
|
+
#: ``ecgt_garan_brand``, ``ecgt_garan_model``, ``ecgt_garan_years`` and
|
|
135
|
+
#: ``ecgt_garan_guarantee_details`` are required *together* -- Etsy enforces
|
|
136
|
+
#: that server-side and rejects a partial set.
|
|
137
|
+
ECGT_FIELDS = (
|
|
138
|
+
"ecgt_garan_brand",
|
|
139
|
+
"ecgt_garan_model",
|
|
140
|
+
"ecgt_garan_years",
|
|
141
|
+
"ecgt_garan_guarantee_details",
|
|
142
|
+
"ecgt_other_commercial_guarantee_details",
|
|
143
|
+
"ecgt_after_sales_service_info",
|
|
144
|
+
"ecgt_software_update_details",
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
class _ECGTFieldsMixin:
|
|
149
|
+
"""Storage for the EU commercial guarantee (ECGT) listing fields.
|
|
150
|
+
|
|
151
|
+
Both listing request models accept the same seven fields, so the
|
|
152
|
+
assignment lives here instead of being duplicated. See ``ECGT_FIELDS``.
|
|
153
|
+
"""
|
|
154
|
+
|
|
155
|
+
def _store_ecgt(
|
|
156
|
+
self,
|
|
157
|
+
ecgt_garan_brand: Optional[str],
|
|
158
|
+
ecgt_garan_model: Optional[str],
|
|
159
|
+
ecgt_garan_years: Optional[int],
|
|
160
|
+
ecgt_garan_guarantee_details: Optional[str],
|
|
161
|
+
ecgt_other_commercial_guarantee_details: Optional[str],
|
|
162
|
+
ecgt_after_sales_service_info: Optional[str],
|
|
163
|
+
ecgt_software_update_details: Optional[str],
|
|
164
|
+
) -> None:
|
|
165
|
+
self.ecgt_garan_brand = ecgt_garan_brand
|
|
166
|
+
self.ecgt_garan_model = ecgt_garan_model
|
|
167
|
+
self.ecgt_garan_years = ecgt_garan_years
|
|
168
|
+
self.ecgt_garan_guarantee_details = ecgt_garan_guarantee_details
|
|
169
|
+
self.ecgt_other_commercial_guarantee_details = (
|
|
170
|
+
ecgt_other_commercial_guarantee_details
|
|
171
|
+
)
|
|
172
|
+
self.ecgt_after_sales_service_info = ecgt_after_sales_service_info
|
|
173
|
+
self.ecgt_software_update_details = ecgt_software_update_details
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class CreateDraftListingRequest(_PersonalizationFieldsMixin, _ECGTFieldsMixin, Request):
|
|
131
177
|
nullable = [
|
|
132
178
|
"shipping_profile_id",
|
|
133
179
|
"return_policy_id",
|
|
@@ -146,6 +192,7 @@ class CreateDraftListingRequest(_PersonalizationFieldsMixin, Request):
|
|
|
146
192
|
"production_partner_ids",
|
|
147
193
|
"image_ids",
|
|
148
194
|
"readiness_state_id",
|
|
195
|
+
*ECGT_FIELDS,
|
|
149
196
|
]
|
|
150
197
|
mandatory = [
|
|
151
198
|
"quantity",
|
|
@@ -192,6 +239,13 @@ class CreateDraftListingRequest(_PersonalizationFieldsMixin, Request):
|
|
|
192
239
|
is_taxable: Optional[bool] = None,
|
|
193
240
|
listing_type: Optional[Type] = None,
|
|
194
241
|
readiness_state_id: Optional[int] = None,
|
|
242
|
+
ecgt_garan_brand: Optional[str] = None,
|
|
243
|
+
ecgt_garan_model: Optional[str] = None,
|
|
244
|
+
ecgt_garan_years: Optional[int] = None,
|
|
245
|
+
ecgt_garan_guarantee_details: Optional[str] = None,
|
|
246
|
+
ecgt_other_commercial_guarantee_details: Optional[str] = None,
|
|
247
|
+
ecgt_after_sales_service_info: Optional[str] = None,
|
|
248
|
+
ecgt_software_update_details: Optional[str] = None,
|
|
195
249
|
):
|
|
196
250
|
self.quantity = quantity
|
|
197
251
|
self.title = title
|
|
@@ -228,13 +282,22 @@ class CreateDraftListingRequest(_PersonalizationFieldsMixin, Request):
|
|
|
228
282
|
self.is_taxable = is_taxable
|
|
229
283
|
self._type = listing_type
|
|
230
284
|
self.readiness_state_id = readiness_state_id
|
|
285
|
+
self._store_ecgt(
|
|
286
|
+
ecgt_garan_brand,
|
|
287
|
+
ecgt_garan_model,
|
|
288
|
+
ecgt_garan_years,
|
|
289
|
+
ecgt_garan_guarantee_details,
|
|
290
|
+
ecgt_other_commercial_guarantee_details,
|
|
291
|
+
ecgt_after_sales_service_info,
|
|
292
|
+
ecgt_software_update_details,
|
|
293
|
+
)
|
|
231
294
|
super().__init__(
|
|
232
295
|
nullable=CreateDraftListingRequest.nullable,
|
|
233
296
|
mandatory=CreateDraftListingRequest.mandatory,
|
|
234
297
|
)
|
|
235
298
|
|
|
236
299
|
|
|
237
|
-
class UpdateListingRequest(_PersonalizationFieldsMixin, Request):
|
|
300
|
+
class UpdateListingRequest(_PersonalizationFieldsMixin, _ECGTFieldsMixin, Request):
|
|
238
301
|
nullable: List[str] = [
|
|
239
302
|
"materials",
|
|
240
303
|
"shipping_profile_id",
|
|
@@ -250,6 +313,7 @@ class UpdateListingRequest(_PersonalizationFieldsMixin, Request):
|
|
|
250
313
|
"featured_rank",
|
|
251
314
|
"production_partner_ids",
|
|
252
315
|
"_type",
|
|
316
|
+
*ECGT_FIELDS,
|
|
253
317
|
]
|
|
254
318
|
|
|
255
319
|
mandatory: List[str] = []
|
|
@@ -284,6 +348,13 @@ class UpdateListingRequest(_PersonalizationFieldsMixin, Request):
|
|
|
284
348
|
is_supply: Optional[bool] = None,
|
|
285
349
|
production_partner_ids: Optional[List[int]] = None,
|
|
286
350
|
listing_type: Optional[Type] = None,
|
|
351
|
+
ecgt_garan_brand: Optional[str] = None,
|
|
352
|
+
ecgt_garan_model: Optional[str] = None,
|
|
353
|
+
ecgt_garan_years: Optional[int] = None,
|
|
354
|
+
ecgt_garan_guarantee_details: Optional[str] = None,
|
|
355
|
+
ecgt_other_commercial_guarantee_details: Optional[str] = None,
|
|
356
|
+
ecgt_after_sales_service_info: Optional[str] = None,
|
|
357
|
+
ecgt_software_update_details: Optional[str] = None,
|
|
287
358
|
):
|
|
288
359
|
self.image_ids = image_ids
|
|
289
360
|
self.title = title
|
|
@@ -315,6 +386,15 @@ class UpdateListingRequest(_PersonalizationFieldsMixin, Request):
|
|
|
315
386
|
self.is_supply = is_supply
|
|
316
387
|
self.production_partner_ids = production_partner_ids
|
|
317
388
|
self._type = listing_type
|
|
389
|
+
self._store_ecgt(
|
|
390
|
+
ecgt_garan_brand,
|
|
391
|
+
ecgt_garan_model,
|
|
392
|
+
ecgt_garan_years,
|
|
393
|
+
ecgt_garan_guarantee_details,
|
|
394
|
+
ecgt_other_commercial_guarantee_details,
|
|
395
|
+
ecgt_after_sales_service_info,
|
|
396
|
+
ecgt_software_update_details,
|
|
397
|
+
)
|
|
318
398
|
super().__init__(
|
|
319
399
|
nullable=UpdateListingRequest.nullable,
|
|
320
400
|
mandatory=UpdateListingRequest.mandatory,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
|
-
from typing import Union
|
|
2
|
+
from typing import Optional, Union
|
|
3
3
|
|
|
4
4
|
from etsy_python.v3.exceptions.RequestException import RequestException
|
|
5
5
|
from etsy_python.v3.models.Listing import UpdateListingVideoRequest
|
|
@@ -29,9 +29,22 @@ class ListingVideoResource:
|
|
|
29
29
|
return self.session.make_request(endpoint)
|
|
30
30
|
|
|
31
31
|
def upload_listing_video(
|
|
32
|
-
self,
|
|
32
|
+
self,
|
|
33
|
+
shop_id: int,
|
|
34
|
+
listing_id: int,
|
|
35
|
+
listing_video: UpdateListingVideoRequest,
|
|
36
|
+
is_multi_video: Optional[bool] = None,
|
|
33
37
|
) -> Union[Response, RequestException]:
|
|
38
|
+
"""Upload a video to a listing.
|
|
39
|
+
|
|
40
|
+
Pass ``is_multi_video=True`` to keep existing videos on the listing.
|
|
41
|
+
Omitting it preserves the former single-video behaviour, where the
|
|
42
|
+
upload replaces any video already attached.
|
|
43
|
+
"""
|
|
34
44
|
endpoint = f"/shops/{shop_id}/listings/{listing_id}/videos"
|
|
35
45
|
return self.session.make_request(
|
|
36
|
-
endpoint,
|
|
46
|
+
endpoint,
|
|
47
|
+
method=Method.POST,
|
|
48
|
+
payload=listing_video,
|
|
49
|
+
query_params={"is_multi_video": is_multi_video},
|
|
37
50
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|