apimatic-pnl-sdk 1.0.0
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 +7 -0
- data/LICENSE +28 -0
- data/README.md +164 -0
- data/bin/console +15 -0
- data/lib/postnl_ecommerce/api_helper.rb +10 -0
- data/lib/postnl_ecommerce/client.rb +126 -0
- data/lib/postnl_ecommerce/configuration.rb +195 -0
- data/lib/postnl_ecommerce/controllers/barcode_controller.rb +71 -0
- data/lib/postnl_ecommerce/controllers/base_controller.rb +60 -0
- data/lib/postnl_ecommerce/controllers/checkout_controller.rb +45 -0
- data/lib/postnl_ecommerce/controllers/confirming_controller.rb +45 -0
- data/lib/postnl_ecommerce/controllers/deliverydate_controller.rb +233 -0
- data/lib/postnl_ecommerce/controllers/labelling_controller.rb +52 -0
- data/lib/postnl_ecommerce/controllers/locations_controller.rb +271 -0
- data/lib/postnl_ecommerce/controllers/postalcode_check_controller.rb +60 -0
- data/lib/postnl_ecommerce/controllers/shipment_controller.rb +52 -0
- data/lib/postnl_ecommerce/controllers/shipping_status_controller.rb +222 -0
- data/lib/postnl_ecommerce/controllers/timeframes_controller.rb +90 -0
- data/lib/postnl_ecommerce/exceptions/api_exception.rb +21 -0
- data/lib/postnl_ecommerce/exceptions/barcode_response_invalid_exception.rb +57 -0
- data/lib/postnl_ecommerce/exceptions/confirming_response_error_exception.rb +55 -0
- data/lib/postnl_ecommerce/exceptions/internal_server_error_exception.rb +46 -0
- data/lib/postnl_ecommerce/exceptions/invalid_request_exception.rb +62 -0
- data/lib/postnl_ecommerce/exceptions/labelling_response_invalid_exception.rb +57 -0
- data/lib/postnl_ecommerce/exceptions/method_not_allowed_only_get_exception.rb +53 -0
- data/lib/postnl_ecommerce/exceptions/method_not_allowed_only_get_post_exception.rb +53 -0
- data/lib/postnl_ecommerce/exceptions/method_not_allowed_only_post_exception.rb +53 -0
- data/lib/postnl_ecommerce/exceptions/postalcode_check_response_invalid_exception.rb +55 -0
- data/lib/postnl_ecommerce/exceptions/too_many_requests_exception.rb +53 -0
- data/lib/postnl_ecommerce/exceptions/unauthorized_exception.rb +53 -0
- data/lib/postnl_ecommerce/http/api_response.rb +19 -0
- data/lib/postnl_ecommerce/http/auth/custom_header_authentication.rb +52 -0
- data/lib/postnl_ecommerce/http/http_call_back.rb +10 -0
- data/lib/postnl_ecommerce/http/http_method_enum.rb +10 -0
- data/lib/postnl_ecommerce/http/http_request.rb +10 -0
- data/lib/postnl_ecommerce/http/http_response.rb +10 -0
- data/lib/postnl_ecommerce/http/proxy_settings.rb +22 -0
- data/lib/postnl_ecommerce/models/address.rb +240 -0
- data/lib/postnl_ecommerce/models/address_type_enum.rb +36 -0
- data/lib/postnl_ecommerce/models/amount.rb +138 -0
- data/lib/postnl_ecommerce/models/barcode_error.rb +71 -0
- data/lib/postnl_ecommerce/models/barcode_response.rb +62 -0
- data/lib/postnl_ecommerce/models/base_model.rb +110 -0
- data/lib/postnl_ecommerce/models/checkout_address.rb +120 -0
- data/lib/postnl_ecommerce/models/checkout_cut_off_day_enum.rb +61 -0
- data/lib/postnl_ecommerce/models/checkout_cut_off_time.rb +91 -0
- data/lib/postnl_ecommerce/models/checkout_cut_off_type_enum.rb +40 -0
- data/lib/postnl_ecommerce/models/checkout_delivery_option.rb +81 -0
- data/lib/postnl_ecommerce/models/checkout_location.rb +126 -0
- data/lib/postnl_ecommerce/models/checkout_option_enum.rb +64 -0
- data/lib/postnl_ecommerce/models/checkout_pickup_address.rb +112 -0
- data/lib/postnl_ecommerce/models/checkout_pickup_option.rb +103 -0
- data/lib/postnl_ecommerce/models/checkout_request.rb +152 -0
- data/lib/postnl_ecommerce/models/checkout_response.rb +110 -0
- data/lib/postnl_ecommerce/models/checkout_time_frame.rb +108 -0
- data/lib/postnl_ecommerce/models/checkout_warning.rb +95 -0
- data/lib/postnl_ecommerce/models/checkout_warning_option_enum.rb +68 -0
- data/lib/postnl_ecommerce/models/code_enum.rb +44 -0
- data/lib/postnl_ecommerce/models/complete_status.rb +62 -0
- data/lib/postnl_ecommerce/models/complete_status_shipment.rb +270 -0
- data/lib/postnl_ecommerce/models/confirming_custom.rb +239 -0
- data/lib/postnl_ecommerce/models/confirming_custom_content.rb +113 -0
- data/lib/postnl_ecommerce/models/confirming_error.rb +71 -0
- data/lib/postnl_ecommerce/models/confirming_message.rb +70 -0
- data/lib/postnl_ecommerce/models/confirming_request.rb +86 -0
- data/lib/postnl_ecommerce/models/confirming_response.rb +71 -0
- data/lib/postnl_ecommerce/models/confirming_response_shipment.rb +103 -0
- data/lib/postnl_ecommerce/models/confirming_shipment.rb +472 -0
- data/lib/postnl_ecommerce/models/contact.rb +101 -0
- data/lib/postnl_ecommerce/models/countrycode_enum.rb +36 -0
- data/lib/postnl_ecommerce/models/currency_enum.rb +44 -0
- data/lib/postnl_ecommerce/models/currency_labelling_api_enum.rb +36 -0
- data/lib/postnl_ecommerce/models/current_status.rb +62 -0
- data/lib/postnl_ecommerce/models/current_status_shipment.rb +207 -0
- data/lib/postnl_ecommerce/models/customer.rb +123 -0
- data/lib/postnl_ecommerce/models/customer_address.rb +237 -0
- data/lib/postnl_ecommerce/models/customs.rb +238 -0
- data/lib/postnl_ecommerce/models/customs_labelling_api.rb +238 -0
- data/lib/postnl_ecommerce/models/delivery_options.rb +64 -0
- data/lib/postnl_ecommerce/models/deliverydate_delivery_response.rb +87 -0
- data/lib/postnl_ecommerce/models/deliverydate_option_enum.rb +56 -0
- data/lib/postnl_ecommerce/models/deliverydate_options.rb +65 -0
- data/lib/postnl_ecommerce/models/deliverydate_shipping_response.rb +62 -0
- data/lib/postnl_ecommerce/models/detail.rb +62 -0
- data/lib/postnl_ecommerce/models/dimension.rb +106 -0
- data/lib/postnl_ecommerce/models/error.rb +73 -0
- data/lib/postnl_ecommerce/models/event.rb +127 -0
- data/lib/postnl_ecommerce/models/expectation.rb +71 -0
- data/lib/postnl_ecommerce/models/extra_field.rb +71 -0
- data/lib/postnl_ecommerce/models/fault.rb +71 -0
- data/lib/postnl_ecommerce/models/fault_shipping_status_api.rb +71 -0
- data/lib/postnl_ecommerce/models/friday.rb +62 -0
- data/lib/postnl_ecommerce/models/get_locations_result_multiple.rb +71 -0
- data/lib/postnl_ecommerce/models/get_locations_result_single.rb +62 -0
- data/lib/postnl_ecommerce/models/group.rb +97 -0
- data/lib/postnl_ecommerce/models/hazardous_material.rb +178 -0
- data/lib/postnl_ecommerce/models/labelling_customer.rb +123 -0
- data/lib/postnl_ecommerce/models/labelling_customer_labelling_api.rb +123 -0
- data/lib/postnl_ecommerce/models/labelling_customer_message.rb +83 -0
- data/lib/postnl_ecommerce/models/labelling_customer_shipment.rb +484 -0
- data/lib/postnl_ecommerce/models/labelling_customer_shipment_labelling_api.rb +484 -0
- data/lib/postnl_ecommerce/models/labelling_customs_content.rb +111 -0
- data/lib/postnl_ecommerce/models/labelling_error.rb +81 -0
- data/lib/postnl_ecommerce/models/labelling_label.rb +84 -0
- data/lib/postnl_ecommerce/models/labelling_merged_label.rb +80 -0
- data/lib/postnl_ecommerce/models/labelling_request.rb +112 -0
- data/lib/postnl_ecommerce/models/labelling_response.rb +95 -0
- data/lib/postnl_ecommerce/models/labelling_response_shipment.rb +123 -0
- data/lib/postnl_ecommerce/models/language_enum.rb +48 -0
- data/lib/postnl_ecommerce/models/location.rb +174 -0
- data/lib/postnl_ecommerce/models/location_response_single.rb +63 -0
- data/lib/postnl_ecommerce/models/locations_address.rb +122 -0
- data/lib/postnl_ecommerce/models/locations_delivery_option_enum.rb +40 -0
- data/lib/postnl_ecommerce/models/locations_opening_hours.rb +121 -0
- data/lib/postnl_ecommerce/models/locations_response_multiple.rb +63 -0
- data/lib/postnl_ecommerce/models/monday.rb +62 -0
- data/lib/postnl_ecommerce/models/no_timeframes_options.rb +62 -0
- data/lib/postnl_ecommerce/models/old_status.rb +106 -0
- data/lib/postnl_ecommerce/models/opening_hours.rb +121 -0
- data/lib/postnl_ecommerce/models/opening_hours_per_day.rb +71 -0
- data/lib/postnl_ecommerce/models/options.rb +64 -0
- data/lib/postnl_ecommerce/models/origin_country_code_enum.rb +36 -0
- data/lib/postnl_ecommerce/models/postalcode_check_address.rb +116 -0
- data/lib/postnl_ecommerce/models/postalcode_check_error.rb +81 -0
- data/lib/postnl_ecommerce/models/product_option.rb +74 -0
- data/lib/postnl_ecommerce/models/reason_no_timeframe.rb +104 -0
- data/lib/postnl_ecommerce/models/reason_no_timeframes.rb +71 -0
- data/lib/postnl_ecommerce/models/saturday.rb +62 -0
- data/lib/postnl_ecommerce/models/shipment_type_enum.rb +50 -0
- data/lib/postnl_ecommerce/models/shippingstatus_address.rb +204 -0
- data/lib/postnl_ecommerce/models/shippingstatus_amount.rb +75 -0
- data/lib/postnl_ecommerce/models/shippingstatus_customer.rb +83 -0
- data/lib/postnl_ecommerce/models/shippingstatus_dimension.rb +101 -0
- data/lib/postnl_ecommerce/models/shippingstatus_product_option.rb +74 -0
- data/lib/postnl_ecommerce/models/shippingstatus_product_options.rb +63 -0
- data/lib/postnl_ecommerce/models/shippingstatus_response.rb +94 -0
- data/lib/postnl_ecommerce/models/shippingstatus_response_signature.rb +71 -0
- data/lib/postnl_ecommerce/models/shippingstatus_response_updated_shipment.rb +105 -0
- data/lib/postnl_ecommerce/models/shippingstatus_warning.rb +71 -0
- data/lib/postnl_ecommerce/models/signature.rb +84 -0
- data/lib/postnl_ecommerce/models/status.rb +108 -0
- data/lib/postnl_ecommerce/models/sunday.rb +62 -0
- data/lib/postnl_ecommerce/models/sustainability.rb +73 -0
- data/lib/postnl_ecommerce/models/thursday.rb +62 -0
- data/lib/postnl_ecommerce/models/timeframe.rb +71 -0
- data/lib/postnl_ecommerce/models/timeframe_options_enum.rb +60 -0
- data/lib/postnl_ecommerce/models/timeframe_response.rb +74 -0
- data/lib/postnl_ecommerce/models/timeframe_timeframe.rb +96 -0
- data/lib/postnl_ecommerce/models/timeframes.rb +71 -0
- data/lib/postnl_ecommerce/models/timeframes_response_object.rb +71 -0
- data/lib/postnl_ecommerce/models/tuesday.rb +62 -0
- data/lib/postnl_ecommerce/models/type_enum.rb +64 -0
- data/lib/postnl_ecommerce/models/updated_shipment_status.rb +108 -0
- data/lib/postnl_ecommerce/models/warning.rb +71 -0
- data/lib/postnl_ecommerce/models/warnings.rb +62 -0
- data/lib/postnl_ecommerce/models/wednesday.rb +62 -0
- data/lib/postnl_ecommerce/utilities/date_time_helper.rb +11 -0
- data/lib/postnl_ecommerce/utilities/file_wrapper.rb +28 -0
- data/lib/postnl_ecommerce.rb +188 -0
- data/test/controllers/controller_test_base.rb +23 -0
- data/test/controllers/test_barcode_controller.rb +52 -0
- data/test/controllers/test_checkout_controller.rb +63 -0
- data/test/controllers/test_confirming_controller.rb +54 -0
- data/test/controllers/test_deliverydate_controller.rb +60 -0
- data/test/controllers/test_labelling_controller.rb +57 -0
- data/test/controllers/test_locations_controller.rb +185 -0
- data/test/controllers/test_postalcode_check_controller.rb +55 -0
- data/test/controllers/test_shipment_controller.rb +57 -0
- data/test/controllers/test_shipping_status_controller.rb +209 -0
- data/test/controllers/test_timeframes_controller.rb +67 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +283 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# postnl_ecommerce
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for PostNL by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module PostnlEcommerce
|
|
7
|
+
# Fault Model.
|
|
8
|
+
class Fault < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :faultstring
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [Detail]
|
|
18
|
+
attr_accessor :detail
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['faultstring'] = 'faultstring'
|
|
24
|
+
@_hash['detail'] = 'detail'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
faultstring
|
|
32
|
+
detail
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(faultstring = SKIP, detail = SKIP)
|
|
42
|
+
@faultstring = faultstring unless faultstring == SKIP
|
|
43
|
+
@detail = detail unless detail == SKIP
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Creates an instance of the object from a hash.
|
|
47
|
+
def self.from_hash(hash)
|
|
48
|
+
return nil unless hash
|
|
49
|
+
|
|
50
|
+
# Extract variables from the hash.
|
|
51
|
+
faultstring = hash.key?('faultstring') ? hash['faultstring'] : SKIP
|
|
52
|
+
detail = Detail.from_hash(hash['detail']) if hash['detail']
|
|
53
|
+
|
|
54
|
+
# Create object from extracted values.
|
|
55
|
+
Fault.new(faultstring,
|
|
56
|
+
detail)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Provides a human-readable string representation of the object.
|
|
60
|
+
def to_s
|
|
61
|
+
class_name = self.class.name.split('::').last
|
|
62
|
+
"<#{class_name} faultstring: #{@faultstring}, detail: #{@detail}>"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
66
|
+
def inspect
|
|
67
|
+
class_name = self.class.name.split('::').last
|
|
68
|
+
"<#{class_name} faultstring: #{@faultstring.inspect}, detail: #{@detail.inspect}>"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# postnl_ecommerce
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for PostNL by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module PostnlEcommerce
|
|
7
|
+
# FaultShippingStatusAPI Model.
|
|
8
|
+
class FaultShippingStatusAPI < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :faultstring
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [Detail]
|
|
18
|
+
attr_accessor :detail
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['faultstring'] = 'faultstring'
|
|
24
|
+
@_hash['detail'] = 'detail'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
faultstring
|
|
32
|
+
detail
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(faultstring = SKIP, detail = SKIP)
|
|
42
|
+
@faultstring = faultstring unless faultstring == SKIP
|
|
43
|
+
@detail = detail unless detail == SKIP
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Creates an instance of the object from a hash.
|
|
47
|
+
def self.from_hash(hash)
|
|
48
|
+
return nil unless hash
|
|
49
|
+
|
|
50
|
+
# Extract variables from the hash.
|
|
51
|
+
faultstring = hash.key?('faultstring') ? hash['faultstring'] : SKIP
|
|
52
|
+
detail = Detail.from_hash(hash['detail']) if hash['detail']
|
|
53
|
+
|
|
54
|
+
# Create object from extracted values.
|
|
55
|
+
FaultShippingStatusAPI.new(faultstring,
|
|
56
|
+
detail)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Provides a human-readable string representation of the object.
|
|
60
|
+
def to_s
|
|
61
|
+
class_name = self.class.name.split('::').last
|
|
62
|
+
"<#{class_name} faultstring: #{@faultstring}, detail: #{@detail}>"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
66
|
+
def inspect
|
|
67
|
+
class_name = self.class.name.split('::').last
|
|
68
|
+
"<#{class_name} faultstring: #{@faultstring.inspect}, detail: #{@detail.inspect}>"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# postnl_ecommerce
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for PostNL by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module PostnlEcommerce
|
|
7
|
+
# Friday Model.
|
|
8
|
+
class Friday < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :string
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['string'] = 'string'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
string
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(string = SKIP)
|
|
36
|
+
@string = string unless string == SKIP
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Creates an instance of the object from a hash.
|
|
40
|
+
def self.from_hash(hash)
|
|
41
|
+
return nil unless hash
|
|
42
|
+
|
|
43
|
+
# Extract variables from the hash.
|
|
44
|
+
string = hash.key?('string') ? hash['string'] : SKIP
|
|
45
|
+
|
|
46
|
+
# Create object from extracted values.
|
|
47
|
+
Friday.new(string)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Provides a human-readable string representation of the object.
|
|
51
|
+
def to_s
|
|
52
|
+
class_name = self.class.name.split('::').last
|
|
53
|
+
"<#{class_name} string: #{@string}>"
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
57
|
+
def inspect
|
|
58
|
+
class_name = self.class.name.split('::').last
|
|
59
|
+
"<#{class_name} string: #{@string.inspect}>"
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# postnl_ecommerce
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for PostNL by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module PostnlEcommerce
|
|
7
|
+
# GetLocationsResultMultiple Model.
|
|
8
|
+
class GetLocationsResultMultiple < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Array[Location]]
|
|
14
|
+
attr_accessor :response_location
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['response_location'] = 'ResponseLocation'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
response_location
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(response_location = SKIP)
|
|
36
|
+
@response_location = response_location unless response_location == SKIP
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Creates an instance of the object from a hash.
|
|
40
|
+
def self.from_hash(hash)
|
|
41
|
+
return nil unless hash
|
|
42
|
+
|
|
43
|
+
# Extract variables from the hash.
|
|
44
|
+
# Parameter is an array, so we need to iterate through it
|
|
45
|
+
response_location = nil
|
|
46
|
+
unless hash['ResponseLocation'].nil?
|
|
47
|
+
response_location = []
|
|
48
|
+
hash['ResponseLocation'].each do |structure|
|
|
49
|
+
response_location << (Location.from_hash(structure) if structure)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
response_location = SKIP unless hash.key?('ResponseLocation')
|
|
54
|
+
|
|
55
|
+
# Create object from extracted values.
|
|
56
|
+
GetLocationsResultMultiple.new(response_location)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Provides a human-readable string representation of the object.
|
|
60
|
+
def to_s
|
|
61
|
+
class_name = self.class.name.split('::').last
|
|
62
|
+
"<#{class_name} response_location: #{@response_location}>"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
66
|
+
def inspect
|
|
67
|
+
class_name = self.class.name.split('::').last
|
|
68
|
+
"<#{class_name} response_location: #{@response_location.inspect}>"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# postnl_ecommerce
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for PostNL by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module PostnlEcommerce
|
|
7
|
+
# GetLocationsResultSingle Model.
|
|
8
|
+
class GetLocationsResultSingle < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Location]
|
|
14
|
+
attr_accessor :response_location
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['response_location'] = 'ResponseLocation'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
response_location
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(response_location = SKIP)
|
|
36
|
+
@response_location = response_location unless response_location == SKIP
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Creates an instance of the object from a hash.
|
|
40
|
+
def self.from_hash(hash)
|
|
41
|
+
return nil unless hash
|
|
42
|
+
|
|
43
|
+
# Extract variables from the hash.
|
|
44
|
+
response_location = Location.from_hash(hash['ResponseLocation']) if hash['ResponseLocation']
|
|
45
|
+
|
|
46
|
+
# Create object from extracted values.
|
|
47
|
+
GetLocationsResultSingle.new(response_location)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Provides a human-readable string representation of the object.
|
|
51
|
+
def to_s
|
|
52
|
+
class_name = self.class.name.split('::').last
|
|
53
|
+
"<#{class_name} response_location: #{@response_location}>"
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
57
|
+
def inspect
|
|
58
|
+
class_name = self.class.name.split('::').last
|
|
59
|
+
"<#{class_name} response_location: #{@response_location.inspect}>"
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# postnl_ecommerce
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for PostNL by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module PostnlEcommerce
|
|
7
|
+
# Group Model.
|
|
8
|
+
class Group < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Group sort that determines the type of group that is indicated. This is a
|
|
13
|
+
# code. For possible values, please see
|
|
14
|
+
# [here](https://developer.postnl.nl/docs/#/http/reference-data/reference-co
|
|
15
|
+
# des/group-types)
|
|
16
|
+
# @return [String]
|
|
17
|
+
attr_accessor :group_type
|
|
18
|
+
|
|
19
|
+
# Sequence number of the collo within the complete shipment (e.g. collo 2 of
|
|
20
|
+
# 4) Mandatory for multicollo shipments
|
|
21
|
+
# @return [Integer]
|
|
22
|
+
attr_accessor :group_sequence
|
|
23
|
+
|
|
24
|
+
# Total number of colli in the shipment (in case of multicolli shipments)
|
|
25
|
+
# Mandatory for multicollo shipments
|
|
26
|
+
# @return [Integer]
|
|
27
|
+
attr_accessor :group_count
|
|
28
|
+
|
|
29
|
+
# Main barcode for the shipment (in case of multicolli shipments) Mandatory
|
|
30
|
+
# for multicollo shipments
|
|
31
|
+
# @return [String]
|
|
32
|
+
attr_accessor :main_barcode
|
|
33
|
+
|
|
34
|
+
# A mapping from model property names to API property names.
|
|
35
|
+
def self.names
|
|
36
|
+
@_hash = {} if @_hash.nil?
|
|
37
|
+
@_hash['group_type'] = 'GroupType'
|
|
38
|
+
@_hash['group_sequence'] = 'GroupSequence'
|
|
39
|
+
@_hash['group_count'] = 'GroupCount'
|
|
40
|
+
@_hash['main_barcode'] = 'MainBarcode'
|
|
41
|
+
@_hash
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for optional fields
|
|
45
|
+
def self.optionals
|
|
46
|
+
%w[
|
|
47
|
+
group_sequence
|
|
48
|
+
group_count
|
|
49
|
+
]
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# An array for nullable fields
|
|
53
|
+
def self.nullables
|
|
54
|
+
[]
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def initialize(group_type = nil, main_barcode = nil, group_sequence = SKIP,
|
|
58
|
+
group_count = SKIP)
|
|
59
|
+
@group_type = group_type
|
|
60
|
+
@group_sequence = group_sequence unless group_sequence == SKIP
|
|
61
|
+
@group_count = group_count unless group_count == SKIP
|
|
62
|
+
@main_barcode = main_barcode
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Creates an instance of the object from a hash.
|
|
66
|
+
def self.from_hash(hash)
|
|
67
|
+
return nil unless hash
|
|
68
|
+
|
|
69
|
+
# Extract variables from the hash.
|
|
70
|
+
group_type = hash.key?('GroupType') ? hash['GroupType'] : nil
|
|
71
|
+
main_barcode = hash.key?('MainBarcode') ? hash['MainBarcode'] : nil
|
|
72
|
+
group_sequence = hash.key?('GroupSequence') ? hash['GroupSequence'] : SKIP
|
|
73
|
+
group_count = hash.key?('GroupCount') ? hash['GroupCount'] : SKIP
|
|
74
|
+
|
|
75
|
+
# Create object from extracted values.
|
|
76
|
+
Group.new(group_type,
|
|
77
|
+
main_barcode,
|
|
78
|
+
group_sequence,
|
|
79
|
+
group_count)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Provides a human-readable string representation of the object.
|
|
83
|
+
def to_s
|
|
84
|
+
class_name = self.class.name.split('::').last
|
|
85
|
+
"<#{class_name} group_type: #{@group_type}, group_sequence: #{@group_sequence},"\
|
|
86
|
+
" group_count: #{@group_count}, main_barcode: #{@main_barcode}>"
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
90
|
+
def inspect
|
|
91
|
+
class_name = self.class.name.split('::').last
|
|
92
|
+
"<#{class_name} group_type: #{@group_type.inspect}, group_sequence:"\
|
|
93
|
+
" #{@group_sequence.inspect}, group_count: #{@group_count.inspect}, main_barcode:"\
|
|
94
|
+
" #{@main_barcode.inspect}>"
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# postnl_ecommerce
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for PostNL by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module PostnlEcommerce
|
|
7
|
+
# HazardousMaterial Model.
|
|
8
|
+
class HazardousMaterial < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Toxic substance code as stated in the ADR agreement
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :toxic_substance_code
|
|
15
|
+
|
|
16
|
+
# Array of additional toxic substance codes as stated in the ADR agreement
|
|
17
|
+
# @return [Array[String]]
|
|
18
|
+
attr_accessor :additional_toxic_substance_code
|
|
19
|
+
|
|
20
|
+
# The amount of ADR points
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :adr_points
|
|
23
|
+
|
|
24
|
+
# The code indicating for which category of tunnels passage is prohibited
|
|
25
|
+
# with these goods.
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :tunnel_code
|
|
28
|
+
|
|
29
|
+
# Code identifying the category of the packaging material.
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :packaging_group_code
|
|
32
|
+
|
|
33
|
+
# Description of the packaging material
|
|
34
|
+
# @return [String]
|
|
35
|
+
attr_accessor :packaging_group_description
|
|
36
|
+
|
|
37
|
+
# Gross weight of the goods in grams.
|
|
38
|
+
# @return [String]
|
|
39
|
+
attr_accessor :gross_weight
|
|
40
|
+
|
|
41
|
+
# The UNDG number
|
|
42
|
+
# @return [String]
|
|
43
|
+
attr_accessor :undg_number
|
|
44
|
+
|
|
45
|
+
# The transport category code
|
|
46
|
+
# @return [String]
|
|
47
|
+
attr_accessor :transport_category_code
|
|
48
|
+
|
|
49
|
+
# The chemical technical description of the goods.
|
|
50
|
+
# @return [String]
|
|
51
|
+
attr_accessor :chemical_technical_description
|
|
52
|
+
|
|
53
|
+
# A mapping from model property names to API property names.
|
|
54
|
+
def self.names
|
|
55
|
+
@_hash = {} if @_hash.nil?
|
|
56
|
+
@_hash['toxic_substance_code'] = 'ToxicSubstanceCode'
|
|
57
|
+
@_hash['additional_toxic_substance_code'] =
|
|
58
|
+
'AdditionalToxicSubstanceCode'
|
|
59
|
+
@_hash['adr_points'] = 'ADRPoints'
|
|
60
|
+
@_hash['tunnel_code'] = 'TunnelCode'
|
|
61
|
+
@_hash['packaging_group_code'] = 'PackagingGroupCode'
|
|
62
|
+
@_hash['packaging_group_description'] = 'PackagingGroupDescription'
|
|
63
|
+
@_hash['gross_weight'] = 'GrossWeight'
|
|
64
|
+
@_hash['undg_number'] = 'UNDGNumber'
|
|
65
|
+
@_hash['transport_category_code'] = 'TransportCategoryCode'
|
|
66
|
+
@_hash['chemical_technical_description'] =
|
|
67
|
+
'ChemicalTechnicalDescription'
|
|
68
|
+
@_hash
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# An array for optional fields
|
|
72
|
+
def self.optionals
|
|
73
|
+
%w[
|
|
74
|
+
additional_toxic_substance_code
|
|
75
|
+
adr_points
|
|
76
|
+
tunnel_code
|
|
77
|
+
packaging_group_code
|
|
78
|
+
packaging_group_description
|
|
79
|
+
gross_weight
|
|
80
|
+
undg_number
|
|
81
|
+
transport_category_code
|
|
82
|
+
chemical_technical_description
|
|
83
|
+
]
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# An array for nullable fields
|
|
87
|
+
def self.nullables
|
|
88
|
+
[]
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def initialize(toxic_substance_code = nil,
|
|
92
|
+
additional_toxic_substance_code = SKIP, adr_points = SKIP,
|
|
93
|
+
tunnel_code = SKIP, packaging_group_code = SKIP,
|
|
94
|
+
packaging_group_description = SKIP, gross_weight = SKIP,
|
|
95
|
+
undg_number = SKIP, transport_category_code = SKIP,
|
|
96
|
+
chemical_technical_description = SKIP)
|
|
97
|
+
@toxic_substance_code = toxic_substance_code
|
|
98
|
+
unless additional_toxic_substance_code == SKIP
|
|
99
|
+
@additional_toxic_substance_code =
|
|
100
|
+
additional_toxic_substance_code
|
|
101
|
+
end
|
|
102
|
+
@adr_points = adr_points unless adr_points == SKIP
|
|
103
|
+
@tunnel_code = tunnel_code unless tunnel_code == SKIP
|
|
104
|
+
@packaging_group_code = packaging_group_code unless packaging_group_code == SKIP
|
|
105
|
+
unless packaging_group_description == SKIP
|
|
106
|
+
@packaging_group_description =
|
|
107
|
+
packaging_group_description
|
|
108
|
+
end
|
|
109
|
+
@gross_weight = gross_weight unless gross_weight == SKIP
|
|
110
|
+
@undg_number = undg_number unless undg_number == SKIP
|
|
111
|
+
@transport_category_code = transport_category_code unless transport_category_code == SKIP
|
|
112
|
+
unless chemical_technical_description == SKIP
|
|
113
|
+
@chemical_technical_description =
|
|
114
|
+
chemical_technical_description
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Creates an instance of the object from a hash.
|
|
119
|
+
def self.from_hash(hash)
|
|
120
|
+
return nil unless hash
|
|
121
|
+
|
|
122
|
+
# Extract variables from the hash.
|
|
123
|
+
toxic_substance_code =
|
|
124
|
+
hash.key?('ToxicSubstanceCode') ? hash['ToxicSubstanceCode'] : nil
|
|
125
|
+
additional_toxic_substance_code =
|
|
126
|
+
hash.key?('AdditionalToxicSubstanceCode') ? hash['AdditionalToxicSubstanceCode'] : SKIP
|
|
127
|
+
adr_points = hash.key?('ADRPoints') ? hash['ADRPoints'] : SKIP
|
|
128
|
+
tunnel_code = hash.key?('TunnelCode') ? hash['TunnelCode'] : SKIP
|
|
129
|
+
packaging_group_code =
|
|
130
|
+
hash.key?('PackagingGroupCode') ? hash['PackagingGroupCode'] : SKIP
|
|
131
|
+
packaging_group_description =
|
|
132
|
+
hash.key?('PackagingGroupDescription') ? hash['PackagingGroupDescription'] : SKIP
|
|
133
|
+
gross_weight = hash.key?('GrossWeight') ? hash['GrossWeight'] : SKIP
|
|
134
|
+
undg_number = hash.key?('UNDGNumber') ? hash['UNDGNumber'] : SKIP
|
|
135
|
+
transport_category_code =
|
|
136
|
+
hash.key?('TransportCategoryCode') ? hash['TransportCategoryCode'] : SKIP
|
|
137
|
+
chemical_technical_description =
|
|
138
|
+
hash.key?('ChemicalTechnicalDescription') ? hash['ChemicalTechnicalDescription'] : SKIP
|
|
139
|
+
|
|
140
|
+
# Create object from extracted values.
|
|
141
|
+
HazardousMaterial.new(toxic_substance_code,
|
|
142
|
+
additional_toxic_substance_code,
|
|
143
|
+
adr_points,
|
|
144
|
+
tunnel_code,
|
|
145
|
+
packaging_group_code,
|
|
146
|
+
packaging_group_description,
|
|
147
|
+
gross_weight,
|
|
148
|
+
undg_number,
|
|
149
|
+
transport_category_code,
|
|
150
|
+
chemical_technical_description)
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Provides a human-readable string representation of the object.
|
|
154
|
+
def to_s
|
|
155
|
+
class_name = self.class.name.split('::').last
|
|
156
|
+
"<#{class_name} toxic_substance_code: #{@toxic_substance_code},"\
|
|
157
|
+
" additional_toxic_substance_code: #{@additional_toxic_substance_code}, adr_points:"\
|
|
158
|
+
" #{@adr_points}, tunnel_code: #{@tunnel_code}, packaging_group_code:"\
|
|
159
|
+
" #{@packaging_group_code}, packaging_group_description: #{@packaging_group_description},"\
|
|
160
|
+
" gross_weight: #{@gross_weight}, undg_number: #{@undg_number}, transport_category_code:"\
|
|
161
|
+
" #{@transport_category_code}, chemical_technical_description:"\
|
|
162
|
+
" #{@chemical_technical_description}>"
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
166
|
+
def inspect
|
|
167
|
+
class_name = self.class.name.split('::').last
|
|
168
|
+
"<#{class_name} toxic_substance_code: #{@toxic_substance_code.inspect},"\
|
|
169
|
+
" additional_toxic_substance_code: #{@additional_toxic_substance_code.inspect}, adr_points:"\
|
|
170
|
+
" #{@adr_points.inspect}, tunnel_code: #{@tunnel_code.inspect}, packaging_group_code:"\
|
|
171
|
+
" #{@packaging_group_code.inspect}, packaging_group_description:"\
|
|
172
|
+
" #{@packaging_group_description.inspect}, gross_weight: #{@gross_weight.inspect},"\
|
|
173
|
+
" undg_number: #{@undg_number.inspect}, transport_category_code:"\
|
|
174
|
+
" #{@transport_category_code.inspect}, chemical_technical_description:"\
|
|
175
|
+
" #{@chemical_technical_description.inspect}>"
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|