Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class Generation Updates & Updated to 679 #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.bundle
Gemfile.lock
lib/ebay/schema/ebaySvc.xsd
examples/config.rb
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "http://rubygems.org"

gemspec
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
25 changes: 25 additions & 0 deletions ebayapi.gemspec
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]"
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
8 changes: 8 additions & 0 deletions lib/ebay/api_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/ebay/requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
17 changes: 17 additions & 0 deletions lib/ebay/requests/extend_site_hosted_pictures.rb
Original file line number Diff line number Diff line change
@@ -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


5 changes: 5 additions & 0 deletions lib/ebay/requests/get_my_messages.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'ebay/types/pagination'

module Ebay # :nodoc:
module Requests # :nodoc:
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/ebay/requests/get_seller_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/ebay/requests/get_user_preferences.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/ebay/requests/set_user_preferences.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions lib/ebay/requests/upload_site_hosted_pictures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/ebay/responses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
15 changes: 15 additions & 0 deletions lib/ebay/responses/extend_site_hosted_pictures.rb
Original file line number Diff line number Diff line change
@@ -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


6 changes: 6 additions & 0 deletions lib/ebay/responses/get_ebay_details.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/ebay/responses/get_user_preferences.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/ebay/schema/mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
6 changes: 2 additions & 4 deletions lib/ebay/schema/mapper/ebay_schema_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/ebay/schema/mapper/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading