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.
Files changed (172) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +164 -0
  4. data/bin/console +15 -0
  5. data/lib/postnl_ecommerce/api_helper.rb +10 -0
  6. data/lib/postnl_ecommerce/client.rb +126 -0
  7. data/lib/postnl_ecommerce/configuration.rb +195 -0
  8. data/lib/postnl_ecommerce/controllers/barcode_controller.rb +71 -0
  9. data/lib/postnl_ecommerce/controllers/base_controller.rb +60 -0
  10. data/lib/postnl_ecommerce/controllers/checkout_controller.rb +45 -0
  11. data/lib/postnl_ecommerce/controllers/confirming_controller.rb +45 -0
  12. data/lib/postnl_ecommerce/controllers/deliverydate_controller.rb +233 -0
  13. data/lib/postnl_ecommerce/controllers/labelling_controller.rb +52 -0
  14. data/lib/postnl_ecommerce/controllers/locations_controller.rb +271 -0
  15. data/lib/postnl_ecommerce/controllers/postalcode_check_controller.rb +60 -0
  16. data/lib/postnl_ecommerce/controllers/shipment_controller.rb +52 -0
  17. data/lib/postnl_ecommerce/controllers/shipping_status_controller.rb +222 -0
  18. data/lib/postnl_ecommerce/controllers/timeframes_controller.rb +90 -0
  19. data/lib/postnl_ecommerce/exceptions/api_exception.rb +21 -0
  20. data/lib/postnl_ecommerce/exceptions/barcode_response_invalid_exception.rb +57 -0
  21. data/lib/postnl_ecommerce/exceptions/confirming_response_error_exception.rb +55 -0
  22. data/lib/postnl_ecommerce/exceptions/internal_server_error_exception.rb +46 -0
  23. data/lib/postnl_ecommerce/exceptions/invalid_request_exception.rb +62 -0
  24. data/lib/postnl_ecommerce/exceptions/labelling_response_invalid_exception.rb +57 -0
  25. data/lib/postnl_ecommerce/exceptions/method_not_allowed_only_get_exception.rb +53 -0
  26. data/lib/postnl_ecommerce/exceptions/method_not_allowed_only_get_post_exception.rb +53 -0
  27. data/lib/postnl_ecommerce/exceptions/method_not_allowed_only_post_exception.rb +53 -0
  28. data/lib/postnl_ecommerce/exceptions/postalcode_check_response_invalid_exception.rb +55 -0
  29. data/lib/postnl_ecommerce/exceptions/too_many_requests_exception.rb +53 -0
  30. data/lib/postnl_ecommerce/exceptions/unauthorized_exception.rb +53 -0
  31. data/lib/postnl_ecommerce/http/api_response.rb +19 -0
  32. data/lib/postnl_ecommerce/http/auth/custom_header_authentication.rb +52 -0
  33. data/lib/postnl_ecommerce/http/http_call_back.rb +10 -0
  34. data/lib/postnl_ecommerce/http/http_method_enum.rb +10 -0
  35. data/lib/postnl_ecommerce/http/http_request.rb +10 -0
  36. data/lib/postnl_ecommerce/http/http_response.rb +10 -0
  37. data/lib/postnl_ecommerce/http/proxy_settings.rb +22 -0
  38. data/lib/postnl_ecommerce/models/address.rb +240 -0
  39. data/lib/postnl_ecommerce/models/address_type_enum.rb +36 -0
  40. data/lib/postnl_ecommerce/models/amount.rb +138 -0
  41. data/lib/postnl_ecommerce/models/barcode_error.rb +71 -0
  42. data/lib/postnl_ecommerce/models/barcode_response.rb +62 -0
  43. data/lib/postnl_ecommerce/models/base_model.rb +110 -0
  44. data/lib/postnl_ecommerce/models/checkout_address.rb +120 -0
  45. data/lib/postnl_ecommerce/models/checkout_cut_off_day_enum.rb +61 -0
  46. data/lib/postnl_ecommerce/models/checkout_cut_off_time.rb +91 -0
  47. data/lib/postnl_ecommerce/models/checkout_cut_off_type_enum.rb +40 -0
  48. data/lib/postnl_ecommerce/models/checkout_delivery_option.rb +81 -0
  49. data/lib/postnl_ecommerce/models/checkout_location.rb +126 -0
  50. data/lib/postnl_ecommerce/models/checkout_option_enum.rb +64 -0
  51. data/lib/postnl_ecommerce/models/checkout_pickup_address.rb +112 -0
  52. data/lib/postnl_ecommerce/models/checkout_pickup_option.rb +103 -0
  53. data/lib/postnl_ecommerce/models/checkout_request.rb +152 -0
  54. data/lib/postnl_ecommerce/models/checkout_response.rb +110 -0
  55. data/lib/postnl_ecommerce/models/checkout_time_frame.rb +108 -0
  56. data/lib/postnl_ecommerce/models/checkout_warning.rb +95 -0
  57. data/lib/postnl_ecommerce/models/checkout_warning_option_enum.rb +68 -0
  58. data/lib/postnl_ecommerce/models/code_enum.rb +44 -0
  59. data/lib/postnl_ecommerce/models/complete_status.rb +62 -0
  60. data/lib/postnl_ecommerce/models/complete_status_shipment.rb +270 -0
  61. data/lib/postnl_ecommerce/models/confirming_custom.rb +239 -0
  62. data/lib/postnl_ecommerce/models/confirming_custom_content.rb +113 -0
  63. data/lib/postnl_ecommerce/models/confirming_error.rb +71 -0
  64. data/lib/postnl_ecommerce/models/confirming_message.rb +70 -0
  65. data/lib/postnl_ecommerce/models/confirming_request.rb +86 -0
  66. data/lib/postnl_ecommerce/models/confirming_response.rb +71 -0
  67. data/lib/postnl_ecommerce/models/confirming_response_shipment.rb +103 -0
  68. data/lib/postnl_ecommerce/models/confirming_shipment.rb +472 -0
  69. data/lib/postnl_ecommerce/models/contact.rb +101 -0
  70. data/lib/postnl_ecommerce/models/countrycode_enum.rb +36 -0
  71. data/lib/postnl_ecommerce/models/currency_enum.rb +44 -0
  72. data/lib/postnl_ecommerce/models/currency_labelling_api_enum.rb +36 -0
  73. data/lib/postnl_ecommerce/models/current_status.rb +62 -0
  74. data/lib/postnl_ecommerce/models/current_status_shipment.rb +207 -0
  75. data/lib/postnl_ecommerce/models/customer.rb +123 -0
  76. data/lib/postnl_ecommerce/models/customer_address.rb +237 -0
  77. data/lib/postnl_ecommerce/models/customs.rb +238 -0
  78. data/lib/postnl_ecommerce/models/customs_labelling_api.rb +238 -0
  79. data/lib/postnl_ecommerce/models/delivery_options.rb +64 -0
  80. data/lib/postnl_ecommerce/models/deliverydate_delivery_response.rb +87 -0
  81. data/lib/postnl_ecommerce/models/deliverydate_option_enum.rb +56 -0
  82. data/lib/postnl_ecommerce/models/deliverydate_options.rb +65 -0
  83. data/lib/postnl_ecommerce/models/deliverydate_shipping_response.rb +62 -0
  84. data/lib/postnl_ecommerce/models/detail.rb +62 -0
  85. data/lib/postnl_ecommerce/models/dimension.rb +106 -0
  86. data/lib/postnl_ecommerce/models/error.rb +73 -0
  87. data/lib/postnl_ecommerce/models/event.rb +127 -0
  88. data/lib/postnl_ecommerce/models/expectation.rb +71 -0
  89. data/lib/postnl_ecommerce/models/extra_field.rb +71 -0
  90. data/lib/postnl_ecommerce/models/fault.rb +71 -0
  91. data/lib/postnl_ecommerce/models/fault_shipping_status_api.rb +71 -0
  92. data/lib/postnl_ecommerce/models/friday.rb +62 -0
  93. data/lib/postnl_ecommerce/models/get_locations_result_multiple.rb +71 -0
  94. data/lib/postnl_ecommerce/models/get_locations_result_single.rb +62 -0
  95. data/lib/postnl_ecommerce/models/group.rb +97 -0
  96. data/lib/postnl_ecommerce/models/hazardous_material.rb +178 -0
  97. data/lib/postnl_ecommerce/models/labelling_customer.rb +123 -0
  98. data/lib/postnl_ecommerce/models/labelling_customer_labelling_api.rb +123 -0
  99. data/lib/postnl_ecommerce/models/labelling_customer_message.rb +83 -0
  100. data/lib/postnl_ecommerce/models/labelling_customer_shipment.rb +484 -0
  101. data/lib/postnl_ecommerce/models/labelling_customer_shipment_labelling_api.rb +484 -0
  102. data/lib/postnl_ecommerce/models/labelling_customs_content.rb +111 -0
  103. data/lib/postnl_ecommerce/models/labelling_error.rb +81 -0
  104. data/lib/postnl_ecommerce/models/labelling_label.rb +84 -0
  105. data/lib/postnl_ecommerce/models/labelling_merged_label.rb +80 -0
  106. data/lib/postnl_ecommerce/models/labelling_request.rb +112 -0
  107. data/lib/postnl_ecommerce/models/labelling_response.rb +95 -0
  108. data/lib/postnl_ecommerce/models/labelling_response_shipment.rb +123 -0
  109. data/lib/postnl_ecommerce/models/language_enum.rb +48 -0
  110. data/lib/postnl_ecommerce/models/location.rb +174 -0
  111. data/lib/postnl_ecommerce/models/location_response_single.rb +63 -0
  112. data/lib/postnl_ecommerce/models/locations_address.rb +122 -0
  113. data/lib/postnl_ecommerce/models/locations_delivery_option_enum.rb +40 -0
  114. data/lib/postnl_ecommerce/models/locations_opening_hours.rb +121 -0
  115. data/lib/postnl_ecommerce/models/locations_response_multiple.rb +63 -0
  116. data/lib/postnl_ecommerce/models/monday.rb +62 -0
  117. data/lib/postnl_ecommerce/models/no_timeframes_options.rb +62 -0
  118. data/lib/postnl_ecommerce/models/old_status.rb +106 -0
  119. data/lib/postnl_ecommerce/models/opening_hours.rb +121 -0
  120. data/lib/postnl_ecommerce/models/opening_hours_per_day.rb +71 -0
  121. data/lib/postnl_ecommerce/models/options.rb +64 -0
  122. data/lib/postnl_ecommerce/models/origin_country_code_enum.rb +36 -0
  123. data/lib/postnl_ecommerce/models/postalcode_check_address.rb +116 -0
  124. data/lib/postnl_ecommerce/models/postalcode_check_error.rb +81 -0
  125. data/lib/postnl_ecommerce/models/product_option.rb +74 -0
  126. data/lib/postnl_ecommerce/models/reason_no_timeframe.rb +104 -0
  127. data/lib/postnl_ecommerce/models/reason_no_timeframes.rb +71 -0
  128. data/lib/postnl_ecommerce/models/saturday.rb +62 -0
  129. data/lib/postnl_ecommerce/models/shipment_type_enum.rb +50 -0
  130. data/lib/postnl_ecommerce/models/shippingstatus_address.rb +204 -0
  131. data/lib/postnl_ecommerce/models/shippingstatus_amount.rb +75 -0
  132. data/lib/postnl_ecommerce/models/shippingstatus_customer.rb +83 -0
  133. data/lib/postnl_ecommerce/models/shippingstatus_dimension.rb +101 -0
  134. data/lib/postnl_ecommerce/models/shippingstatus_product_option.rb +74 -0
  135. data/lib/postnl_ecommerce/models/shippingstatus_product_options.rb +63 -0
  136. data/lib/postnl_ecommerce/models/shippingstatus_response.rb +94 -0
  137. data/lib/postnl_ecommerce/models/shippingstatus_response_signature.rb +71 -0
  138. data/lib/postnl_ecommerce/models/shippingstatus_response_updated_shipment.rb +105 -0
  139. data/lib/postnl_ecommerce/models/shippingstatus_warning.rb +71 -0
  140. data/lib/postnl_ecommerce/models/signature.rb +84 -0
  141. data/lib/postnl_ecommerce/models/status.rb +108 -0
  142. data/lib/postnl_ecommerce/models/sunday.rb +62 -0
  143. data/lib/postnl_ecommerce/models/sustainability.rb +73 -0
  144. data/lib/postnl_ecommerce/models/thursday.rb +62 -0
  145. data/lib/postnl_ecommerce/models/timeframe.rb +71 -0
  146. data/lib/postnl_ecommerce/models/timeframe_options_enum.rb +60 -0
  147. data/lib/postnl_ecommerce/models/timeframe_response.rb +74 -0
  148. data/lib/postnl_ecommerce/models/timeframe_timeframe.rb +96 -0
  149. data/lib/postnl_ecommerce/models/timeframes.rb +71 -0
  150. data/lib/postnl_ecommerce/models/timeframes_response_object.rb +71 -0
  151. data/lib/postnl_ecommerce/models/tuesday.rb +62 -0
  152. data/lib/postnl_ecommerce/models/type_enum.rb +64 -0
  153. data/lib/postnl_ecommerce/models/updated_shipment_status.rb +108 -0
  154. data/lib/postnl_ecommerce/models/warning.rb +71 -0
  155. data/lib/postnl_ecommerce/models/warnings.rb +62 -0
  156. data/lib/postnl_ecommerce/models/wednesday.rb +62 -0
  157. data/lib/postnl_ecommerce/utilities/date_time_helper.rb +11 -0
  158. data/lib/postnl_ecommerce/utilities/file_wrapper.rb +28 -0
  159. data/lib/postnl_ecommerce.rb +188 -0
  160. data/test/controllers/controller_test_base.rb +23 -0
  161. data/test/controllers/test_barcode_controller.rb +52 -0
  162. data/test/controllers/test_checkout_controller.rb +63 -0
  163. data/test/controllers/test_confirming_controller.rb +54 -0
  164. data/test/controllers/test_deliverydate_controller.rb +60 -0
  165. data/test/controllers/test_labelling_controller.rb +57 -0
  166. data/test/controllers/test_locations_controller.rb +185 -0
  167. data/test/controllers/test_postalcode_check_controller.rb +55 -0
  168. data/test/controllers/test_shipment_controller.rb +57 -0
  169. data/test/controllers/test_shipping_status_controller.rb +209 -0
  170. data/test/controllers/test_timeframes_controller.rb +67 -0
  171. data/test/http_response_catcher.rb +19 -0
  172. metadata +283 -0
@@ -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
+ # The option for which no timeframe was calculated for a specific date
8
+ class NoTimeframesOptions < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [TimeframeOptionsEnum]
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
+ NoTimeframesOptions.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,106 @@
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
+ # OldStatus Model.
8
+ class OldStatus < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The status timestamp
13
+ # @return [String]
14
+ attr_accessor :time_stamp
15
+
16
+ # The status code
17
+ # @return [String]
18
+ attr_accessor :status_code
19
+
20
+ # The status description
21
+ # @return [String]
22
+ attr_accessor :status_description
23
+
24
+ # The phase code
25
+ # @return [String]
26
+ attr_accessor :phase_code
27
+
28
+ # The phase description
29
+ # @return [String]
30
+ attr_accessor :phase_description
31
+
32
+ # A mapping from model property names to API property names.
33
+ def self.names
34
+ @_hash = {} if @_hash.nil?
35
+ @_hash['time_stamp'] = 'TimeStamp'
36
+ @_hash['status_code'] = 'StatusCode'
37
+ @_hash['status_description'] = 'StatusDescription'
38
+ @_hash['phase_code'] = 'PhaseCode'
39
+ @_hash['phase_description'] = 'PhaseDescription'
40
+ @_hash
41
+ end
42
+
43
+ # An array for optional fields
44
+ def self.optionals
45
+ %w[
46
+ time_stamp
47
+ status_code
48
+ status_description
49
+ phase_code
50
+ phase_description
51
+ ]
52
+ end
53
+
54
+ # An array for nullable fields
55
+ def self.nullables
56
+ []
57
+ end
58
+
59
+ def initialize(time_stamp = SKIP, status_code = SKIP,
60
+ status_description = SKIP, phase_code = SKIP,
61
+ phase_description = SKIP)
62
+ @time_stamp = time_stamp unless time_stamp == SKIP
63
+ @status_code = status_code unless status_code == SKIP
64
+ @status_description = status_description unless status_description == SKIP
65
+ @phase_code = phase_code unless phase_code == SKIP
66
+ @phase_description = phase_description unless phase_description == SKIP
67
+ end
68
+
69
+ # Creates an instance of the object from a hash.
70
+ def self.from_hash(hash)
71
+ return nil unless hash
72
+
73
+ # Extract variables from the hash.
74
+ time_stamp = hash.key?('TimeStamp') ? hash['TimeStamp'] : SKIP
75
+ status_code = hash.key?('StatusCode') ? hash['StatusCode'] : SKIP
76
+ status_description =
77
+ hash.key?('StatusDescription') ? hash['StatusDescription'] : SKIP
78
+ phase_code = hash.key?('PhaseCode') ? hash['PhaseCode'] : SKIP
79
+ phase_description =
80
+ hash.key?('PhaseDescription') ? hash['PhaseDescription'] : SKIP
81
+
82
+ # Create object from extracted values.
83
+ OldStatus.new(time_stamp,
84
+ status_code,
85
+ status_description,
86
+ phase_code,
87
+ phase_description)
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} time_stamp: #{@time_stamp}, status_code: #{@status_code},"\
94
+ " status_description: #{@status_description}, phase_code: #{@phase_code}, phase_description:"\
95
+ " #{@phase_description}>"
96
+ end
97
+
98
+ # Provides a debugging-friendly string with detailed object information.
99
+ def inspect
100
+ class_name = self.class.name.split('::').last
101
+ "<#{class_name} time_stamp: #{@time_stamp.inspect}, status_code: #{@status_code.inspect},"\
102
+ " status_description: #{@status_description.inspect}, phase_code: #{@phase_code.inspect},"\
103
+ " phase_description: #{@phase_description.inspect}>"
104
+ end
105
+ end
106
+ end
@@ -0,0 +1,121 @@
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
+ # The standard opening hours of the pickup location
8
+ class OpeningHours < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [OpeningHoursPerDay]
14
+ attr_accessor :monday
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [OpeningHoursPerDay]
18
+ attr_accessor :tuesday
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [OpeningHoursPerDay]
22
+ attr_accessor :wednesday
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [OpeningHoursPerDay]
26
+ attr_accessor :thursday
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [OpeningHoursPerDay]
30
+ attr_accessor :friday
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [OpeningHoursPerDay]
34
+ attr_accessor :saturday
35
+
36
+ # TODO: Write general description for this method
37
+ # @return [OpeningHoursPerDay]
38
+ attr_accessor :sunday
39
+
40
+ # A mapping from model property names to API property names.
41
+ def self.names
42
+ @_hash = {} if @_hash.nil?
43
+ @_hash['monday'] = 'Monday'
44
+ @_hash['tuesday'] = 'Tuesday'
45
+ @_hash['wednesday'] = 'Wednesday'
46
+ @_hash['thursday'] = 'Thursday'
47
+ @_hash['friday'] = 'Friday'
48
+ @_hash['saturday'] = 'Saturday'
49
+ @_hash['sunday'] = 'Sunday'
50
+ @_hash
51
+ end
52
+
53
+ # An array for optional fields
54
+ def self.optionals
55
+ %w[
56
+ monday
57
+ tuesday
58
+ wednesday
59
+ thursday
60
+ friday
61
+ saturday
62
+ sunday
63
+ ]
64
+ end
65
+
66
+ # An array for nullable fields
67
+ def self.nullables
68
+ []
69
+ end
70
+
71
+ def initialize(monday = SKIP, tuesday = SKIP, wednesday = SKIP,
72
+ thursday = SKIP, friday = SKIP, saturday = SKIP,
73
+ sunday = SKIP)
74
+ @monday = monday unless monday == SKIP
75
+ @tuesday = tuesday unless tuesday == SKIP
76
+ @wednesday = wednesday unless wednesday == SKIP
77
+ @thursday = thursday unless thursday == SKIP
78
+ @friday = friday unless friday == SKIP
79
+ @saturday = saturday unless saturday == SKIP
80
+ @sunday = sunday unless sunday == SKIP
81
+ end
82
+
83
+ # Creates an instance of the object from a hash.
84
+ def self.from_hash(hash)
85
+ return nil unless hash
86
+
87
+ # Extract variables from the hash.
88
+ monday = OpeningHoursPerDay.from_hash(hash['Monday']) if hash['Monday']
89
+ tuesday = OpeningHoursPerDay.from_hash(hash['Tuesday']) if hash['Tuesday']
90
+ wednesday = OpeningHoursPerDay.from_hash(hash['Wednesday']) if hash['Wednesday']
91
+ thursday = OpeningHoursPerDay.from_hash(hash['Thursday']) if hash['Thursday']
92
+ friday = OpeningHoursPerDay.from_hash(hash['Friday']) if hash['Friday']
93
+ saturday = OpeningHoursPerDay.from_hash(hash['Saturday']) if hash['Saturday']
94
+ sunday = OpeningHoursPerDay.from_hash(hash['Sunday']) if hash['Sunday']
95
+
96
+ # Create object from extracted values.
97
+ OpeningHours.new(monday,
98
+ tuesday,
99
+ wednesday,
100
+ thursday,
101
+ friday,
102
+ saturday,
103
+ sunday)
104
+ end
105
+
106
+ # Provides a human-readable string representation of the object.
107
+ def to_s
108
+ class_name = self.class.name.split('::').last
109
+ "<#{class_name} monday: #{@monday}, tuesday: #{@tuesday}, wednesday: #{@wednesday},"\
110
+ " thursday: #{@thursday}, friday: #{@friday}, saturday: #{@saturday}, sunday: #{@sunday}>"
111
+ end
112
+
113
+ # Provides a debugging-friendly string with detailed object information.
114
+ def inspect
115
+ class_name = self.class.name.split('::').last
116
+ "<#{class_name} monday: #{@monday.inspect}, tuesday: #{@tuesday.inspect}, wednesday:"\
117
+ " #{@wednesday.inspect}, thursday: #{@thursday.inspect}, friday: #{@friday.inspect},"\
118
+ " saturday: #{@saturday.inspect}, sunday: #{@sunday.inspect}>"
119
+ end
120
+ end
121
+ 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
+ # OpeningHoursPerDay Model.
8
+ class OpeningHoursPerDay < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :from
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :to
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['from'] = 'From'
24
+ @_hash['to'] = 'To'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ from
32
+ to
33
+ ]
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(from = SKIP, to = SKIP)
42
+ @from = from unless from == SKIP
43
+ @to = to unless to == 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
+ from = hash.key?('From') ? hash['From'] : SKIP
52
+ to = hash.key?('To') ? hash['To'] : SKIP
53
+
54
+ # Create object from extracted values.
55
+ OpeningHoursPerDay.new(from,
56
+ to)
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} from: #{@from}, to: #{@to}>"
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} from: #{@from.inspect}, to: #{@to.inspect}>"
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,64 @@
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
+ # The delivery option for which the timeframe is calculated. See [Delivery
8
+ # Options](https://developer.postnl.nl/docs/#/http/reference-data/reference-co
9
+ # des/delivery-options) for possible values.
10
+ class Options < BaseModel
11
+ SKIP = Object.new
12
+ private_constant :SKIP
13
+
14
+ # TODO: Write general description for this method
15
+ # @return [TimeframeOptionsEnum]
16
+ attr_accessor :string
17
+
18
+ # A mapping from model property names to API property names.
19
+ def self.names
20
+ @_hash = {} if @_hash.nil?
21
+ @_hash['string'] = 'string'
22
+ @_hash
23
+ end
24
+
25
+ # An array for optional fields
26
+ def self.optionals
27
+ %w[
28
+ string
29
+ ]
30
+ end
31
+
32
+ # An array for nullable fields
33
+ def self.nullables
34
+ []
35
+ end
36
+
37
+ def initialize(string = SKIP)
38
+ @string = string unless string == SKIP
39
+ end
40
+
41
+ # Creates an instance of the object from a hash.
42
+ def self.from_hash(hash)
43
+ return nil unless hash
44
+
45
+ # Extract variables from the hash.
46
+ string = hash.key?('string') ? hash['string'] : SKIP
47
+
48
+ # Create object from extracted values.
49
+ Options.new(string)
50
+ end
51
+
52
+ # Provides a human-readable string representation of the object.
53
+ def to_s
54
+ class_name = self.class.name.split('::').last
55
+ "<#{class_name} string: #{@string}>"
56
+ end
57
+
58
+ # Provides a debugging-friendly string with detailed object information.
59
+ def inspect
60
+ class_name = self.class.name.split('::').last
61
+ "<#{class_name} string: #{@string.inspect}>"
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,36 @@
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
+ # OriginCountryCode.
8
+ class OriginCountryCodeEnum
9
+ ORIGIN_COUNTRY_CODE_ENUM = [
10
+ # TODO: Write general description for NL
11
+ NL = 'NL'.freeze,
12
+
13
+ # TODO: Write general description for BE
14
+ BE = 'BE'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ ORIGIN_COUNTRY_CODE_ENUM.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = NL)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'nl' then NL
30
+ when 'be' then BE
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,116 @@
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
+ # PostalcodeCheckAddress Model.
8
+ class PostalcodeCheckAddress < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # City of requested address
13
+ # @return [String]
14
+ attr_accessor :city
15
+
16
+ # Postalcode of requested address
17
+ # @return [String]
18
+ attr_accessor :postal_code
19
+
20
+ # Street of requested address
21
+ # @return [String]
22
+ attr_accessor :street_name
23
+
24
+ # Housenumber of requested address
25
+ # @return [Integer]
26
+ attr_accessor :house_number
27
+
28
+ # Housenumber addition
29
+ # @return [String]
30
+ attr_accessor :house_number_addition
31
+
32
+ # Full formatted address according to PostNL standard (returns each line as
33
+ # a separate string)
34
+ # @return [Array[String]]
35
+ attr_accessor :formatted_address
36
+
37
+ # A mapping from model property names to API property names.
38
+ def self.names
39
+ @_hash = {} if @_hash.nil?
40
+ @_hash['city'] = 'city'
41
+ @_hash['postal_code'] = 'postalCode'
42
+ @_hash['street_name'] = 'streetName'
43
+ @_hash['house_number'] = 'houseNumber'
44
+ @_hash['house_number_addition'] = 'houseNumberAddition'
45
+ @_hash['formatted_address'] = 'formattedAddress'
46
+ @_hash
47
+ end
48
+
49
+ # An array for optional fields
50
+ def self.optionals
51
+ %w[
52
+ city
53
+ postal_code
54
+ street_name
55
+ house_number
56
+ house_number_addition
57
+ formatted_address
58
+ ]
59
+ end
60
+
61
+ # An array for nullable fields
62
+ def self.nullables
63
+ []
64
+ end
65
+
66
+ def initialize(city = SKIP, postal_code = SKIP, street_name = SKIP,
67
+ house_number = SKIP, house_number_addition = SKIP,
68
+ formatted_address = SKIP)
69
+ @city = city unless city == SKIP
70
+ @postal_code = postal_code unless postal_code == SKIP
71
+ @street_name = street_name unless street_name == SKIP
72
+ @house_number = house_number unless house_number == SKIP
73
+ @house_number_addition = house_number_addition unless house_number_addition == SKIP
74
+ @formatted_address = formatted_address unless formatted_address == SKIP
75
+ end
76
+
77
+ # Creates an instance of the object from a hash.
78
+ def self.from_hash(hash)
79
+ return nil unless hash
80
+
81
+ # Extract variables from the hash.
82
+ city = hash.key?('city') ? hash['city'] : SKIP
83
+ postal_code = hash.key?('postalCode') ? hash['postalCode'] : SKIP
84
+ street_name = hash.key?('streetName') ? hash['streetName'] : SKIP
85
+ house_number = hash.key?('houseNumber') ? hash['houseNumber'] : SKIP
86
+ house_number_addition =
87
+ hash.key?('houseNumberAddition') ? hash['houseNumberAddition'] : SKIP
88
+ formatted_address =
89
+ hash.key?('formattedAddress') ? hash['formattedAddress'] : SKIP
90
+
91
+ # Create object from extracted values.
92
+ PostalcodeCheckAddress.new(city,
93
+ postal_code,
94
+ street_name,
95
+ house_number,
96
+ house_number_addition,
97
+ formatted_address)
98
+ end
99
+
100
+ # Provides a human-readable string representation of the object.
101
+ def to_s
102
+ class_name = self.class.name.split('::').last
103
+ "<#{class_name} city: #{@city}, postal_code: #{@postal_code}, street_name: #{@street_name},"\
104
+ " house_number: #{@house_number}, house_number_addition: #{@house_number_addition},"\
105
+ " formatted_address: #{@formatted_address}>"
106
+ end
107
+
108
+ # Provides a debugging-friendly string with detailed object information.
109
+ def inspect
110
+ class_name = self.class.name.split('::').last
111
+ "<#{class_name} city: #{@city.inspect}, postal_code: #{@postal_code.inspect}, street_name:"\
112
+ " #{@street_name.inspect}, house_number: #{@house_number.inspect}, house_number_addition:"\
113
+ " #{@house_number_addition.inspect}, formatted_address: #{@formatted_address.inspect}>"
114
+ end
115
+ end
116
+ end
@@ -0,0 +1,81 @@
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
+ # PostalcodeCheckError Model.
8
+ class PostalcodeCheckError < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :status
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :title
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :detail
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['status'] = 'status'
28
+ @_hash['title'] = 'title'
29
+ @_hash['detail'] = 'detail'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ %w[
36
+ status
37
+ title
38
+ detail
39
+ ]
40
+ end
41
+
42
+ # An array for nullable fields
43
+ def self.nullables
44
+ []
45
+ end
46
+
47
+ def initialize(status = SKIP, title = SKIP, detail = SKIP)
48
+ @status = status unless status == SKIP
49
+ @title = title unless title == SKIP
50
+ @detail = detail unless detail == 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
+ status = hash.key?('status') ? hash['status'] : SKIP
59
+ title = hash.key?('title') ? hash['title'] : SKIP
60
+ detail = hash.key?('detail') ? hash['detail'] : SKIP
61
+
62
+ # Create object from extracted values.
63
+ PostalcodeCheckError.new(status,
64
+ title,
65
+ detail)
66
+ end
67
+
68
+ # Provides a human-readable string representation of the object.
69
+ def to_s
70
+ class_name = self.class.name.split('::').last
71
+ "<#{class_name} status: #{@status}, title: #{@title}, detail: #{@detail}>"
72
+ end
73
+
74
+ # Provides a debugging-friendly string with detailed object information.
75
+ def inspect
76
+ class_name = self.class.name.split('::').last
77
+ "<#{class_name} status: #{@status.inspect}, title: #{@title.inspect}, detail:"\
78
+ " #{@detail.inspect}>"
79
+ end
80
+ end
81
+ end