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,174 @@
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
+ # Location Model.
8
+ class Location < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [LocationsAddress]
14
+ attr_accessor :address
15
+
16
+ # The options belonging to the pickup location. The delivery options RETA,
17
+ # UL, PU, DO, BW, RT and BWUL can be shown in the response. Please ignore
18
+ # these codes. These codes are internal PostNL codes.
19
+ # @return [DeliveryOptions]
20
+ attr_accessor :delivery_options
21
+
22
+ # The distance from the address/coordinates provided in the request to the
23
+ # pickup location returned. Distance in meters.
24
+ # @return [Integer]
25
+ attr_accessor :distance
26
+
27
+ # The latitude of the pickup location
28
+ # @return [Float]
29
+ attr_accessor :latitude
30
+
31
+ # The pickup location identifier
32
+ # @return [Integer]
33
+ attr_accessor :location_code
34
+
35
+ # The longitude of the pickup location
36
+ # @return [Float]
37
+ attr_accessor :longitude
38
+
39
+ # The name of the pickup location
40
+ # @return [String]
41
+ attr_accessor :name
42
+
43
+ # The standard opening times of the pickup location
44
+ # @return [LocationsOpeningHours]
45
+ attr_accessor :opening_hours
46
+
47
+ # Sustainability score; see [Sustainability
48
+ # codes](https://developer.postnl.nl/docs/#/http/reference-data/reference-co
49
+ # des/sustainability-codes) for possible values.
50
+ # @return [Sustainability]
51
+ attr_accessor :sustainability
52
+
53
+ # The partner name belonging to the pickup location. Can be ignored, no
54
+ # longer used.
55
+ # @return [String]
56
+ attr_accessor :partner_name
57
+
58
+ # The retail network belonging to the pickup location. Can be ignored, no
59
+ # longer used
60
+ # @return [String]
61
+ attr_accessor :retail_network_id
62
+
63
+ # A mapping from model property names to API property names.
64
+ def self.names
65
+ @_hash = {} if @_hash.nil?
66
+ @_hash['address'] = 'Address'
67
+ @_hash['delivery_options'] = 'DeliveryOptions'
68
+ @_hash['distance'] = 'Distance'
69
+ @_hash['latitude'] = 'Latitude'
70
+ @_hash['location_code'] = 'LocationCode'
71
+ @_hash['longitude'] = 'Longitude'
72
+ @_hash['name'] = 'Name'
73
+ @_hash['opening_hours'] = 'OpeningHours'
74
+ @_hash['sustainability'] = 'Sustainability'
75
+ @_hash['partner_name'] = 'PartnerName'
76
+ @_hash['retail_network_id'] = 'RetailNetworkID'
77
+ @_hash
78
+ end
79
+
80
+ # An array for optional fields
81
+ def self.optionals
82
+ %w[
83
+ address
84
+ delivery_options
85
+ distance
86
+ latitude
87
+ location_code
88
+ longitude
89
+ name
90
+ opening_hours
91
+ sustainability
92
+ partner_name
93
+ retail_network_id
94
+ ]
95
+ end
96
+
97
+ # An array for nullable fields
98
+ def self.nullables
99
+ []
100
+ end
101
+
102
+ def initialize(address = SKIP, delivery_options = SKIP, distance = SKIP,
103
+ latitude = SKIP, location_code = SKIP, longitude = SKIP,
104
+ name = SKIP, opening_hours = SKIP, sustainability = SKIP,
105
+ partner_name = SKIP, retail_network_id = SKIP)
106
+ @address = address unless address == SKIP
107
+ @delivery_options = delivery_options unless delivery_options == SKIP
108
+ @distance = distance unless distance == SKIP
109
+ @latitude = latitude unless latitude == SKIP
110
+ @location_code = location_code unless location_code == SKIP
111
+ @longitude = longitude unless longitude == SKIP
112
+ @name = name unless name == SKIP
113
+ @opening_hours = opening_hours unless opening_hours == SKIP
114
+ @sustainability = sustainability unless sustainability == SKIP
115
+ @partner_name = partner_name unless partner_name == SKIP
116
+ @retail_network_id = retail_network_id unless retail_network_id == SKIP
117
+ end
118
+
119
+ # Creates an instance of the object from a hash.
120
+ def self.from_hash(hash)
121
+ return nil unless hash
122
+
123
+ # Extract variables from the hash.
124
+ address = LocationsAddress.from_hash(hash['Address']) if hash['Address']
125
+ delivery_options = DeliveryOptions.from_hash(hash['DeliveryOptions']) if
126
+ hash['DeliveryOptions']
127
+ distance = hash.key?('Distance') ? hash['Distance'] : SKIP
128
+ latitude = hash.key?('Latitude') ? hash['Latitude'] : SKIP
129
+ location_code = hash.key?('LocationCode') ? hash['LocationCode'] : SKIP
130
+ longitude = hash.key?('Longitude') ? hash['Longitude'] : SKIP
131
+ name = hash.key?('Name') ? hash['Name'] : SKIP
132
+ opening_hours = LocationsOpeningHours.from_hash(hash['OpeningHours']) if
133
+ hash['OpeningHours']
134
+ sustainability = Sustainability.from_hash(hash['Sustainability']) if hash['Sustainability']
135
+ partner_name = hash.key?('PartnerName') ? hash['PartnerName'] : SKIP
136
+ retail_network_id =
137
+ hash.key?('RetailNetworkID') ? hash['RetailNetworkID'] : SKIP
138
+
139
+ # Create object from extracted values.
140
+ Location.new(address,
141
+ delivery_options,
142
+ distance,
143
+ latitude,
144
+ location_code,
145
+ longitude,
146
+ name,
147
+ opening_hours,
148
+ sustainability,
149
+ partner_name,
150
+ retail_network_id)
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} address: #{@address}, delivery_options: #{@delivery_options}, distance:"\
157
+ " #{@distance}, latitude: #{@latitude}, location_code: #{@location_code}, longitude:"\
158
+ " #{@longitude}, name: #{@name}, opening_hours: #{@opening_hours}, sustainability:"\
159
+ " #{@sustainability}, partner_name: #{@partner_name}, retail_network_id:"\
160
+ " #{@retail_network_id}>"
161
+ end
162
+
163
+ # Provides a debugging-friendly string with detailed object information.
164
+ def inspect
165
+ class_name = self.class.name.split('::').last
166
+ "<#{class_name} address: #{@address.inspect}, delivery_options:"\
167
+ " #{@delivery_options.inspect}, distance: #{@distance.inspect}, latitude:"\
168
+ " #{@latitude.inspect}, location_code: #{@location_code.inspect}, longitude:"\
169
+ " #{@longitude.inspect}, name: #{@name.inspect}, opening_hours: #{@opening_hours.inspect},"\
170
+ " sustainability: #{@sustainability.inspect}, partner_name: #{@partner_name.inspect},"\
171
+ " retail_network_id: #{@retail_network_id.inspect}>"
172
+ end
173
+ end
174
+ 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
+ # LocationResponseSingle Model.
8
+ class LocationResponseSingle < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [GetLocationsResultSingle]
14
+ attr_accessor :get_locations_result
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['get_locations_result'] = 'GetLocationsResult'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ %w[
26
+ get_locations_result
27
+ ]
28
+ end
29
+
30
+ # An array for nullable fields
31
+ def self.nullables
32
+ []
33
+ end
34
+
35
+ def initialize(get_locations_result = SKIP)
36
+ @get_locations_result = get_locations_result unless get_locations_result == 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
+ get_locations_result = GetLocationsResultSingle.from_hash(hash['GetLocationsResult']) if
45
+ hash['GetLocationsResult']
46
+
47
+ # Create object from extracted values.
48
+ LocationResponseSingle.new(get_locations_result)
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} get_locations_result: #{@get_locations_result}>"
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} get_locations_result: #{@get_locations_result.inspect}>"
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,122 @@
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
+ # LocationsAddress Model.
8
+ class LocationsAddress < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The city of the pickup location address
13
+ # @return [String]
14
+ attr_accessor :city
15
+
16
+ # The country of the pickup location address
17
+ # @return [String]
18
+ attr_accessor :countrycode
19
+
20
+ # The house number of the pickup location address
21
+ # @return [Integer]
22
+ attr_accessor :house_nr
23
+
24
+ # The house number extension of the pickup location address
25
+ # @return [String]
26
+ attr_accessor :house_nr_ext
27
+
28
+ # Additional information about the pickup location
29
+ # @return [String]
30
+ attr_accessor :remark
31
+
32
+ # The street of the pickup location address
33
+ # @return [String]
34
+ attr_accessor :street
35
+
36
+ # The zipcode of the pickup location address
37
+ # @return [String]
38
+ attr_accessor :zipcode
39
+
40
+ # A mapping from model property names to API property names.
41
+ def self.names
42
+ @_hash = {} if @_hash.nil?
43
+ @_hash['city'] = 'City'
44
+ @_hash['countrycode'] = 'Countrycode'
45
+ @_hash['house_nr'] = 'HouseNr'
46
+ @_hash['house_nr_ext'] = 'HouseNrExt'
47
+ @_hash['remark'] = 'Remark'
48
+ @_hash['street'] = 'Street'
49
+ @_hash['zipcode'] = 'Zipcode'
50
+ @_hash
51
+ end
52
+
53
+ # An array for optional fields
54
+ def self.optionals
55
+ %w[
56
+ city
57
+ countrycode
58
+ house_nr
59
+ house_nr_ext
60
+ remark
61
+ street
62
+ zipcode
63
+ ]
64
+ end
65
+
66
+ # An array for nullable fields
67
+ def self.nullables
68
+ []
69
+ end
70
+
71
+ def initialize(city = SKIP, countrycode = SKIP, house_nr = SKIP,
72
+ house_nr_ext = SKIP, remark = SKIP, street = SKIP,
73
+ zipcode = SKIP)
74
+ @city = city unless city == SKIP
75
+ @countrycode = countrycode unless countrycode == SKIP
76
+ @house_nr = house_nr unless house_nr == SKIP
77
+ @house_nr_ext = house_nr_ext unless house_nr_ext == SKIP
78
+ @remark = remark unless remark == SKIP
79
+ @street = street unless street == SKIP
80
+ @zipcode = zipcode unless zipcode == 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
+ city = hash.key?('City') ? hash['City'] : SKIP
89
+ countrycode = hash.key?('Countrycode') ? hash['Countrycode'] : SKIP
90
+ house_nr = hash.key?('HouseNr') ? hash['HouseNr'] : SKIP
91
+ house_nr_ext = hash.key?('HouseNrExt') ? hash['HouseNrExt'] : SKIP
92
+ remark = hash.key?('Remark') ? hash['Remark'] : SKIP
93
+ street = hash.key?('Street') ? hash['Street'] : SKIP
94
+ zipcode = hash.key?('Zipcode') ? hash['Zipcode'] : SKIP
95
+
96
+ # Create object from extracted values.
97
+ LocationsAddress.new(city,
98
+ countrycode,
99
+ house_nr,
100
+ house_nr_ext,
101
+ remark,
102
+ street,
103
+ zipcode)
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} city: #{@city}, countrycode: #{@countrycode}, house_nr: #{@house_nr},"\
110
+ " house_nr_ext: #{@house_nr_ext}, remark: #{@remark}, street: #{@street}, zipcode:"\
111
+ " #{@zipcode}>"
112
+ end
113
+
114
+ # Provides a debugging-friendly string with detailed object information.
115
+ def inspect
116
+ class_name = self.class.name.split('::').last
117
+ "<#{class_name} city: #{@city.inspect}, countrycode: #{@countrycode.inspect}, house_nr:"\
118
+ " #{@house_nr.inspect}, house_nr_ext: #{@house_nr_ext.inspect}, remark: #{@remark.inspect},"\
119
+ " street: #{@street.inspect}, zipcode: #{@zipcode.inspect}>"
120
+ end
121
+ end
122
+ end
@@ -0,0 +1,40 @@
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
+ # locationsDeliveryOption.
8
+ class LocationsDeliveryOptionEnum
9
+ LOCATIONS_DELIVERY_OPTION_ENUM = [
10
+ # TODO: Write general description for PG
11
+ PG = 'PG'.freeze,
12
+
13
+ # TODO: Write general description for PA
14
+ PA = 'PA'.freeze,
15
+
16
+ # TODO: Write general description for PG_EX
17
+ PG_EX = 'PG_EX'.freeze
18
+ ].freeze
19
+
20
+ def self.validate(value)
21
+ return false if value.nil?
22
+
23
+ LOCATIONS_DELIVERY_OPTION_ENUM.include?(value)
24
+ end
25
+
26
+ def self.from_value(value, default_value = PG)
27
+ return default_value if value.nil?
28
+
29
+ str = value.to_s.strip
30
+
31
+ case str.downcase
32
+ when 'pg' then PG
33
+ when 'pa' then PA
34
+ when 'pg_ex' then PG_EX
35
+ else
36
+ default_value
37
+ end
38
+ end
39
+ end
40
+ 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 times of the pickup location
8
+ class LocationsOpeningHours < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Monday]
14
+ attr_accessor :monday
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Tuesday]
18
+ attr_accessor :tuesday
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [Wednesday]
22
+ attr_accessor :wednesday
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [Thursday]
26
+ attr_accessor :thursday
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [Friday]
30
+ attr_accessor :friday
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [Saturday]
34
+ attr_accessor :saturday
35
+
36
+ # TODO: Write general description for this method
37
+ # @return [Sunday]
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 = Monday.from_hash(hash['Monday']) if hash['Monday']
89
+ tuesday = Tuesday.from_hash(hash['Tuesday']) if hash['Tuesday']
90
+ wednesday = Wednesday.from_hash(hash['Wednesday']) if hash['Wednesday']
91
+ thursday = Thursday.from_hash(hash['Thursday']) if hash['Thursday']
92
+ friday = Friday.from_hash(hash['Friday']) if hash['Friday']
93
+ saturday = Saturday.from_hash(hash['Saturday']) if hash['Saturday']
94
+ sunday = Sunday.from_hash(hash['Sunday']) if hash['Sunday']
95
+
96
+ # Create object from extracted values.
97
+ LocationsOpeningHours.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,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
+ # LocationsResponseMultiple Model.
8
+ class LocationsResponseMultiple < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [GetLocationsResultMultiple]
14
+ attr_accessor :get_locations_result
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['get_locations_result'] = 'GetLocationsResult'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ %w[
26
+ get_locations_result
27
+ ]
28
+ end
29
+
30
+ # An array for nullable fields
31
+ def self.nullables
32
+ []
33
+ end
34
+
35
+ def initialize(get_locations_result = SKIP)
36
+ @get_locations_result = get_locations_result unless get_locations_result == 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
+ get_locations_result = GetLocationsResultMultiple.from_hash(hash['GetLocationsResult']) if
45
+ hash['GetLocationsResult']
46
+
47
+ # Create object from extracted values.
48
+ LocationsResponseMultiple.new(get_locations_result)
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} get_locations_result: #{@get_locations_result}>"
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} get_locations_result: #{@get_locations_result.inspect}>"
61
+ end
62
+ end
63
+ 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
+ # Monday Model.
8
+ class Monday < 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
+ Monday.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