digital-payments-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 (66) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +85 -0
  4. data/lib/shell_ev/api_helper.rb +10 -0
  5. data/lib/shell_ev/client.rb +86 -0
  6. data/lib/shell_ev/configuration.rb +104 -0
  7. data/lib/shell_ev/controllers/base_controller.rb +66 -0
  8. data/lib/shell_ev/controllers/digital_payment_enablement_controller.rb +56 -0
  9. data/lib/shell_ev/controllers/fueling_controller.rb +126 -0
  10. data/lib/shell_ev/controllers/partner_notification_controller.rb +95 -0
  11. data/lib/shell_ev/controllers/shell_api_platform_security_authentication_controller.rb +44 -0
  12. data/lib/shell_ev/controllers/station_locator_controller.rb +76 -0
  13. data/lib/shell_ev/exceptions/access_token_error_exception.rb +37 -0
  14. data/lib/shell_ev/exceptions/api_exception.rb +10 -0
  15. data/lib/shell_ev/exceptions/cancel_fueling_error_response_error_exception.rb +64 -0
  16. data/lib/shell_ev/exceptions/mpp_acces_token_error_response_exception.rb +44 -0
  17. data/lib/shell_ev/exceptions/payment_enablement_error_response_exception.rb +37 -0
  18. data/lib/shell_ev/exceptions/station_locator_bad_request_exception.rb +38 -0
  19. data/lib/shell_ev/exceptions/station_locator_forbidden_exception.rb +38 -0
  20. data/lib/shell_ev/exceptions/station_locator_internal_server_error_exception.rb +38 -0
  21. data/lib/shell_ev/exceptions/station_locator_not_found_exception.rb +38 -0
  22. data/lib/shell_ev/exceptions/station_locator_unauthorized_exception.rb +38 -0
  23. data/lib/shell_ev/http/auth/mpp_token.rb +42 -0
  24. data/lib/shell_ev/http/auth/o_auth_token_post.rb +44 -0
  25. data/lib/shell_ev/http/http_call_back.rb +10 -0
  26. data/lib/shell_ev/http/http_method_enum.rb +10 -0
  27. data/lib/shell_ev/http/http_request.rb +10 -0
  28. data/lib/shell_ev/http/http_response.rb +10 -0
  29. data/lib/shell_ev/models/access_token_response.rb +71 -0
  30. data/lib/shell_ev/models/around_location_array.rb +109 -0
  31. data/lib/shell_ev/models/around_location_array_data_items.rb +242 -0
  32. data/lib/shell_ev/models/around_location_array_data_items_loc.rb +99 -0
  33. data/lib/shell_ev/models/around_location_array_data_items_opening_hours_items.rb +148 -0
  34. data/lib/shell_ev/models/base_model.rb +62 -0
  35. data/lib/shell_ev/models/cancel_fueling_error_response.rb +92 -0
  36. data/lib/shell_ev/models/cancel_fueling_request.rb +61 -0
  37. data/lib/shell_ev/models/collecting_company.rb +50 -0
  38. data/lib/shell_ev/models/fault_response.rb +50 -0
  39. data/lib/shell_ev/models/fault_response_fault.rb +60 -0
  40. data/lib/shell_ev/models/fault_response_fault_detail.rb +50 -0
  41. data/lib/shell_ev/models/finalise_fueling_request.rb +181 -0
  42. data/lib/shell_ev/models/finalise_fueling_request_payment.rb +71 -0
  43. data/lib/shell_ev/models/finalise_fueling_request_products_items.rb +70 -0
  44. data/lib/shell_ev/models/loyalty_details.rb +59 -0
  45. data/lib/shell_ev/models/mobile_payment_registration_request.rb +134 -0
  46. data/lib/shell_ev/models/mpp_acces_token_response.rb +81 -0
  47. data/lib/shell_ev/models/mpp_error.rb +94 -0
  48. data/lib/shell_ev/models/mpp_token_request_body.rb +73 -0
  49. data/lib/shell_ev/models/oauth_token_post_request_body.rb +73 -0
  50. data/lib/shell_ev/models/partner_token_request_body.rb +73 -0
  51. data/lib/shell_ev/models/payment_details_items.rb +78 -0
  52. data/lib/shell_ev/models/payment_enablement_response.rb +48 -0
  53. data/lib/shell_ev/models/payment_properties.rb +169 -0
  54. data/lib/shell_ev/models/prepare_fueling_request.rb +183 -0
  55. data/lib/shell_ev/models/prepare_fueling_request_device_details_items.rb +95 -0
  56. data/lib/shell_ev/models/prepare_fueling_response.rb +66 -0
  57. data/lib/shell_ev/utilities/date_time_helper.rb +11 -0
  58. data/lib/shell_ev/utilities/file_wrapper.rb +16 -0
  59. data/lib/shell_ev.rb +85 -0
  60. data/test/controllers/controller_test_base.rb +29 -0
  61. data/test/controllers/test_fueling_controller.rb +61 -0
  62. data/test/controllers/test_partner_notification_controller.rb +60 -0
  63. data/test/controllers/test_shell_api_platform_security_authentication_controller.rb +36 -0
  64. data/test/controllers/test_station_locator_controller.rb +44 -0
  65. data/test/http_response_catcher.rb +19 -0
  66. metadata +185 -0
@@ -0,0 +1,71 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ShellEv
7
+ # AccessTokenResponse Model.
8
+ class AccessTokenResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # It is the token used for the requests that required an authenticated user.
13
+ # This will be used for all the callback URLs.
14
+ # @return [String]
15
+ attr_accessor :access_token
16
+
17
+ # validity of the access token in seconds
18
+ # @return [String]
19
+ attr_accessor :expires_in
20
+
21
+ # Type of token provided
22
+ # @return [String]
23
+ attr_accessor :token_type
24
+
25
+ # A mapping from model property names to API property names.
26
+ def self.names
27
+ @_hash = {} if @_hash.nil?
28
+ @_hash['access_token'] = 'access_token'
29
+ @_hash['expires_in'] = 'expires_in'
30
+ @_hash['token_type'] = 'token_type'
31
+ @_hash
32
+ end
33
+
34
+ # An array for optional fields
35
+ def self.optionals
36
+ %w[
37
+ access_token
38
+ expires_in
39
+ token_type
40
+ ]
41
+ end
42
+
43
+ # An array for nullable fields
44
+ def self.nullables
45
+ []
46
+ end
47
+
48
+ def initialize(access_token = SKIP,
49
+ expires_in = SKIP,
50
+ token_type = 'Bearer')
51
+ @access_token = access_token unless access_token == SKIP
52
+ @expires_in = expires_in unless expires_in == SKIP
53
+ @token_type = token_type unless token_type == SKIP
54
+ end
55
+
56
+ # Creates an instance of the object from a hash.
57
+ def self.from_hash(hash)
58
+ return nil unless hash
59
+
60
+ # Extract variables from the hash.
61
+ access_token = hash.key?('access_token') ? hash['access_token'] : SKIP
62
+ expires_in = hash.key?('expires_in') ? hash['expires_in'] : SKIP
63
+ token_type = hash['token_type'] ||= 'Bearer'
64
+
65
+ # Create object from extracted values.
66
+ AccessTokenResponse.new(access_token,
67
+ expires_in,
68
+ token_type)
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,109 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ShellEv
7
+ # #Amenities The table below lists all the different types of amenities: |
8
+ # Code | Description | ------- | --------
9
+ # | 1 | ATM
10
+ # | 2 | Water Closet or Toilet | 3 |
11
+ # Lottery | 4 | Select
12
+ # | 5 | Shop
13
+ # | 6 | Truck Friendly | 11 | Bottled
14
+ # Gas | 12 | PB Gas
15
+ # | 13 | Disabled Facilities | 14 |
16
+ # Credit card | 16 | Loyalty Card (AIr
17
+ # Miles for NL) | 17 | WiFi
18
+ # | 19 | Air & Water | 20 | Hoover /
19
+ # Vacuum | 21 | Pay at pump
20
+ # | 24 | Truck Only | 25 |
21
+ # Car Wash | 26 | Service Bay
22
+ # | 902 | External Card Reader |
23
+ # 903 | Bakery Shop | 907 | Grocery
24
+ # rewards / Partner Loyalty Accepted | 908 | Food Offerings | 914 |
25
+ # Shower | 915 | Vehicle identity system | 917 | Quick-lube | 918
26
+ # | High Speed Diesel | 919 | Type Of Parking | 920 | Mobile
27
+ # Payment | 921 | Disability Assistance | 922 | 24 Hour Fuel Service
28
+ # | 923 | Mobile Loyalty | 1001 | ATM-IN | 1002 | ATM-OUT | 1401
29
+ # | Credit card - Visa | 1402 | Credit card - Mastercard | 1403 |
30
+ # Credit card - American Express | 1404 | Credit card - Diners Club |
31
+ # 1405 | Credit card - General | 1505 | Shellcard | 1506 |
32
+ # Shellcard | 1507 | Partner card | 1601 | Club smart card | 1602
33
+ # | Gold Club smart card | 2001 | Water Closet or Toilet - standard |
34
+ # 2002 | Water Closet or Toilet - child | 2501 | Conveyor | 2502 |
35
+ # Jet | 2503 | Manual | 2504 | Rollover | 2505 | Rollover & Jet |
36
+ # 2506 | Conveyor & Jet | 5001 | Costa Express | 5002 | Deli2Go |
37
+ # 5003 | 2theloo | 5011 | Tim Hortons | 5012 | Starbucks | 5013
38
+ # | Waitrose | 5014 | Coca-Cola Freestyle | 9051 | Fleet card - DKV |
39
+ # 9052 | Fleet card - UTA | 9053 | Fleet card - Esso | 9054 | Fleet
40
+ # card - Eni | 9055 | Fleet card | 9061 | austrian highway sticker |
41
+ # 9062 | Czech highway sticker | 9063 | Slovak highway sticker | 9064
42
+ # | hungarian highway sticker | 9081 | Snack Food/Quick Food | 9082
43
+ # | Sandwich | 9083 | Burger | 9084 | Pizza | 9085 | Hot Food |
44
+ # 9086 | Cafeteria | 9087 | Restaurant | 9088 | Others | 9101 |
45
+ # Telepass Premium | 9102 | Sconti BancoPosta | 9103 | Fuel discount
46
+ # | 9111 | Full service /Attended Service | 9112 | Self service | 9114
47
+ # | Unmanned | 9161 | Ido ticket | 9163 | Toll smart card/Etoll |
48
+ # 9191 | Parking Lanes | 9192 | Guarded parking | 9193 | Truck
49
+ # Parking | 90735 | Navigator Fleet Loyalty Discount | 7077 | CRT Shell
50
+ # Card Accepted | 7022 | Fleet Shell Card Accepted | 100001 | Single
51
+ # Network Card Accepted | 100002 | National Network Card Accepted | 5015
52
+ # | Third party rental\:Pizza Hut Express | 5016 | Third party rental\:
53
+ # Budgens | 5017 | Third party rental\: Deli Cafe | 5018 | Third party
54
+ # rental\: Amazon Locker | 5019 | Third party rental\: Deli by Shell |
55
+ # 9204 | Car Wash MPay | 9205 | PayTM | 9241 | AdBlue Pump Truck |
56
+ # 9242 | AdBlue Pump Passenger vehicles | 9243 | AdBlue Packed Product
57
+ # | 999909 | Shop\: Spar Express | 999910 | Shop\: Migrolino Error Codes
58
+ # All request will return a 200 HTTP Response, but the Response will include
59
+ # details of an error if/when an error occurs
60
+ class AroundLocationArray < BaseModel
61
+ SKIP = Object.new
62
+ private_constant :SKIP
63
+
64
+ # An array of station objects
65
+ # @return [Array[AroundLocationArrayDataItems]]
66
+ attr_accessor :data
67
+
68
+ # A mapping from model property names to API property names.
69
+ def self.names
70
+ @_hash = {} if @_hash.nil?
71
+ @_hash['data'] = 'data'
72
+ @_hash
73
+ end
74
+
75
+ # An array for optional fields
76
+ def self.optionals
77
+ []
78
+ end
79
+
80
+ # An array for nullable fields
81
+ def self.nullables
82
+ []
83
+ end
84
+
85
+ def initialize(data = nil)
86
+ @data = data
87
+ end
88
+
89
+ # Creates an instance of the object from a hash.
90
+ def self.from_hash(hash)
91
+ return nil unless hash
92
+
93
+ # Extract variables from the hash.
94
+ # Parameter is an array, so we need to iterate through it
95
+ data = nil
96
+ unless hash['data'].nil?
97
+ data = []
98
+ hash['data'].each do |structure|
99
+ data << (AroundLocationArrayDataItems.from_hash(structure) if structure)
100
+ end
101
+ end
102
+
103
+ data = nil unless hash.key?('data')
104
+
105
+ # Create object from extracted values.
106
+ AroundLocationArray.new(data)
107
+ end
108
+ end
109
+ end
@@ -0,0 +1,242 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ShellEv
7
+ # AroundLocationArrayDataItems Model.
8
+ class AroundLocationArrayDataItems < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The station’s unique site identifier – this must be ignored
13
+ # @return [String]
14
+ attr_accessor :id
15
+
16
+ # All fuel stations are of at least one Type, indicating whether it is
17
+ # Shell-branded or not, and if the
18
+ # station can be used by trucks. Note that a station can have more than one
19
+ # Type (e.g. Shell retail
20
+ # sites (Type=0) can also be truck friendly (Type=2)).
21
+ # Type values are as follows:
22
+ # * 0 = Shell owned/branded stations that are not also Type=2 or Type=3
23
+ # * 1 = Partner stations accepting Shell Card
24
+ # * 2 = Shell owned/branded stations that are truck friendly but not Type=3
25
+ # * 3 = Shell owned/branded stations that are truck only
26
+ # @return [Integer]
27
+ attr_accessor :type
28
+
29
+ # The name of the site
30
+ # @return [String]
31
+ attr_accessor :name
32
+
33
+ # The side address as a concatenation of address information
34
+ # @return [String]
35
+ attr_accessor :addr
36
+
37
+ # The site’s latitude
38
+ # @return [Float]
39
+ attr_accessor :lat
40
+
41
+ # The site’s longitude
42
+ # @return [Float]
43
+ attr_accessor :lon
44
+
45
+ # An array of amenities available at the station (see above for complete
46
+ # list)
47
+ # @return [Array[Integer]]
48
+ attr_accessor :amen
49
+
50
+ # An array of fuels* available at the station.
51
+ # Global Product Group names:
52
+ # * 8 = CNG
53
+ # * 10 = Premium Gasoline
54
+ # * 11 = Premium Diesel
55
+ # * 12 = Fuelsave Midgrade Gasoline
56
+ # * 13 = Fuelsave Regular Diesel
57
+ # * 14 = Midgrade Gasoline
58
+ # * 15 = Low Octane gasoline
59
+ # * 16 = Regular Diesel
60
+ # * 17 = Autogas LPG
61
+ # * 18 = Auto/RV Propane
62
+ # * 20 = Hydrogen
63
+ # * 21 = Kerosene
64
+ # * 22 = Super Premium Gasoline
65
+ # * 23 = Unleaded Super
66
+ # * 24 = Truck Diesel
67
+ # * 25 = Super98
68
+ # * 26 = GTL
69
+ # * 27 = Fuelsave 98
70
+ # * 28 = LNG
71
+ # * 29 = DieselFit
72
+ # * 30 = Shell Recharge
73
+ #
74
+ # *An external mapping table may need to be maintained if it is required to
75
+ # display true fuel product names (as visible on the site)
76
+ # @return [Array[Integer]]
77
+ attr_accessor :fuel
78
+
79
+ # Object containing address details/elements
80
+ # @return [AroundLocationArrayDataItemsLoc]
81
+ attr_accessor :loc
82
+
83
+ # This is the 5-digit Shell Station ID. Leading ‘0’ should be dropped and
84
+ # only last four digits, should be used. E.G. for ‘00123’, only ‘0123’
85
+ # should be used and for ‘04567’ only ‘4567’ should be used.
86
+ # @return [String]
87
+ attr_accessor :mpp_station_id
88
+
89
+ # The Mobile Payment Platform recognises a user being located at a Shell
90
+ # Station if their GPS is within 300m of a Shell station. Some locations
91
+ # will return multiple Shell Stations within a 300 meter radius. This is an
92
+ # issue for Mobile Payments as it needs to accurately identify the station
93
+ # the Customer is located at to ensure the correct pump is released
94
+ # In Germany such locations have been identified and each Station has been
95
+ # assigned a unique letter (e.g. A, B, C). These letters are clearly visible
96
+ # at the stations. If a Mobile Payments user is located at such a location,
97
+ # they will need to identify the Station by identifying and specifying the
98
+ # Station’s corresponding letter as part of the refuelling journey.
99
+ # The double_site_id is used to store the Stations unique letter/ID value.
100
+ # It’s only populated if/when 1 or more stations are within 300m from this
101
+ # station.
102
+ # @return [String]
103
+ attr_accessor :double_site_id
104
+
105
+ # An Array of the station’s opening hours. This may have opening and closing
106
+ # times in hours, minutes and the day of the week.
107
+ # @return [Array[AroundLocationArrayDataItemsOpeningHoursItems]]
108
+ attr_accessor :opening_hours
109
+
110
+ # Station’s contact telephone number
111
+ # @return [String]
112
+ attr_accessor :telephone
113
+
114
+ # Station’s authorisation code
115
+ # @return [String]
116
+ attr_accessor :authorisation_code
117
+
118
+ # Station’s mobile payment preauthorisation value
119
+ # @return [Integer]
120
+ attr_accessor :mp_preauth
121
+
122
+ # A mapping from model property names to API property names.
123
+ def self.names
124
+ @_hash = {} if @_hash.nil?
125
+ @_hash['id'] = 'id'
126
+ @_hash['type'] = 'type'
127
+ @_hash['name'] = 'name'
128
+ @_hash['addr'] = 'addr'
129
+ @_hash['lat'] = 'lat'
130
+ @_hash['lon'] = 'lon'
131
+ @_hash['amen'] = 'amen'
132
+ @_hash['fuel'] = 'fuel'
133
+ @_hash['loc'] = 'loc'
134
+ @_hash['mpp_station_id'] = 'mpp_station_id'
135
+ @_hash['double_site_id'] = 'double_site_id'
136
+ @_hash['opening_hours'] = 'opening_hours'
137
+ @_hash['telephone'] = 'telephone'
138
+ @_hash['authorisation_code'] = 'authorisation_code'
139
+ @_hash['mp_preauth'] = 'mp_preauth'
140
+ @_hash
141
+ end
142
+
143
+ # An array for optional fields
144
+ def self.optionals
145
+ %w[
146
+ double_site_id
147
+ opening_hours
148
+ telephone
149
+ authorisation_code
150
+ mp_preauth
151
+ ]
152
+ end
153
+
154
+ # An array for nullable fields
155
+ def self.nullables
156
+ []
157
+ end
158
+
159
+ def initialize(id = nil,
160
+ type = nil,
161
+ name = nil,
162
+ addr = nil,
163
+ lat = nil,
164
+ lon = nil,
165
+ amen = nil,
166
+ fuel = nil,
167
+ loc = nil,
168
+ mpp_station_id = nil,
169
+ double_site_id = SKIP,
170
+ opening_hours = SKIP,
171
+ telephone = SKIP,
172
+ authorisation_code = SKIP,
173
+ mp_preauth = SKIP)
174
+ @id = id
175
+ @type = type
176
+ @name = name
177
+ @addr = addr
178
+ @lat = lat
179
+ @lon = lon
180
+ @amen = amen
181
+ @fuel = fuel
182
+ @loc = loc
183
+ @mpp_station_id = mpp_station_id
184
+ @double_site_id = double_site_id unless double_site_id == SKIP
185
+ @opening_hours = opening_hours unless opening_hours == SKIP
186
+ @telephone = telephone unless telephone == SKIP
187
+ @authorisation_code = authorisation_code unless authorisation_code == SKIP
188
+ @mp_preauth = mp_preauth unless mp_preauth == SKIP
189
+ end
190
+
191
+ # Creates an instance of the object from a hash.
192
+ def self.from_hash(hash)
193
+ return nil unless hash
194
+
195
+ # Extract variables from the hash.
196
+ id = hash.key?('id') ? hash['id'] : nil
197
+ type = hash.key?('type') ? hash['type'] : nil
198
+ name = hash.key?('name') ? hash['name'] : nil
199
+ addr = hash.key?('addr') ? hash['addr'] : nil
200
+ lat = hash.key?('lat') ? hash['lat'] : nil
201
+ lon = hash.key?('lon') ? hash['lon'] : nil
202
+ amen = hash.key?('amen') ? hash['amen'] : nil
203
+ fuel = hash.key?('fuel') ? hash['fuel'] : nil
204
+ loc = AroundLocationArrayDataItemsLoc.from_hash(hash['loc']) if hash['loc']
205
+ mpp_station_id =
206
+ hash.key?('mpp_station_id') ? hash['mpp_station_id'] : nil
207
+ double_site_id =
208
+ hash.key?('double_site_id') ? hash['double_site_id'] : SKIP
209
+ # Parameter is an array, so we need to iterate through it
210
+ opening_hours = nil
211
+ unless hash['opening_hours'].nil?
212
+ opening_hours = []
213
+ hash['opening_hours'].each do |structure|
214
+ opening_hours << (AroundLocationArrayDataItemsOpeningHoursItems.from_hash(structure) if structure)
215
+ end
216
+ end
217
+
218
+ opening_hours = SKIP unless hash.key?('opening_hours')
219
+ telephone = hash.key?('telephone') ? hash['telephone'] : SKIP
220
+ authorisation_code =
221
+ hash.key?('authorisation_code') ? hash['authorisation_code'] : SKIP
222
+ mp_preauth = hash.key?('mp_preauth') ? hash['mp_preauth'] : SKIP
223
+
224
+ # Create object from extracted values.
225
+ AroundLocationArrayDataItems.new(id,
226
+ type,
227
+ name,
228
+ addr,
229
+ lat,
230
+ lon,
231
+ amen,
232
+ fuel,
233
+ loc,
234
+ mpp_station_id,
235
+ double_site_id,
236
+ opening_hours,
237
+ telephone,
238
+ authorisation_code,
239
+ mp_preauth)
240
+ end
241
+ end
242
+ end
@@ -0,0 +1,99 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ShellEv
7
+ # Object containing address details/elements
8
+ class AroundLocationArrayDataItemsLoc < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The station’s full street address, including building number
13
+ # @return [String]
14
+ attr_accessor :street
15
+
16
+ # The station’s postcode
17
+ # @return [String]
18
+ attr_accessor :pc
19
+
20
+ # The city the station is located within
21
+ # @return [String]
22
+ attr_accessor :city
23
+
24
+ # The region the station is located within
25
+ # @return [String]
26
+ attr_accessor :region
27
+
28
+ # The name of the country (in English) the station is located within
29
+ # @return [String]
30
+ attr_accessor :country
31
+
32
+ # The two-letter ISO 3166 country code of the country the station is located
33
+ # within
34
+ # @return [String]
35
+ attr_accessor :ccode
36
+
37
+ # A mapping from model property names to API property names.
38
+ def self.names
39
+ @_hash = {} if @_hash.nil?
40
+ @_hash['street'] = 'street'
41
+ @_hash['pc'] = 'pc'
42
+ @_hash['city'] = 'city'
43
+ @_hash['region'] = 'region'
44
+ @_hash['country'] = 'country'
45
+ @_hash['ccode'] = 'ccode'
46
+ @_hash
47
+ end
48
+
49
+ # An array for optional fields
50
+ def self.optionals
51
+ %w[
52
+ street
53
+ pc
54
+ city
55
+ region
56
+ ]
57
+ end
58
+
59
+ # An array for nullable fields
60
+ def self.nullables
61
+ []
62
+ end
63
+
64
+ def initialize(country = nil,
65
+ ccode = nil,
66
+ street = SKIP,
67
+ pc = SKIP,
68
+ city = SKIP,
69
+ region = SKIP)
70
+ @street = street unless street == SKIP
71
+ @pc = pc unless pc == SKIP
72
+ @city = city unless city == SKIP
73
+ @region = region unless region == SKIP
74
+ @country = country
75
+ @ccode = ccode
76
+ end
77
+
78
+ # Creates an instance of the object from a hash.
79
+ def self.from_hash(hash)
80
+ return nil unless hash
81
+
82
+ # Extract variables from the hash.
83
+ country = hash.key?('country') ? hash['country'] : nil
84
+ ccode = hash.key?('ccode') ? hash['ccode'] : nil
85
+ street = hash.key?('street') ? hash['street'] : SKIP
86
+ pc = hash.key?('pc') ? hash['pc'] : SKIP
87
+ city = hash.key?('city') ? hash['city'] : SKIP
88
+ region = hash.key?('region') ? hash['region'] : SKIP
89
+
90
+ # Create object from extracted values.
91
+ AroundLocationArrayDataItemsLoc.new(country,
92
+ ccode,
93
+ street,
94
+ pc,
95
+ city,
96
+ region)
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,148 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ShellEv
7
+ # AroundLocationArrayDataItemsOpeningHoursItems Model.
8
+ class AroundLocationArrayDataItemsOpeningHoursItems < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :closing_from_hours
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :closing_from_minutes
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :closing_to_hours
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [String]
26
+ attr_accessor :closing_to_minutes
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [String]
30
+ attr_accessor :from_day
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [String]
34
+ attr_accessor :opening_from_hours
35
+
36
+ # TODO: Write general description for this method
37
+ # @return [String]
38
+ attr_accessor :opening_from_minutes
39
+
40
+ # TODO: Write general description for this method
41
+ # @return [String]
42
+ attr_accessor :opening_to_hours
43
+
44
+ # TODO: Write general description for this method
45
+ # @return [String]
46
+ attr_accessor :opening_to_minutes
47
+
48
+ # TODO: Write general description for this method
49
+ # @return [String]
50
+ attr_accessor :to_day
51
+
52
+ # A mapping from model property names to API property names.
53
+ def self.names
54
+ @_hash = {} if @_hash.nil?
55
+ @_hash['closing_from_hours'] = 'Closing_From_Hours'
56
+ @_hash['closing_from_minutes'] = 'Closing_From_Minutes'
57
+ @_hash['closing_to_hours'] = 'Closing_To_Hours'
58
+ @_hash['closing_to_minutes'] = 'Closing_To_Minutes'
59
+ @_hash['from_day'] = 'From_Day'
60
+ @_hash['opening_from_hours'] = 'Opening_From_Hours'
61
+ @_hash['opening_from_minutes'] = 'Opening_From_Minutes'
62
+ @_hash['opening_to_hours'] = 'Opening_To_Hours'
63
+ @_hash['opening_to_minutes'] = 'Opening_To_Minutes'
64
+ @_hash['to_day'] = 'To_Day'
65
+ @_hash
66
+ end
67
+
68
+ # An array for optional fields
69
+ def self.optionals
70
+ %w[
71
+ closing_from_hours
72
+ closing_from_minutes
73
+ closing_to_hours
74
+ closing_to_minutes
75
+ from_day
76
+ opening_from_hours
77
+ opening_from_minutes
78
+ opening_to_hours
79
+ opening_to_minutes
80
+ to_day
81
+ ]
82
+ end
83
+
84
+ # An array for nullable fields
85
+ def self.nullables
86
+ []
87
+ end
88
+
89
+ def initialize(closing_from_hours = SKIP,
90
+ closing_from_minutes = SKIP,
91
+ closing_to_hours = SKIP,
92
+ closing_to_minutes = SKIP,
93
+ from_day = SKIP,
94
+ opening_from_hours = SKIP,
95
+ opening_from_minutes = SKIP,
96
+ opening_to_hours = SKIP,
97
+ opening_to_minutes = SKIP,
98
+ to_day = SKIP)
99
+ @closing_from_hours = closing_from_hours unless closing_from_hours == SKIP
100
+ @closing_from_minutes = closing_from_minutes unless closing_from_minutes == SKIP
101
+ @closing_to_hours = closing_to_hours unless closing_to_hours == SKIP
102
+ @closing_to_minutes = closing_to_minutes unless closing_to_minutes == SKIP
103
+ @from_day = from_day unless from_day == SKIP
104
+ @opening_from_hours = opening_from_hours unless opening_from_hours == SKIP
105
+ @opening_from_minutes = opening_from_minutes unless opening_from_minutes == SKIP
106
+ @opening_to_hours = opening_to_hours unless opening_to_hours == SKIP
107
+ @opening_to_minutes = opening_to_minutes unless opening_to_minutes == SKIP
108
+ @to_day = to_day unless to_day == SKIP
109
+ end
110
+
111
+ # Creates an instance of the object from a hash.
112
+ def self.from_hash(hash)
113
+ return nil unless hash
114
+
115
+ # Extract variables from the hash.
116
+ closing_from_hours =
117
+ hash.key?('Closing_From_Hours') ? hash['Closing_From_Hours'] : SKIP
118
+ closing_from_minutes =
119
+ hash.key?('Closing_From_Minutes') ? hash['Closing_From_Minutes'] : SKIP
120
+ closing_to_hours =
121
+ hash.key?('Closing_To_Hours') ? hash['Closing_To_Hours'] : SKIP
122
+ closing_to_minutes =
123
+ hash.key?('Closing_To_Minutes') ? hash['Closing_To_Minutes'] : SKIP
124
+ from_day = hash.key?('From_Day') ? hash['From_Day'] : SKIP
125
+ opening_from_hours =
126
+ hash.key?('Opening_From_Hours') ? hash['Opening_From_Hours'] : SKIP
127
+ opening_from_minutes =
128
+ hash.key?('Opening_From_Minutes') ? hash['Opening_From_Minutes'] : SKIP
129
+ opening_to_hours =
130
+ hash.key?('Opening_To_Hours') ? hash['Opening_To_Hours'] : SKIP
131
+ opening_to_minutes =
132
+ hash.key?('Opening_To_Minutes') ? hash['Opening_To_Minutes'] : SKIP
133
+ to_day = hash.key?('To_Day') ? hash['To_Day'] : SKIP
134
+
135
+ # Create object from extracted values.
136
+ AroundLocationArrayDataItemsOpeningHoursItems.new(closing_from_hours,
137
+ closing_from_minutes,
138
+ closing_to_hours,
139
+ closing_to_minutes,
140
+ from_day,
141
+ opening_from_hours,
142
+ opening_from_minutes,
143
+ opening_to_hours,
144
+ opening_to_minutes,
145
+ to_day)
146
+ end
147
+ end
148
+ end