Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions etsy_python/v3/resources/Taxonomy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass
from typing import Union
from typing import Any, Dict, Optional, Union

from etsy_python.v3.exceptions.RequestException import RequestException
from etsy_python.v3.resources.Response import Response
Expand Down Expand Up @@ -30,7 +30,14 @@ def get_seller_taxonomy_nodes(self) -> Union[Response, RequestException]:
return self.session.make_request(endpoint)

def get_properties_by_taxonomy_id(
self, taxonomy_id: int
self,
taxonomy_id: int,
supports_variations: Optional[bool] = None,
supports_attributes: Optional[bool] = None,
) -> Union[Response, RequestException]:
endpoint = f"/seller-taxonomy/nodes/{taxonomy_id}/properties"
return self.session.make_request(endpoint)
query_params: Dict[str, Any] = {
"supports_variations": supports_variations,
"supports_attributes": supports_attributes,
}
return self.session.make_request(endpoint, query_params=query_params)
42 changes: 39 additions & 3 deletions specs/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2412,11 +2412,11 @@
{
"name": "max_variations_supported",
"in": "query",
"description": "Coming soon: This parameter determines whether a third variation can be added to or updated for a listing. It accepts values of 2 or 3, where 3 enables third-variation support.",
"description": "This parameter determines whether a third variation can be added to or updated for a listing. It accepts values of 2 or 3, where 3 enables third-variation support.",
"required": false,
"schema": {
"type": "string",
"description": "Coming soon: This parameter determines whether a third variation can be added to or updated for a listing. It accepts values of 2 or 3, where 3 enables third-variation support.",
"description": "This parameter determines whether a third variation can be added to or updated for a listing. It accepts values of 2 or 3, where 3 enables third-variation support.",
"enum": [
"2",
"3"
Expand Down Expand Up @@ -6853,7 +6853,7 @@
"/v3/application/shops/{shop_id}/receipts/{receipt_id}/tracking": {
"post": {
"operationId": "createReceiptShipment",
"description": "<div class=\"wt-display-flex-xs wt-align-items-center wt-mt-xs-2 wt-mb-xs-3\"><span class=\"wt-badge wt-badge--notificationPrimary wt-bg-slime-tint wt-mr-xs-2\">General Release</span><a class=\"wt-text-link\" href=\"https://github.com/etsy/open-api/discussions\" target=\"_blank\" rel=\"noopener noreferrer\">Report bug</a></div><div class=\"wt-display-flex-xs wt-align-items-center wt-mt-xs-2 wt-mb-xs-3\"><p class=\"wt-text-body-01 banner-text\">This endpoint is ready for production use.</p></div>\n\nSubmits tracking information for a Shop Receipt, which creates a Shop Receipt Shipment entry for the given receipt_id. Each time you successfully submit tracking info, Etsy sends a notification email to the buyer User. When send_bcc is true, Etsy sends shipping notifications to the seller as well. When tracking_code and carrier_name aren't sent, the receipt is marked as shipped only. If the carrier is not supported, you may use `other` as the carrier name so you can provide the tracking code. **NOTES** When shipping within the United States AND the order is over $10 _or_ when shipping to India, tracking code and carrier name ARE required. Access to ShopReceipt's first_line, second_line, city, state, zip, country_iso and formatted_address is contingent in some regions to a preferred partnership status with Etsy",
"description": "<div class=\"wt-display-flex-xs wt-align-items-center wt-mt-xs-2 wt-mb-xs-3\"><span class=\"wt-badge wt-badge--notificationPrimary wt-bg-slime-tint wt-mr-xs-2\">General Release</span><a class=\"wt-text-link\" href=\"https://github.com/etsy/open-api/discussions\" target=\"_blank\" rel=\"noopener noreferrer\">Report bug</a></div><div class=\"wt-display-flex-xs wt-align-items-center wt-mt-xs-2 wt-mb-xs-3\"><p class=\"wt-text-body-01 banner-text\">This endpoint is ready for production use.</p></div>\n\nSubmits tracking information for a Shop Receipt, which creates a Shop Receipt Shipment entry for the given receipt_id. Each time you successfully submit tracking info, Etsy sends a notification email to the buyer User. When send_bcc is true, Etsy sends shipping notifications to the seller as well. When tracking_code and carrier_name aren't sent, the receipt is marked as shipped only. If the carrier is not supported, you may use `other` as the carrier name so you can provide the tracking code. **NOTES** When shipping within the United States AND the order is over $10 _or_ when shipping to India, tracking code and carrier name ARE required. **ACCESS RESTRICTION** In regions where Etsy's Preferred Partner Program is enforced, this endpoint is only available to applications that are approved fulfillment partners. Requests from other applications return `403 Forbidden`, even when the API key is valid, the OAuth token has the `transactions_w` scope and other receipt endpoints respond successfully. A request is authorized if the application is a commercial-access application categorized as Fulfillment or Print On Demand, if it is a personal-use application owned by the authenticated seller, or if the seller authorized the application before the Preferred Partner Program launched in their region. If your application doesn't meet these criteria, contact Etsy API support to ask about partner eligibility. Access to ShopReceipt's first_line, second_line, city, state, zip, country_iso and formatted_address is contingent in some regions to a preferred partnership status with Etsy",
"tags": [
"Shop Receipt"
],
Expand Down Expand Up @@ -7534,6 +7534,28 @@
"format": "int64",
"minimum": 1
}
},
{
"name": "supports_variations",
"in": "query",
"description": "When `true`, returns properties that support variations. When `false`, returns properties that do not support variations.",
"required": false,
"schema": {
"type": "boolean",
"description": "When `true`, returns properties that support variations. When `false`, returns properties that do not support variations.",
"nullable": true
}
},
{
"name": "supports_attributes",
"in": "query",
"description": "When `true`, returns properties that support attributes. When `false`, returns properties that do not support attributes.",
"required": false,
"schema": {
"type": "boolean",
"description": "When `true`, returns properties that support attributes. When `false`, returns properties that do not support attributes.",
"nullable": true
}
}
],
"responses": {
Expand Down Expand Up @@ -15584,6 +15606,20 @@
"description": "[Personalization only] The ID of the original personalization question.",
"format": "int64",
"nullable": true
},
"mime_type": {
"type": "string",
"description": "MIME type of an uploaded personalization file. Null for non-upload questions.",
"nullable": true,
"enum": [
"image/jpeg",
"image/png",
"image/gif",
"image/svg+xml",
"image/heif",
"image/heic",
"application/pdf"
]
}
}
},
Expand Down
16 changes: 15 additions & 1 deletion tests/test_remaining_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,21 @@ def test_get_properties_by_taxonomy_id(self, mock_session):
resource = SellerTaxonomyResource(session=mock_session)
resource.get_properties_by_taxonomy_id(MOCK_TAXONOMY_ID)
mock_session.make_request.assert_called_once_with(
f"/seller-taxonomy/nodes/{MOCK_TAXONOMY_ID}/properties"
f"/seller-taxonomy/nodes/{MOCK_TAXONOMY_ID}/properties",
query_params={"supports_variations": None, "supports_attributes": None},
)

def test_get_properties_by_taxonomy_id_with_filters(self, mock_session):
mock_session.make_request.return_value = Response(
200, make_collection(make_taxonomy_property)
)
resource = SellerTaxonomyResource(session=mock_session)
resource.get_properties_by_taxonomy_id(
MOCK_TAXONOMY_ID, supports_variations=True, supports_attributes=False
)
mock_session.make_request.assert_called_once_with(
f"/seller-taxonomy/nodes/{MOCK_TAXONOMY_ID}/properties",
query_params={"supports_variations": True, "supports_attributes": False},
)


Expand Down
Loading