unforlogistics-api 0.6 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/unforlogistics/api.rb +16 -0
- data/lib/unforlogistics/core/addresses.rb +25 -0
- data/lib/unforlogistics/core/couriers.rb +32 -0
- data/lib/unforlogistics/core/emails.rb +25 -0
- data/lib/unforlogistics/core/global_configs.rb +17 -0
- data/lib/unforlogistics/core/locations.rb +15 -2
- data/lib/unforlogistics/core/misc.rb +31 -0
- data/lib/unforlogistics/core/phones.rb +25 -0
- data/lib/unforlogistics/core/shipment_dispatch_controls.rb +21 -0
- data/lib/unforlogistics/core/shipment_dispatch_handlings.rb +21 -0
- data/lib/unforlogistics/core/shipment_dispatches.rb +21 -0
- data/lib/unforlogistics/core/shipment_drivers.rb +29 -0
- data/lib/unforlogistics/core/shipment_package_sizes.rb +17 -0
- data/lib/unforlogistics/core/shipment_regions.rb +21 -0
- data/lib/unforlogistics/core/shipment_trips.rb +17 -0
- data/lib/unforlogistics/core/shipment_vehicle_kinds.rb +17 -0
- data/lib/unforlogistics/core/shipment_zones.rb +21 -0
- data/lib/unforlogistics/core/shipments.rb +25 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d516bd24775104531b639ecc4d3c5614e638bea5
|
4
|
+
data.tar.gz: b8a5f06ff8985c38948d0b3e4806b28a0d60d6b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f8a0ac70f61568dcecc19c5349bc9ce573362de3167bc82d402097e1ae8f31a3c33d4b5284a2c362cb0740f6241a61a67b94fc45cdfcc5212279691f3e57e7c
|
7
|
+
data.tar.gz: 9c90d7d4f08732a81d55a231d3ea65be486716a51d7bc7a6b314d7637d89a1fe1d3593d06114e6273db0fe6b5b605e79cacd9d47d637e05c42dee05d1adfb0b5
|
data/CHANGELOG.md
CHANGED
data/lib/unforlogistics/api.rb
CHANGED
@@ -5,6 +5,22 @@ Dir["#{core_dir}/**/*.rb"].each {|file| require file }
|
|
5
5
|
|
6
6
|
module Unforlogistics
|
7
7
|
class Api < ::UnforBaseApi
|
8
|
+
include Unforlogistics::Core::Addresses
|
9
|
+
include Unforlogistics::Core::Couriers
|
10
|
+
include Unforlogistics::Core::Emails
|
11
|
+
include Unforlogistics::Core::GlobalConfigs
|
8
12
|
include Unforlogistics::Core::Locations
|
13
|
+
include Unforlogistics::Core::Misc
|
14
|
+
include Unforlogistics::Core::Phones
|
15
|
+
include Unforlogistics::Core::ShipmentDispatchControls
|
16
|
+
include Unforlogistics::Core::ShipmentDispatchHandlings
|
17
|
+
include Unforlogistics::Core::ShipmentDispatches
|
18
|
+
include Unforlogistics::Core::ShipmentDrivers
|
19
|
+
include Unforlogistics::Core::ShipmentPackageSizes
|
20
|
+
include Unforlogistics::Core::ShipmentRegions
|
21
|
+
include Unforlogistics::Core::ShipmentTrips
|
22
|
+
include Unforlogistics::Core::ShipmentVehicleKinds
|
23
|
+
include Unforlogistics::Core::ShipmentZones
|
24
|
+
include Unforlogistics::Core::Shipments
|
9
25
|
end
|
10
26
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module Addresses
|
4
|
+
def get_addresses(filters={})
|
5
|
+
get_request('/addresses', filters)
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_address(id)
|
9
|
+
get_request("/addresses/#{id}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_address(attrs={})
|
13
|
+
post_request('/addresses', attrs)
|
14
|
+
end
|
15
|
+
|
16
|
+
def update_address(id, attrs={})
|
17
|
+
put_request('/addresses', attrs)
|
18
|
+
end
|
19
|
+
|
20
|
+
def set_address_status(id, status)
|
21
|
+
put_request("/addresses/#{id}/status", { value: status })
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module Couriers
|
4
|
+
def get_couriers(filters={})
|
5
|
+
get_request('/couriers', filters)
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_courier(id)
|
9
|
+
get_request("/couriers/#{id}")
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
def create_courier(attrs={})
|
14
|
+
post_request('/couriers', attrs)
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
def update_courier(id, attrs={})
|
19
|
+
put_request("/couriers/#{id}", attrs)
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def enable_courier(id)
|
24
|
+
put_request("/couriers/#{id}/enabled")
|
25
|
+
end
|
26
|
+
|
27
|
+
def disable_courier(id)
|
28
|
+
put_request("/couriers/#{id}/disabled")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module Emails
|
4
|
+
def get_emails(filters={})
|
5
|
+
get_request('/emails', filters)
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_email(id)
|
9
|
+
get_request("/emails/#{id}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_email(attrs={})
|
13
|
+
post_request('/emails', attrs)
|
14
|
+
end
|
15
|
+
|
16
|
+
def update_email(id, attrs={})
|
17
|
+
put_request("/emails/#{id}", attrs)
|
18
|
+
end
|
19
|
+
|
20
|
+
def set_email_status(id, status)
|
21
|
+
put_request("/emails/#{id}/status", { value: status })
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module GlobalConfigs
|
4
|
+
def get_global_configs
|
5
|
+
get_request('/global_configs')
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_global_config(key)
|
9
|
+
get_request("/global_configs/#{key}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def update_global_config(key, value)
|
13
|
+
put_request("/global_configs/#{key}", { value: value })
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,8 +1,21 @@
|
|
1
1
|
module Unforlogistics
|
2
2
|
module Core
|
3
3
|
module Locations
|
4
|
-
def get_provinces
|
5
|
-
get_request('/provinces')
|
4
|
+
def get_provinces(filters={})
|
5
|
+
get_request('/provinces', filters)
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_province(id)
|
9
|
+
get_request("/provinces/#{id}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def get_localities(filters={})
|
13
|
+
get_request('/localities', filters)
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
def get_locality(id)
|
18
|
+
get_request("/localities/#{id}")
|
6
19
|
end
|
7
20
|
end
|
8
21
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module Misc
|
4
|
+
def get_courier_providers
|
5
|
+
get_request('/courier_providers')
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_courier_provider(code)
|
9
|
+
get_request("/courier_providers/#{code}")
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
def get_distribution_centers
|
14
|
+
get_request('/distribution_centers')
|
15
|
+
end
|
16
|
+
|
17
|
+
def get_distribution_center(code)
|
18
|
+
get_request("/distribution_centers/#{code}")
|
19
|
+
end
|
20
|
+
|
21
|
+
def get_shipment_modes
|
22
|
+
get_request('/shipment_modes')
|
23
|
+
end
|
24
|
+
|
25
|
+
def get_shipment_mode(code)
|
26
|
+
get_request("/shipment_modes/#{code}")
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module Phones
|
4
|
+
def get_phones(filters={})
|
5
|
+
get_request('/phones', filters)
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_phone(id)
|
9
|
+
get_request("/phones/#{id}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_phone(attrs={})
|
13
|
+
post_request('/phones', attrs)
|
14
|
+
end
|
15
|
+
|
16
|
+
def update_phone(id, attrs={})
|
17
|
+
put_request("/phones/#{id}", attrs)
|
18
|
+
end
|
19
|
+
|
20
|
+
def set_phone_status(id, status)
|
21
|
+
put_request("/phones/#{id}/status", { value: status })
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module ShipmentDispatchControls
|
4
|
+
def get_shipment_dispatch_controls(filters={})
|
5
|
+
get_request('/shipment_dispatch_controls', filters)
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_shipment_dispatch_control(id)
|
9
|
+
get_request("/shipment_dispatch_controls/#{id}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_shipment_dispatch_control(attrs={})
|
13
|
+
post_request('/shipment_dispatch_controls', attrs)
|
14
|
+
end
|
15
|
+
|
16
|
+
def cancel_shipment_dispatch_control(id)
|
17
|
+
put_request("/shipment_dispatch_controls/#{id}/cancellation")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module ShipmentDispatchHandlings
|
4
|
+
def get_shipment_dispatch_handlings(filters={})
|
5
|
+
get_request('/shipment_dispatch_handlings', filters)
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_shipment_dispatch_handling(id)
|
9
|
+
get_request("/shipment_dispatch_handlings/#{id}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_shipment_dispatch_handling(attrs={})
|
13
|
+
post_request('/shipment_dispatch_handlings', attrs)
|
14
|
+
end
|
15
|
+
|
16
|
+
def cancel_shipment_dispatch_handling(id)
|
17
|
+
put_request("/shipment_dispatch_handlings/#{id}/cancellation")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module ShipmentDispatches
|
4
|
+
def get_shipment_dispatch(filters={})
|
5
|
+
get_request('/shipment_dispatches', filters)
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_shipment_dispatch(id)
|
9
|
+
get_request("/shipment_dispatches/#{id}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_shipment_dispatch(attrs={})
|
13
|
+
post_request('/shipment_dispatches', attrs)
|
14
|
+
end
|
15
|
+
|
16
|
+
def cancel_shipment_dispatch(id)
|
17
|
+
put_request("/shipment_dispatches/#{id}/cancellation")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module ShipmentDrivers
|
4
|
+
def get_shipment_drivers(filters={})
|
5
|
+
get_request('/shipment_drivers', filters)
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_shipment_driver(id)
|
9
|
+
get_request("/shipment_drivers/#{id}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_shipment_driver(attrs={})
|
13
|
+
post_request('/shipment_drivers', attrs)
|
14
|
+
end
|
15
|
+
|
16
|
+
def update_shipment_driver(id, attrs={})
|
17
|
+
put_request("/shipment_drivers/#{id}", attrs)
|
18
|
+
end
|
19
|
+
|
20
|
+
def enable_shipment_driver(id)
|
21
|
+
put_request("/shipment_drivers/#{id}/enabled")
|
22
|
+
end
|
23
|
+
|
24
|
+
def disable_shipment_driver(id)
|
25
|
+
put_request("/shipment_drivers/#{id}/disabled")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module ShipmentPackageSizes
|
4
|
+
def get_shipment_package_sizes
|
5
|
+
get_request('/shipment_package_sizes')
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_shipment_package_size(code)
|
9
|
+
get_request("/shipment_package_sizes/#{code}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def update_shipment_package_size(code, attrs={})
|
13
|
+
put_request("/shipment_package_sizes/#{code}", attrs)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module ShipmentRegions
|
4
|
+
def get_shipment_regions(filters={})
|
5
|
+
get_request('/shipment_regions', filters)
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_shipment_region(id)
|
9
|
+
get_request("/shipment_regions/#{id}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_shipment_region(attrs={})
|
13
|
+
post_request('/shipment_regions', attrs)
|
14
|
+
end
|
15
|
+
|
16
|
+
def update_shipment_region(id, attrs={})
|
17
|
+
put_request("/shipment_regions/#{id}", attrs)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module ShipmentTrips
|
4
|
+
def get_shipment_trips(filters={})
|
5
|
+
get_request('/shipment_trips', filters)
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_shipment_trip(id)
|
9
|
+
get_request("/shipment_trips/#{id}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_shipment_trip(attrs={})
|
13
|
+
post_request('/shipment_trips', attrs)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module ShipmentVehicleKinds
|
4
|
+
def get_shipment_vehicle_kinds
|
5
|
+
get_request('/shipment_vehicle_kinds')
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_shipment_vehicle_kind(code)
|
9
|
+
get_request("/shipment_vehicle_kinds/#{code}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def update_shipment_vehicle_kind(code, attrs={})
|
13
|
+
put_request("/shipment_vehicle_kinds/#{code}", attrs)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module ShipmentZones
|
4
|
+
def get_shipment_zones(filters={})
|
5
|
+
get_request('/shipment_zones', filters)
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_shipment_zone(id)
|
9
|
+
get_request("/shipment_zones/#{id}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_shipment_zone(attrs={})
|
13
|
+
post_request('/shipment_zones', attrs)
|
14
|
+
end
|
15
|
+
|
16
|
+
def update_shipment_zone(id, attrs={})
|
17
|
+
put_request("/shipment_zones/#{id}", attrs)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Unforlogistics
|
2
|
+
module Core
|
3
|
+
module Shipments
|
4
|
+
def get_shipments(filters={})
|
5
|
+
get_requests('/shipments', filters)
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_shipment(code)
|
9
|
+
get_requests("/shipments/#{code}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_shipment(attrs={})
|
13
|
+
post_requests('/shipments', attrs)
|
14
|
+
end
|
15
|
+
|
16
|
+
def cancel_shipment(code)
|
17
|
+
put_requests("/shipments/#{code}/cancellation")
|
18
|
+
end
|
19
|
+
|
20
|
+
def quote_shipment(attrs={})
|
21
|
+
post_requests('/shipments/quote', attrs)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unforlogistics-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.7'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matias Hick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -63,7 +63,23 @@ files:
|
|
63
63
|
- LICENSE.md
|
64
64
|
- README.md
|
65
65
|
- lib/unforlogistics/api.rb
|
66
|
+
- lib/unforlogistics/core/addresses.rb
|
67
|
+
- lib/unforlogistics/core/couriers.rb
|
68
|
+
- lib/unforlogistics/core/emails.rb
|
69
|
+
- lib/unforlogistics/core/global_configs.rb
|
66
70
|
- lib/unforlogistics/core/locations.rb
|
71
|
+
- lib/unforlogistics/core/misc.rb
|
72
|
+
- lib/unforlogistics/core/phones.rb
|
73
|
+
- lib/unforlogistics/core/shipment_dispatch_controls.rb
|
74
|
+
- lib/unforlogistics/core/shipment_dispatch_handlings.rb
|
75
|
+
- lib/unforlogistics/core/shipment_dispatches.rb
|
76
|
+
- lib/unforlogistics/core/shipment_drivers.rb
|
77
|
+
- lib/unforlogistics/core/shipment_package_sizes.rb
|
78
|
+
- lib/unforlogistics/core/shipment_regions.rb
|
79
|
+
- lib/unforlogistics/core/shipment_trips.rb
|
80
|
+
- lib/unforlogistics/core/shipment_vehicle_kinds.rb
|
81
|
+
- lib/unforlogistics/core/shipment_zones.rb
|
82
|
+
- lib/unforlogistics/core/shipments.rb
|
67
83
|
homepage: https://github.com/unformattmh/unforlogistics_gem
|
68
84
|
licenses:
|
69
85
|
- MIT
|