From d7124d510cdf271fb7ec6002074f155f22d3f3a7 Mon Sep 17 00:00:00 2001 From: Ben Hughes Date: Fri, 30 Jul 2010 12:05:35 -0400 Subject: [PATCH 1/4] Upgrades to the class generator to support a modern libxml-ruby and activesupport. --- Rakefile | 3 + lib/ebay/schema/mapper.rb | 2 +- .../schema/mapper/ebay_schema_importer.rb | 6 +- lib/ebay/schema/mapper/node.rb | 4 +- .../schema/mapper/ruby_class_generator.rb | 56 +++++++++++++------ 5 files changed, 46 insertions(+), 25 deletions(-) diff --git a/Rakefile b/Rakefile index 3a82febd..8e37a1b5 100644 --- a/Rakefile +++ b/Rakefile @@ -5,6 +5,9 @@ require 'rake/testtask' require 'rake/rdoctask' require 'rake/gempackagetask' require 'rake/contrib/rubyforgepublisher' +gem 'activesupport' +gem 'libxml-ruby' +require 'xml' PKG_VERSION = "0.12.0" PKG_NAME = "ebayapi" diff --git a/lib/ebay/schema/mapper.rb b/lib/ebay/schema/mapper.rb index 7397397f..62ce4114 100644 --- a/lib/ebay/schema/mapper.rb +++ b/lib/ebay/schema/mapper.rb @@ -10,4 +10,4 @@ require 'mapper/class_definition' # Remove the broken unpluralization of 'ies' words -Inflector.inflections.plurals.delete_if{|inflection| inflection.first == /([^aeiouy]|qu)ies$/i } +ActiveSupport::Inflector.inflections.plurals.delete_if{|inflection| inflection.first == /([^aeiouy]|qu)ies$/i } diff --git a/lib/ebay/schema/mapper/ebay_schema_importer.rb b/lib/ebay/schema/mapper/ebay_schema_importer.rb index 9e3de06a..097028d3 100644 --- a/lib/ebay/schema/mapper/ebay_schema_importer.rb +++ b/lib/ebay/schema/mapper/ebay_schema_importer.rb @@ -14,17 +14,15 @@ def initialize(schema, data) @xml = XML::Parser.string(data).parse.root @elements = schema.collect_elements - @elements.uniq! @attributes = schema.collect_attributes - @attributes.uniq! + # Only want the simple types that have an enumeration (codes) @simple_types = schema.collect_simpletypes - @simple_types.uniq! @code_types = @simple_types.reject{ |e| e.restriction.enumeration.empty? || Ignores.include?(e.name.name) } @complex_types = schema.collect_complextypes - @complex_types.uniq! + @fault_types = nil if schema.respond_to?(:collect_faulttypes) @fault_types = schema.collect_faulttypes diff --git a/lib/ebay/schema/mapper/node.rb b/lib/ebay/schema/mapper/node.rb index 7085004d..33c8a818 100644 --- a/lib/ebay/schema/mapper/node.rb +++ b/lib/ebay/schema/mapper/node.rb @@ -22,14 +22,14 @@ def accessor_name name = ebay_underscore(@name) if name =~ /_array$/ name.gsub!(/_array$/, '') - Inflector.pluralize(name) + ActiveSupport::Inflector.pluralize(name) else name end end def xml_mapping_node_type - override_type || Inflector.demodulize(self.class.to_s).underscore + override_type || ActiveSupport::Inflector.demodulize(self.class.to_s).underscore end def declaration diff --git a/lib/ebay/schema/mapper/ruby_class_generator.rb b/lib/ebay/schema/mapper/ruby_class_generator.rb index 9a05846c..1d662b07 100644 --- a/lib/ebay/schema/mapper/ruby_class_generator.rb +++ b/lib/ebay/schema/mapper/ruby_class_generator.rb @@ -42,7 +42,7 @@ def generate_class customization = ClassTemplate.new(ebay_underscore(name)) customization.load if customization.exists? - + if request? || response? class_name = ebay_camelize(name).gsub(/(Request|Response)$/, '') else @@ -134,13 +134,22 @@ def select_template end def find_base - type = @type.complexcontent.extension.base - @base = @complex_types.find_name(type.name) unless type.nil? - rescue NoMethodError + return nil if @type.nil? + + the_base = case + when @type.respond_to?(:complexcontent) && @type.complexcontent.respond_to?(:extension) + @type.complexcontent.extension.base + when @type.respond_to?(:complexcontent) && @type.complexcontent.respond_to?(:base) + @type.complexcontent.base + else + nil + end + + @base = @complex_types.find_name(the_base.name) unless the_base.nil? end def non_inherited_elements - return @type.elements if @base.nil? + return @type.each_element {} if @base.nil? @type.elements.reject do |e| @base.find_element(e.name) @@ -158,9 +167,12 @@ def generate_nodes result = [] result << build_node_for_built_in_type(trim_type(name), content.extension.base.name, :field => '', :min => '0') - result.concat(content.attributes.collect do |a| - TextNode.new(trim_code_type(a.type.name), :field => "@#{a.name.name}", :min => '0') - end) + unless !content.respond_to?(:attributes) or content.attributes.nil? + result.concat(content.attributes.collect do |a| + TextNode.new(trim_code_type(a.type.name), :field => "@#{a.name.name}", :min => '0') + end) + end + result else result = nodes_for_complex_elements @@ -175,9 +187,15 @@ def nodes_for_complex_elements end.flatten rescue NoMethodError # Hack for when the type doesn't respond to elements - @type.complexcontent.content.content.elements.collect do |e| - node_for(e) - end.flatten + if @type.complexcontent.nil? + [] + elsif @type.complexcontent.content.nil? + [] + else + @type.complexcontent.content.elements.collect do |e| + node_for(e) + end.flatten + end end end @@ -246,9 +264,15 @@ def build_node_for_complex_type(name, type, options) if simple_type TextNode.new(name, options) elsif element = @complex_types.find_name(type) - if element.elements.size == 1 && element.elements[0].maxoccurs == "unbounded" + element_elements = element.each_element {} + + if element_elements.nil? and type == 'AmountType' + MoneyNode.new(name, options) + elsif element_elements.nil? + ObjectNode.new(name, options) + elsif element_elements.size == 1 && element_elements[0].maxoccurs == "unbounded" # Found a container! - child = element.elements[0] + child = element_elements[0] ignored = %w( MemberMessage BidApproval PromotionalSaleDetails BidAssistantList ) @@ -264,11 +288,7 @@ def build_node_for_complex_type(name, type, options) ArrayNode.new(name, options) end else - if type == 'AmountType' - MoneyNode.new(name, options) - else - ObjectNode.new(name, options) - end + ObjectNode.new(name, options) end end else From 0e13cdb4ec918e5e8ec8cf458bbd7ae428c41754 Mon Sep 17 00:00:00 2001 From: Ben Hughes Date: Fri, 30 Jul 2010 12:07:10 -0400 Subject: [PATCH 2/4] Updated to latest eBay API schema version 679. --- lib/ebay/api_methods.rb | 8 ++++++ lib/ebay/requests.rb | 1 + .../requests/extend_site_hosted_pictures.rb | 17 +++++++++++++ lib/ebay/requests/get_my_messages.rb | 5 ++++ lib/ebay/requests/get_seller_events.rb | 2 ++ lib/ebay/requests/get_user_preferences.rb | 2 ++ lib/ebay/requests/set_user_preferences.rb | 3 +++ .../requests/upload_site_hosted_pictures.rb | 4 +++ lib/ebay/responses.rb | 1 + .../responses/extend_site_hosted_pictures.rb | 15 +++++++++++ lib/ebay/responses/get_ebay_details.rb | 6 +++++ lib/ebay/responses/get_user_preferences.rb | 3 +++ lib/ebay/schema/version.rb | 2 +- lib/ebay/types.rb | 7 ++++++ lib/ebay/types/account_detail_entry_code.rb | 1 + lib/ebay/types/address.rb | 2 ++ lib/ebay/types/address_usage_code.rb | 12 +++++++++ lib/ebay/types/amount.rb | 2 -- lib/ebay/types/base64_binary.rb | 2 -- lib/ebay/types/basic_amount.rb | 2 -- lib/ebay/types/category_feature.rb | 5 ++++ lib/ebay/types/charity_id.rb | 2 -- lib/ebay/types/condition.rb | 17 +++++++++++++ lib/ebay/types/condition_enabled_code.rb | 12 +++++++++ .../types/condition_enabled_definition.rb | 13 ++++++++++ lib/ebay/types/condition_values.rb | 18 +++++++++++++ lib/ebay/types/condition_values_definition.rb | 13 ++++++++++ lib/ebay/types/detail_name_code.rb | 1 + lib/ebay/types/feature_definitions.rb | 6 +++++ lib/ebay/types/feature_id_code.rb | 2 ++ lib/ebay/types/feedback_requirements.rb | 2 -- lib/ebay/types/gallery_status_code.rb | 19 ++++++++++++++ lib/ebay/types/item.rb | 10 ++++++++ lib/ebay/types/listing_duration_reference.rb | 2 -- lib/ebay/types/measure.rb | 4 --- lib/ebay/types/my_messages_folder_summary.rb | 4 +++ lib/ebay/types/my_messages_message.rb | 8 ++++++ lib/ebay/types/my_messages_summary.rb | 4 +++ lib/ebay/types/name_recommendation.rb | 2 ++ .../types/notification_event_type_code.rb | 2 ++ lib/ebay/types/payment_hold_status_code.rb | 1 + lib/ebay/types/picture_details.rb | 4 +++ lib/ebay/types/picture_watermark_code.rb | 11 ++++++++ .../purchase_reminder_email_preferences.rb | 15 +++++++++++ lib/ebay/types/quantity.rb | 2 -- .../types/quantity_available_hint_code.rb | 11 ++++++++ lib/ebay/types/recoupment_policy_details.rb | 21 ++++++++++++++++ lib/ebay/types/seller.rb | 2 ++ lib/ebay/types/shipping_category_details.rb | 21 ++++++++++++++++ lib/ebay/types/shipping_service_code.rb | 5 ++++ lib/ebay/types/shipping_service_details.rb | 2 ++ lib/ebay/types/site_defaults.rb | 5 ++++ lib/ebay/types/tax_description_code.rb | 12 +++++++++ lib/ebay/types/tax_details.rb | 25 +++++++++++++++++++ lib/ebay/types/tax_type_code.rb | 11 ++++++++ lib/ebay/types/taxes.rb | 18 +++++++++++++ lib/ebay/types/transaction.rb | 3 +++ lib/ebay/types/user.rb | 2 ++ lib/ebay/types/vero_report_item.rb | 8 ++++++ lib/ebay/types/xsl_file.rb | 1 - 60 files changed, 403 insertions(+), 20 deletions(-) create mode 100644 lib/ebay/requests/extend_site_hosted_pictures.rb create mode 100644 lib/ebay/responses/extend_site_hosted_pictures.rb create mode 100644 lib/ebay/types/address_usage_code.rb create mode 100644 lib/ebay/types/condition.rb create mode 100644 lib/ebay/types/condition_enabled_code.rb create mode 100644 lib/ebay/types/condition_enabled_definition.rb create mode 100644 lib/ebay/types/condition_values.rb create mode 100644 lib/ebay/types/condition_values_definition.rb create mode 100644 lib/ebay/types/gallery_status_code.rb create mode 100644 lib/ebay/types/picture_watermark_code.rb create mode 100644 lib/ebay/types/purchase_reminder_email_preferences.rb create mode 100644 lib/ebay/types/quantity_available_hint_code.rb create mode 100644 lib/ebay/types/recoupment_policy_details.rb create mode 100644 lib/ebay/types/shipping_category_details.rb create mode 100644 lib/ebay/types/tax_description_code.rb create mode 100644 lib/ebay/types/tax_details.rb create mode 100644 lib/ebay/types/tax_type_code.rb create mode 100644 lib/ebay/types/taxes.rb diff --git a/lib/ebay/api_methods.rb b/lib/ebay/api_methods.rb index d6418460..d455b702 100644 --- a/lib/ebay/api_methods.rb +++ b/lib/ebay/api_methods.rb @@ -233,6 +233,14 @@ def end_item(params = {}) def end_items(params = {}) commit(Ebay::Requests::EndItems, params) end + # Builds Ebay::Requests#ExtendSiteHostedPictures + # + # Returns Ebay::Responses#ExtendSiteHostedPictures + # + # Official Documentation for ExtendSiteHostedPictures[http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/io_ExtendSiteHostedPictures.html] + def extend_site_hosted_pictures(params = {}) + commit(Ebay::Requests::ExtendSiteHostedPictures, params) + end # Builds Ebay::Requests#FetchToken # # Returns Ebay::Responses#FetchToken diff --git a/lib/ebay/requests.rb b/lib/ebay/requests.rb index 54abc436..3b71be80 100644 --- a/lib/ebay/requests.rb +++ b/lib/ebay/requests.rb @@ -28,6 +28,7 @@ require 'ebay/requests/end_fixed_price_item' require 'ebay/requests/end_item' require 'ebay/requests/end_items' +require 'ebay/requests/extend_site_hosted_pictures' require 'ebay/requests/fetch_token' require 'ebay/requests/get_account' require 'ebay/requests/get_ad_format_leads' diff --git a/lib/ebay/requests/extend_site_hosted_pictures.rb b/lib/ebay/requests/extend_site_hosted_pictures.rb new file mode 100644 index 00000000..dce85fc6 --- /dev/null +++ b/lib/ebay/requests/extend_site_hosted_pictures.rb @@ -0,0 +1,17 @@ + +module Ebay # :nodoc: + module Requests # :nodoc: + # == Attributes + # text_node :picture_url, 'PictureURL', :optional => true + # numeric_node :extension_in_days, 'ExtensionInDays', :optional => true + class ExtendSiteHostedPictures < Abstract + include XML::Mapping + include Initializer + root_element_name 'ExtendSiteHostedPicturesRequest' + text_node :picture_url, 'PictureURL', :optional => true + numeric_node :extension_in_days, 'ExtensionInDays', :optional => true + end + end +end + + diff --git a/lib/ebay/requests/get_my_messages.rb b/lib/ebay/requests/get_my_messages.rb index 5d127a19..9b74eeb8 100644 --- a/lib/ebay/requests/get_my_messages.rb +++ b/lib/ebay/requests/get_my_messages.rb @@ -1,3 +1,4 @@ +require 'ebay/types/pagination' module Ebay # :nodoc: module Requests # :nodoc: @@ -8,6 +9,8 @@ module Requests # :nodoc: # time_node :start_time, 'StartTime', :optional => true # time_node :end_time, 'EndTime', :optional => true # value_array_node :external_message_ids, 'ExternalMessageIDs', 'ExternalMessageID', :default_value => [] + # object_node :pagination, 'Pagination', :class => Pagination, :optional => true + # boolean_node :include_high_priority_message_only, 'IncludeHighPriorityMessageOnly', 'true', 'false', :optional => true class GetMyMessages < Abstract include XML::Mapping include Initializer @@ -18,6 +21,8 @@ class GetMyMessages < Abstract time_node :start_time, 'StartTime', :optional => true time_node :end_time, 'EndTime', :optional => true value_array_node :external_message_ids, 'ExternalMessageIDs', 'ExternalMessageID', :default_value => [] + object_node :pagination, 'Pagination', :class => Pagination, :optional => true + boolean_node :include_high_priority_message_only, 'IncludeHighPriorityMessageOnly', 'true', 'false', :optional => true end end end diff --git a/lib/ebay/requests/get_seller_events.rb b/lib/ebay/requests/get_seller_events.rb index 399dc0ba..0927d17d 100644 --- a/lib/ebay/requests/get_seller_events.rb +++ b/lib/ebay/requests/get_seller_events.rb @@ -12,6 +12,7 @@ module Requests # :nodoc: # boolean_node :new_item_filter, 'NewItemFilter', 'true', 'false', :optional => true # boolean_node :include_watch_count, 'IncludeWatchCount', 'true', 'false', :optional => true # boolean_node :include_variation_specifics, 'IncludeVariationSpecifics', 'true', 'false', :optional => true + # boolean_node :hide_variations, 'HideVariations', 'true', 'false', :optional => true class GetSellerEvents < Abstract include XML::Mapping include Initializer @@ -26,6 +27,7 @@ class GetSellerEvents < Abstract boolean_node :new_item_filter, 'NewItemFilter', 'true', 'false', :optional => true boolean_node :include_watch_count, 'IncludeWatchCount', 'true', 'false', :optional => true boolean_node :include_variation_specifics, 'IncludeVariationSpecifics', 'true', 'false', :optional => true + boolean_node :hide_variations, 'HideVariations', 'true', 'false', :optional => true end end end diff --git a/lib/ebay/requests/get_user_preferences.rb b/lib/ebay/requests/get_user_preferences.rb index 6d0d0dad..4d2cc9a6 100644 --- a/lib/ebay/requests/get_user_preferences.rb +++ b/lib/ebay/requests/get_user_preferences.rb @@ -12,6 +12,7 @@ module Requests # :nodoc: # boolean_node :show_email_shipment_tracking_number_preference, 'ShowEmailShipmentTrackingNumberPreference', 'true', 'false', :optional => true # boolean_node :show_seller_exclude_ship_to_location_preference, 'ShowSellerExcludeShipToLocationPreference', 'true', 'false', :optional => true # boolean_node :show_unpaid_item_assistance_preference, 'ShowUnpaidItemAssistancePreference', 'true', 'false', :optional => true + # boolean_node :show_purchase_reminder_email_preferences, 'ShowPurchaseReminderEmailPreferences', 'true', 'false', :optional => true class GetUserPreferences < Abstract include XML::Mapping include Initializer @@ -26,6 +27,7 @@ class GetUserPreferences < Abstract boolean_node :show_email_shipment_tracking_number_preference, 'ShowEmailShipmentTrackingNumberPreference', 'true', 'false', :optional => true boolean_node :show_seller_exclude_ship_to_location_preference, 'ShowSellerExcludeShipToLocationPreference', 'true', 'false', :optional => true boolean_node :show_unpaid_item_assistance_preference, 'ShowUnpaidItemAssistancePreference', 'true', 'false', :optional => true + boolean_node :show_purchase_reminder_email_preferences, 'ShowPurchaseReminderEmailPreferences', 'true', 'false', :optional => true end end end diff --git a/lib/ebay/requests/set_user_preferences.rb b/lib/ebay/requests/set_user_preferences.rb index 7950f8fe..fcb59742 100644 --- a/lib/ebay/requests/set_user_preferences.rb +++ b/lib/ebay/requests/set_user_preferences.rb @@ -5,6 +5,7 @@ require 'ebay/types/seller_favorite_item_preferences' require 'ebay/types/end_of_auction_email_preferences' require 'ebay/types/unpaid_item_assistance_preferences' +require 'ebay/types/purchase_reminder_email_preferences' module Ebay # :nodoc: module Requests # :nodoc: @@ -17,6 +18,7 @@ module Requests # :nodoc: # object_node :end_of_auction_email_preferences, 'EndOfAuctionEmailPreferences', :class => EndOfAuctionEmailPreferences, :optional => true # boolean_node :email_shipment_tracking_number_preference, 'EmailShipmentTrackingNumberPreference', 'true', 'false', :optional => true # object_node :unpaid_item_assistance_preferences, 'UnpaidItemAssistancePreferences', :class => UnpaidItemAssistancePreferences, :optional => true + # object_node :purchase_reminder_email_preferences, 'PurchaseReminderEmailPreferences', :class => PurchaseReminderEmailPreferences, :optional => true class SetUserPreferences < Abstract include XML::Mapping include Initializer @@ -29,6 +31,7 @@ class SetUserPreferences < Abstract object_node :end_of_auction_email_preferences, 'EndOfAuctionEmailPreferences', :class => EndOfAuctionEmailPreferences, :optional => true boolean_node :email_shipment_tracking_number_preference, 'EmailShipmentTrackingNumberPreference', 'true', 'false', :optional => true object_node :unpaid_item_assistance_preferences, 'UnpaidItemAssistancePreferences', :class => UnpaidItemAssistancePreferences, :optional => true + object_node :purchase_reminder_email_preferences, 'PurchaseReminderEmailPreferences', :class => PurchaseReminderEmailPreferences, :optional => true end end end diff --git a/lib/ebay/requests/upload_site_hosted_pictures.rb b/lib/ebay/requests/upload_site_hosted_pictures.rb index ca3933f9..033742d4 100644 --- a/lib/ebay/requests/upload_site_hosted_pictures.rb +++ b/lib/ebay/requests/upload_site_hosted_pictures.rb @@ -9,6 +9,8 @@ module Requests # :nodoc: # object_node :picture_data, 'PictureData', :class => Base64Binary, :optional => true # text_node :picture_upload_policy, 'PictureUploadPolicy', :optional => true # text_node :external_picture_url, 'ExternalPictureURL', :optional => true + # value_array_node :picture_watermarks, 'PictureWatermark', :default_value => [] + # numeric_node :extension_in_days, 'ExtensionInDays', :optional => true class UploadSiteHostedPictures < Abstract include XML::Mapping include Initializer @@ -19,6 +21,8 @@ class UploadSiteHostedPictures < Abstract object_node :picture_data, 'PictureData', :class => Base64Binary, :optional => true text_node :picture_upload_policy, 'PictureUploadPolicy', :optional => true text_node :external_picture_url, 'ExternalPictureURL', :optional => true + value_array_node :picture_watermarks, 'PictureWatermark', :default_value => [] + numeric_node :extension_in_days, 'ExtensionInDays', :optional => true end end end diff --git a/lib/ebay/responses.rb b/lib/ebay/responses.rb index d7f06086..2c6b609d 100644 --- a/lib/ebay/responses.rb +++ b/lib/ebay/responses.rb @@ -28,6 +28,7 @@ require 'ebay/responses/end_fixed_price_item' require 'ebay/responses/end_item' require 'ebay/responses/end_items' +require 'ebay/responses/extend_site_hosted_pictures' require 'ebay/responses/fetch_token' require 'ebay/responses/get_account' require 'ebay/responses/get_ad_format_leads' diff --git a/lib/ebay/responses/extend_site_hosted_pictures.rb b/lib/ebay/responses/extend_site_hosted_pictures.rb new file mode 100644 index 00000000..9c424af2 --- /dev/null +++ b/lib/ebay/responses/extend_site_hosted_pictures.rb @@ -0,0 +1,15 @@ + +module Ebay # :nodoc: + module Responses # :nodoc: + # == Attributes + # text_node :picture_url, 'PictureURL', :optional => true + class ExtendSiteHostedPictures < Abstract + include XML::Mapping + include Initializer + root_element_name 'ExtendSiteHostedPicturesResponse' + text_node :picture_url, 'PictureURL', :optional => true + end + end +end + + diff --git a/lib/ebay/responses/get_ebay_details.rb b/lib/ebay/responses/get_ebay_details.rb index d4c76997..260b1af6 100644 --- a/lib/ebay/responses/get_ebay_details.rb +++ b/lib/ebay/responses/get_ebay_details.rb @@ -20,6 +20,8 @@ require 'ebay/types/listing_feature_details' require 'ebay/types/variation_details' require 'ebay/types/exclude_shipping_location_details' +require 'ebay/types/recoupment_policy_details' +require 'ebay/types/shipping_category_details' module Ebay # :nodoc: module Responses # :nodoc: @@ -47,6 +49,8 @@ module Responses # :nodoc: # object_node :variation_details, 'VariationDetails', :class => VariationDetails, :optional => true # array_node :exclude_shipping_location_details, 'ExcludeShippingLocationDetails', :class => ExcludeShippingLocationDetails, :default_value => [] # time_node :update_time, 'UpdateTime', :optional => true + # array_node :recoupment_policy_details, 'RecoupmentPolicyDetails', :class => RecoupmentPolicyDetails, :default_value => [] + # array_node :shipping_category_details, 'ShippingCategoryDetails', :class => ShippingCategoryDetails, :default_value => [] class GeteBayDetails < Abstract include XML::Mapping include Initializer @@ -74,6 +78,8 @@ class GeteBayDetails < Abstract object_node :variation_details, 'VariationDetails', :class => VariationDetails, :optional => true array_node :exclude_shipping_location_details, 'ExcludeShippingLocationDetails', :class => ExcludeShippingLocationDetails, :default_value => [] time_node :update_time, 'UpdateTime', :optional => true + array_node :recoupment_policy_details, 'RecoupmentPolicyDetails', :class => RecoupmentPolicyDetails, :default_value => [] + array_node :shipping_category_details, 'ShippingCategoryDetails', :class => ShippingCategoryDetails, :default_value => [] end end end diff --git a/lib/ebay/responses/get_user_preferences.rb b/lib/ebay/responses/get_user_preferences.rb index 164a8ce5..403f6cda 100644 --- a/lib/ebay/responses/get_user_preferences.rb +++ b/lib/ebay/responses/get_user_preferences.rb @@ -7,6 +7,7 @@ require 'ebay/types/pro_stores_checkout_preference' require 'ebay/types/unpaid_item_assistance_preferences' require 'ebay/types/seller_exclude_ship_to_location_preferences' +require 'ebay/types/purchase_reminder_email_preferences' module Ebay # :nodoc: module Responses # :nodoc: @@ -21,6 +22,7 @@ module Responses # :nodoc: # object_node :pro_stores_preference, 'ProStoresPreference', :class => ProStoresCheckoutPreference, :optional => true # object_node :unpaid_item_assistance_preferences, 'UnpaidItemAssistancePreferences', :class => UnpaidItemAssistancePreferences, :optional => true # array_node :seller_exclude_ship_to_location_preferences, 'SellerExcludeShipToLocationPreferences', :class => SellerExcludeShipToLocationPreferences, :default_value => [] + # object_node :purchase_reminder_email_preferences, 'PurchaseReminderEmailPreferences', :class => PurchaseReminderEmailPreferences, :optional => true class GetUserPreferences < Abstract include XML::Mapping include Initializer @@ -35,6 +37,7 @@ class GetUserPreferences < Abstract object_node :pro_stores_preference, 'ProStoresPreference', :class => ProStoresCheckoutPreference, :optional => true object_node :unpaid_item_assistance_preferences, 'UnpaidItemAssistancePreferences', :class => UnpaidItemAssistancePreferences, :optional => true array_node :seller_exclude_ship_to_location_preferences, 'SellerExcludeShipToLocationPreferences', :class => SellerExcludeShipToLocationPreferences, :default_value => [] + object_node :purchase_reminder_email_preferences, 'PurchaseReminderEmailPreferences', :class => PurchaseReminderEmailPreferences, :optional => true end end end diff --git a/lib/ebay/schema/version.rb b/lib/ebay/schema/version.rb index 75364d12..cac5f82a 100644 --- a/lib/ebay/schema/version.rb +++ b/lib/ebay/schema/version.rb @@ -1,5 +1,5 @@ module Ebay module Schema - VERSION = 653 + VERSION = 679 end end diff --git a/lib/ebay/types.rb b/lib/ebay/types.rb index 7404c802..143355c5 100644 --- a/lib/ebay/types.rb +++ b/lib/ebay/types.rb @@ -30,6 +30,7 @@ require 'ebay/types/address_owner_code' require 'ebay/types/address_record_type_code' require 'ebay/types/address_status_code' +require 'ebay/types/address_usage_code' require 'ebay/types/announcement_message_code' require 'ebay/types/application_device_type_code' require 'ebay/types/attribute_conversion_enabled_code' @@ -67,6 +68,7 @@ require 'ebay/types/combined_payment_period_code' require 'ebay/types/comment_type_code' require 'ebay/types/complete_status_code' +require 'ebay/types/condition_enabled_code' require 'ebay/types/cost_group_flat_code' require 'ebay/types/country_code' require 'ebay/types/currency_code' @@ -99,6 +101,7 @@ require 'ebay/types/flat_rate_insurance_range_code' require 'ebay/types/flat_shipping_rate_option_code' require 'ebay/types/gallery_sort_filter_code' +require 'ebay/types/gallery_status_code' require 'ebay/types/gallery_type_code' require 'ebay/types/general_payment_method_code' require 'ebay/types/geographic_exposure_code' @@ -169,6 +172,7 @@ require 'ebay/types/picture_set_code' require 'ebay/types/picture_source_code' require 'ebay/types/picture_upload_policy_code' +require 'ebay/types/picture_watermark_code' require 'ebay/types/policy_compliance_status_code' require 'ebay/types/preferred_location_code' require 'ebay/types/pro_pack_code' @@ -182,6 +186,7 @@ require 'ebay/types/promotional_sale_status_code' require 'ebay/types/promotional_sale_type_code' require 'ebay/types/purchase_purpose_type_code' +require 'ebay/types/quantity_available_hint_code' require 'ebay/types/quantity_operator_code' require 'ebay/types/question_type_code' require 'ebay/types/rcs_payment_status_code' @@ -257,6 +262,8 @@ require 'ebay/types/summary_frequency_code' require 'ebay/types/summary_window_period_code' require 'ebay/types/task_status_code' +require 'ebay/types/tax_description_code' +require 'ebay/types/tax_type_code' require 'ebay/types/ticket_event_type_code' require 'ebay/types/token_return_method_code' require 'ebay/types/token_status_code' diff --git a/lib/ebay/types/account_detail_entry_code.rb b/lib/ebay/types/account_detail_entry_code.rb index 60eaa72b..33fbfd48 100644 --- a/lib/ebay/types/account_detail_entry_code.rb +++ b/lib/ebay/types/account_detail_entry_code.rb @@ -260,6 +260,7 @@ class AccountDetailEntryCode CreditRealEstateProFee = 'CreditRealEstateProFee' RealEstateProFeatureFee = 'RealEstateProFeatureFee' CreditRealEstateProFeatureFee = 'CreditRealEstateProFeatureFee' + Discount = 'Discount' end end end diff --git a/lib/ebay/types/address.rb b/lib/ebay/types/address.rb index 0d448399..044a94da 100644 --- a/lib/ebay/types/address.rb +++ b/lib/ebay/types/address.rb @@ -33,6 +33,7 @@ module Types # :nodoc: # text_node :first_name, 'FirstName', :optional => true # text_node :last_name, 'LastName', :optional => true # text_node :phone2, 'Phone2', :optional => true + # text_node :address_usage, 'AddressUsage', :optional => true class Address include XML::Mapping include Initializer @@ -68,6 +69,7 @@ class Address text_node :first_name, 'FirstName', :optional => true text_node :last_name, 'LastName', :optional => true text_node :phone2, 'Phone2', :optional => true + text_node :address_usage, 'AddressUsage', :optional => true end end end diff --git a/lib/ebay/types/address_usage_code.rb b/lib/ebay/types/address_usage_code.rb new file mode 100644 index 00000000..f1288f62 --- /dev/null +++ b/lib/ebay/types/address_usage_code.rb @@ -0,0 +1,12 @@ +module Ebay # :nodoc: + module Types # :nodoc: + class AddressUsageCode + extend Enumerable + extend Enumeration + DefaultShipping = 'DefaultShipping' + Shipping = 'Shipping' + Invalid = 'Invalid' + end + end +end + diff --git a/lib/ebay/types/amount.rb b/lib/ebay/types/amount.rb index 0a64e5fe..c72998f9 100644 --- a/lib/ebay/types/amount.rb +++ b/lib/ebay/types/amount.rb @@ -3,13 +3,11 @@ module Ebay # :nodoc: module Types # :nodoc: # == Attributes # numeric_node :amount, '', :optional => true - # text_node :currency, '@currencyID', :optional => true class Amount include XML::Mapping include Initializer root_element_name 'Amount' numeric_node :amount, '', :optional => true - text_node :currency, '@currencyID', :optional => true end end end diff --git a/lib/ebay/types/base64_binary.rb b/lib/ebay/types/base64_binary.rb index 15217b50..d9cbfda2 100644 --- a/lib/ebay/types/base64_binary.rb +++ b/lib/ebay/types/base64_binary.rb @@ -3,13 +3,11 @@ module Ebay # :nodoc: module Types # :nodoc: # == Attributes # - # text_node :string, '@contentType', :optional => true class Base64Binary include XML::Mapping include Initializer root_element_name 'Base64Binary' - text_node :string, '@contentType', :optional => true end end end diff --git a/lib/ebay/types/basic_amount.rb b/lib/ebay/types/basic_amount.rb index 75e367f2..000f533b 100644 --- a/lib/ebay/types/basic_amount.rb +++ b/lib/ebay/types/basic_amount.rb @@ -3,13 +3,11 @@ module Ebay # :nodoc: module Types # :nodoc: # == Attributes # text_node :basic_amount, '', :optional => true - # text_node :currency, '@currencyID', :optional => true class BasicAmount include XML::Mapping include Initializer root_element_name 'BasicAmount' text_node :basic_amount, '', :optional => true - text_node :currency, '@currencyID', :optional => true end end end diff --git a/lib/ebay/types/category_feature.rb b/lib/ebay/types/category_feature.rb index 8ce3cff8..8b8be809 100644 --- a/lib/ebay/types/category_feature.rb +++ b/lib/ebay/types/category_feature.rb @@ -1,6 +1,7 @@ require 'ebay/types/listing_duration_reference' require 'ebay/types/listing_enhancement_duration_reference' require 'ebay/types/store_owner_extended_listing_durations' +require 'ebay/types/condition_values' module Ebay # :nodoc: module Types # :nodoc: @@ -109,6 +110,8 @@ module Types # :nodoc: # text_node :item_compatibility_enabled, 'ItemCompatibilityEnabled', :optional => true # numeric_node :min_item_compatibility, 'MinItemCompatibility', :optional => true # numeric_node :max_item_compatibility, 'MaxItemCompatibility', :optional => true + # text_node :condition_enabled, 'ConditionEnabled', :optional => true + # object_node :condition_values, 'ConditionValues', :class => ConditionValues, :optional => true class CategoryFeature include XML::Mapping include Initializer @@ -217,6 +220,8 @@ class CategoryFeature text_node :item_compatibility_enabled, 'ItemCompatibilityEnabled', :optional => true numeric_node :min_item_compatibility, 'MinItemCompatibility', :optional => true numeric_node :max_item_compatibility, 'MaxItemCompatibility', :optional => true + text_node :condition_enabled, 'ConditionEnabled', :optional => true + object_node :condition_values, 'ConditionValues', :class => ConditionValues, :optional => true end end end diff --git a/lib/ebay/types/charity_id.rb b/lib/ebay/types/charity_id.rb index 9a8dc807..3485ffd9 100644 --- a/lib/ebay/types/charity_id.rb +++ b/lib/ebay/types/charity_id.rb @@ -3,13 +3,11 @@ module Ebay # :nodoc: module Types # :nodoc: # == Attributes # text_node :charity_id, '', :optional => true - # text_node :charity_affiliation_type, '@type', :optional => true class CharityID include XML::Mapping include Initializer root_element_name 'CharityID' text_node :charity_id, '', :optional => true - text_node :charity_affiliation_type, '@type', :optional => true end end end diff --git a/lib/ebay/types/condition.rb b/lib/ebay/types/condition.rb new file mode 100644 index 00000000..0e2cb506 --- /dev/null +++ b/lib/ebay/types/condition.rb @@ -0,0 +1,17 @@ + +module Ebay # :nodoc: + module Types # :nodoc: + # == Attributes + # numeric_node :id, 'ID', :optional => true + # text_node :display_name, 'DisplayName', :optional => true + class Condition + include XML::Mapping + include Initializer + root_element_name 'Condition' + numeric_node :id, 'ID', :optional => true + text_node :display_name, 'DisplayName', :optional => true + end + end +end + + diff --git a/lib/ebay/types/condition_enabled_code.rb b/lib/ebay/types/condition_enabled_code.rb new file mode 100644 index 00000000..41fa02e6 --- /dev/null +++ b/lib/ebay/types/condition_enabled_code.rb @@ -0,0 +1,12 @@ +module Ebay # :nodoc: + module Types # :nodoc: + class ConditionEnabledCode + extend Enumerable + extend Enumeration + Disabled = 'Disabled' + Enabled = 'Enabled' + Required = 'Required' + end + end +end + diff --git a/lib/ebay/types/condition_enabled_definition.rb b/lib/ebay/types/condition_enabled_definition.rb new file mode 100644 index 00000000..de22c3f9 --- /dev/null +++ b/lib/ebay/types/condition_enabled_definition.rb @@ -0,0 +1,13 @@ + +module Ebay # :nodoc: + module Types # :nodoc: + # == Attributes + class ConditionEnabledDefinition + include XML::Mapping + include Initializer + root_element_name 'ConditionEnabledDefinition' + end + end +end + + diff --git a/lib/ebay/types/condition_values.rb b/lib/ebay/types/condition_values.rb new file mode 100644 index 00000000..ee95c8e2 --- /dev/null +++ b/lib/ebay/types/condition_values.rb @@ -0,0 +1,18 @@ +require 'ebay/types/condition' + +module Ebay # :nodoc: + module Types # :nodoc: + # == Attributes + # array_node :conditions, 'Condition', :class => Condition, :default_value => [] + # text_node :condition_help_url, 'ConditionHelpURL', :optional => true + class ConditionValues + include XML::Mapping + include Initializer + root_element_name 'ConditionValues' + array_node :conditions, 'Condition', :class => Condition, :default_value => [] + text_node :condition_help_url, 'ConditionHelpURL', :optional => true + end + end +end + + diff --git a/lib/ebay/types/condition_values_definition.rb b/lib/ebay/types/condition_values_definition.rb new file mode 100644 index 00000000..e79c9263 --- /dev/null +++ b/lib/ebay/types/condition_values_definition.rb @@ -0,0 +1,13 @@ + +module Ebay # :nodoc: + module Types # :nodoc: + # == Attributes + class ConditionValuesDefinition + include XML::Mapping + include Initializer + root_element_name 'ConditionValuesDefinition' + end + end +end + + diff --git a/lib/ebay/types/detail_name_code.rb b/lib/ebay/types/detail_name_code.rb index d6a0368a..6c5c0f84 100644 --- a/lib/ebay/types/detail_name_code.rb +++ b/lib/ebay/types/detail_name_code.rb @@ -25,6 +25,7 @@ class DetailNameCode ListingFeatureDetails = 'ListingFeatureDetails' VariationDetails = 'VariationDetails' ExcludeShippingLocationDetails = 'ExcludeShippingLocationDetails' + RecoupmentPolicyDetails = 'RecoupmentPolicyDetails' end end end diff --git a/lib/ebay/types/feature_definitions.rb b/lib/ebay/types/feature_definitions.rb index 4b5480cc..904211a2 100644 --- a/lib/ebay/types/feature_definitions.rb +++ b/lib/ebay/types/feature_definitions.rb @@ -105,6 +105,8 @@ require 'ebay/types/item_compatibility_enabled_definition' require 'ebay/types/max_item_compatibility_definition' require 'ebay/types/min_item_compatibility_definition' +require 'ebay/types/condition_enabled_definition' +require 'ebay/types/condition_values_definition' module Ebay # :nodoc: module Types # :nodoc: @@ -216,6 +218,8 @@ module Types # :nodoc: # object_node :item_compatibility_enabled, 'ItemCompatibilityEnabled', :class => ItemCompatibilityEnabledDefinition, :optional => true # object_node :max_item_compatibility, 'MaxItemCompatibility', :class => MaxItemCompatibilityDefinition, :optional => true # object_node :min_item_compatibility, 'MinItemCompatibility', :class => MinItemCompatibilityDefinition, :optional => true + # object_node :condition_enabled, 'ConditionEnabled', :class => ConditionEnabledDefinition, :optional => true + # object_node :condition_values, 'ConditionValues', :class => ConditionValuesDefinition, :optional => true class FeatureDefinitions include XML::Mapping include Initializer @@ -327,6 +331,8 @@ class FeatureDefinitions object_node :item_compatibility_enabled, 'ItemCompatibilityEnabled', :class => ItemCompatibilityEnabledDefinition, :optional => true object_node :max_item_compatibility, 'MaxItemCompatibility', :class => MaxItemCompatibilityDefinition, :optional => true object_node :min_item_compatibility, 'MinItemCompatibility', :class => MinItemCompatibilityDefinition, :optional => true + object_node :condition_enabled, 'ConditionEnabled', :class => ConditionEnabledDefinition, :optional => true + object_node :condition_values, 'ConditionValues', :class => ConditionValuesDefinition, :optional => true end end end diff --git a/lib/ebay/types/feature_id_code.rb b/lib/ebay/types/feature_id_code.rb index 4244ea44..9a9aff9e 100644 --- a/lib/ebay/types/feature_id_code.rb +++ b/lib/ebay/types/feature_id_code.rb @@ -105,6 +105,8 @@ class FeatureIDCode CompatibilityEnabled = 'CompatibilityEnabled' MinCompatibleApplications = 'MinCompatibleApplications' MaxCompatibleApplications = 'MaxCompatibleApplications' + ConditionEnabled = 'ConditionEnabled' + ConditionValues = 'ConditionValues' end end end diff --git a/lib/ebay/types/feedback_requirements.rb b/lib/ebay/types/feedback_requirements.rb index 504ef450..dda51dbc 100644 --- a/lib/ebay/types/feedback_requirements.rb +++ b/lib/ebay/types/feedback_requirements.rb @@ -3,13 +3,11 @@ module Ebay # :nodoc: module Types # :nodoc: # == Attributes # boolean_node :feedback_requirements, 'FeedbackRequirements', 'true', 'false', :optional => true - # text_node :string, '@minimum', :optional => true class FeedbackRequirements include XML::Mapping include Initializer root_element_name 'FeedbackRequirements' boolean_node :feedback_requirements, 'FeedbackRequirements', 'true', 'false', :optional => true - text_node :string, '@minimum', :optional => true end end end diff --git a/lib/ebay/types/gallery_status_code.rb b/lib/ebay/types/gallery_status_code.rb new file mode 100644 index 00000000..ed416dfd --- /dev/null +++ b/lib/ebay/types/gallery_status_code.rb @@ -0,0 +1,19 @@ +module Ebay # :nodoc: + module Types # :nodoc: + class GalleryStatusCode + extend Enumerable + extend Enumeration + Success = 'Success' + Pending = 'Pending' + InvalidURL = 'InvalidUrl' + InvalidProtocol = 'InvalidProtocol' + InvalidFile = 'InvalidFile' + ServerDown = 'ServerDown' + ImageNonExistent = 'ImageNonExistent' + ImageReadTimeOut = 'ImageReadTimeOut' + InvalidFileFormat = 'InvalidFileFormat' + ImageProcessingError = 'ImageProcessingError' + end + end +end + diff --git a/lib/ebay/types/item.rb b/lib/ebay/types/item.rb index c531abcb..5a3af66d 100644 --- a/lib/ebay/types/item.rb +++ b/lib/ebay/types/item.rb @@ -151,6 +151,11 @@ module Types # :nodoc: # object_node :variations, 'Variations', :class => Variations, :optional => true # array_node :item_compatibility_lists, 'ItemCompatibilityList', 'Compatibility', :class => ItemCompatibility, :default_value => [] # numeric_node :item_compatibility_count, 'ItemCompatibilityCount', :optional => true + # numeric_node :condition_id, 'ConditionID', :optional => true + # text_node :condition_display_name, 'ConditionDisplayName', :optional => true + # text_node :tax_category, 'TaxCategory', :optional => true + # text_node :quantity_available_hint, 'QuantityAvailableHint', :optional => true + # numeric_node :quantity_threshold, 'QuantityThreshold', :optional => true class Item include XML::Mapping include Initializer @@ -271,6 +276,11 @@ class Item object_node :variations, 'Variations', :class => Variations, :optional => true array_node :item_compatibility_lists, 'ItemCompatibilityList', 'Compatibility', :class => ItemCompatibility, :default_value => [] numeric_node :item_compatibility_count, 'ItemCompatibilityCount', :optional => true + numeric_node :condition_id, 'ConditionID', :optional => true + text_node :condition_display_name, 'ConditionDisplayName', :optional => true + text_node :tax_category, 'TaxCategory', :optional => true + text_node :quantity_available_hint, 'QuantityAvailableHint', :optional => true + numeric_node :quantity_threshold, 'QuantityThreshold', :optional => true end end end diff --git a/lib/ebay/types/listing_duration_reference.rb b/lib/ebay/types/listing_duration_reference.rb index 7f8c276c..8a7c943e 100644 --- a/lib/ebay/types/listing_duration_reference.rb +++ b/lib/ebay/types/listing_duration_reference.rb @@ -3,13 +3,11 @@ module Ebay # :nodoc: module Types # :nodoc: # == Attributes # numeric_node :listing_duration_reference, '', :optional => true - # text_node :listing_type, '@type', :optional => true class ListingDurationReference include XML::Mapping include Initializer root_element_name 'ListingDurationReference' numeric_node :listing_duration_reference, '', :optional => true - text_node :listing_type, '@type', :optional => true end end end diff --git a/lib/ebay/types/measure.rb b/lib/ebay/types/measure.rb index 0171cfc0..b8e01028 100644 --- a/lib/ebay/types/measure.rb +++ b/lib/ebay/types/measure.rb @@ -3,15 +3,11 @@ module Ebay # :nodoc: module Types # :nodoc: # == Attributes # numeric_node :measure, '', :optional => true - # text_node :token, '@unit', :optional => true - # text_node :measurement_system, '@measurementSystem', :optional => true class Measure include XML::Mapping include Initializer root_element_name 'Measure' numeric_node :measure, '', :optional => true - text_node :token, '@unit', :optional => true - text_node :measurement_system, '@measurementSystem', :optional => true end end end diff --git a/lib/ebay/types/my_messages_folder_summary.rb b/lib/ebay/types/my_messages_folder_summary.rb index b078ae4e..9eb5e125 100644 --- a/lib/ebay/types/my_messages_folder_summary.rb +++ b/lib/ebay/types/my_messages_folder_summary.rb @@ -8,6 +8,8 @@ module Types # :nodoc: # numeric_node :new_message_count, 'NewMessageCount', :optional => true # numeric_node :total_alert_count, 'TotalAlertCount', :optional => true # numeric_node :total_message_count, 'TotalMessageCount', :optional => true + # numeric_node :new_high_priority_count, 'NewHighPriorityCount', :optional => true + # numeric_node :total_high_priority_count, 'TotalHighPriorityCount', :optional => true class MyMessagesFolderSummary include XML::Mapping include Initializer @@ -18,6 +20,8 @@ class MyMessagesFolderSummary numeric_node :new_message_count, 'NewMessageCount', :optional => true numeric_node :total_alert_count, 'TotalAlertCount', :optional => true numeric_node :total_message_count, 'TotalMessageCount', :optional => true + numeric_node :new_high_priority_count, 'NewHighPriorityCount', :optional => true + numeric_node :total_high_priority_count, 'TotalHighPriorityCount', :optional => true end end end diff --git a/lib/ebay/types/my_messages_message.rb b/lib/ebay/types/my_messages_message.rb index 43cf6ecd..8a996daf 100644 --- a/lib/ebay/types/my_messages_message.rb +++ b/lib/ebay/types/my_messages_message.rb @@ -26,6 +26,10 @@ module Types # :nodoc: # text_node :message_type, 'MessageType', :optional => true # text_node :listing_status, 'ListingStatus', :optional => true # text_node :question_type, 'QuestionType', :optional => true + # boolean_node :replied, 'Replied', 'true', 'false', :optional => true + # boolean_node :high_priority, 'HighPriority', 'true', 'false', :optional => true + # time_node :item_end_time, 'ItemEndTime', :optional => true + # text_node :item_title, 'ItemTitle', :optional => true class MyMessagesMessage include XML::Mapping include Initializer @@ -51,6 +55,10 @@ class MyMessagesMessage text_node :message_type, 'MessageType', :optional => true text_node :listing_status, 'ListingStatus', :optional => true text_node :question_type, 'QuestionType', :optional => true + boolean_node :replied, 'Replied', 'true', 'false', :optional => true + boolean_node :high_priority, 'HighPriority', 'true', 'false', :optional => true + time_node :item_end_time, 'ItemEndTime', :optional => true + text_node :item_title, 'ItemTitle', :optional => true end end end diff --git a/lib/ebay/types/my_messages_summary.rb b/lib/ebay/types/my_messages_summary.rb index 534ff672..1c95cadc 100644 --- a/lib/ebay/types/my_messages_summary.rb +++ b/lib/ebay/types/my_messages_summary.rb @@ -10,6 +10,8 @@ module Types # :nodoc: # numeric_node :flagged_message_count, 'FlaggedMessageCount', :optional => true # numeric_node :total_alert_count, 'TotalAlertCount', :optional => true # numeric_node :total_message_count, 'TotalMessageCount', :optional => true + # numeric_node :new_high_priority_count, 'NewHighPriorityCount', :optional => true + # numeric_node :total_high_priority_count, 'TotalHighPriorityCount', :optional => true class MyMessagesSummary include XML::Mapping include Initializer @@ -21,6 +23,8 @@ class MyMessagesSummary numeric_node :flagged_message_count, 'FlaggedMessageCount', :optional => true numeric_node :total_alert_count, 'TotalAlertCount', :optional => true numeric_node :total_message_count, 'TotalMessageCount', :optional => true + numeric_node :new_high_priority_count, 'NewHighPriorityCount', :optional => true + numeric_node :total_high_priority_count, 'TotalHighPriorityCount', :optional => true end end end diff --git a/lib/ebay/types/name_recommendation.rb b/lib/ebay/types/name_recommendation.rb index 08e7405e..9b6df543 100644 --- a/lib/ebay/types/name_recommendation.rb +++ b/lib/ebay/types/name_recommendation.rb @@ -9,6 +9,7 @@ module Types # :nodoc: # array_node :value_recommendations, 'ValueRecommendation', :class => ValueRecommendation, :default_value => [] # text_node :help_url, 'HelpURL', :optional => true # text_node :source, 'Source', :optional => true + # text_node :help_text, 'HelpText', :optional => true class NameRecommendation include XML::Mapping include Initializer @@ -18,6 +19,7 @@ class NameRecommendation array_node :value_recommendations, 'ValueRecommendation', :class => ValueRecommendation, :default_value => [] text_node :help_url, 'HelpURL', :optional => true text_node :source, 'Source', :optional => true + text_node :help_text, 'HelpText', :optional => true end end end diff --git a/lib/ebay/types/notification_event_type_code.rb b/lib/ebay/types/notification_event_type_code.rb index 256b0114..1a5ff17f 100644 --- a/lib/ebay/types/notification_event_type_code.rb +++ b/lib/ebay/types/notification_event_type_code.rb @@ -66,6 +66,8 @@ class NotificationEventTypeCode BulkDataExchangeJobCompleted = 'BulkDataExchangeJobCompleted' ItemMarkedShipped = 'ItemMarkedShipped' ItemMarkedPaid = 'ItemMarkedPaid' + MyMessagesHighPriorityMessage = 'MyMessagesHighPriorityMessage' + MyMessagesHighPriorityMessageHeader = 'MyMessagesHighPriorityMessageHeader' end end end diff --git a/lib/ebay/types/payment_hold_status_code.rb b/lib/ebay/types/payment_hold_status_code.rb index 2999412f..ac125209 100644 --- a/lib/ebay/types/payment_hold_status_code.rb +++ b/lib/ebay/types/payment_hold_status_code.rb @@ -7,6 +7,7 @@ class PaymentHoldStatusCode MerchantHold = 'MerchantHold' Released = 'Released' None = 'None' + NewSellerHold = 'NewSellerHold' end end end diff --git a/lib/ebay/types/picture_details.rb b/lib/ebay/types/picture_details.rb index 6f5d6d3b..cee5e758 100644 --- a/lib/ebay/types/picture_details.rb +++ b/lib/ebay/types/picture_details.rb @@ -8,6 +8,8 @@ module Types # :nodoc: # text_node :picture_url, 'PictureURL', :optional => true # text_node :picture_source, 'PictureSource', :optional => true # text_node :gallery_duration, 'GalleryDuration', :optional => true + # text_node :gallery_status, 'GalleryStatus', :optional => true + # text_node :gallery_error_info, 'GalleryErrorInfo', :optional => true class PictureDetails include XML::Mapping include Initializer @@ -18,6 +20,8 @@ class PictureDetails text_node :picture_url, 'PictureURL', :optional => true text_node :picture_source, 'PictureSource', :optional => true text_node :gallery_duration, 'GalleryDuration', :optional => true + text_node :gallery_status, 'GalleryStatus', :optional => true + text_node :gallery_error_info, 'GalleryErrorInfo', :optional => true end end end diff --git a/lib/ebay/types/picture_watermark_code.rb b/lib/ebay/types/picture_watermark_code.rb new file mode 100644 index 00000000..0d33e258 --- /dev/null +++ b/lib/ebay/types/picture_watermark_code.rb @@ -0,0 +1,11 @@ +module Ebay # :nodoc: + module Types # :nodoc: + class PictureWatermarkCode + extend Enumerable + extend Enumeration + User = 'User' + Icon = 'Icon' + end + end +end + diff --git a/lib/ebay/types/purchase_reminder_email_preferences.rb b/lib/ebay/types/purchase_reminder_email_preferences.rb new file mode 100644 index 00000000..40386d19 --- /dev/null +++ b/lib/ebay/types/purchase_reminder_email_preferences.rb @@ -0,0 +1,15 @@ + +module Ebay # :nodoc: + module Types # :nodoc: + # == Attributes + # boolean_node :purchase_reminder_email_preferences, 'PurchaseReminderEmailPreferences', 'true', 'false', :optional => true + class PurchaseReminderEmailPreferences + include XML::Mapping + include Initializer + root_element_name 'PurchaseReminderEmailPreferences' + boolean_node :purchase_reminder_email_preferences, 'PurchaseReminderEmailPreferences', 'true', 'false', :optional => true + end + end +end + + diff --git a/lib/ebay/types/quantity.rb b/lib/ebay/types/quantity.rb index 7b189870..00447fd6 100644 --- a/lib/ebay/types/quantity.rb +++ b/lib/ebay/types/quantity.rb @@ -3,13 +3,11 @@ module Ebay # :nodoc: module Types # :nodoc: # == Attributes # numeric_node :quantity, '', :optional => true - # text_node :token, '@unit', :optional => true class Quantity include XML::Mapping include Initializer root_element_name 'Quantity' numeric_node :quantity, '', :optional => true - text_node :token, '@unit', :optional => true end end end diff --git a/lib/ebay/types/quantity_available_hint_code.rb b/lib/ebay/types/quantity_available_hint_code.rb new file mode 100644 index 00000000..4af2da68 --- /dev/null +++ b/lib/ebay/types/quantity_available_hint_code.rb @@ -0,0 +1,11 @@ +module Ebay # :nodoc: + module Types # :nodoc: + class QuantityAvailableHintCode + extend Enumerable + extend Enumeration + Limited = 'Limited' + MoreThan = 'MoreThan' + end + end +end + diff --git a/lib/ebay/types/recoupment_policy_details.rb b/lib/ebay/types/recoupment_policy_details.rb new file mode 100644 index 00000000..f3925ef0 --- /dev/null +++ b/lib/ebay/types/recoupment_policy_details.rb @@ -0,0 +1,21 @@ + +module Ebay # :nodoc: + module Types # :nodoc: + # == Attributes + # boolean_node :enforced_on_listing_site, 'EnforcedOnListingSite', 'true', 'false', :optional => true + # boolean_node :enforced_on_registration_site, 'EnforcedOnRegistrationSite', 'true', 'false', :optional => true + # text_node :detail_version, 'DetailVersion', :optional => true + # time_node :update_time, 'UpdateTime', :optional => true + class RecoupmentPolicyDetails + include XML::Mapping + include Initializer + root_element_name 'RecoupmentPolicyDetails' + boolean_node :enforced_on_listing_site, 'EnforcedOnListingSite', 'true', 'false', :optional => true + boolean_node :enforced_on_registration_site, 'EnforcedOnRegistrationSite', 'true', 'false', :optional => true + text_node :detail_version, 'DetailVersion', :optional => true + time_node :update_time, 'UpdateTime', :optional => true + end + end +end + + diff --git a/lib/ebay/types/seller.rb b/lib/ebay/types/seller.rb index bc814587..267c1aa1 100644 --- a/lib/ebay/types/seller.rb +++ b/lib/ebay/types/seller.rb @@ -35,6 +35,7 @@ module Types # :nodoc: # object_node :feature_eligibility, 'FeatureEligibility', :class => FeatureEligibility, :optional => true # boolean_node :top_rated_seller, 'TopRatedSeller', 'true', 'false', :optional => true # value_array_node :top_rated_seller_details, 'TopRatedSellerDetails', 'TopRatedProgram', :default_value => [] + # value_array_node :recoupment_policy_consents, 'RecoupmentPolicyConsent', 'Site', :default_value => [] class Seller include XML::Mapping include Initializer @@ -67,6 +68,7 @@ class Seller object_node :feature_eligibility, 'FeatureEligibility', :class => FeatureEligibility, :optional => true boolean_node :top_rated_seller, 'TopRatedSeller', 'true', 'false', :optional => true value_array_node :top_rated_seller_details, 'TopRatedSellerDetails', 'TopRatedProgram', :default_value => [] + value_array_node :recoupment_policy_consents, 'RecoupmentPolicyConsent', 'Site', :default_value => [] end end end diff --git a/lib/ebay/types/shipping_category_details.rb b/lib/ebay/types/shipping_category_details.rb new file mode 100644 index 00000000..dcd9e94d --- /dev/null +++ b/lib/ebay/types/shipping_category_details.rb @@ -0,0 +1,21 @@ + +module Ebay # :nodoc: + module Types # :nodoc: + # == Attributes + # text_node :shipping_category, 'ShippingCategory', :optional => true + # text_node :description, 'Description', :optional => true + # text_node :detail_version, 'DetailVersion', :optional => true + # time_node :update_time, 'UpdateTime', :optional => true + class ShippingCategoryDetails + include XML::Mapping + include Initializer + root_element_name 'ShippingCategoryDetails' + text_node :shipping_category, 'ShippingCategory', :optional => true + text_node :description, 'Description', :optional => true + text_node :detail_version, 'DetailVersion', :optional => true + time_node :update_time, 'UpdateTime', :optional => true + end + end +end + + diff --git a/lib/ebay/types/shipping_service_code.rb b/lib/ebay/types/shipping_service_code.rb index 65074d39..0f5e9208 100644 --- a/lib/ebay/types/shipping_service_code.rb +++ b/lib/ebay/types/shipping_service_code.rb @@ -563,6 +563,11 @@ class ShippingServiceCode DEPickup = 'DE_Pickup' AUPickup = 'AU_Pickup' AUSmallParcels = 'AU_SmallParcels' + AUSmallParcelWithTracking = 'AU_SmallParcelWithTracking' + AUSmallParcelWithTrackingAndSignature = 'AU_SmallParcelWithTrackingAndSignature' + AURegularParcelWithTracking = 'AU_RegularParcelWithTracking' + AURegularParcelWithTrackingAndSignature = 'AU_RegularParcelWithTrackingAndSignature' + AUPrePaidExpressPostSatchel5kg = 'AU_PrePaidExpressPostSatchel5kg' AUPrePaidParcelPostSatchels500g = 'AU_PrePaidParcelPostSatchels500g' AUPrePaidParcelPostSatchels3kg = 'AU_PrePaidParcelPostSatchels3kg' AUPrePaidExpressPostSatchel500g = 'AU_PrePaidExpressPostSatchel500g' diff --git a/lib/ebay/types/shipping_service_details.rb b/lib/ebay/types/shipping_service_details.rb index dd09032a..926ed06f 100644 --- a/lib/ebay/types/shipping_service_details.rb +++ b/lib/ebay/types/shipping_service_details.rb @@ -26,6 +26,7 @@ module Types # :nodoc: # boolean_node :weight_required, 'WeightRequired', 'true', 'false', :optional => true # text_node :detail_version, 'DetailVersion', :optional => true # time_node :update_time, 'UpdateTime', :optional => true + # text_node :shipping_category, 'ShippingCategory', :optional => true class ShippingServiceDetails include XML::Mapping include Initializer @@ -52,6 +53,7 @@ class ShippingServiceDetails boolean_node :weight_required, 'WeightRequired', 'true', 'false', :optional => true text_node :detail_version, 'DetailVersion', :optional => true time_node :update_time, 'UpdateTime', :optional => true + text_node :shipping_category, 'ShippingCategory', :optional => true end end end diff --git a/lib/ebay/types/site_defaults.rb b/lib/ebay/types/site_defaults.rb index d359c559..20d0b33a 100644 --- a/lib/ebay/types/site_defaults.rb +++ b/lib/ebay/types/site_defaults.rb @@ -1,6 +1,7 @@ require 'ebay/types/listing_duration_reference' require 'ebay/types/listing_enhancement_duration_reference' require 'ebay/types/store_owner_extended_listing_durations' +require 'ebay/types/condition_values' module Ebay # :nodoc: module Types # :nodoc: @@ -112,6 +113,8 @@ module Types # :nodoc: # text_node :item_compatibility_enabled, 'ItemCompatibilityEnabled', :optional => true # numeric_node :min_item_compatibility, 'MinItemCompatibility', :optional => true # numeric_node :max_item_compatibility, 'MaxItemCompatibility', :optional => true + # text_node :condition_enabled, 'ConditionEnabled', :optional => true + # object_node :condition_values, 'ConditionValues', :class => ConditionValues, :optional => true class SiteDefaults include XML::Mapping include Initializer @@ -223,6 +226,8 @@ class SiteDefaults text_node :item_compatibility_enabled, 'ItemCompatibilityEnabled', :optional => true numeric_node :min_item_compatibility, 'MinItemCompatibility', :optional => true numeric_node :max_item_compatibility, 'MaxItemCompatibility', :optional => true + text_node :condition_enabled, 'ConditionEnabled', :optional => true + object_node :condition_values, 'ConditionValues', :class => ConditionValues, :optional => true end end end diff --git a/lib/ebay/types/tax_description_code.rb b/lib/ebay/types/tax_description_code.rb new file mode 100644 index 00000000..0cbbec4d --- /dev/null +++ b/lib/ebay/types/tax_description_code.rb @@ -0,0 +1,12 @@ +module Ebay # :nodoc: + module Types # :nodoc: + class TaxDescriptionCode + extend Enumerable + extend Enumeration + SalesTax = 'SalesTax' + ElectronicWasteRecyclingFee = 'ElectronicWasteRecyclingFee' + TireRecyclingFee = 'TireRecyclingFee' + end + end +end + diff --git a/lib/ebay/types/tax_details.rb b/lib/ebay/types/tax_details.rb new file mode 100644 index 00000000..5016a94e --- /dev/null +++ b/lib/ebay/types/tax_details.rb @@ -0,0 +1,25 @@ + +module Ebay # :nodoc: + module Types # :nodoc: + # == Attributes + # text_node :imposition, 'Imposition', :optional => true + # text_node :tax_description, 'TaxDescription', :optional => true + # money_node :tax_amount, 'TaxAmount', :optional => true + # money_node :tax_on_subtotal_amount, 'TaxOnSubtotalAmount', :optional => true + # money_node :tax_on_shipping_amount, 'TaxOnShippingAmount', :optional => true + # money_node :tax_on_handling_amount, 'TaxOnHandlingAmount', :optional => true + class TaxDetails + include XML::Mapping + include Initializer + root_element_name 'TaxDetails' + text_node :imposition, 'Imposition', :optional => true + text_node :tax_description, 'TaxDescription', :optional => true + money_node :tax_amount, 'TaxAmount', :optional => true + money_node :tax_on_subtotal_amount, 'TaxOnSubtotalAmount', :optional => true + money_node :tax_on_shipping_amount, 'TaxOnShippingAmount', :optional => true + money_node :tax_on_handling_amount, 'TaxOnHandlingAmount', :optional => true + end + end +end + + diff --git a/lib/ebay/types/tax_type_code.rb b/lib/ebay/types/tax_type_code.rb new file mode 100644 index 00000000..ed0c96e7 --- /dev/null +++ b/lib/ebay/types/tax_type_code.rb @@ -0,0 +1,11 @@ +module Ebay # :nodoc: + module Types # :nodoc: + class TaxTypeCode + extend Enumerable + extend Enumeration + SalesTax = 'SalesTax' + WasteRecyclingFee = 'WasteRecyclingFee' + end + end +end + diff --git a/lib/ebay/types/taxes.rb b/lib/ebay/types/taxes.rb new file mode 100644 index 00000000..d8b59fda --- /dev/null +++ b/lib/ebay/types/taxes.rb @@ -0,0 +1,18 @@ +require 'ebay/types/tax_details' + +module Ebay # :nodoc: + module Types # :nodoc: + # == Attributes + # money_node :total_tax_amount, 'TotalTaxAmount', :optional => true + # array_node :tax_details, 'TaxDetails', :class => TaxDetails, :default_value => [] + class Taxes + include XML::Mapping + include Initializer + root_element_name 'Taxes' + money_node :total_tax_amount, 'TotalTaxAmount', :optional => true + array_node :tax_details, 'TaxDetails', :class => TaxDetails, :default_value => [] + end + end +end + + diff --git a/lib/ebay/types/transaction.rb b/lib/ebay/types/transaction.rb index 093f9c92..e432d010 100644 --- a/lib/ebay/types/transaction.rb +++ b/lib/ebay/types/transaction.rb @@ -10,6 +10,7 @@ require 'ebay/types/listing_checkout_redirect_preference' require 'ebay/types/refund' require 'ebay/types/variation' +require 'ebay/types/taxes' module Ebay # :nodoc: module Types # :nodoc: @@ -55,6 +56,7 @@ module Types # :nodoc: # money_node :buyer_guarantee_price, 'BuyerGuaranteePrice', :optional => true # object_node :variation, 'Variation', :class => Variation, :optional => true # text_node :buyer_checkout_message, 'BuyerCheckoutMessage', :optional => true + # object_node :taxes, 'Taxes', :class => Taxes, :optional => true class Transaction include XML::Mapping include Initializer @@ -100,6 +102,7 @@ class Transaction money_node :buyer_guarantee_price, 'BuyerGuaranteePrice', :optional => true object_node :variation, 'Variation', :class => Variation, :optional => true text_node :buyer_checkout_message, 'BuyerCheckoutMessage', :optional => true + object_node :taxes, 'Taxes', :class => Taxes, :optional => true end end end diff --git a/lib/ebay/types/user.rb b/lib/ebay/types/user.rb index 112d6fcf..def407e1 100644 --- a/lib/ebay/types/user.rb +++ b/lib/ebay/types/user.rb @@ -47,6 +47,7 @@ module Types # :nodoc: # boolean_node :enterprise_seller, 'EnterpriseSeller', 'true', 'false', :optional => true # text_node :billing_email, 'BillingEmail', :optional => true # boolean_node :qualifies_for_selling, 'QualifiesForSelling', 'true', 'false', :optional => true + # text_node :static_alias, 'StaticAlias', :optional => true class User include XML::Mapping include Initializer @@ -91,6 +92,7 @@ class User boolean_node :enterprise_seller, 'EnterpriseSeller', 'true', 'false', :optional => true text_node :billing_email, 'BillingEmail', :optional => true boolean_node :qualifies_for_selling, 'QualifiesForSelling', 'true', 'false', :optional => true + text_node :static_alias, 'StaticAlias', :optional => true end end end diff --git a/lib/ebay/types/vero_report_item.rb b/lib/ebay/types/vero_report_item.rb index a8ade99b..0f352e19 100644 --- a/lib/ebay/types/vero_report_item.rb +++ b/lib/ebay/types/vero_report_item.rb @@ -6,6 +6,10 @@ module Types # :nodoc: # numeric_node :vero_reason_code_id, 'VeROReasonCodeID', :optional => true # text_node :message_to_seller, 'MessageToSeller', :optional => true # boolean_node :copy_email_to_rights_owner, 'CopyEmailToRightsOwner', 'true', 'false', :optional => true + # value_array_node :regions, 'Region', :default_value => [] + # value_array_node :countries, 'Country', :default_value => [] + # text_node :patent, 'Patent', :optional => true + # text_node :detailed_message, 'DetailedMessage', :optional => true class VeROReportItem include XML::Mapping include Initializer @@ -14,6 +18,10 @@ class VeROReportItem numeric_node :vero_reason_code_id, 'VeROReasonCodeID', :optional => true text_node :message_to_seller, 'MessageToSeller', :optional => true boolean_node :copy_email_to_rights_owner, 'CopyEmailToRightsOwner', 'true', 'false', :optional => true + value_array_node :regions, 'Region', :default_value => [] + value_array_node :countries, 'Country', :default_value => [] + text_node :patent, 'Patent', :optional => true + text_node :detailed_message, 'DetailedMessage', :optional => true end end end diff --git a/lib/ebay/types/xsl_file.rb b/lib/ebay/types/xsl_file.rb index 48d86c41..3af0a34a 100644 --- a/lib/ebay/types/xsl_file.rb +++ b/lib/ebay/types/xsl_file.rb @@ -24,7 +24,6 @@ def unpack_stylesheet(base64string) stylesheet = base64string.unpack('m').first stylesheet.sub!(/urn:schemas-microsoft-com:xslt/, 'http://exslt.org/common') stylesheet.sub!(/exclude-result-prefixes="x"/, 'exclude-result-prefixes="x xal"') - stylesheet end end end From ddb559fb2891cce53807ffc11cd1cafa6da31665 Mon Sep 17 00:00:00 2001 From: Ben Hughes Date: Thu, 14 Oct 2010 14:10:05 +0800 Subject: [PATCH 3/4] Need activesupport; needs to eventually be defined via bundler/Gemfile. --- test/test_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_helper.rb b/test/test_helper.rb index 8bd17a1b..44180250 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -6,6 +6,7 @@ require 'ebay' require 'http_mock' require 'credentials' +require 'activesupport' class Test::Unit::TestCase #:nodoc: From 6b44cee3768f0b3cace2c890468f2f5366a1d2d9 Mon Sep 17 00:00:00 2001 From: Ben Hughes Date: Sat, 18 Dec 2010 15:26:02 -0800 Subject: [PATCH 4/4] Added gemspec and Gemfile. --- .gitignore | 2 ++ Gemfile | 3 +++ ebayapi.gemspec | 25 +++++++++++++++++++++++++ lib/ebay/version.rb | 3 +++ lib/ebayapi.rb | 1 + 5 files changed, 34 insertions(+) create mode 100644 Gemfile create mode 100644 ebayapi.gemspec create mode 100644 lib/ebay/version.rb create mode 100644 lib/ebayapi.rb diff --git a/.gitignore b/.gitignore index 13fae692..389dfef9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ +.bundle +Gemfile.lock lib/ebay/schema/ebaySvc.xsd examples/config.rb diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..c80ee369 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source "http://rubygems.org" + +gemspec diff --git a/ebayapi.gemspec b/ebayapi.gemspec new file mode 100644 index 00000000..1e4e5050 --- /dev/null +++ b/ebayapi.gemspec @@ -0,0 +1,25 @@ +# -*- encoding: utf-8 -*- +$:.push File.expand_path("../lib", __FILE__) +require "ebay/version" + +Gem::Specification.new do |s| + s.name = "ebayapi" + s.version = Ebay::VERSION + s.author = "Cody Fausner" + s.email = "codyfauser@gmail.com" + s.homepage = "https://github.com/codyfauser/ebay" + s.summary = "Ruby interface to the eBay XML Trading API" + s.description = "A ruby library for interacting with the eBay XML Trading API, based on self-generated request and response classes." + + s.files = Dir["{lib,test}/**/*", "[A-Z]*", "init.rb"] + s.require_path = "lib" + + s.rubyforge_project = s.name + s.required_rubygems_version = ">= 1.3.4" + + s.add_dependency("activesupport", [">= 2.3.4"]) + s.add_dependency("xml-simple", ["~> 1.0.11"]) + s.add_dependency("xml-mapping", ["~> 0.8.1"]) + s.add_dependency("libxml-ruby", ["~> 1.1.4"]) + s.add_dependency("money", ["~> 1.7.1"]) +end diff --git a/lib/ebay/version.rb b/lib/ebay/version.rb new file mode 100644 index 00000000..af6be89c --- /dev/null +++ b/lib/ebay/version.rb @@ -0,0 +1,3 @@ +module Ebay + VERSION = "0.13.0" +end diff --git a/lib/ebayapi.rb b/lib/ebayapi.rb new file mode 100644 index 00000000..a85fda94 --- /dev/null +++ b/lib/ebayapi.rb @@ -0,0 +1 @@ +require "ebay"