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,83 @@
|
|
|
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
|
+
# ShippingstatusCustomer Model.
|
|
8
|
+
class ShippingstatusCustomer < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The customer code of the shipment
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :customer_code
|
|
15
|
+
|
|
16
|
+
# The customer number of the shipment
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :customer_number
|
|
19
|
+
|
|
20
|
+
# The customer name
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['customer_code'] = 'CustomerCode'
|
|
28
|
+
@_hash['customer_number'] = 'CustomerNumber'
|
|
29
|
+
@_hash['name'] = 'Name'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
customer_code
|
|
37
|
+
customer_number
|
|
38
|
+
name
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
[]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def initialize(customer_code = SKIP, customer_number = SKIP, name = SKIP)
|
|
48
|
+
@customer_code = customer_code unless customer_code == SKIP
|
|
49
|
+
@customer_number = customer_number unless customer_number == SKIP
|
|
50
|
+
@name = name unless name == SKIP
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Creates an instance of the object from a hash.
|
|
54
|
+
def self.from_hash(hash)
|
|
55
|
+
return nil unless hash
|
|
56
|
+
|
|
57
|
+
# Extract variables from the hash.
|
|
58
|
+
customer_code = hash.key?('CustomerCode') ? hash['CustomerCode'] : SKIP
|
|
59
|
+
customer_number =
|
|
60
|
+
hash.key?('CustomerNumber') ? hash['CustomerNumber'] : SKIP
|
|
61
|
+
name = hash.key?('Name') ? hash['Name'] : SKIP
|
|
62
|
+
|
|
63
|
+
# Create object from extracted values.
|
|
64
|
+
ShippingstatusCustomer.new(customer_code,
|
|
65
|
+
customer_number,
|
|
66
|
+
name)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Provides a human-readable string representation of the object.
|
|
70
|
+
def to_s
|
|
71
|
+
class_name = self.class.name.split('::').last
|
|
72
|
+
"<#{class_name} customer_code: #{@customer_code}, customer_number: #{@customer_number},"\
|
|
73
|
+
" name: #{@name}>"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
77
|
+
def inspect
|
|
78
|
+
class_name = self.class.name.split('::').last
|
|
79
|
+
"<#{class_name} customer_code: #{@customer_code.inspect}, customer_number:"\
|
|
80
|
+
" #{@customer_number.inspect}, name: #{@name.inspect}>"
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,101 @@
|
|
|
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
|
+
# ShippingstatusDimension Model.
|
|
8
|
+
class ShippingstatusDimension < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The weight of the shipment
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :weight
|
|
15
|
+
|
|
16
|
+
# The height of the shipment
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :height
|
|
19
|
+
|
|
20
|
+
# The length of the shipment
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :length
|
|
23
|
+
|
|
24
|
+
# The width of the shipment
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :width
|
|
27
|
+
|
|
28
|
+
# The volume of the shipment
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :volume
|
|
31
|
+
|
|
32
|
+
# A mapping from model property names to API property names.
|
|
33
|
+
def self.names
|
|
34
|
+
@_hash = {} if @_hash.nil?
|
|
35
|
+
@_hash['weight'] = 'Weight'
|
|
36
|
+
@_hash['height'] = 'Height'
|
|
37
|
+
@_hash['length'] = 'Length'
|
|
38
|
+
@_hash['width'] = 'Width'
|
|
39
|
+
@_hash['volume'] = 'Volume'
|
|
40
|
+
@_hash
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# An array for optional fields
|
|
44
|
+
def self.optionals
|
|
45
|
+
%w[
|
|
46
|
+
weight
|
|
47
|
+
height
|
|
48
|
+
length
|
|
49
|
+
width
|
|
50
|
+
volume
|
|
51
|
+
]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# An array for nullable fields
|
|
55
|
+
def self.nullables
|
|
56
|
+
[]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def initialize(weight = SKIP, height = SKIP, length = SKIP, width = SKIP,
|
|
60
|
+
volume = SKIP)
|
|
61
|
+
@weight = weight unless weight == SKIP
|
|
62
|
+
@height = height unless height == SKIP
|
|
63
|
+
@length = length unless length == SKIP
|
|
64
|
+
@width = width unless width == SKIP
|
|
65
|
+
@volume = volume unless volume == SKIP
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Creates an instance of the object from a hash.
|
|
69
|
+
def self.from_hash(hash)
|
|
70
|
+
return nil unless hash
|
|
71
|
+
|
|
72
|
+
# Extract variables from the hash.
|
|
73
|
+
weight = hash.key?('Weight') ? hash['Weight'] : SKIP
|
|
74
|
+
height = hash.key?('Height') ? hash['Height'] : SKIP
|
|
75
|
+
length = hash.key?('Length') ? hash['Length'] : SKIP
|
|
76
|
+
width = hash.key?('Width') ? hash['Width'] : SKIP
|
|
77
|
+
volume = hash.key?('Volume') ? hash['Volume'] : SKIP
|
|
78
|
+
|
|
79
|
+
# Create object from extracted values.
|
|
80
|
+
ShippingstatusDimension.new(weight,
|
|
81
|
+
height,
|
|
82
|
+
length,
|
|
83
|
+
width,
|
|
84
|
+
volume)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Provides a human-readable string representation of the object.
|
|
88
|
+
def to_s
|
|
89
|
+
class_name = self.class.name.split('::').last
|
|
90
|
+
"<#{class_name} weight: #{@weight}, height: #{@height}, length: #{@length}, width:"\
|
|
91
|
+
" #{@width}, volume: #{@volume}>"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
95
|
+
def inspect
|
|
96
|
+
class_name = self.class.name.split('::').last
|
|
97
|
+
"<#{class_name} weight: #{@weight.inspect}, height: #{@height.inspect}, length:"\
|
|
98
|
+
" #{@length.inspect}, width: #{@width.inspect}, volume: #{@volume.inspect}>"
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
# ShippingstatusProductOption Model.
|
|
8
|
+
class ShippingstatusProductOption < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The product option code for this ProductOption.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :option_code
|
|
15
|
+
|
|
16
|
+
# The characteristic of the ProductOption.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :characteristic_code
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['option_code'] = 'OptionCode'
|
|
24
|
+
@_hash['characteristic_code'] = 'CharacteristicCode'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
option_code
|
|
32
|
+
characteristic_code
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(option_code = SKIP, characteristic_code = SKIP)
|
|
42
|
+
@option_code = option_code unless option_code == SKIP
|
|
43
|
+
@characteristic_code = characteristic_code unless characteristic_code == 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
|
+
option_code = hash.key?('OptionCode') ? hash['OptionCode'] : SKIP
|
|
52
|
+
characteristic_code =
|
|
53
|
+
hash.key?('CharacteristicCode') ? hash['CharacteristicCode'] : SKIP
|
|
54
|
+
|
|
55
|
+
# Create object from extracted values.
|
|
56
|
+
ShippingstatusProductOption.new(option_code,
|
|
57
|
+
characteristic_code)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Provides a human-readable string representation of the object.
|
|
61
|
+
def to_s
|
|
62
|
+
class_name = self.class.name.split('::').last
|
|
63
|
+
"<#{class_name} option_code: #{@option_code}, characteristic_code:"\
|
|
64
|
+
" #{@characteristic_code}>"
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
68
|
+
def inspect
|
|
69
|
+
class_name = self.class.name.split('::').last
|
|
70
|
+
"<#{class_name} option_code: #{@option_code.inspect}, characteristic_code:"\
|
|
71
|
+
" #{@characteristic_code.inspect}>"
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
# ShippingstatusProductOptions Model.
|
|
8
|
+
class ShippingstatusProductOptions < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [ShippingstatusProductOption]
|
|
14
|
+
attr_accessor :product_option
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['product_option'] = 'ProductOption'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
product_option
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(product_option = SKIP)
|
|
36
|
+
@product_option = product_option unless product_option == 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
|
+
product_option = ShippingstatusProductOption.from_hash(hash['ProductOption']) if
|
|
45
|
+
hash['ProductOption']
|
|
46
|
+
|
|
47
|
+
# Create object from extracted values.
|
|
48
|
+
ShippingstatusProductOptions.new(product_option)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Provides a human-readable string representation of the object.
|
|
52
|
+
def to_s
|
|
53
|
+
class_name = self.class.name.split('::').last
|
|
54
|
+
"<#{class_name} product_option: #{@product_option}>"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
58
|
+
def inspect
|
|
59
|
+
class_name = self.class.name.split('::').last
|
|
60
|
+
"<#{class_name} product_option: #{@product_option.inspect}>"
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
# ShippingstatusResponse Model.
|
|
8
|
+
class ShippingstatusResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The current status and old statuses of the shipment
|
|
13
|
+
# @return [CompleteStatus]
|
|
14
|
+
attr_accessor :complete_status
|
|
15
|
+
|
|
16
|
+
# The current status and old statuses of the shipment
|
|
17
|
+
# @return [CurrentStatus]
|
|
18
|
+
attr_accessor :current_status
|
|
19
|
+
|
|
20
|
+
# Possible warnings (see [Error
|
|
21
|
+
# Codes](https://developer.postnl.nl/docs/#/http/reference-data/error-codes)
|
|
22
|
+
# for possible values)
|
|
23
|
+
# @return [Array[ShippingstatusWarning]]
|
|
24
|
+
attr_accessor :warnings
|
|
25
|
+
|
|
26
|
+
# A mapping from model property names to API property names.
|
|
27
|
+
def self.names
|
|
28
|
+
@_hash = {} if @_hash.nil?
|
|
29
|
+
@_hash['complete_status'] = 'CompleteStatus'
|
|
30
|
+
@_hash['current_status'] = 'CurrentStatus'
|
|
31
|
+
@_hash['warnings'] = 'Warnings'
|
|
32
|
+
@_hash
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# An array for optional fields
|
|
36
|
+
def self.optionals
|
|
37
|
+
%w[
|
|
38
|
+
complete_status
|
|
39
|
+
current_status
|
|
40
|
+
warnings
|
|
41
|
+
]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for nullable fields
|
|
45
|
+
def self.nullables
|
|
46
|
+
[]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def initialize(complete_status = SKIP, current_status = SKIP,
|
|
50
|
+
warnings = SKIP)
|
|
51
|
+
@complete_status = complete_status unless complete_status == SKIP
|
|
52
|
+
@current_status = current_status unless current_status == SKIP
|
|
53
|
+
@warnings = warnings unless warnings == SKIP
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Creates an instance of the object from a hash.
|
|
57
|
+
def self.from_hash(hash)
|
|
58
|
+
return nil unless hash
|
|
59
|
+
|
|
60
|
+
# Extract variables from the hash.
|
|
61
|
+
complete_status = CompleteStatus.from_hash(hash['CompleteStatus']) if hash['CompleteStatus']
|
|
62
|
+
current_status = CurrentStatus.from_hash(hash['CurrentStatus']) if hash['CurrentStatus']
|
|
63
|
+
# Parameter is an array, so we need to iterate through it
|
|
64
|
+
warnings = nil
|
|
65
|
+
unless hash['Warnings'].nil?
|
|
66
|
+
warnings = []
|
|
67
|
+
hash['Warnings'].each do |structure|
|
|
68
|
+
warnings << (ShippingstatusWarning.from_hash(structure) if structure)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
warnings = SKIP unless hash.key?('Warnings')
|
|
73
|
+
|
|
74
|
+
# Create object from extracted values.
|
|
75
|
+
ShippingstatusResponse.new(complete_status,
|
|
76
|
+
current_status,
|
|
77
|
+
warnings)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Provides a human-readable string representation of the object.
|
|
81
|
+
def to_s
|
|
82
|
+
class_name = self.class.name.split('::').last
|
|
83
|
+
"<#{class_name} complete_status: #{@complete_status}, current_status: #{@current_status},"\
|
|
84
|
+
" warnings: #{@warnings}>"
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
88
|
+
def inspect
|
|
89
|
+
class_name = self.class.name.split('::').last
|
|
90
|
+
"<#{class_name} complete_status: #{@complete_status.inspect}, current_status:"\
|
|
91
|
+
" #{@current_status.inspect}, warnings: #{@warnings.inspect}>"
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
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
|
+
# ShippingstatusResponseSignature Model.
|
|
8
|
+
class ShippingstatusResponseSignature < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Signature]
|
|
14
|
+
attr_accessor :signature
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [Warnings]
|
|
18
|
+
attr_accessor :warnings
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['signature'] = 'Signature'
|
|
24
|
+
@_hash['warnings'] = 'Warnings'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
signature
|
|
32
|
+
warnings
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(signature = SKIP, warnings = SKIP)
|
|
42
|
+
@signature = signature unless signature == SKIP
|
|
43
|
+
@warnings = warnings unless warnings == 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
|
+
signature = Signature.from_hash(hash['Signature']) if hash['Signature']
|
|
52
|
+
warnings = Warnings.from_hash(hash['Warnings']) if hash['Warnings']
|
|
53
|
+
|
|
54
|
+
# Create object from extracted values.
|
|
55
|
+
ShippingstatusResponseSignature.new(signature,
|
|
56
|
+
warnings)
|
|
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} signature: #{@signature}, warnings: #{@warnings}>"
|
|
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} signature: #{@signature.inspect}, warnings: #{@warnings.inspect}>"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
# ShippingstatusResponseUpdatedShipment Model.
|
|
8
|
+
class ShippingstatusResponseUpdatedShipment < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The barcode belonging to the status update
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :barcode
|
|
15
|
+
|
|
16
|
+
# The date of the update
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :creation_date
|
|
19
|
+
|
|
20
|
+
# The customer number
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :customer_number
|
|
23
|
+
|
|
24
|
+
# The customer code
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :customer_code
|
|
27
|
+
|
|
28
|
+
# The status update. See [Status
|
|
29
|
+
# codes](https://developer.postnl.nl/docs/#/http/reference-data/error-codes)
|
|
30
|
+
# for possible values.
|
|
31
|
+
# @return [UpdatedShipmentStatus]
|
|
32
|
+
attr_accessor :status
|
|
33
|
+
|
|
34
|
+
# A mapping from model property names to API property names.
|
|
35
|
+
def self.names
|
|
36
|
+
@_hash = {} if @_hash.nil?
|
|
37
|
+
@_hash['barcode'] = 'Barcode'
|
|
38
|
+
@_hash['creation_date'] = 'CreationDate'
|
|
39
|
+
@_hash['customer_number'] = 'CustomerNumber'
|
|
40
|
+
@_hash['customer_code'] = 'CustomerCode'
|
|
41
|
+
@_hash['status'] = 'Status'
|
|
42
|
+
@_hash
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# An array for optional fields
|
|
46
|
+
def self.optionals
|
|
47
|
+
%w[
|
|
48
|
+
barcode
|
|
49
|
+
creation_date
|
|
50
|
+
customer_number
|
|
51
|
+
customer_code
|
|
52
|
+
status
|
|
53
|
+
]
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# An array for nullable fields
|
|
57
|
+
def self.nullables
|
|
58
|
+
[]
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def initialize(barcode = SKIP, creation_date = SKIP, customer_number = SKIP,
|
|
62
|
+
customer_code = SKIP, status = SKIP)
|
|
63
|
+
@barcode = barcode unless barcode == SKIP
|
|
64
|
+
@creation_date = creation_date unless creation_date == SKIP
|
|
65
|
+
@customer_number = customer_number unless customer_number == SKIP
|
|
66
|
+
@customer_code = customer_code unless customer_code == SKIP
|
|
67
|
+
@status = status unless status == SKIP
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Creates an instance of the object from a hash.
|
|
71
|
+
def self.from_hash(hash)
|
|
72
|
+
return nil unless hash
|
|
73
|
+
|
|
74
|
+
# Extract variables from the hash.
|
|
75
|
+
barcode = hash.key?('Barcode') ? hash['Barcode'] : SKIP
|
|
76
|
+
creation_date = hash.key?('CreationDate') ? hash['CreationDate'] : SKIP
|
|
77
|
+
customer_number =
|
|
78
|
+
hash.key?('CustomerNumber') ? hash['CustomerNumber'] : SKIP
|
|
79
|
+
customer_code = hash.key?('CustomerCode') ? hash['CustomerCode'] : SKIP
|
|
80
|
+
status = UpdatedShipmentStatus.from_hash(hash['Status']) if hash['Status']
|
|
81
|
+
|
|
82
|
+
# Create object from extracted values.
|
|
83
|
+
ShippingstatusResponseUpdatedShipment.new(barcode,
|
|
84
|
+
creation_date,
|
|
85
|
+
customer_number,
|
|
86
|
+
customer_code,
|
|
87
|
+
status)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Provides a human-readable string representation of the object.
|
|
91
|
+
def to_s
|
|
92
|
+
class_name = self.class.name.split('::').last
|
|
93
|
+
"<#{class_name} barcode: #{@barcode}, creation_date: #{@creation_date}, customer_number:"\
|
|
94
|
+
" #{@customer_number}, customer_code: #{@customer_code}, status: #{@status}>"
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
98
|
+
def inspect
|
|
99
|
+
class_name = self.class.name.split('::').last
|
|
100
|
+
"<#{class_name} barcode: #{@barcode.inspect}, creation_date: #{@creation_date.inspect},"\
|
|
101
|
+
" customer_number: #{@customer_number.inspect}, customer_code: #{@customer_code.inspect},"\
|
|
102
|
+
" status: #{@status.inspect}>"
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
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
|
+
# ShippingstatusWarning Model.
|
|
8
|
+
class ShippingstatusWarning < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Warning message
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :message
|
|
15
|
+
|
|
16
|
+
# Warning code
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :code
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['message'] = 'Message'
|
|
24
|
+
@_hash['code'] = 'Code'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
message
|
|
32
|
+
code
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(message = SKIP, code = SKIP)
|
|
42
|
+
@message = message unless message == SKIP
|
|
43
|
+
@code = code unless code == 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
|
+
message = hash.key?('Message') ? hash['Message'] : SKIP
|
|
52
|
+
code = hash.key?('Code') ? hash['Code'] : SKIP
|
|
53
|
+
|
|
54
|
+
# Create object from extracted values.
|
|
55
|
+
ShippingstatusWarning.new(message,
|
|
56
|
+
code)
|
|
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} message: #{@message}, code: #{@code}>"
|
|
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} message: #{@message.inspect}, code: #{@code.inspect}>"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|