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,123 @@
|
|
|
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
|
+
# LabellingCustomer Model.
|
|
8
|
+
class LabellingCustomer < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [CustomerAddress]
|
|
14
|
+
attr_accessor :address
|
|
15
|
+
|
|
16
|
+
# Code of delivery location at PostNL Pakketten
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :collection_location
|
|
19
|
+
|
|
20
|
+
# Name of customer contact person
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :contact_person
|
|
23
|
+
|
|
24
|
+
# Customer code as known at PostNL Pakketten
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :customer_code
|
|
27
|
+
|
|
28
|
+
# Name of customer contact person
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :customer_number
|
|
31
|
+
|
|
32
|
+
# E-mail address of the customer
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :email
|
|
35
|
+
|
|
36
|
+
# Customer name
|
|
37
|
+
# @return [String]
|
|
38
|
+
attr_accessor :name
|
|
39
|
+
|
|
40
|
+
# A mapping from model property names to API property names.
|
|
41
|
+
def self.names
|
|
42
|
+
@_hash = {} if @_hash.nil?
|
|
43
|
+
@_hash['address'] = 'Address'
|
|
44
|
+
@_hash['collection_location'] = 'CollectionLocation'
|
|
45
|
+
@_hash['contact_person'] = 'ContactPerson'
|
|
46
|
+
@_hash['customer_code'] = 'CustomerCode'
|
|
47
|
+
@_hash['customer_number'] = 'CustomerNumber'
|
|
48
|
+
@_hash['email'] = 'Email'
|
|
49
|
+
@_hash['name'] = 'Name'
|
|
50
|
+
@_hash
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# An array for optional fields
|
|
54
|
+
def self.optionals
|
|
55
|
+
%w[
|
|
56
|
+
address
|
|
57
|
+
collection_location
|
|
58
|
+
contact_person
|
|
59
|
+
email
|
|
60
|
+
name
|
|
61
|
+
]
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# An array for nullable fields
|
|
65
|
+
def self.nullables
|
|
66
|
+
[]
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def initialize(customer_code = nil, customer_number = nil, address = SKIP,
|
|
70
|
+
collection_location = SKIP, contact_person = SKIP,
|
|
71
|
+
email = SKIP, name = SKIP)
|
|
72
|
+
@address = address unless address == SKIP
|
|
73
|
+
@collection_location = collection_location unless collection_location == SKIP
|
|
74
|
+
@contact_person = contact_person unless contact_person == SKIP
|
|
75
|
+
@customer_code = customer_code
|
|
76
|
+
@customer_number = customer_number
|
|
77
|
+
@email = email unless email == SKIP
|
|
78
|
+
@name = name unless name == SKIP
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Creates an instance of the object from a hash.
|
|
82
|
+
def self.from_hash(hash)
|
|
83
|
+
return nil unless hash
|
|
84
|
+
|
|
85
|
+
# Extract variables from the hash.
|
|
86
|
+
customer_code = hash.key?('CustomerCode') ? hash['CustomerCode'] : nil
|
|
87
|
+
customer_number =
|
|
88
|
+
hash.key?('CustomerNumber') ? hash['CustomerNumber'] : nil
|
|
89
|
+
address = CustomerAddress.from_hash(hash['Address']) if hash['Address']
|
|
90
|
+
collection_location =
|
|
91
|
+
hash.key?('CollectionLocation') ? hash['CollectionLocation'] : SKIP
|
|
92
|
+
contact_person = hash.key?('ContactPerson') ? hash['ContactPerson'] : SKIP
|
|
93
|
+
email = hash.key?('Email') ? hash['Email'] : SKIP
|
|
94
|
+
name = hash.key?('Name') ? hash['Name'] : SKIP
|
|
95
|
+
|
|
96
|
+
# Create object from extracted values.
|
|
97
|
+
LabellingCustomer.new(customer_code,
|
|
98
|
+
customer_number,
|
|
99
|
+
address,
|
|
100
|
+
collection_location,
|
|
101
|
+
contact_person,
|
|
102
|
+
email,
|
|
103
|
+
name)
|
|
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} address: #{@address}, collection_location: #{@collection_location},"\
|
|
110
|
+
" contact_person: #{@contact_person}, customer_code: #{@customer_code}, customer_number:"\
|
|
111
|
+
" #{@customer_number}, email: #{@email}, name: #{@name}>"
|
|
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} address: #{@address.inspect}, collection_location:"\
|
|
118
|
+
" #{@collection_location.inspect}, contact_person: #{@contact_person.inspect},"\
|
|
119
|
+
" customer_code: #{@customer_code.inspect}, customer_number: #{@customer_number.inspect},"\
|
|
120
|
+
" email: #{@email.inspect}, name: #{@name.inspect}>"
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
# LabellingCustomerLabellingAPI Model.
|
|
8
|
+
class LabellingCustomerLabellingAPI < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [CustomerAddress]
|
|
14
|
+
attr_accessor :address
|
|
15
|
+
|
|
16
|
+
# Code of delivery location at PostNL Pakketten
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :collection_location
|
|
19
|
+
|
|
20
|
+
# Name of customer contact person
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :contact_person
|
|
23
|
+
|
|
24
|
+
# Customer code as known at PostNL Pakketten
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :customer_code
|
|
27
|
+
|
|
28
|
+
# Name of customer contact person
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :customer_number
|
|
31
|
+
|
|
32
|
+
# E-mail address of the customer
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :email
|
|
35
|
+
|
|
36
|
+
# Customer name
|
|
37
|
+
# @return [String]
|
|
38
|
+
attr_accessor :name
|
|
39
|
+
|
|
40
|
+
# A mapping from model property names to API property names.
|
|
41
|
+
def self.names
|
|
42
|
+
@_hash = {} if @_hash.nil?
|
|
43
|
+
@_hash['address'] = 'Address'
|
|
44
|
+
@_hash['collection_location'] = 'CollectionLocation'
|
|
45
|
+
@_hash['contact_person'] = 'ContactPerson'
|
|
46
|
+
@_hash['customer_code'] = 'CustomerCode'
|
|
47
|
+
@_hash['customer_number'] = 'CustomerNumber'
|
|
48
|
+
@_hash['email'] = 'Email'
|
|
49
|
+
@_hash['name'] = 'Name'
|
|
50
|
+
@_hash
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# An array for optional fields
|
|
54
|
+
def self.optionals
|
|
55
|
+
%w[
|
|
56
|
+
address
|
|
57
|
+
collection_location
|
|
58
|
+
contact_person
|
|
59
|
+
email
|
|
60
|
+
name
|
|
61
|
+
]
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# An array for nullable fields
|
|
65
|
+
def self.nullables
|
|
66
|
+
[]
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def initialize(customer_code = nil, customer_number = nil, address = SKIP,
|
|
70
|
+
collection_location = SKIP, contact_person = SKIP,
|
|
71
|
+
email = SKIP, name = SKIP)
|
|
72
|
+
@address = address unless address == SKIP
|
|
73
|
+
@collection_location = collection_location unless collection_location == SKIP
|
|
74
|
+
@contact_person = contact_person unless contact_person == SKIP
|
|
75
|
+
@customer_code = customer_code
|
|
76
|
+
@customer_number = customer_number
|
|
77
|
+
@email = email unless email == SKIP
|
|
78
|
+
@name = name unless name == SKIP
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Creates an instance of the object from a hash.
|
|
82
|
+
def self.from_hash(hash)
|
|
83
|
+
return nil unless hash
|
|
84
|
+
|
|
85
|
+
# Extract variables from the hash.
|
|
86
|
+
customer_code = hash.key?('CustomerCode') ? hash['CustomerCode'] : nil
|
|
87
|
+
customer_number =
|
|
88
|
+
hash.key?('CustomerNumber') ? hash['CustomerNumber'] : nil
|
|
89
|
+
address = CustomerAddress.from_hash(hash['Address']) if hash['Address']
|
|
90
|
+
collection_location =
|
|
91
|
+
hash.key?('CollectionLocation') ? hash['CollectionLocation'] : SKIP
|
|
92
|
+
contact_person = hash.key?('ContactPerson') ? hash['ContactPerson'] : SKIP
|
|
93
|
+
email = hash.key?('Email') ? hash['Email'] : SKIP
|
|
94
|
+
name = hash.key?('Name') ? hash['Name'] : SKIP
|
|
95
|
+
|
|
96
|
+
# Create object from extracted values.
|
|
97
|
+
LabellingCustomerLabellingAPI.new(customer_code,
|
|
98
|
+
customer_number,
|
|
99
|
+
address,
|
|
100
|
+
collection_location,
|
|
101
|
+
contact_person,
|
|
102
|
+
email,
|
|
103
|
+
name)
|
|
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} address: #{@address}, collection_location: #{@collection_location},"\
|
|
110
|
+
" contact_person: #{@contact_person}, customer_code: #{@customer_code}, customer_number:"\
|
|
111
|
+
" #{@customer_number}, email: #{@email}, name: #{@name}>"
|
|
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} address: #{@address.inspect}, collection_location:"\
|
|
118
|
+
" #{@collection_location.inspect}, contact_person: #{@contact_person.inspect},"\
|
|
119
|
+
" customer_code: #{@customer_code.inspect}, customer_number: #{@customer_number.inspect},"\
|
|
120
|
+
" email: #{@email.inspect}, name: #{@name.inspect}>"
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# postnl_ecommerce
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for PostNL by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module PostnlEcommerce
|
|
7
|
+
# LabellingCustomerMessage Model.
|
|
8
|
+
class LabellingCustomerMessage < 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
|
+
# Printer type that will be used to process the label, e.g. Zebra printer or
|
|
21
|
+
# PDF See [Printer
|
|
22
|
+
# types](https://developer.postnl.nl/docs/#/http/reference-data/reference-co
|
|
23
|
+
# des/printer-types) for the available printer types.
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :printertype
|
|
26
|
+
|
|
27
|
+
# A mapping from model property names to API property names.
|
|
28
|
+
def self.names
|
|
29
|
+
@_hash = {} if @_hash.nil?
|
|
30
|
+
@_hash['message_id'] = 'MessageID'
|
|
31
|
+
@_hash['message_time_stamp'] = 'MessageTimeStamp'
|
|
32
|
+
@_hash['printertype'] = 'Printertype'
|
|
33
|
+
@_hash
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for optional fields
|
|
37
|
+
def self.optionals
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# An array for nullable fields
|
|
42
|
+
def self.nullables
|
|
43
|
+
[]
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def initialize(message_id = nil, message_time_stamp = nil,
|
|
47
|
+
printertype = nil)
|
|
48
|
+
@message_id = message_id
|
|
49
|
+
@message_time_stamp = message_time_stamp
|
|
50
|
+
@printertype = printertype
|
|
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
|
+
message_id = hash.key?('MessageID') ? hash['MessageID'] : nil
|
|
59
|
+
message_time_stamp =
|
|
60
|
+
hash.key?('MessageTimeStamp') ? hash['MessageTimeStamp'] : nil
|
|
61
|
+
printertype = hash.key?('Printertype') ? hash['Printertype'] : nil
|
|
62
|
+
|
|
63
|
+
# Create object from extracted values.
|
|
64
|
+
LabellingCustomerMessage.new(message_id,
|
|
65
|
+
message_time_stamp,
|
|
66
|
+
printertype)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Provides a human-readable string representation of the object.
|
|
70
|
+
def to_s
|
|
71
|
+
class_name = self.class.name.split('::').last
|
|
72
|
+
"<#{class_name} message_id: #{@message_id}, message_time_stamp: #{@message_time_stamp},"\
|
|
73
|
+
" printertype: #{@printertype}>"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
77
|
+
def inspect
|
|
78
|
+
class_name = self.class.name.split('::').last
|
|
79
|
+
"<#{class_name} message_id: #{@message_id.inspect}, message_time_stamp:"\
|
|
80
|
+
" #{@message_time_stamp.inspect}, printertype: #{@printertype.inspect}>"
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|