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,484 @@
|
|
|
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
|
+
# LabellingCustomerShipmentLabellingAPI Model.
|
|
8
|
+
class LabellingCustomerShipmentLabellingAPI < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# List of 1 or more Address type elements. At least 1 address type is
|
|
13
|
+
# mandatory. See [Address
|
|
14
|
+
# types](https://developer.postnl.nl/docs/#/http/reference-data/reference-co
|
|
15
|
+
# des/address-types) for the available types.
|
|
16
|
+
# @return [Array[Address]]
|
|
17
|
+
attr_accessor :addresses
|
|
18
|
+
|
|
19
|
+
# List of amount types. An amount represents a value of the shipment. Amount
|
|
20
|
+
# type 01 mandatory for COD-shipments, Amount type 02 mandatory for domestic
|
|
21
|
+
# insured shipments. Please see [Amount
|
|
22
|
+
# types](https://developer.postnl.nl/docs/#/http/reference-data/reference-co
|
|
23
|
+
# des/amount-types) for the available types.
|
|
24
|
+
# @return [Array[Amount]]
|
|
25
|
+
attr_accessor :amounts
|
|
26
|
+
|
|
27
|
+
# Barcode of the shipment. This is a unique value. Note: If you leave this
|
|
28
|
+
# attribute out of your request an unique barcode will be generated
|
|
29
|
+
# automatically.
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :barcode
|
|
32
|
+
|
|
33
|
+
# Code used for logistic purposes (usually generated by the service itself
|
|
34
|
+
# and returned in the response). Please note that this must be provided when
|
|
35
|
+
# using the Confirm API to confirm shipments where coding texts are
|
|
36
|
+
# required (e.g. letterbox parcels).
|
|
37
|
+
# @return [String]
|
|
38
|
+
attr_accessor :coding_text
|
|
39
|
+
|
|
40
|
+
# Starting date/time of the collection of the shipment. Format: dd-MM-yyyy
|
|
41
|
+
# hh:mm:ss
|
|
42
|
+
# @return [String]
|
|
43
|
+
attr_accessor :collection_time_stamp_start
|
|
44
|
+
|
|
45
|
+
# Ending date/time of the collection of the shipment. Format: dd-MM-yyyy
|
|
46
|
+
# hh:mm:ss
|
|
47
|
+
# @return [String]
|
|
48
|
+
attr_accessor :collection_time_stamp_end
|
|
49
|
+
|
|
50
|
+
# One or more ContactType elements belonging to a shipment. Mandatory in
|
|
51
|
+
# some cases. Please refer to the available [Contact
|
|
52
|
+
# types](https://developer.postnl.nl/docs/#/http/reference-data/reference-co
|
|
53
|
+
# des/contact-types) for the possible values.
|
|
54
|
+
# @return [Array[Contact]]
|
|
55
|
+
attr_accessor :contacts
|
|
56
|
+
|
|
57
|
+
# Content of the shipment. Mandatory for Extra@Home shipments
|
|
58
|
+
# @return [String]
|
|
59
|
+
attr_accessor :content
|
|
60
|
+
|
|
61
|
+
# Cost center of the shipment. This value will appear on your invoice
|
|
62
|
+
# @return [String]
|
|
63
|
+
attr_accessor :cost_center
|
|
64
|
+
|
|
65
|
+
# Order number of the customer
|
|
66
|
+
# @return [String]
|
|
67
|
+
attr_accessor :customer_order_number
|
|
68
|
+
|
|
69
|
+
# The Customs type is mandatory for non-EU shipments and not allowed for any
|
|
70
|
+
# other shipment types.
|
|
71
|
+
# @return [CustomsLabellingAPI]
|
|
72
|
+
attr_accessor :customs
|
|
73
|
+
|
|
74
|
+
# Delivery address specification. This field is mandatory when AddressType
|
|
75
|
+
# on the Address is 09.
|
|
76
|
+
# @return [String]
|
|
77
|
+
attr_accessor :delivery_address
|
|
78
|
+
|
|
79
|
+
# Mandatory when using Mailbox Parcels (for generation of the coding rule)
|
|
80
|
+
# and delivery options like Evening/Morning/Sameday delivery etc.
|
|
81
|
+
# @return [String]
|
|
82
|
+
attr_accessor :delivery_date
|
|
83
|
+
|
|
84
|
+
# Note: Length, Width, Height values are about the order of the size and
|
|
85
|
+
# need to be filled in from the longest to the shortest value. For example:
|
|
86
|
+
# shipment's official height is 700mm, width 500mm, length 300mm. The
|
|
87
|
+
# longest side (highest value) of 700mm needs to be entered at Length. Width
|
|
88
|
+
# value becomes 500mm, Height value: 300mm (the lowest). Entering the
|
|
89
|
+
# dimensions in the wrong order may result in incorrect shipping labels and
|
|
90
|
+
# longer delivery times. The maximum dimensions can be found in your PostNL
|
|
91
|
+
# contract.
|
|
92
|
+
# @return [Dimension]
|
|
93
|
+
attr_accessor :dimension
|
|
94
|
+
|
|
95
|
+
# Barcode of the downstream network partner of PostNL Parcels. Madatory for
|
|
96
|
+
# requesting Parcels Non-EU combilabel product codes.
|
|
97
|
+
# @return [String]
|
|
98
|
+
attr_accessor :down_partner_barcode
|
|
99
|
+
|
|
100
|
+
# Identification of the downstream network partner of PostNL Pakketten.
|
|
101
|
+
# @return [String]
|
|
102
|
+
attr_accessor :down_partner_id
|
|
103
|
+
|
|
104
|
+
# Identification of the location of the downstream network partner of PostNL
|
|
105
|
+
# Pakketten.
|
|
106
|
+
# @return [String]
|
|
107
|
+
attr_accessor :down_partner_location
|
|
108
|
+
|
|
109
|
+
# List of 0 or more Group types with data, grouping multiple shipments
|
|
110
|
+
# together. Mandatory for multicollo shipments. Please see
|
|
111
|
+
# [Guidelines](https://developer.postnl.nl/docs/#/http/api-endpoints/send-tr
|
|
112
|
+
# ack/labelling/guidelines) (Multiple shipments) for more information.
|
|
113
|
+
# @return [Array[Group]]
|
|
114
|
+
attr_accessor :groups
|
|
115
|
+
|
|
116
|
+
# Array of hazardous materials contained in the shipment
|
|
117
|
+
# @return [Array[HazardousMaterial]]
|
|
118
|
+
attr_accessor :hazardous_material
|
|
119
|
+
|
|
120
|
+
# Deprecated. Collection product code of a shipment.
|
|
121
|
+
# @return [String]
|
|
122
|
+
attr_accessor :product_code_collect
|
|
123
|
+
|
|
124
|
+
# Product code of the shipment. See the [Products
|
|
125
|
+
# page](https://developer.postnl.nl/docs/#/http/reference-data/product-codes
|
|
126
|
+
# -dutch-domestic) for possible products.
|
|
127
|
+
# @return [String]
|
|
128
|
+
attr_accessor :product_code_delivery
|
|
129
|
+
|
|
130
|
+
# Product options for the shipment, mandatory for certain products, see the
|
|
131
|
+
# [Products
|
|
132
|
+
# page](https://developer.postnl.nl/docs/#/http/reference-data/product-codes
|
|
133
|
+
# -dutch-domestic).
|
|
134
|
+
# @return [Array[ProductOption]]
|
|
135
|
+
attr_accessor :product_options
|
|
136
|
+
|
|
137
|
+
# Date of birth. Mandatory for Age check products
|
|
138
|
+
# @return [String]
|
|
139
|
+
attr_accessor :receiver_date_of_birth
|
|
140
|
+
|
|
141
|
+
# Your own reference of the shipment. Mandatory for Extra@Home shipments;
|
|
142
|
+
# for E@H this is used to create your order number, so this should be unique
|
|
143
|
+
# for each request.
|
|
144
|
+
# @return [String]
|
|
145
|
+
attr_accessor :reference
|
|
146
|
+
|
|
147
|
+
# Additional reference of the collect order of the shipment
|
|
148
|
+
# @return [String]
|
|
149
|
+
attr_accessor :reference_collect
|
|
150
|
+
|
|
151
|
+
# Remark of the shipment.
|
|
152
|
+
# @return [String]
|
|
153
|
+
attr_accessor :remark
|
|
154
|
+
|
|
155
|
+
# Return barcode of the shipment. PostNL will provide you with a separate
|
|
156
|
+
# customer code specifically for generating the returnBarcode. Mandatory for
|
|
157
|
+
# Label in the Box (return label) shipments.
|
|
158
|
+
# @return [String]
|
|
159
|
+
attr_accessor :return_barcode
|
|
160
|
+
|
|
161
|
+
# Return reference of the shipment
|
|
162
|
+
# @return [String]
|
|
163
|
+
attr_accessor :return_reference
|
|
164
|
+
|
|
165
|
+
# Deprecated. ID of the chosen timeslot as returned by the timeslot
|
|
166
|
+
# webservice
|
|
167
|
+
# @return [String]
|
|
168
|
+
attr_accessor :timeslot_id
|
|
169
|
+
|
|
170
|
+
# Possibility to provide extra key-value pairs to the webservice. Not used
|
|
171
|
+
# at the moment.
|
|
172
|
+
# @return [Array[ExtraField]]
|
|
173
|
+
attr_accessor :extra_fields
|
|
174
|
+
|
|
175
|
+
# A mapping from model property names to API property names.
|
|
176
|
+
def self.names
|
|
177
|
+
@_hash = {} if @_hash.nil?
|
|
178
|
+
@_hash['addresses'] = 'Addresses'
|
|
179
|
+
@_hash['amounts'] = 'Amounts'
|
|
180
|
+
@_hash['barcode'] = 'Barcode'
|
|
181
|
+
@_hash['coding_text'] = 'CodingText'
|
|
182
|
+
@_hash['collection_time_stamp_start'] = 'CollectionTimeStampStart'
|
|
183
|
+
@_hash['collection_time_stamp_end'] = 'CollectionTimeStampEnd'
|
|
184
|
+
@_hash['contacts'] = 'Contacts'
|
|
185
|
+
@_hash['content'] = 'Content'
|
|
186
|
+
@_hash['cost_center'] = 'CostCenter'
|
|
187
|
+
@_hash['customer_order_number'] = 'CustomerOrderNumber'
|
|
188
|
+
@_hash['customs'] = 'Customs'
|
|
189
|
+
@_hash['delivery_address'] = 'DeliveryAddress'
|
|
190
|
+
@_hash['delivery_date'] = 'DeliveryDate'
|
|
191
|
+
@_hash['dimension'] = 'Dimension'
|
|
192
|
+
@_hash['down_partner_barcode'] = 'DownPartnerBarcode'
|
|
193
|
+
@_hash['down_partner_id'] = 'DownPartnerID'
|
|
194
|
+
@_hash['down_partner_location'] = 'DownPartnerLocation'
|
|
195
|
+
@_hash['groups'] = 'Groups'
|
|
196
|
+
@_hash['hazardous_material'] = 'HazardousMaterial'
|
|
197
|
+
@_hash['product_code_collect'] = 'ProductCodeCollect'
|
|
198
|
+
@_hash['product_code_delivery'] = 'ProductCodeDelivery'
|
|
199
|
+
@_hash['product_options'] = 'ProductOptions'
|
|
200
|
+
@_hash['receiver_date_of_birth'] = 'ReceiverDateOfBirth'
|
|
201
|
+
@_hash['reference'] = 'Reference'
|
|
202
|
+
@_hash['reference_collect'] = 'ReferenceCollect'
|
|
203
|
+
@_hash['remark'] = 'Remark'
|
|
204
|
+
@_hash['return_barcode'] = 'ReturnBarcode'
|
|
205
|
+
@_hash['return_reference'] = 'ReturnReference'
|
|
206
|
+
@_hash['timeslot_id'] = 'TimeslotID'
|
|
207
|
+
@_hash['extra_fields'] = 'ExtraFields'
|
|
208
|
+
@_hash
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# An array for optional fields
|
|
212
|
+
def self.optionals
|
|
213
|
+
%w[
|
|
214
|
+
amounts
|
|
215
|
+
coding_text
|
|
216
|
+
collection_time_stamp_start
|
|
217
|
+
collection_time_stamp_end
|
|
218
|
+
contacts
|
|
219
|
+
content
|
|
220
|
+
cost_center
|
|
221
|
+
customer_order_number
|
|
222
|
+
customs
|
|
223
|
+
delivery_address
|
|
224
|
+
delivery_date
|
|
225
|
+
down_partner_barcode
|
|
226
|
+
down_partner_id
|
|
227
|
+
down_partner_location
|
|
228
|
+
groups
|
|
229
|
+
hazardous_material
|
|
230
|
+
product_code_collect
|
|
231
|
+
product_options
|
|
232
|
+
receiver_date_of_birth
|
|
233
|
+
reference
|
|
234
|
+
reference_collect
|
|
235
|
+
remark
|
|
236
|
+
return_barcode
|
|
237
|
+
return_reference
|
|
238
|
+
timeslot_id
|
|
239
|
+
extra_fields
|
|
240
|
+
]
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# An array for nullable fields
|
|
244
|
+
def self.nullables
|
|
245
|
+
[]
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
def initialize(addresses = nil, barcode = nil, dimension = nil,
|
|
249
|
+
product_code_delivery = '3085', amounts = SKIP,
|
|
250
|
+
coding_text = SKIP, collection_time_stamp_start = SKIP,
|
|
251
|
+
collection_time_stamp_end = SKIP, contacts = SKIP,
|
|
252
|
+
content = SKIP, cost_center = SKIP,
|
|
253
|
+
customer_order_number = SKIP, customs = SKIP,
|
|
254
|
+
delivery_address = SKIP, delivery_date = SKIP,
|
|
255
|
+
down_partner_barcode = SKIP, down_partner_id = SKIP,
|
|
256
|
+
down_partner_location = SKIP, groups = SKIP,
|
|
257
|
+
hazardous_material = SKIP, product_code_collect = SKIP,
|
|
258
|
+
product_options = SKIP, receiver_date_of_birth = SKIP,
|
|
259
|
+
reference = SKIP, reference_collect = SKIP, remark = SKIP,
|
|
260
|
+
return_barcode = SKIP, return_reference = SKIP,
|
|
261
|
+
timeslot_id = SKIP, extra_fields = SKIP)
|
|
262
|
+
@addresses = addresses
|
|
263
|
+
@amounts = amounts unless amounts == SKIP
|
|
264
|
+
@barcode = barcode
|
|
265
|
+
@coding_text = coding_text unless coding_text == SKIP
|
|
266
|
+
unless collection_time_stamp_start == SKIP
|
|
267
|
+
@collection_time_stamp_start =
|
|
268
|
+
collection_time_stamp_start
|
|
269
|
+
end
|
|
270
|
+
unless collection_time_stamp_end == SKIP
|
|
271
|
+
@collection_time_stamp_end =
|
|
272
|
+
collection_time_stamp_end
|
|
273
|
+
end
|
|
274
|
+
@contacts = contacts unless contacts == SKIP
|
|
275
|
+
@content = content unless content == SKIP
|
|
276
|
+
@cost_center = cost_center unless cost_center == SKIP
|
|
277
|
+
@customer_order_number = customer_order_number unless customer_order_number == SKIP
|
|
278
|
+
@customs = customs unless customs == SKIP
|
|
279
|
+
@delivery_address = delivery_address unless delivery_address == SKIP
|
|
280
|
+
@delivery_date = delivery_date unless delivery_date == SKIP
|
|
281
|
+
@dimension = dimension
|
|
282
|
+
@down_partner_barcode = down_partner_barcode unless down_partner_barcode == SKIP
|
|
283
|
+
@down_partner_id = down_partner_id unless down_partner_id == SKIP
|
|
284
|
+
@down_partner_location = down_partner_location unless down_partner_location == SKIP
|
|
285
|
+
@groups = groups unless groups == SKIP
|
|
286
|
+
@hazardous_material = hazardous_material unless hazardous_material == SKIP
|
|
287
|
+
@product_code_collect = product_code_collect unless product_code_collect == SKIP
|
|
288
|
+
@product_code_delivery = product_code_delivery
|
|
289
|
+
@product_options = product_options unless product_options == SKIP
|
|
290
|
+
@receiver_date_of_birth = receiver_date_of_birth unless receiver_date_of_birth == SKIP
|
|
291
|
+
@reference = reference unless reference == SKIP
|
|
292
|
+
@reference_collect = reference_collect unless reference_collect == SKIP
|
|
293
|
+
@remark = remark unless remark == SKIP
|
|
294
|
+
@return_barcode = return_barcode unless return_barcode == SKIP
|
|
295
|
+
@return_reference = return_reference unless return_reference == SKIP
|
|
296
|
+
@timeslot_id = timeslot_id unless timeslot_id == SKIP
|
|
297
|
+
@extra_fields = extra_fields unless extra_fields == SKIP
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# Creates an instance of the object from a hash.
|
|
301
|
+
def self.from_hash(hash)
|
|
302
|
+
return nil unless hash
|
|
303
|
+
|
|
304
|
+
# Extract variables from the hash.
|
|
305
|
+
# Parameter is an array, so we need to iterate through it
|
|
306
|
+
addresses = nil
|
|
307
|
+
unless hash['Addresses'].nil?
|
|
308
|
+
addresses = []
|
|
309
|
+
hash['Addresses'].each do |structure|
|
|
310
|
+
addresses << (Address.from_hash(structure) if structure)
|
|
311
|
+
end
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
addresses = nil unless hash.key?('Addresses')
|
|
315
|
+
barcode = hash.key?('Barcode') ? hash['Barcode'] : nil
|
|
316
|
+
dimension = Dimension.from_hash(hash['Dimension']) if hash['Dimension']
|
|
317
|
+
product_code_delivery = hash['ProductCodeDelivery'] ||= '3085'
|
|
318
|
+
# Parameter is an array, so we need to iterate through it
|
|
319
|
+
amounts = nil
|
|
320
|
+
unless hash['Amounts'].nil?
|
|
321
|
+
amounts = []
|
|
322
|
+
hash['Amounts'].each do |structure|
|
|
323
|
+
amounts << (Amount.from_hash(structure) if structure)
|
|
324
|
+
end
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
amounts = SKIP unless hash.key?('Amounts')
|
|
328
|
+
coding_text = hash.key?('CodingText') ? hash['CodingText'] : SKIP
|
|
329
|
+
collection_time_stamp_start =
|
|
330
|
+
hash.key?('CollectionTimeStampStart') ? hash['CollectionTimeStampStart'] : SKIP
|
|
331
|
+
collection_time_stamp_end =
|
|
332
|
+
hash.key?('CollectionTimeStampEnd') ? hash['CollectionTimeStampEnd'] : SKIP
|
|
333
|
+
# Parameter is an array, so we need to iterate through it
|
|
334
|
+
contacts = nil
|
|
335
|
+
unless hash['Contacts'].nil?
|
|
336
|
+
contacts = []
|
|
337
|
+
hash['Contacts'].each do |structure|
|
|
338
|
+
contacts << (Contact.from_hash(structure) if structure)
|
|
339
|
+
end
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
contacts = SKIP unless hash.key?('Contacts')
|
|
343
|
+
content = hash.key?('Content') ? hash['Content'] : SKIP
|
|
344
|
+
cost_center = hash.key?('CostCenter') ? hash['CostCenter'] : SKIP
|
|
345
|
+
customer_order_number =
|
|
346
|
+
hash.key?('CustomerOrderNumber') ? hash['CustomerOrderNumber'] : SKIP
|
|
347
|
+
customs = CustomsLabellingAPI.from_hash(hash['Customs']) if hash['Customs']
|
|
348
|
+
delivery_address =
|
|
349
|
+
hash.key?('DeliveryAddress') ? hash['DeliveryAddress'] : SKIP
|
|
350
|
+
delivery_date = hash.key?('DeliveryDate') ? hash['DeliveryDate'] : SKIP
|
|
351
|
+
down_partner_barcode =
|
|
352
|
+
hash.key?('DownPartnerBarcode') ? hash['DownPartnerBarcode'] : SKIP
|
|
353
|
+
down_partner_id =
|
|
354
|
+
hash.key?('DownPartnerID') ? hash['DownPartnerID'] : SKIP
|
|
355
|
+
down_partner_location =
|
|
356
|
+
hash.key?('DownPartnerLocation') ? hash['DownPartnerLocation'] : SKIP
|
|
357
|
+
# Parameter is an array, so we need to iterate through it
|
|
358
|
+
groups = nil
|
|
359
|
+
unless hash['Groups'].nil?
|
|
360
|
+
groups = []
|
|
361
|
+
hash['Groups'].each do |structure|
|
|
362
|
+
groups << (Group.from_hash(structure) if structure)
|
|
363
|
+
end
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
groups = SKIP unless hash.key?('Groups')
|
|
367
|
+
# Parameter is an array, so we need to iterate through it
|
|
368
|
+
hazardous_material = nil
|
|
369
|
+
unless hash['HazardousMaterial'].nil?
|
|
370
|
+
hazardous_material = []
|
|
371
|
+
hash['HazardousMaterial'].each do |structure|
|
|
372
|
+
hazardous_material << (HazardousMaterial.from_hash(structure) if structure)
|
|
373
|
+
end
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
hazardous_material = SKIP unless hash.key?('HazardousMaterial')
|
|
377
|
+
product_code_collect =
|
|
378
|
+
hash.key?('ProductCodeCollect') ? hash['ProductCodeCollect'] : SKIP
|
|
379
|
+
# Parameter is an array, so we need to iterate through it
|
|
380
|
+
product_options = nil
|
|
381
|
+
unless hash['ProductOptions'].nil?
|
|
382
|
+
product_options = []
|
|
383
|
+
hash['ProductOptions'].each do |structure|
|
|
384
|
+
product_options << (ProductOption.from_hash(structure) if structure)
|
|
385
|
+
end
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
product_options = SKIP unless hash.key?('ProductOptions')
|
|
389
|
+
receiver_date_of_birth =
|
|
390
|
+
hash.key?('ReceiverDateOfBirth') ? hash['ReceiverDateOfBirth'] : SKIP
|
|
391
|
+
reference = hash.key?('Reference') ? hash['Reference'] : SKIP
|
|
392
|
+
reference_collect =
|
|
393
|
+
hash.key?('ReferenceCollect') ? hash['ReferenceCollect'] : SKIP
|
|
394
|
+
remark = hash.key?('Remark') ? hash['Remark'] : SKIP
|
|
395
|
+
return_barcode = hash.key?('ReturnBarcode') ? hash['ReturnBarcode'] : SKIP
|
|
396
|
+
return_reference =
|
|
397
|
+
hash.key?('ReturnReference') ? hash['ReturnReference'] : SKIP
|
|
398
|
+
timeslot_id = hash.key?('TimeslotID') ? hash['TimeslotID'] : SKIP
|
|
399
|
+
# Parameter is an array, so we need to iterate through it
|
|
400
|
+
extra_fields = nil
|
|
401
|
+
unless hash['ExtraFields'].nil?
|
|
402
|
+
extra_fields = []
|
|
403
|
+
hash['ExtraFields'].each do |structure|
|
|
404
|
+
extra_fields << (ExtraField.from_hash(structure) if structure)
|
|
405
|
+
end
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
extra_fields = SKIP unless hash.key?('ExtraFields')
|
|
409
|
+
|
|
410
|
+
# Create object from extracted values.
|
|
411
|
+
LabellingCustomerShipmentLabellingAPI.new(addresses,
|
|
412
|
+
barcode,
|
|
413
|
+
dimension,
|
|
414
|
+
product_code_delivery,
|
|
415
|
+
amounts,
|
|
416
|
+
coding_text,
|
|
417
|
+
collection_time_stamp_start,
|
|
418
|
+
collection_time_stamp_end,
|
|
419
|
+
contacts,
|
|
420
|
+
content,
|
|
421
|
+
cost_center,
|
|
422
|
+
customer_order_number,
|
|
423
|
+
customs,
|
|
424
|
+
delivery_address,
|
|
425
|
+
delivery_date,
|
|
426
|
+
down_partner_barcode,
|
|
427
|
+
down_partner_id,
|
|
428
|
+
down_partner_location,
|
|
429
|
+
groups,
|
|
430
|
+
hazardous_material,
|
|
431
|
+
product_code_collect,
|
|
432
|
+
product_options,
|
|
433
|
+
receiver_date_of_birth,
|
|
434
|
+
reference,
|
|
435
|
+
reference_collect,
|
|
436
|
+
remark,
|
|
437
|
+
return_barcode,
|
|
438
|
+
return_reference,
|
|
439
|
+
timeslot_id,
|
|
440
|
+
extra_fields)
|
|
441
|
+
end
|
|
442
|
+
|
|
443
|
+
# Provides a human-readable string representation of the object.
|
|
444
|
+
def to_s
|
|
445
|
+
class_name = self.class.name.split('::').last
|
|
446
|
+
"<#{class_name} addresses: #{@addresses}, amounts: #{@amounts}, barcode: #{@barcode},"\
|
|
447
|
+
" coding_text: #{@coding_text}, collection_time_stamp_start:"\
|
|
448
|
+
" #{@collection_time_stamp_start}, collection_time_stamp_end: #{@collection_time_stamp_end},"\
|
|
449
|
+
" contacts: #{@contacts}, content: #{@content}, cost_center: #{@cost_center},"\
|
|
450
|
+
" customer_order_number: #{@customer_order_number}, customs: #{@customs}, delivery_address:"\
|
|
451
|
+
" #{@delivery_address}, delivery_date: #{@delivery_date}, dimension: #{@dimension},"\
|
|
452
|
+
" down_partner_barcode: #{@down_partner_barcode}, down_partner_id: #{@down_partner_id},"\
|
|
453
|
+
" down_partner_location: #{@down_partner_location}, groups: #{@groups}, hazardous_material:"\
|
|
454
|
+
" #{@hazardous_material}, product_code_collect: #{@product_code_collect},"\
|
|
455
|
+
" product_code_delivery: #{@product_code_delivery}, product_options: #{@product_options},"\
|
|
456
|
+
" receiver_date_of_birth: #{@receiver_date_of_birth}, reference: #{@reference},"\
|
|
457
|
+
" reference_collect: #{@reference_collect}, remark: #{@remark}, return_barcode:"\
|
|
458
|
+
" #{@return_barcode}, return_reference: #{@return_reference}, timeslot_id: #{@timeslot_id},"\
|
|
459
|
+
" extra_fields: #{@extra_fields}>"
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
463
|
+
def inspect
|
|
464
|
+
class_name = self.class.name.split('::').last
|
|
465
|
+
"<#{class_name} addresses: #{@addresses.inspect}, amounts: #{@amounts.inspect}, barcode:"\
|
|
466
|
+
" #{@barcode.inspect}, coding_text: #{@coding_text.inspect}, collection_time_stamp_start:"\
|
|
467
|
+
" #{@collection_time_stamp_start.inspect}, collection_time_stamp_end:"\
|
|
468
|
+
" #{@collection_time_stamp_end.inspect}, contacts: #{@contacts.inspect}, content:"\
|
|
469
|
+
" #{@content.inspect}, cost_center: #{@cost_center.inspect}, customer_order_number:"\
|
|
470
|
+
" #{@customer_order_number.inspect}, customs: #{@customs.inspect}, delivery_address:"\
|
|
471
|
+
" #{@delivery_address.inspect}, delivery_date: #{@delivery_date.inspect}, dimension:"\
|
|
472
|
+
" #{@dimension.inspect}, down_partner_barcode: #{@down_partner_barcode.inspect},"\
|
|
473
|
+
" down_partner_id: #{@down_partner_id.inspect}, down_partner_location:"\
|
|
474
|
+
" #{@down_partner_location.inspect}, groups: #{@groups.inspect}, hazardous_material:"\
|
|
475
|
+
" #{@hazardous_material.inspect}, product_code_collect: #{@product_code_collect.inspect},"\
|
|
476
|
+
" product_code_delivery: #{@product_code_delivery.inspect}, product_options:"\
|
|
477
|
+
" #{@product_options.inspect}, receiver_date_of_birth: #{@receiver_date_of_birth.inspect},"\
|
|
478
|
+
" reference: #{@reference.inspect}, reference_collect: #{@reference_collect.inspect},"\
|
|
479
|
+
" remark: #{@remark.inspect}, return_barcode: #{@return_barcode.inspect}, return_reference:"\
|
|
480
|
+
" #{@return_reference.inspect}, timeslot_id: #{@timeslot_id.inspect}, extra_fields:"\
|
|
481
|
+
" #{@extra_fields.inspect}>"
|
|
482
|
+
end
|
|
483
|
+
end
|
|
484
|
+
end
|
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
# LabellingCustomsContent Model.
|
|
8
|
+
class LabellingCustomsContent < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Description of goods
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :description
|
|
15
|
+
|
|
16
|
+
# Fill in the total of the item(s)
|
|
17
|
+
# @return [Integer]
|
|
18
|
+
attr_accessor :quantity
|
|
19
|
+
|
|
20
|
+
# Net weight of goods in gram(gr)
|
|
21
|
+
# @return [Integer]
|
|
22
|
+
attr_accessor :weight
|
|
23
|
+
|
|
24
|
+
# Commercial (customs) value of goods. Fill in the value of the item(s).
|
|
25
|
+
# @return [Float]
|
|
26
|
+
attr_accessor :value
|
|
27
|
+
|
|
28
|
+
# Specify every item with the standard HS commodity code (HS-code), [more
|
|
29
|
+
# information](https://tarief.douane.nl/ite-tariff-public/#/home)
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :hs_tariff_nr
|
|
32
|
+
|
|
33
|
+
# Fill in the code of the country where the item was produced (ISO-code),
|
|
34
|
+
# [more information](https://www.iso.org/home.html)
|
|
35
|
+
# @return [String]
|
|
36
|
+
attr_accessor :country_of_origin
|
|
37
|
+
|
|
38
|
+
# A mapping from model property names to API property names.
|
|
39
|
+
def self.names
|
|
40
|
+
@_hash = {} if @_hash.nil?
|
|
41
|
+
@_hash['description'] = 'Description'
|
|
42
|
+
@_hash['quantity'] = 'Quantity'
|
|
43
|
+
@_hash['weight'] = 'Weight'
|
|
44
|
+
@_hash['value'] = 'Value'
|
|
45
|
+
@_hash['hs_tariff_nr'] = 'HSTariffNr'
|
|
46
|
+
@_hash['country_of_origin'] = 'CountryOfOrigin'
|
|
47
|
+
@_hash
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# An array for optional fields
|
|
51
|
+
def self.optionals
|
|
52
|
+
%w[
|
|
53
|
+
hs_tariff_nr
|
|
54
|
+
country_of_origin
|
|
55
|
+
]
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# An array for nullable fields
|
|
59
|
+
def self.nullables
|
|
60
|
+
[]
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def initialize(description = nil, quantity = nil, weight = nil, value = nil,
|
|
64
|
+
hs_tariff_nr = SKIP, country_of_origin = SKIP)
|
|
65
|
+
@description = description
|
|
66
|
+
@quantity = quantity
|
|
67
|
+
@weight = weight
|
|
68
|
+
@value = value
|
|
69
|
+
@hs_tariff_nr = hs_tariff_nr unless hs_tariff_nr == SKIP
|
|
70
|
+
@country_of_origin = country_of_origin unless country_of_origin == SKIP
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Creates an instance of the object from a hash.
|
|
74
|
+
def self.from_hash(hash)
|
|
75
|
+
return nil unless hash
|
|
76
|
+
|
|
77
|
+
# Extract variables from the hash.
|
|
78
|
+
description = hash.key?('Description') ? hash['Description'] : nil
|
|
79
|
+
quantity = hash.key?('Quantity') ? hash['Quantity'] : nil
|
|
80
|
+
weight = hash.key?('Weight') ? hash['Weight'] : nil
|
|
81
|
+
value = hash.key?('Value') ? hash['Value'] : nil
|
|
82
|
+
hs_tariff_nr = hash.key?('HSTariffNr') ? hash['HSTariffNr'] : SKIP
|
|
83
|
+
country_of_origin =
|
|
84
|
+
hash.key?('CountryOfOrigin') ? hash['CountryOfOrigin'] : SKIP
|
|
85
|
+
|
|
86
|
+
# Create object from extracted values.
|
|
87
|
+
LabellingCustomsContent.new(description,
|
|
88
|
+
quantity,
|
|
89
|
+
weight,
|
|
90
|
+
value,
|
|
91
|
+
hs_tariff_nr,
|
|
92
|
+
country_of_origin)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Provides a human-readable string representation of the object.
|
|
96
|
+
def to_s
|
|
97
|
+
class_name = self.class.name.split('::').last
|
|
98
|
+
"<#{class_name} description: #{@description}, quantity: #{@quantity}, weight: #{@weight},"\
|
|
99
|
+
" value: #{@value}, hs_tariff_nr: #{@hs_tariff_nr}, country_of_origin:"\
|
|
100
|
+
" #{@country_of_origin}>"
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
104
|
+
def inspect
|
|
105
|
+
class_name = self.class.name.split('::').last
|
|
106
|
+
"<#{class_name} description: #{@description.inspect}, quantity: #{@quantity.inspect},"\
|
|
107
|
+
" weight: #{@weight.inspect}, value: #{@value.inspect}, hs_tariff_nr:"\
|
|
108
|
+
" #{@hs_tariff_nr.inspect}, country_of_origin: #{@country_of_origin.inspect}>"
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
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
|
+
# LabellingError Model.
|
|
8
|
+
class LabellingError < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The error reason
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :error
|
|
15
|
+
|
|
16
|
+
# The error code
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :code
|
|
19
|
+
|
|
20
|
+
# The description of the error
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :description
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['error'] = 'Error'
|
|
28
|
+
@_hash['code'] = 'Code'
|
|
29
|
+
@_hash['description'] = 'Description'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
error
|
|
37
|
+
code
|
|
38
|
+
description
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
[]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def initialize(error = SKIP, code = SKIP, description = SKIP)
|
|
48
|
+
@error = error unless error == SKIP
|
|
49
|
+
@code = code unless code == SKIP
|
|
50
|
+
@description = description unless description == 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
|
+
error = hash.key?('Error') ? hash['Error'] : SKIP
|
|
59
|
+
code = hash.key?('Code') ? hash['Code'] : SKIP
|
|
60
|
+
description = hash.key?('Description') ? hash['Description'] : SKIP
|
|
61
|
+
|
|
62
|
+
# Create object from extracted values.
|
|
63
|
+
LabellingError.new(error,
|
|
64
|
+
code,
|
|
65
|
+
description)
|
|
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} error: #{@error}, code: #{@code}, description: #{@description}>"
|
|
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} error: #{@error.inspect}, code: #{@code.inspect}, description:"\
|
|
78
|
+
" #{@description.inspect}>"
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|