unforlogistics-api 0.6 → 0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2107271ac040f2a4d4c8f57e7fb7b901c8a5f1ce
4
- data.tar.gz: 8054c17e2af8d8ea575eef18351efb883b31296e
3
+ metadata.gz: d516bd24775104531b639ecc4d3c5614e638bea5
4
+ data.tar.gz: b8a5f06ff8985c38948d0b3e4806b28a0d60d6b0
5
5
  SHA512:
6
- metadata.gz: 5a428c01d2be1b4851007090e5dc50540ce3f50ff2a6b0800af9f7707fbb444a3f75ed501b0ffde5d7f1cd0efcb3b55fbd918ed720ab06123238789161c8d53b
7
- data.tar.gz: 0edd996a9da727945f5318ea3215002057be52994a4ce202c1af8a7328ecc5be25c2757f5f8d64dcb49a0df4a816cc007aadac8de70a1905ef6e88d8107d3865
6
+ metadata.gz: 8f8a0ac70f61568dcecc19c5349bc9ce573362de3167bc82d402097e1ae8f31a3c33d4b5284a2c362cb0740f6241a61a67b94fc45cdfcc5212279691f3e57e7c
7
+ data.tar.gz: 9c90d7d4f08732a81d55a231d3ea65be486716a51d7bc7a6b314d7637d89a1fe1d3593d06114e6273db0fe6b5b605e79cacd9d47d637e05c42dee05d1adfb0b5
data/CHANGELOG.md CHANGED
@@ -21,3 +21,7 @@
21
21
  ## v0.6
22
22
 
23
23
  * Auto require core libs
24
+
25
+ ## v0.7
26
+
27
+ * Implemented most methods
@@ -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.6'
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-14 00:00:00.000000000 Z
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