apimatic-pnl-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +164 -0
- data/bin/console +15 -0
- data/lib/postnl_ecommerce/api_helper.rb +10 -0
- data/lib/postnl_ecommerce/client.rb +126 -0
- data/lib/postnl_ecommerce/configuration.rb +195 -0
- data/lib/postnl_ecommerce/controllers/barcode_controller.rb +71 -0
- data/lib/postnl_ecommerce/controllers/base_controller.rb +60 -0
- data/lib/postnl_ecommerce/controllers/checkout_controller.rb +45 -0
- data/lib/postnl_ecommerce/controllers/confirming_controller.rb +45 -0
- data/lib/postnl_ecommerce/controllers/deliverydate_controller.rb +233 -0
- data/lib/postnl_ecommerce/controllers/labelling_controller.rb +52 -0
- data/lib/postnl_ecommerce/controllers/locations_controller.rb +271 -0
- data/lib/postnl_ecommerce/controllers/postalcode_check_controller.rb +60 -0
- data/lib/postnl_ecommerce/controllers/shipment_controller.rb +52 -0
- data/lib/postnl_ecommerce/controllers/shipping_status_controller.rb +222 -0
- data/lib/postnl_ecommerce/controllers/timeframes_controller.rb +90 -0
- data/lib/postnl_ecommerce/exceptions/api_exception.rb +21 -0
- data/lib/postnl_ecommerce/exceptions/barcode_response_invalid_exception.rb +57 -0
- data/lib/postnl_ecommerce/exceptions/confirming_response_error_exception.rb +55 -0
- data/lib/postnl_ecommerce/exceptions/internal_server_error_exception.rb +46 -0
- data/lib/postnl_ecommerce/exceptions/invalid_request_exception.rb +62 -0
- data/lib/postnl_ecommerce/exceptions/labelling_response_invalid_exception.rb +57 -0
- data/lib/postnl_ecommerce/exceptions/method_not_allowed_only_get_exception.rb +53 -0
- data/lib/postnl_ecommerce/exceptions/method_not_allowed_only_get_post_exception.rb +53 -0
- data/lib/postnl_ecommerce/exceptions/method_not_allowed_only_post_exception.rb +53 -0
- data/lib/postnl_ecommerce/exceptions/postalcode_check_response_invalid_exception.rb +55 -0
- data/lib/postnl_ecommerce/exceptions/too_many_requests_exception.rb +53 -0
- data/lib/postnl_ecommerce/exceptions/unauthorized_exception.rb +53 -0
- data/lib/postnl_ecommerce/http/api_response.rb +19 -0
- data/lib/postnl_ecommerce/http/auth/custom_header_authentication.rb +52 -0
- data/lib/postnl_ecommerce/http/http_call_back.rb +10 -0
- data/lib/postnl_ecommerce/http/http_method_enum.rb +10 -0
- data/lib/postnl_ecommerce/http/http_request.rb +10 -0
- data/lib/postnl_ecommerce/http/http_response.rb +10 -0
- data/lib/postnl_ecommerce/http/proxy_settings.rb +22 -0
- data/lib/postnl_ecommerce/models/address.rb +240 -0
- data/lib/postnl_ecommerce/models/address_type_enum.rb +36 -0
- data/lib/postnl_ecommerce/models/amount.rb +138 -0
- data/lib/postnl_ecommerce/models/barcode_error.rb +71 -0
- data/lib/postnl_ecommerce/models/barcode_response.rb +62 -0
- data/lib/postnl_ecommerce/models/base_model.rb +110 -0
- data/lib/postnl_ecommerce/models/checkout_address.rb +120 -0
- data/lib/postnl_ecommerce/models/checkout_cut_off_day_enum.rb +61 -0
- data/lib/postnl_ecommerce/models/checkout_cut_off_time.rb +91 -0
- data/lib/postnl_ecommerce/models/checkout_cut_off_type_enum.rb +40 -0
- data/lib/postnl_ecommerce/models/checkout_delivery_option.rb +81 -0
- data/lib/postnl_ecommerce/models/checkout_location.rb +126 -0
- data/lib/postnl_ecommerce/models/checkout_option_enum.rb +64 -0
- data/lib/postnl_ecommerce/models/checkout_pickup_address.rb +112 -0
- data/lib/postnl_ecommerce/models/checkout_pickup_option.rb +103 -0
- data/lib/postnl_ecommerce/models/checkout_request.rb +152 -0
- data/lib/postnl_ecommerce/models/checkout_response.rb +110 -0
- data/lib/postnl_ecommerce/models/checkout_time_frame.rb +108 -0
- data/lib/postnl_ecommerce/models/checkout_warning.rb +95 -0
- data/lib/postnl_ecommerce/models/checkout_warning_option_enum.rb +68 -0
- data/lib/postnl_ecommerce/models/code_enum.rb +44 -0
- data/lib/postnl_ecommerce/models/complete_status.rb +62 -0
- data/lib/postnl_ecommerce/models/complete_status_shipment.rb +270 -0
- data/lib/postnl_ecommerce/models/confirming_custom.rb +239 -0
- data/lib/postnl_ecommerce/models/confirming_custom_content.rb +113 -0
- data/lib/postnl_ecommerce/models/confirming_error.rb +71 -0
- data/lib/postnl_ecommerce/models/confirming_message.rb +70 -0
- data/lib/postnl_ecommerce/models/confirming_request.rb +86 -0
- data/lib/postnl_ecommerce/models/confirming_response.rb +71 -0
- data/lib/postnl_ecommerce/models/confirming_response_shipment.rb +103 -0
- data/lib/postnl_ecommerce/models/confirming_shipment.rb +472 -0
- data/lib/postnl_ecommerce/models/contact.rb +101 -0
- data/lib/postnl_ecommerce/models/countrycode_enum.rb +36 -0
- data/lib/postnl_ecommerce/models/currency_enum.rb +44 -0
- data/lib/postnl_ecommerce/models/currency_labelling_api_enum.rb +36 -0
- data/lib/postnl_ecommerce/models/current_status.rb +62 -0
- data/lib/postnl_ecommerce/models/current_status_shipment.rb +207 -0
- data/lib/postnl_ecommerce/models/customer.rb +123 -0
- data/lib/postnl_ecommerce/models/customer_address.rb +237 -0
- data/lib/postnl_ecommerce/models/customs.rb +238 -0
- data/lib/postnl_ecommerce/models/customs_labelling_api.rb +238 -0
- data/lib/postnl_ecommerce/models/delivery_options.rb +64 -0
- data/lib/postnl_ecommerce/models/deliverydate_delivery_response.rb +87 -0
- data/lib/postnl_ecommerce/models/deliverydate_option_enum.rb +56 -0
- data/lib/postnl_ecommerce/models/deliverydate_options.rb +65 -0
- data/lib/postnl_ecommerce/models/deliverydate_shipping_response.rb +62 -0
- data/lib/postnl_ecommerce/models/detail.rb +62 -0
- data/lib/postnl_ecommerce/models/dimension.rb +106 -0
- data/lib/postnl_ecommerce/models/error.rb +73 -0
- data/lib/postnl_ecommerce/models/event.rb +127 -0
- data/lib/postnl_ecommerce/models/expectation.rb +71 -0
- data/lib/postnl_ecommerce/models/extra_field.rb +71 -0
- data/lib/postnl_ecommerce/models/fault.rb +71 -0
- data/lib/postnl_ecommerce/models/fault_shipping_status_api.rb +71 -0
- data/lib/postnl_ecommerce/models/friday.rb +62 -0
- data/lib/postnl_ecommerce/models/get_locations_result_multiple.rb +71 -0
- data/lib/postnl_ecommerce/models/get_locations_result_single.rb +62 -0
- data/lib/postnl_ecommerce/models/group.rb +97 -0
- data/lib/postnl_ecommerce/models/hazardous_material.rb +178 -0
- data/lib/postnl_ecommerce/models/labelling_customer.rb +123 -0
- data/lib/postnl_ecommerce/models/labelling_customer_labelling_api.rb +123 -0
- data/lib/postnl_ecommerce/models/labelling_customer_message.rb +83 -0
- data/lib/postnl_ecommerce/models/labelling_customer_shipment.rb +484 -0
- data/lib/postnl_ecommerce/models/labelling_customer_shipment_labelling_api.rb +484 -0
- data/lib/postnl_ecommerce/models/labelling_customs_content.rb +111 -0
- data/lib/postnl_ecommerce/models/labelling_error.rb +81 -0
- data/lib/postnl_ecommerce/models/labelling_label.rb +84 -0
- data/lib/postnl_ecommerce/models/labelling_merged_label.rb +80 -0
- data/lib/postnl_ecommerce/models/labelling_request.rb +112 -0
- data/lib/postnl_ecommerce/models/labelling_response.rb +95 -0
- data/lib/postnl_ecommerce/models/labelling_response_shipment.rb +123 -0
- data/lib/postnl_ecommerce/models/language_enum.rb +48 -0
- data/lib/postnl_ecommerce/models/location.rb +174 -0
- data/lib/postnl_ecommerce/models/location_response_single.rb +63 -0
- data/lib/postnl_ecommerce/models/locations_address.rb +122 -0
- data/lib/postnl_ecommerce/models/locations_delivery_option_enum.rb +40 -0
- data/lib/postnl_ecommerce/models/locations_opening_hours.rb +121 -0
- data/lib/postnl_ecommerce/models/locations_response_multiple.rb +63 -0
- data/lib/postnl_ecommerce/models/monday.rb +62 -0
- data/lib/postnl_ecommerce/models/no_timeframes_options.rb +62 -0
- data/lib/postnl_ecommerce/models/old_status.rb +106 -0
- data/lib/postnl_ecommerce/models/opening_hours.rb +121 -0
- data/lib/postnl_ecommerce/models/opening_hours_per_day.rb +71 -0
- data/lib/postnl_ecommerce/models/options.rb +64 -0
- data/lib/postnl_ecommerce/models/origin_country_code_enum.rb +36 -0
- data/lib/postnl_ecommerce/models/postalcode_check_address.rb +116 -0
- data/lib/postnl_ecommerce/models/postalcode_check_error.rb +81 -0
- data/lib/postnl_ecommerce/models/product_option.rb +74 -0
- data/lib/postnl_ecommerce/models/reason_no_timeframe.rb +104 -0
- data/lib/postnl_ecommerce/models/reason_no_timeframes.rb +71 -0
- data/lib/postnl_ecommerce/models/saturday.rb +62 -0
- data/lib/postnl_ecommerce/models/shipment_type_enum.rb +50 -0
- data/lib/postnl_ecommerce/models/shippingstatus_address.rb +204 -0
- data/lib/postnl_ecommerce/models/shippingstatus_amount.rb +75 -0
- data/lib/postnl_ecommerce/models/shippingstatus_customer.rb +83 -0
- data/lib/postnl_ecommerce/models/shippingstatus_dimension.rb +101 -0
- data/lib/postnl_ecommerce/models/shippingstatus_product_option.rb +74 -0
- data/lib/postnl_ecommerce/models/shippingstatus_product_options.rb +63 -0
- data/lib/postnl_ecommerce/models/shippingstatus_response.rb +94 -0
- data/lib/postnl_ecommerce/models/shippingstatus_response_signature.rb +71 -0
- data/lib/postnl_ecommerce/models/shippingstatus_response_updated_shipment.rb +105 -0
- data/lib/postnl_ecommerce/models/shippingstatus_warning.rb +71 -0
- data/lib/postnl_ecommerce/models/signature.rb +84 -0
- data/lib/postnl_ecommerce/models/status.rb +108 -0
- data/lib/postnl_ecommerce/models/sunday.rb +62 -0
- data/lib/postnl_ecommerce/models/sustainability.rb +73 -0
- data/lib/postnl_ecommerce/models/thursday.rb +62 -0
- data/lib/postnl_ecommerce/models/timeframe.rb +71 -0
- data/lib/postnl_ecommerce/models/timeframe_options_enum.rb +60 -0
- data/lib/postnl_ecommerce/models/timeframe_response.rb +74 -0
- data/lib/postnl_ecommerce/models/timeframe_timeframe.rb +96 -0
- data/lib/postnl_ecommerce/models/timeframes.rb +71 -0
- data/lib/postnl_ecommerce/models/timeframes_response_object.rb +71 -0
- data/lib/postnl_ecommerce/models/tuesday.rb +62 -0
- data/lib/postnl_ecommerce/models/type_enum.rb +64 -0
- data/lib/postnl_ecommerce/models/updated_shipment_status.rb +108 -0
- data/lib/postnl_ecommerce/models/warning.rb +71 -0
- data/lib/postnl_ecommerce/models/warnings.rb +62 -0
- data/lib/postnl_ecommerce/models/wednesday.rb +62 -0
- data/lib/postnl_ecommerce/utilities/date_time_helper.rb +11 -0
- data/lib/postnl_ecommerce/utilities/file_wrapper.rb +28 -0
- data/lib/postnl_ecommerce.rb +188 -0
- data/test/controllers/controller_test_base.rb +23 -0
- data/test/controllers/test_barcode_controller.rb +52 -0
- data/test/controllers/test_checkout_controller.rb +63 -0
- data/test/controllers/test_confirming_controller.rb +54 -0
- data/test/controllers/test_deliverydate_controller.rb +60 -0
- data/test/controllers/test_labelling_controller.rb +57 -0
- data/test/controllers/test_locations_controller.rb +185 -0
- data/test/controllers/test_postalcode_check_controller.rb +55 -0
- data/test/controllers/test_shipment_controller.rb +57 -0
- data/test/controllers/test_shipping_status_controller.rb +209 -0
- data/test/controllers/test_timeframes_controller.rb +67 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +283 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# postnl_ecommerce
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for PostNL by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module PostnlEcommerce
|
|
7
|
+
# ConfirmingError Model.
|
|
8
|
+
class ConfirmingError < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The error code
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :code
|
|
15
|
+
|
|
16
|
+
# The error description
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :description
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['code'] = 'Code'
|
|
24
|
+
@_hash['description'] = 'Description'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
code
|
|
32
|
+
description
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(code = SKIP, description = SKIP)
|
|
42
|
+
@code = code unless code == SKIP
|
|
43
|
+
@description = description unless description == 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
|
+
code = hash.key?('Code') ? hash['Code'] : SKIP
|
|
52
|
+
description = hash.key?('Description') ? hash['Description'] : SKIP
|
|
53
|
+
|
|
54
|
+
# Create object from extracted values.
|
|
55
|
+
ConfirmingError.new(code,
|
|
56
|
+
description)
|
|
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} code: #{@code}, description: #{@description}>"
|
|
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} code: #{@code.inspect}, description: #{@description.inspect}>"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
# ConfirmingMessage Model.
|
|
8
|
+
class ConfirmingMessage < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# ID of the message
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :message_id
|
|
15
|
+
|
|
16
|
+
# Date/time of sending the message. Format: dd-mm-yyyy hh:mm:ss
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :message_time_stamp
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['message_id'] = 'MessageID'
|
|
24
|
+
@_hash['message_time_stamp'] = 'MessageTimeStamp'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for nullable fields
|
|
34
|
+
def self.nullables
|
|
35
|
+
[]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def initialize(message_id = nil, message_time_stamp = nil)
|
|
39
|
+
@message_id = message_id
|
|
40
|
+
@message_time_stamp = message_time_stamp
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Creates an instance of the object from a hash.
|
|
44
|
+
def self.from_hash(hash)
|
|
45
|
+
return nil unless hash
|
|
46
|
+
|
|
47
|
+
# Extract variables from the hash.
|
|
48
|
+
message_id = hash.key?('MessageID') ? hash['MessageID'] : nil
|
|
49
|
+
message_time_stamp =
|
|
50
|
+
hash.key?('MessageTimeStamp') ? hash['MessageTimeStamp'] : nil
|
|
51
|
+
|
|
52
|
+
# Create object from extracted values.
|
|
53
|
+
ConfirmingMessage.new(message_id,
|
|
54
|
+
message_time_stamp)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Provides a human-readable string representation of the object.
|
|
58
|
+
def to_s
|
|
59
|
+
class_name = self.class.name.split('::').last
|
|
60
|
+
"<#{class_name} message_id: #{@message_id}, message_time_stamp: #{@message_time_stamp}>"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
64
|
+
def inspect
|
|
65
|
+
class_name = self.class.name.split('::').last
|
|
66
|
+
"<#{class_name} message_id: #{@message_id.inspect}, message_time_stamp:"\
|
|
67
|
+
" #{@message_time_stamp.inspect}>"
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
# ConfirmingRequest Model.
|
|
8
|
+
class ConfirmingRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Customer]
|
|
14
|
+
attr_accessor :customer
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [ConfirmingMessage]
|
|
18
|
+
attr_accessor :message
|
|
19
|
+
|
|
20
|
+
# List of 1 or more Shipments. At least 1 shipment is required.
|
|
21
|
+
# @return [Array[ConfirmingShipment]]
|
|
22
|
+
attr_accessor :shipments
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['customer'] = 'Customer'
|
|
28
|
+
@_hash['message'] = 'Message'
|
|
29
|
+
@_hash['shipments'] = 'Shipments'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
[]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# An array for nullable fields
|
|
39
|
+
def self.nullables
|
|
40
|
+
[]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def initialize(customer = nil, message = nil, shipments = nil)
|
|
44
|
+
@customer = customer
|
|
45
|
+
@message = message
|
|
46
|
+
@shipments = shipments
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Creates an instance of the object from a hash.
|
|
50
|
+
def self.from_hash(hash)
|
|
51
|
+
return nil unless hash
|
|
52
|
+
|
|
53
|
+
# Extract variables from the hash.
|
|
54
|
+
customer = Customer.from_hash(hash['Customer']) if hash['Customer']
|
|
55
|
+
message = ConfirmingMessage.from_hash(hash['Message']) if hash['Message']
|
|
56
|
+
# Parameter is an array, so we need to iterate through it
|
|
57
|
+
shipments = nil
|
|
58
|
+
unless hash['Shipments'].nil?
|
|
59
|
+
shipments = []
|
|
60
|
+
hash['Shipments'].each do |structure|
|
|
61
|
+
shipments << (ConfirmingShipment.from_hash(structure) if structure)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
shipments = nil unless hash.key?('Shipments')
|
|
66
|
+
|
|
67
|
+
# Create object from extracted values.
|
|
68
|
+
ConfirmingRequest.new(customer,
|
|
69
|
+
message,
|
|
70
|
+
shipments)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Provides a human-readable string representation of the object.
|
|
74
|
+
def to_s
|
|
75
|
+
class_name = self.class.name.split('::').last
|
|
76
|
+
"<#{class_name} customer: #{@customer}, message: #{@message}, shipments: #{@shipments}>"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
80
|
+
def inspect
|
|
81
|
+
class_name = self.class.name.split('::').last
|
|
82
|
+
"<#{class_name} customer: #{@customer.inspect}, message: #{@message.inspect}, shipments:"\
|
|
83
|
+
" #{@shipments.inspect}>"
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
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
|
+
# ConfirmingResponse Model.
|
|
8
|
+
class ConfirmingResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Array[ConfirmingResponseShipment]]
|
|
14
|
+
attr_accessor :response_shipments
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['response_shipments'] = 'ResponseShipments'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
response_shipments
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(response_shipments = SKIP)
|
|
36
|
+
@response_shipments = response_shipments unless response_shipments == SKIP
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Creates an instance of the object from a hash.
|
|
40
|
+
def self.from_hash(hash)
|
|
41
|
+
return nil unless hash
|
|
42
|
+
|
|
43
|
+
# Extract variables from the hash.
|
|
44
|
+
# Parameter is an array, so we need to iterate through it
|
|
45
|
+
response_shipments = nil
|
|
46
|
+
unless hash['ResponseShipments'].nil?
|
|
47
|
+
response_shipments = []
|
|
48
|
+
hash['ResponseShipments'].each do |structure|
|
|
49
|
+
response_shipments << (ConfirmingResponseShipment.from_hash(structure) if structure)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
response_shipments = SKIP unless hash.key?('ResponseShipments')
|
|
54
|
+
|
|
55
|
+
# Create object from extracted values.
|
|
56
|
+
ConfirmingResponse.new(response_shipments)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Provides a human-readable string representation of the object.
|
|
60
|
+
def to_s
|
|
61
|
+
class_name = self.class.name.split('::').last
|
|
62
|
+
"<#{class_name} response_shipments: #{@response_shipments}>"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
66
|
+
def inspect
|
|
67
|
+
class_name = self.class.name.split('::').last
|
|
68
|
+
"<#{class_name} response_shipments: #{@response_shipments.inspect}>"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
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
|
+
# ConfirmingResponseShipment Model.
|
|
8
|
+
class ConfirmingResponseShipment < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Possible errors. See the [Error
|
|
13
|
+
# Codes](https://developer.postnl.nl/docs/#/http/reference-data/error-codes)
|
|
14
|
+
# for possible values
|
|
15
|
+
# @return [Array[ConfirmingError]]
|
|
16
|
+
attr_accessor :errors
|
|
17
|
+
|
|
18
|
+
# Possible warnings. See the [Error
|
|
19
|
+
# Codes](https://developer.postnl.nl/docs/#/http/reference-data/error-codes)
|
|
20
|
+
# for possible values
|
|
21
|
+
# @return [Array[Warning]]
|
|
22
|
+
attr_accessor :warnings
|
|
23
|
+
|
|
24
|
+
# The barcode used
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :barcode
|
|
27
|
+
|
|
28
|
+
# A mapping from model property names to API property names.
|
|
29
|
+
def self.names
|
|
30
|
+
@_hash = {} if @_hash.nil?
|
|
31
|
+
@_hash['errors'] = 'Errors'
|
|
32
|
+
@_hash['warnings'] = 'Warnings'
|
|
33
|
+
@_hash['barcode'] = 'Barcode'
|
|
34
|
+
@_hash
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# An array for optional fields
|
|
38
|
+
def self.optionals
|
|
39
|
+
%w[
|
|
40
|
+
errors
|
|
41
|
+
warnings
|
|
42
|
+
barcode
|
|
43
|
+
]
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# An array for nullable fields
|
|
47
|
+
def self.nullables
|
|
48
|
+
[]
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def initialize(errors = SKIP, warnings = SKIP, barcode = SKIP)
|
|
52
|
+
@errors = errors unless errors == SKIP
|
|
53
|
+
@warnings = warnings unless warnings == SKIP
|
|
54
|
+
@barcode = barcode unless barcode == SKIP
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Creates an instance of the object from a hash.
|
|
58
|
+
def self.from_hash(hash)
|
|
59
|
+
return nil unless hash
|
|
60
|
+
|
|
61
|
+
# Extract variables from the hash.
|
|
62
|
+
# Parameter is an array, so we need to iterate through it
|
|
63
|
+
errors = nil
|
|
64
|
+
unless hash['Errors'].nil?
|
|
65
|
+
errors = []
|
|
66
|
+
hash['Errors'].each do |structure|
|
|
67
|
+
errors << (ConfirmingError.from_hash(structure) if structure)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
errors = SKIP unless hash.key?('Errors')
|
|
72
|
+
# Parameter is an array, so we need to iterate through it
|
|
73
|
+
warnings = nil
|
|
74
|
+
unless hash['Warnings'].nil?
|
|
75
|
+
warnings = []
|
|
76
|
+
hash['Warnings'].each do |structure|
|
|
77
|
+
warnings << (Warning.from_hash(structure) if structure)
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
warnings = SKIP unless hash.key?('Warnings')
|
|
82
|
+
barcode = hash.key?('Barcode') ? hash['Barcode'] : SKIP
|
|
83
|
+
|
|
84
|
+
# Create object from extracted values.
|
|
85
|
+
ConfirmingResponseShipment.new(errors,
|
|
86
|
+
warnings,
|
|
87
|
+
barcode)
|
|
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} errors: #{@errors}, warnings: #{@warnings}, barcode: #{@barcode}>"
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
97
|
+
def inspect
|
|
98
|
+
class_name = self.class.name.split('::').last
|
|
99
|
+
"<#{class_name} errors: #{@errors.inspect}, warnings: #{@warnings.inspect}, barcode:"\
|
|
100
|
+
" #{@barcode.inspect}>"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|