Skip to content

Commit 685b5fd

Browse files
committed
Merge pull request #6 from uhlenbrock/publish-catalog-sale
Added post catalog sale endpoint
2 parents 34c07c8 + c4f5bed commit 685b5fd

File tree

5 files changed

+29
-0
lines changed

5 files changed

+29
-0
lines changed

lib/shiphawk/api.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module Api
1414
autoload :Shipments, 'shiphawk/api/shipments' # get /, get :id, get :id/bol, get :id/bol.pdf, post /, put :id, delete :id
1515
autoload :ShipmentsStatus, 'shiphawk/api/shipments_status' # put /
1616
autoload :ZipCodes, 'shiphawk/api/zip_codes' # get /, get /search
17+
autoload :Notifications, 'shiphawk/api/notifications' # post /
1718

1819
end
1920
end

lib/shiphawk/api/notifications.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module Shiphawk
2+
module Api
3+
4+
# Items API
5+
#
6+
# @see https://shiphawk.com/api-docs
7+
#
8+
# The following API actions provide the CRUD interface to managing items.
9+
#
10+
module Notifications
11+
12+
def catalog_sale_create options
13+
post_request catalog_sale_path, options
14+
end
15+
16+
end
17+
18+
end
19+
end

lib/shiphawk/api/query_helpers.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ def status_path
3535
shipments_path "status"
3636
end
3737

38+
def notifications_path sub_path=nil
39+
"notifications/#{sub_path}"
40+
end
41+
42+
def catalog_sale_path
43+
notifications_path "catalog_sale"
44+
end
45+
3846
def zip_codes_path sub_path=nil
3947
"zip_codes/#{sub_path}"
4048
end

lib/shiphawk/client.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class Client
1414
include Shiphawk::Api::Shipments
1515
include Shiphawk::Api::ShipmentsStatus
1616
include Shiphawk::Api::ZipCodes
17+
include Shiphawk::Api::Notifications
1718

1819
attr_reader :api_token, :options, :sandbox
1920

shiphawk-0.8.0.gem

10 KB
Binary file not shown.

0 commit comments

Comments
 (0)