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
10 changes: 10 additions & 0 deletions lib/ebay_api/operations/sell/metadata/marketplace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ class EbayAPI
option :marketplace_id

require_relative "marketplace/get_item_condition_policies"
require_relative "marketplace/get_category_policies"
require_relative "marketplace/get_classified_ad_policies"
require_relative "marketplace/get_automotive_parts_compatibility_policies"
require_relative "marketplace/get_listing_structure_policies"
require_relative "marketplace/get_listing_type_policies"
require_relative "marketplace/get_motors_listing_policies"
require_relative "marketplace/get_negotiated_price_policies"
require_relative "marketplace/get_return_policies"
require_relative "marketplace/get_shipping_policies"
require_relative "marketplace/get_site_visibility_policies"
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @see https://developer.ebay.com/api-docs/sell/metadata/resources/marketplace/methods/getAutomotivePartsCompatibilityPolicies

class EbayAPI
scope :sell do
scope :metadata do
scope :marketplace do
operation :get_automotive_parts_compatibility_policies do
path { "get_automotive_parts_compatibility_policies" }
http_method :get

# When no policies are available, eBay returns 204 No Content.
# To provide a consistent API, we return an empty array instead.
response(204) { { "automotivePartsCompatibilityPolicies" => [] } }
end
end
end
end
end

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# @see https://developer.ebay.com/api-docs/sell/metadata/resources/marketplace/methods/getCategoryPolicies

class EbayAPI
scope :sell do
scope :metadata do
scope :marketplace do
operation :get_category_policies do
path { "get_category_policies" }
http_method :get

# When no policies are available, eBay returns 204 No Content.
# To provide a consistent API, we return an empty array instead.
response(204) { { "categoryPolicies" => [] } }
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @see https://developer.ebay.com/api-docs/sell/metadata/resources/marketplace/methods/getClassifiedAdPolicies

class EbayAPI
scope :sell do
scope :metadata do
scope :marketplace do
operation :get_classified_ad_policies do
path { "get_classified_ad_policies" }
http_method :get

# When no policies are available, eBay returns 204 No Content.
# To provide a consistent API, we return an empty array instead.
response(204) { { "classifiedAdPolicies" => [] } }
end
end
end
end
end

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ class EbayAPI
operation :get_item_condition_policies do
path { "get_item_condition_policies" }
http_method :get

# When no policies are available, eBay returns 204 No Content.
# To provide a consistent API, we return an empty array instead.
response(204) { { "itemConditionPolicies" => [] } }
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @see https://developer.ebay.com/api-docs/sell/metadata/resources/marketplace/methods/getListingStructurePolicies

class EbayAPI
scope :sell do
scope :metadata do
scope :marketplace do
operation :get_listing_structure_policies do
path { "get_listing_structure_policies" }
http_method :get

# When no policies are available, eBay returns 204 No Content.
# To provide a consistent API, we return an empty array instead.
response(204) { { "listingStructurePolicies" => [] } }
end
end
end
end
end

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @see https://developer.ebay.com/api-docs/sell/metadata/resources/marketplace/methods/getListingTypePolicies

class EbayAPI
scope :sell do
scope :metadata do
scope :marketplace do
operation :get_listing_type_policies do
path { "get_listing_type_policies" }
http_method :get

# When no policies are available, eBay returns 204 No Content.
# To provide a consistent API, we return an empty array instead.
response(204) { { "listingTypePolicies" => [] } }
end
end
end
end
end

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @see https://developer.ebay.com/api-docs/sell/metadata/resources/marketplace/methods/getMotorsListingPolicies

class EbayAPI
scope :sell do
scope :metadata do
scope :marketplace do
operation :get_motors_listing_policies do
path { "get_motors_listing_policies" }
http_method :get

# When no policies are available, eBay returns 204 No Content.
# To provide a consistent API, we return an empty array instead.
response(204) { { "motorsListingPolicies" => [] } }
end
end
end
end
end

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# @see https://developer.ebay.com/api-docs/sell/metadata/resources/marketplace/methods/getNegotiatedPricePolicies

class EbayAPI
scope :sell do
scope :metadata do
scope :marketplace do
operation :get_negotiated_price_policies do
path { "get_negotiated_price_policies" }
http_method :get

# When no policies are available, eBay returns 204 No Content.
# To provide a consistent API, we return an empty array instead.
response(204) { { "negotiatedPricePolicies" => [] } }
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @see https://developer.ebay.com/api-docs/sell/metadata/resources/marketplace/methods/getReturnPolicies

class EbayAPI
scope :sell do
scope :metadata do
scope :marketplace do
operation :get_return_policies do
path { "get_return_policies" }
http_method :get

# When no policies are available, eBay returns 204 No Content.
# To provide a consistent API, we return an empty array instead.
response(204) { { "returnPolicies" => [] } }
end
end
end
end
end

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @see https://developer.ebay.com/api-docs/sell/metadata/resources/marketplace/methods/getShippingPolicies

class EbayAPI
scope :sell do
scope :metadata do
scope :marketplace do
operation :get_shipping_policies do
path { "get_shipping_policies" }
http_method :get

# When no policies are available, eBay returns 204 No Content.
# To provide a consistent API, we return an empty array instead.
response(204) { { "shippingPolicies" => [] } }
end
end
end
end
end

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @see https://developer.ebay.com/api-docs/sell/metadata/resources/marketplace/methods/getSiteVisibilityPolicies

class EbayAPI
scope :sell do
scope :metadata do
scope :marketplace do
operation :get_site_visibility_policies do
path { "get_site_visibility_policies" }
http_method :get

# When no policies are available, eBay returns 204 No Content.
# To provide a consistent API, we return an empty array instead.
response(204) { { "siteVisibilityPolicies" => [] } }
end
end
end
end
end

2 changes: 2 additions & 0 deletions spec/fixtures/no_content
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
HTTP/1.1 204 No Content
Content-Length: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
HTTP/1.1 200 OK
Content-Type: application/json

{
"automotivePartsCompatibilityPolicies": [
{
"categoryId": "6028",
"categoryTreeId": "100",
"maxNumberOfCompatibleVehicles": 1000,
"compatibleVehicleTypes": ["US_CARS_TRUCKS", "US_MOTORCYCLES"],
"compatibilityBasedOn": "ASSEMBLY"
}
]
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
HTTP/1.1 200 OK
Content-Type: application/json

{
"categoryPolicies": [
{
"categoryId": "625",
"categoryTreeId": "0",
"autoPayEnabled": true,
"orra": true,
"minimumReservePrice": 0.0,
"paymentMethods": ["CASH_ON_PICKUP"],
"intangibleEnabled": false,
"isbnSupport": "DISABLED",
"upcSupport": "ENABLED",
"eanSupport": "DISABLED",
"valueCategory": false
}
]
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
HTTP/1.1 200 OK
Content-Type: application/json

{
"classifiedAdPolicies": [
{
"categoryId": "625",
"categoryTreeId": "0",
"adFormatEnabled": "Enabled",
"sellerContactDetailsEnabled": true,
"classifiedAdPaymentMethodEnabled": "Enabled",
"classifiedAdShippingMethodEnabled": false,
"classifiedAdBestOfferEnabled": "Enabled",
"classifiedAdCounterOfferEnabled": true,
"classifiedAdContactByPhoneEnabled": true,
"classifiedAdContactByEmailEnabled": true,
"classifiedAdAutoAcceptEnabled": true,
"classifiedAdAutoDeclineEnabled": true
}
]
}


Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
HTTP/1.1 200 OK
Content-Length: 500
Content-Type: application/json

{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
HTTP/1.1 200 OK
Content-Type: application/json

{
"listingStructurePolicies": [
{
"categoryId": "625",
"categoryTreeId": "0",
"variationsSupported": true
}
]
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
HTTP/1.1 200 OK
Content-Type: application/json

{
"listingTypePolicies": [
{
"categoryId": "625",
"categoryTreeId": "0",
"listingDurations": [
{
"listingType": "AUCTION",
"durationValues": ["DAYS_3", "DAYS_5", "DAYS_7", "DAYS_10"]
},
{
"listingType": "FIXED_PRICE_ITEM",
"durationValues": ["GTC"]
}
],
"pickupDropOffEnabled": false,
"digitalGoodDeliveryEnabled": false
}
]
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
HTTP/1.1 200 OK
Content-Type: application/json

{
"motorsListingPolicies": [
{
"categoryId": "6028",
"categoryTreeId": "100",
"vinSupported": true,
"vrmSupported": false,
"kTypeSupported": true,
"epidSupported": true,
"depositSupported": true,
"minItemCompatibility": 1,
"maxItemCompatibility": 1000,
"ebayMotorsProAdFormatEnabled": "Disabled",
"localMarketAdFormatEnabled": "Disabled",
"sellerProvidedTitleSupported": true
}
]
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
HTTP/1.1 200 OK
Content-Type: application/json

{
"negotiatedPricePolicies": [
{
"categoryId": "625",
"categoryTreeId": "0",
"bestOfferAutoAcceptEnabled": true,
"bestOfferAutoDeclineEnabled": true,
"bestOfferCounterEnabled": true
}
]
}


Loading