vmsp-sdk 0.0.1

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 (130) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +167 -0
  4. data/bin/console +15 -0
  5. data/lib/e_mobility_vmspocpiap_is/api_helper.rb +10 -0
  6. data/lib/e_mobility_vmspocpiap_is/client.rb +138 -0
  7. data/lib/e_mobility_vmspocpiap_is/configuration.rb +176 -0
  8. data/lib/e_mobility_vmspocpiap_is/controllers/account_controller.rb +53 -0
  9. data/lib/e_mobility_vmspocpiap_is/controllers/base_controller.rb +60 -0
  10. data/lib/e_mobility_vmspocpiap_is/controllers/cd_rs_pull_controller.rb +103 -0
  11. data/lib/e_mobility_vmspocpiap_is/controllers/cd_rs_push_controller.rb +51 -0
  12. data/lib/e_mobility_vmspocpiap_is/controllers/commands_callback_controller.rb +56 -0
  13. data/lib/e_mobility_vmspocpiap_is/controllers/commands_controller.rb +102 -0
  14. data/lib/e_mobility_vmspocpiap_is/controllers/locations_pull_controller.rb +125 -0
  15. data/lib/e_mobility_vmspocpiap_is/controllers/locations_push_controller.rb +68 -0
  16. data/lib/e_mobility_vmspocpiap_is/controllers/sessions_pull_controller.rb +91 -0
  17. data/lib/e_mobility_vmspocpiap_is/controllers/sessions_push_controller.rb +74 -0
  18. data/lib/e_mobility_vmspocpiap_is/controllers/tariffs_pull_controller.rb +117 -0
  19. data/lib/e_mobility_vmspocpiap_is/controllers/tariffs_push_controller.rb +62 -0
  20. data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_error_response_exception.rb +69 -0
  21. data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_response_exception.rb +67 -0
  22. data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_unauthorized_response_exception.rb +64 -0
  23. data/lib/e_mobility_vmspocpiap_is/exceptions/api_exception.rb +21 -0
  24. data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_error_response_exception.rb +71 -0
  25. data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_response_error_exception.rb +67 -0
  26. data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_unauthorized_response_exception.rb +64 -0
  27. data/lib/e_mobility_vmspocpiap_is/exceptions/v3_commands_startsession400_error_exception.rb +67 -0
  28. data/lib/e_mobility_vmspocpiap_is/http/auth/bearer_authorization.rb +53 -0
  29. data/lib/e_mobility_vmspocpiap_is/http/auth/ocpi_authorization.rb +52 -0
  30. data/lib/e_mobility_vmspocpiap_is/http/http_call_back.rb +10 -0
  31. data/lib/e_mobility_vmspocpiap_is/http/http_method_enum.rb +10 -0
  32. data/lib/e_mobility_vmspocpiap_is/http/http_request.rb +10 -0
  33. data/lib/e_mobility_vmspocpiap_is/http/http_response.rb +10 -0
  34. data/lib/e_mobility_vmspocpiap_is/http/proxy_settings.rb +22 -0
  35. data/lib/e_mobility_vmspocpiap_is/models/account_details.rb +237 -0
  36. data/lib/e_mobility_vmspocpiap_is/models/account_details2.rb +237 -0
  37. data/lib/e_mobility_vmspocpiap_is/models/account_response.rb +98 -0
  38. data/lib/e_mobility_vmspocpiap_is/models/account_state_enum.rb +46 -0
  39. data/lib/e_mobility_vmspocpiap_is/models/account_state_reason_enum.rb +67 -0
  40. data/lib/e_mobility_vmspocpiap_is/models/add_on_fee.rb +101 -0
  41. data/lib/e_mobility_vmspocpiap_is/models/add_on_fee_type_enum.rb +52 -0
  42. data/lib/e_mobility_vmspocpiap_is/models/additional_geo_location.rb +82 -0
  43. data/lib/e_mobility_vmspocpiap_is/models/auth_method_enum.rb +40 -0
  44. data/lib/e_mobility_vmspocpiap_is/models/base_model.rb +110 -0
  45. data/lib/e_mobility_vmspocpiap_is/models/benefit.rb +181 -0
  46. data/lib/e_mobility_vmspocpiap_is/models/booking_restriction_type_enum.rb +44 -0
  47. data/lib/e_mobility_vmspocpiap_is/models/business_details.rb +84 -0
  48. data/lib/e_mobility_vmspocpiap_is/models/capability_enum.rb +88 -0
  49. data/lib/e_mobility_vmspocpiap_is/models/cdr.rb +462 -0
  50. data/lib/e_mobility_vmspocpiap_is/models/cdr1.rb +457 -0
  51. data/lib/e_mobility_vmspocpiap_is/models/cdr_dimension.rb +71 -0
  52. data/lib/e_mobility_vmspocpiap_is/models/cdr_dimension_type_enum.rb +97 -0
  53. data/lib/e_mobility_vmspocpiap_is/models/cdr_location.rb +206 -0
  54. data/lib/e_mobility_vmspocpiap_is/models/cdr_token.rb +91 -0
  55. data/lib/e_mobility_vmspocpiap_is/models/charge_type_enum.rb +52 -0
  56. data/lib/e_mobility_vmspocpiap_is/models/charging_period.rb +100 -0
  57. data/lib/e_mobility_vmspocpiap_is/models/command_response.rb +92 -0
  58. data/lib/e_mobility_vmspocpiap_is/models/command_response1.rb +91 -0
  59. data/lib/e_mobility_vmspocpiap_is/models/command_response_type_enum.rb +44 -0
  60. data/lib/e_mobility_vmspocpiap_is/models/command_result.rb +81 -0
  61. data/lib/e_mobility_vmspocpiap_is/models/command_result_type_enum.rb +64 -0
  62. data/lib/e_mobility_vmspocpiap_is/models/connector.rb +184 -0
  63. data/lib/e_mobility_vmspocpiap_is/models/connector_format_enum.rb +36 -0
  64. data/lib/e_mobility_vmspocpiap_is/models/connector_type_enum.rb +196 -0
  65. data/lib/e_mobility_vmspocpiap_is/models/day_of_week_enum.rb +56 -0
  66. data/lib/e_mobility_vmspocpiap_is/models/display_text.rb +68 -0
  67. data/lib/e_mobility_vmspocpiap_is/models/emaid.rb +137 -0
  68. data/lib/e_mobility_vmspocpiap_is/models/energy_mix.rb +127 -0
  69. data/lib/e_mobility_vmspocpiap_is/models/energy_source.rb +69 -0
  70. data/lib/e_mobility_vmspocpiap_is/models/energy_source_category_enum.rb +60 -0
  71. data/lib/e_mobility_vmspocpiap_is/models/environmental_impact.rb +68 -0
  72. data/lib/e_mobility_vmspocpiap_is/models/environmental_impact_category_enum.rb +36 -0
  73. data/lib/e_mobility_vmspocpiap_is/models/evse.rb +250 -0
  74. data/lib/e_mobility_vmspocpiap_is/models/exceptional_period.rb +84 -0
  75. data/lib/e_mobility_vmspocpiap_is/models/facility_enum.rb +108 -0
  76. data/lib/e_mobility_vmspocpiap_is/models/geo_location.rb +73 -0
  77. data/lib/e_mobility_vmspocpiap_is/models/hours.rb +127 -0
  78. data/lib/e_mobility_vmspocpiap_is/models/image.rb +114 -0
  79. data/lib/e_mobility_vmspocpiap_is/models/image_category_enum.rb +58 -0
  80. data/lib/e_mobility_vmspocpiap_is/models/location.rb +379 -0
  81. data/lib/e_mobility_vmspocpiap_is/models/location1.rb +375 -0
  82. data/lib/e_mobility_vmspocpiap_is/models/ocpi_command_response.rb +62 -0
  83. data/lib/e_mobility_vmspocpiap_is/models/ocpi_response.rb +98 -0
  84. data/lib/e_mobility_vmspocpiap_is/models/parking_direction_enum.rb +40 -0
  85. data/lib/e_mobility_vmspocpiap_is/models/parking_restriction_enum.rb +61 -0
  86. data/lib/e_mobility_vmspocpiap_is/models/parking_type_enum.rb +53 -0
  87. data/lib/e_mobility_vmspocpiap_is/models/power_type_enum.rb +48 -0
  88. data/lib/e_mobility_vmspocpiap_is/models/price.rb +80 -0
  89. data/lib/e_mobility_vmspocpiap_is/models/price_component.rb +99 -0
  90. data/lib/e_mobility_vmspocpiap_is/models/price_limit.rb +71 -0
  91. data/lib/e_mobility_vmspocpiap_is/models/product.rb +186 -0
  92. data/lib/e_mobility_vmspocpiap_is/models/publish_token_type.rb +106 -0
  93. data/lib/e_mobility_vmspocpiap_is/models/regular_hours.rb +80 -0
  94. data/lib/e_mobility_vmspocpiap_is/models/reservation_restriction_type_enum.rb +36 -0
  95. data/lib/e_mobility_vmspocpiap_is/models/session.rb +298 -0
  96. data/lib/e_mobility_vmspocpiap_is/models/session_status_enum.rb +60 -0
  97. data/lib/e_mobility_vmspocpiap_is/models/signed_data.rb +116 -0
  98. data/lib/e_mobility_vmspocpiap_is/models/signed_value.rb +85 -0
  99. data/lib/e_mobility_vmspocpiap_is/models/start_session.rb +107 -0
  100. data/lib/e_mobility_vmspocpiap_is/models/start_session_token.rb +68 -0
  101. data/lib/e_mobility_vmspocpiap_is/models/status2_enum.rb +44 -0
  102. data/lib/e_mobility_vmspocpiap_is/models/status_enum.rb +64 -0
  103. data/lib/e_mobility_vmspocpiap_is/models/status_schedule.rb +97 -0
  104. data/lib/e_mobility_vmspocpiap_is/models/stop_session.rb +70 -0
  105. data/lib/e_mobility_vmspocpiap_is/models/subscription_renewal_cadence_enum.rb +44 -0
  106. data/lib/e_mobility_vmspocpiap_is/models/tariff.rb +347 -0
  107. data/lib/e_mobility_vmspocpiap_is/models/tariff1.rb +336 -0
  108. data/lib/e_mobility_vmspocpiap_is/models/tariff_dimension_type_enum.rb +60 -0
  109. data/lib/e_mobility_vmspocpiap_is/models/tariff_element.rb +91 -0
  110. data/lib/e_mobility_vmspocpiap_is/models/tariff_restrictions.rb +310 -0
  111. data/lib/e_mobility_vmspocpiap_is/models/tariff_type_enum.rb +48 -0
  112. data/lib/e_mobility_vmspocpiap_is/models/tax_amount.rb +95 -0
  113. data/lib/e_mobility_vmspocpiap_is/models/tax_included_enum.rb +40 -0
  114. data/lib/e_mobility_vmspocpiap_is/models/token_type_enum.rb +48 -0
  115. data/lib/e_mobility_vmspocpiap_is/models/type_of_emaid_enum.rb +36 -0
  116. data/lib/e_mobility_vmspocpiap_is/models/url_enum.rb +36 -0
  117. data/lib/e_mobility_vmspocpiap_is/models/v3_cdrs_response.rb +107 -0
  118. data/lib/e_mobility_vmspocpiap_is/models/v3_cdrs_response1.rb +98 -0
  119. data/lib/e_mobility_vmspocpiap_is/models/v3_commands_startsession_response.rb +98 -0
  120. data/lib/e_mobility_vmspocpiap_is/models/v3_commands_stopsession_response.rb +98 -0
  121. data/lib/e_mobility_vmspocpiap_is/models/v3_locations_response.rb +107 -0
  122. data/lib/e_mobility_vmspocpiap_is/models/v3_locations_response1.rb +98 -0
  123. data/lib/e_mobility_vmspocpiap_is/models/v3_sessions_response.rb +107 -0
  124. data/lib/e_mobility_vmspocpiap_is/models/v3_tariffs_response.rb +107 -0
  125. data/lib/e_mobility_vmspocpiap_is/models/v3_tariffs_response1.rb +98 -0
  126. data/lib/e_mobility_vmspocpiap_is/models/vehicle_type_enum.rb +64 -0
  127. data/lib/e_mobility_vmspocpiap_is/utilities/date_time_helper.rb +11 -0
  128. data/lib/e_mobility_vmspocpiap_is/utilities/file_wrapper.rb +28 -0
  129. data/lib/e_mobility_vmspocpiap_is.rb +164 -0
  130. metadata +213 -0
@@ -0,0 +1,237 @@
1
+ # e_mobility_vmspocpiap_is
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module EMobilityVmspocpiapIs
8
+ # Response data object or list of objects.
9
+ class AccountDetails2 < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Unique identifier for the account
14
+ # @return [String]
15
+ attr_accessor :account_id
16
+
17
+ # Current state of the account:
18
+ # * PENDING: user data stored at Shell (after accepting Shell terms → also
19
+ # trigger account linking with GCDM), but account creation flow not finished
20
+ # (e.g. payment setup not completed) → on new webscreens link out, redirect
21
+ # customer directly to pending account creation step
22
+ # * ACTIVE: user creation fully finished, e.g. also payment method added
23
+ # * BLOCKED: user account blocked due to terms updated, pending deletion,
24
+ # payment invalid (CC deleted or expired)
25
+ # @return [AccountStateEnum]
26
+ attr_accessor :account_state
27
+
28
+ # Reason for the current account state:
29
+ # * UNKNOWN: Used for unknown reasons when account_state is BLOCKED - Maps
30
+ # to status_code 2904
31
+ # * USER_PENDING_DELETION: Oauth2OemUserDetails.pendingDeletion is true -
32
+ # user pending deletion - Maps to status_code 2900
33
+ # * USER_TERMS_NOT_ACCEPTED: User has not accepted terms and conditions -
34
+ # Maps to status_code 2903
35
+ # * PAYMENT_METHOD_NOT_SET_UP: Payment method not configured in payment
36
+ # system - Maps to status_code 2906
37
+ # * PAYMENT_METHOD_CARD_EXPIRED: Payment card has expired - Maps to
38
+ # status_code 2907
39
+ # * EMAID_NOT_CREATED: EMAID not created - Maps to status_code 2908
40
+ # * PAYMENT_FAILED: Account in blocked state due to payment collection
41
+ # failure - Maps to status_code 2910
42
+ # The field is undefined: No specific reason (returned with status_code 1000
43
+ # when account_state is ACTIVE, or 2902 when PENDING)
44
+ # @return [AccountStateReasonEnum]
45
+ attr_accessor :account_state_reason
46
+
47
+ # Reason for the current account state:
48
+ # * UNKNOWN: Used for unknown reasons when account_state is BLOCKED - Maps
49
+ # to status_code 2904
50
+ # * USER_PENDING_DELETION: Oauth2OemUserDetails.pendingDeletion is true -
51
+ # user pending deletion - Maps to status_code 2900
52
+ # * USER_TERMS_NOT_ACCEPTED: User has not accepted terms and conditions -
53
+ # Maps to status_code 2903
54
+ # * PAYMENT_METHOD_NOT_SET_UP: Payment method not configured in payment
55
+ # system - Maps to status_code 2906
56
+ # * PAYMENT_METHOD_CARD_EXPIRED: Payment card has expired - Maps to
57
+ # status_code 2907
58
+ # * EMAID_NOT_CREATED: EMAID not created - Maps to status_code 2908
59
+ # * PAYMENT_FAILED: Account in blocked state due to payment collection
60
+ # failure - Maps to status_code 2910
61
+ # The field is undefined: No specific reason (returned with status_code 1000
62
+ # when account_state is ACTIVE, or 2902 when PENDING)
63
+ # @return [Array[Product]]
64
+ attr_accessor :products
65
+
66
+ # Reason for the current account state:
67
+ # * UNKNOWN: Used for unknown reasons when account_state is BLOCKED - Maps
68
+ # to status_code 2904
69
+ # * USER_PENDING_DELETION: Oauth2OemUserDetails.pendingDeletion is true -
70
+ # user pending deletion - Maps to status_code 2900
71
+ # * USER_TERMS_NOT_ACCEPTED: User has not accepted terms and conditions -
72
+ # Maps to status_code 2903
73
+ # * PAYMENT_METHOD_NOT_SET_UP: Payment method not configured in payment
74
+ # system - Maps to status_code 2906
75
+ # * PAYMENT_METHOD_CARD_EXPIRED: Payment card has expired - Maps to
76
+ # status_code 2907
77
+ # * EMAID_NOT_CREATED: EMAID not created - Maps to status_code 2908
78
+ # * PAYMENT_FAILED: Account in blocked state due to payment collection
79
+ # failure - Maps to status_code 2910
80
+ # The field is undefined: No specific reason (returned with status_code 1000
81
+ # when account_state is ACTIVE, or 2902 when PENDING)
82
+ # @return [Array[Benefit]]
83
+ attr_accessor :benefits
84
+
85
+ # Reason for the current account state:
86
+ # * UNKNOWN: Used for unknown reasons when account_state is BLOCKED - Maps
87
+ # to status_code 2904
88
+ # * USER_PENDING_DELETION: Oauth2OemUserDetails.pendingDeletion is true -
89
+ # user pending deletion - Maps to status_code 2900
90
+ # * USER_TERMS_NOT_ACCEPTED: User has not accepted terms and conditions -
91
+ # Maps to status_code 2903
92
+ # * PAYMENT_METHOD_NOT_SET_UP: Payment method not configured in payment
93
+ # system - Maps to status_code 2906
94
+ # * PAYMENT_METHOD_CARD_EXPIRED: Payment card has expired - Maps to
95
+ # status_code 2907
96
+ # * EMAID_NOT_CREATED: EMAID not created - Maps to status_code 2908
97
+ # * PAYMENT_FAILED: Account in blocked state due to payment collection
98
+ # failure - Maps to status_code 2910
99
+ # The field is undefined: No specific reason (returned with status_code 1000
100
+ # when account_state is ACTIVE, or 2902 when PENDING)
101
+ # @return [Array[Emaid]]
102
+ attr_accessor :emaids
103
+
104
+ # Timestamp when the account was created.
105
+ # @return [DateTime]
106
+ attr_accessor :created_at
107
+
108
+ # Timestamp when the account was last updated. In initial account creation,
109
+ # same as created_at.
110
+ # @return [DateTime]
111
+ attr_accessor :updated_at
112
+
113
+ # A mapping from model property names to API property names.
114
+ def self.names
115
+ @_hash = {} if @_hash.nil?
116
+ @_hash['account_id'] = 'account_id'
117
+ @_hash['account_state'] = 'account_state'
118
+ @_hash['account_state_reason'] = 'account_state_reason'
119
+ @_hash['products'] = 'products'
120
+ @_hash['benefits'] = 'benefits'
121
+ @_hash['emaids'] = 'emaids'
122
+ @_hash['created_at'] = 'created_at'
123
+ @_hash['updated_at'] = 'updated_at'
124
+ @_hash
125
+ end
126
+
127
+ # An array for optional fields
128
+ def self.optionals
129
+ %w[
130
+ account_state_reason
131
+ benefits
132
+ emaids
133
+ ]
134
+ end
135
+
136
+ # An array for nullable fields
137
+ def self.nullables
138
+ []
139
+ end
140
+
141
+ def initialize(account_id = nil, account_state = nil, products = nil,
142
+ created_at = nil, updated_at = nil,
143
+ account_state_reason = SKIP, benefits = SKIP, emaids = SKIP)
144
+ @account_id = account_id
145
+ @account_state = account_state
146
+ @account_state_reason = account_state_reason unless account_state_reason == SKIP
147
+ @products = products
148
+ @benefits = benefits unless benefits == SKIP
149
+ @emaids = emaids unless emaids == SKIP
150
+ @created_at = created_at
151
+ @updated_at = updated_at
152
+ end
153
+
154
+ # Creates an instance of the object from a hash.
155
+ def self.from_hash(hash)
156
+ return nil unless hash
157
+
158
+ # Extract variables from the hash.
159
+ account_id = hash.key?('account_id') ? hash['account_id'] : nil
160
+ account_state = hash.key?('account_state') ? hash['account_state'] : nil
161
+ # Parameter is an array, so we need to iterate through it
162
+ products = nil
163
+ unless hash['products'].nil?
164
+ products = []
165
+ hash['products'].each do |structure|
166
+ products << (Product.from_hash(structure) if structure)
167
+ end
168
+ end
169
+
170
+ products = nil unless hash.key?('products')
171
+ created_at = if hash.key?('created_at')
172
+ (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at'])
173
+ end
174
+ updated_at = if hash.key?('updated_at')
175
+ (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at'])
176
+ end
177
+ account_state_reason =
178
+ hash.key?('account_state_reason') ? hash['account_state_reason'] : SKIP
179
+ # Parameter is an array, so we need to iterate through it
180
+ benefits = nil
181
+ unless hash['benefits'].nil?
182
+ benefits = []
183
+ hash['benefits'].each do |structure|
184
+ benefits << (Benefit.from_hash(structure) if structure)
185
+ end
186
+ end
187
+
188
+ benefits = SKIP unless hash.key?('benefits')
189
+ # Parameter is an array, so we need to iterate through it
190
+ emaids = nil
191
+ unless hash['emaids'].nil?
192
+ emaids = []
193
+ hash['emaids'].each do |structure|
194
+ emaids << (Emaid.from_hash(structure) if structure)
195
+ end
196
+ end
197
+
198
+ emaids = SKIP unless hash.key?('emaids')
199
+
200
+ # Create object from extracted values.
201
+ AccountDetails2.new(account_id,
202
+ account_state,
203
+ products,
204
+ created_at,
205
+ updated_at,
206
+ account_state_reason,
207
+ benefits,
208
+ emaids)
209
+ end
210
+
211
+ def to_custom_created_at
212
+ DateTimeHelper.to_rfc3339(created_at)
213
+ end
214
+
215
+ def to_custom_updated_at
216
+ DateTimeHelper.to_rfc3339(updated_at)
217
+ end
218
+
219
+ # Provides a human-readable string representation of the object.
220
+ def to_s
221
+ class_name = self.class.name.split('::').last
222
+ "<#{class_name} account_id: #{@account_id}, account_state: #{@account_state},"\
223
+ " account_state_reason: #{@account_state_reason}, products: #{@products}, benefits:"\
224
+ " #{@benefits}, emaids: #{@emaids}, created_at: #{@created_at}, updated_at: #{@updated_at}>"
225
+ end
226
+
227
+ # Provides a debugging-friendly string with detailed object information.
228
+ def inspect
229
+ class_name = self.class.name.split('::').last
230
+ "<#{class_name} account_id: #{@account_id.inspect}, account_state:"\
231
+ " #{@account_state.inspect}, account_state_reason: #{@account_state_reason.inspect},"\
232
+ " products: #{@products.inspect}, benefits: #{@benefits.inspect}, emaids:"\
233
+ " #{@emaids.inspect}, created_at: #{@created_at.inspect}, updated_at:"\
234
+ " #{@updated_at.inspect}>"
235
+ end
236
+ end
237
+ end
@@ -0,0 +1,98 @@
1
+ # e_mobility_vmspocpiap_is
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module EMobilityVmspocpiapIs
8
+ # AccountResponse Model.
9
+ class AccountResponse < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # OCPI status code, 1000 for success.
14
+ # @return [Integer]
15
+ attr_accessor :status_code
16
+
17
+ # An optional status message which may help when debugging.
18
+ # @return [String]
19
+ attr_accessor :status_message
20
+
21
+ # The time this message was generated.
22
+ # @return [DateTime]
23
+ attr_accessor :timestamp
24
+
25
+ # Response data object or list of objects.
26
+ # @return [AccountDetails2]
27
+ attr_accessor :data
28
+
29
+ # A mapping from model property names to API property names.
30
+ def self.names
31
+ @_hash = {} if @_hash.nil?
32
+ @_hash['status_code'] = 'status_code'
33
+ @_hash['status_message'] = 'status_message'
34
+ @_hash['timestamp'] = 'timestamp'
35
+ @_hash['data'] = 'data'
36
+ @_hash
37
+ end
38
+
39
+ # An array for optional fields
40
+ def self.optionals
41
+ %w[
42
+ status_message
43
+ data
44
+ ]
45
+ end
46
+
47
+ # An array for nullable fields
48
+ def self.nullables
49
+ []
50
+ end
51
+
52
+ def initialize(status_code = nil, timestamp = nil, status_message = SKIP,
53
+ data = SKIP)
54
+ @status_code = status_code
55
+ @status_message = status_message unless status_message == SKIP
56
+ @timestamp = timestamp
57
+ @data = data unless data == SKIP
58
+ end
59
+
60
+ # Creates an instance of the object from a hash.
61
+ def self.from_hash(hash)
62
+ return nil unless hash
63
+
64
+ # Extract variables from the hash.
65
+ status_code = hash.key?('status_code') ? hash['status_code'] : nil
66
+ timestamp = if hash.key?('timestamp')
67
+ (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
68
+ end
69
+ status_message =
70
+ hash.key?('status_message') ? hash['status_message'] : SKIP
71
+ data = AccountDetails2.from_hash(hash['data']) if hash['data']
72
+
73
+ # Create object from extracted values.
74
+ AccountResponse.new(status_code,
75
+ timestamp,
76
+ status_message,
77
+ data)
78
+ end
79
+
80
+ def to_custom_timestamp
81
+ DateTimeHelper.to_rfc3339(timestamp)
82
+ end
83
+
84
+ # Provides a human-readable string representation of the object.
85
+ def to_s
86
+ class_name = self.class.name.split('::').last
87
+ "<#{class_name} status_code: #{@status_code}, status_message: #{@status_message},"\
88
+ " timestamp: #{@timestamp}, data: #{@data}>"
89
+ end
90
+
91
+ # Provides a debugging-friendly string with detailed object information.
92
+ def inspect
93
+ class_name = self.class.name.split('::').last
94
+ "<#{class_name} status_code: #{@status_code.inspect}, status_message:"\
95
+ " #{@status_message.inspect}, timestamp: #{@timestamp.inspect}, data: #{@data.inspect}>"
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,46 @@
1
+ # e_mobility_vmspocpiap_is
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module EMobilityVmspocpiapIs
7
+ # Current state of the account: * PENDING: user data stored at Shell (after
8
+ # accepting Shell terms → also trigger account linking with GCDM), but account
9
+ # creation flow not finished (e.g. payment setup not completed) → on new
10
+ # webscreens link out, redirect customer directly to pending account creation
11
+ # step * ACTIVE: user creation fully finished, e.g. also payment method added
12
+ # * BLOCKED: user account blocked due to terms updated, pending deletion,
13
+ # payment invalid (CC deleted or expired)
14
+ class AccountStateEnum
15
+ ACCOUNT_STATE_ENUM = [
16
+ # TODO: Write general description for PENDING
17
+ PENDING = 'PENDING'.freeze,
18
+
19
+ # TODO: Write general description for ACTIVE
20
+ ACTIVE = 'ACTIVE'.freeze,
21
+
22
+ # TODO: Write general description for BLOCKED
23
+ BLOCKED = 'BLOCKED'.freeze
24
+ ].freeze
25
+
26
+ def self.validate(value)
27
+ return false if value.nil?
28
+
29
+ ACCOUNT_STATE_ENUM.include?(value)
30
+ end
31
+
32
+ def self.from_value(value, default_value = PENDING)
33
+ return default_value if value.nil?
34
+
35
+ str = value.to_s.strip
36
+
37
+ case str.downcase
38
+ when 'pending' then PENDING
39
+ when 'active' then ACTIVE
40
+ when 'blocked' then BLOCKED
41
+ else
42
+ default_value
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,67 @@
1
+ # e_mobility_vmspocpiap_is
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module EMobilityVmspocpiapIs
7
+ # Reason for the current account state: * UNKNOWN: Used for unknown reasons
8
+ # when account_state is BLOCKED - Maps to status_code 2904 *
9
+ # USER_PENDING_DELETION: Oauth2OemUserDetails.pendingDeletion is true - user
10
+ # pending deletion - Maps to status_code 2900 * USER_TERMS_NOT_ACCEPTED: User
11
+ # has not accepted terms and conditions - Maps to status_code 2903 *
12
+ # PAYMENT_METHOD_NOT_SET_UP: Payment method not configured in payment system -
13
+ # Maps to status_code 2906 * PAYMENT_METHOD_CARD_EXPIRED: Payment card has
14
+ # expired - Maps to status_code 2907 * EMAID_NOT_CREATED: EMAID not created -
15
+ # Maps to status_code 2908 * PAYMENT_FAILED: Account in blocked state due to
16
+ # payment collection failure - Maps to status_code 2910 The field is
17
+ # undefined: No specific reason (returned with status_code 1000 when
18
+ # account_state is ACTIVE, or 2902 when PENDING)
19
+ class AccountStateReasonEnum
20
+ ACCOUNT_STATE_REASON_ENUM = [
21
+ # TODO: Write general description for UNKNOWN
22
+ UNKNOWN = 'UNKNOWN'.freeze,
23
+
24
+ # TODO: Write general description for USER_PENDING_DELETION
25
+ USER_PENDING_DELETION = 'USER_PENDING_DELETION'.freeze,
26
+
27
+ # TODO: Write general description for USER_TERMS_NOT_ACCEPTED
28
+ USER_TERMS_NOT_ACCEPTED = 'USER_TERMS_NOT_ACCEPTED'.freeze,
29
+
30
+ # TODO: Write general description for PAYMENT_METHOD_NOT_SET_UP
31
+ PAYMENT_METHOD_NOT_SET_UP = 'PAYMENT_METHOD_NOT_SET_UP'.freeze,
32
+
33
+ # TODO: Write general description for PAYMENT_METHOD_CARD_EXPIRED
34
+ PAYMENT_METHOD_CARD_EXPIRED = 'PAYMENT_METHOD_CARD_EXPIRED'.freeze,
35
+
36
+ # TODO: Write general description for EMAID_NOT_CREATED
37
+ EMAID_NOT_CREATED = 'EMAID_NOT_CREATED'.freeze,
38
+
39
+ # TODO: Write general description for PAYMENT_FAILED
40
+ PAYMENT_FAILED = 'PAYMENT_FAILED'.freeze
41
+ ].freeze
42
+
43
+ def self.validate(value)
44
+ return false if value.nil?
45
+
46
+ ACCOUNT_STATE_REASON_ENUM.include?(value)
47
+ end
48
+
49
+ def self.from_value(value, default_value = UNKNOWN)
50
+ return default_value if value.nil?
51
+
52
+ str = value.to_s.strip
53
+
54
+ case str.downcase
55
+ when 'unknown' then UNKNOWN
56
+ when 'user_pending_deletion' then USER_PENDING_DELETION
57
+ when 'user_terms_not_accepted' then USER_TERMS_NOT_ACCEPTED
58
+ when 'payment_method_not_set_up' then PAYMENT_METHOD_NOT_SET_UP
59
+ when 'payment_method_card_expired' then PAYMENT_METHOD_CARD_EXPIRED
60
+ when 'emaid_not_created' then EMAID_NOT_CREATED
61
+ when 'payment_failed' then PAYMENT_FAILED
62
+ else
63
+ default_value
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,101 @@
1
+ # e_mobility_vmspocpiap_is
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module EMobilityVmspocpiapIs
7
+ # AddOnFee Model.
8
+ class AddOnFee < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [ChargeTypeEnum]
14
+ attr_accessor :name
15
+
16
+ # Description of the add-on fee
17
+ # @return [String]
18
+ attr_accessor :description
19
+
20
+ # Amount of the add-on fee
21
+ # @return [Float]
22
+ attr_accessor :amount
23
+
24
+ # Fee charged
25
+ # @return [Float]
26
+ attr_accessor :fee_charged
27
+
28
+ # Fee charged
29
+ # @return [AddOnFeeTypeEnum]
30
+ attr_accessor :type
31
+
32
+ # A mapping from model property names to API property names.
33
+ def self.names
34
+ @_hash = {} if @_hash.nil?
35
+ @_hash['name'] = 'name'
36
+ @_hash['description'] = 'description'
37
+ @_hash['amount'] = 'amount'
38
+ @_hash['fee_charged'] = 'fee_charged'
39
+ @_hash['type'] = 'type'
40
+ @_hash
41
+ end
42
+
43
+ # An array for optional fields
44
+ def self.optionals
45
+ %w[
46
+ name
47
+ description
48
+ amount
49
+ fee_charged
50
+ type
51
+ ]
52
+ end
53
+
54
+ # An array for nullable fields
55
+ def self.nullables
56
+ []
57
+ end
58
+
59
+ def initialize(name = SKIP, description = SKIP, amount = SKIP,
60
+ fee_charged = SKIP, type = SKIP)
61
+ @name = name unless name == SKIP
62
+ @description = description unless description == SKIP
63
+ @amount = amount unless amount == SKIP
64
+ @fee_charged = fee_charged unless fee_charged == SKIP
65
+ @type = type unless type == SKIP
66
+ end
67
+
68
+ # Creates an instance of the object from a hash.
69
+ def self.from_hash(hash)
70
+ return nil unless hash
71
+
72
+ # Extract variables from the hash.
73
+ name = hash.key?('name') ? hash['name'] : SKIP
74
+ description = hash.key?('description') ? hash['description'] : SKIP
75
+ amount = hash.key?('amount') ? hash['amount'] : SKIP
76
+ fee_charged = hash.key?('fee_charged') ? hash['fee_charged'] : SKIP
77
+ type = hash.key?('type') ? hash['type'] : SKIP
78
+
79
+ # Create object from extracted values.
80
+ AddOnFee.new(name,
81
+ description,
82
+ amount,
83
+ fee_charged,
84
+ type)
85
+ end
86
+
87
+ # Provides a human-readable string representation of the object.
88
+ def to_s
89
+ class_name = self.class.name.split('::').last
90
+ "<#{class_name} name: #{@name}, description: #{@description}, amount: #{@amount},"\
91
+ " fee_charged: #{@fee_charged}, type: #{@type}>"
92
+ end
93
+
94
+ # Provides a debugging-friendly string with detailed object information.
95
+ def inspect
96
+ class_name = self.class.name.split('::').last
97
+ "<#{class_name} name: #{@name.inspect}, description: #{@description.inspect}, amount:"\
98
+ " #{@amount.inspect}, fee_charged: #{@fee_charged.inspect}, type: #{@type.inspect}>"
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,52 @@
1
+ # e_mobility_vmspocpiap_is
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module EMobilityVmspocpiapIs
7
+ # AddOnFeeType.
8
+ class AddOnFeeTypeEnum
9
+ ADD_ON_FEE_TYPE_ENUM = [
10
+ # TODO: Write general description for FLAT
11
+ FLAT = 'FLAT'.freeze,
12
+
13
+ # TODO: Write general description for PERCENTAGE
14
+ PERCENTAGE = 'PERCENTAGE'.freeze,
15
+
16
+ # TODO: Write general description for HOURLY
17
+ HOURLY = 'HOURLY'.freeze,
18
+
19
+ # TODO: Write general description for HOUR
20
+ HOUR = 'HOUR'.freeze,
21
+
22
+ # TODO: Write general description for MINUTE
23
+ MINUTE = 'MINUTE'.freeze,
24
+
25
+ # TODO: Write general description for SECOND
26
+ SECOND = 'SECOND'.freeze
27
+ ].freeze
28
+
29
+ def self.validate(value)
30
+ return false if value.nil?
31
+
32
+ ADD_ON_FEE_TYPE_ENUM.include?(value)
33
+ end
34
+
35
+ def self.from_value(value, default_value = FLAT)
36
+ return default_value if value.nil?
37
+
38
+ str = value.to_s.strip
39
+
40
+ case str.downcase
41
+ when 'flat' then FLAT
42
+ when 'percentage' then PERCENTAGE
43
+ when 'hourly' then HOURLY
44
+ when 'hour' then HOUR
45
+ when 'minute' then MINUTE
46
+ when 'second' then SECOND
47
+ else
48
+ default_value
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,82 @@
1
+ # e_mobility_vmspocpiap_is
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module EMobilityVmspocpiapIs
7
+ # This class defines an additional geo location that is relevant for the
8
+ # Charge Point. The geodetic system to be used is WGS 84.
9
+ class AdditionalGeoLocation < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Latitude of the point in decimal degree. Example 50.770774. Decimal
14
+ # separator "." required.
15
+ # @return [String]
16
+ attr_accessor :latitude
17
+
18
+ # Longitude of the point in decimal degree. Example -126.104965. Decimal
19
+ # separator "." required.
20
+ # @return [String]
21
+ attr_accessor :longitude
22
+
23
+ # Multi-language text with a language code and text value.
24
+ # @return [DisplayText]
25
+ attr_accessor :name
26
+
27
+ # A mapping from model property names to API property names.
28
+ def self.names
29
+ @_hash = {} if @_hash.nil?
30
+ @_hash['latitude'] = 'latitude'
31
+ @_hash['longitude'] = 'longitude'
32
+ @_hash['name'] = 'name'
33
+ @_hash
34
+ end
35
+
36
+ # An array for optional fields
37
+ def self.optionals
38
+ %w[
39
+ name
40
+ ]
41
+ end
42
+
43
+ # An array for nullable fields
44
+ def self.nullables
45
+ []
46
+ end
47
+
48
+ def initialize(latitude = nil, longitude = nil, name = SKIP)
49
+ @latitude = latitude
50
+ @longitude = longitude
51
+ @name = name unless name == SKIP
52
+ end
53
+
54
+ # Creates an instance of the object from a hash.
55
+ def self.from_hash(hash)
56
+ return nil unless hash
57
+
58
+ # Extract variables from the hash.
59
+ latitude = hash.key?('latitude') ? hash['latitude'] : nil
60
+ longitude = hash.key?('longitude') ? hash['longitude'] : nil
61
+ name = DisplayText.from_hash(hash['name']) if hash['name']
62
+
63
+ # Create object from extracted values.
64
+ AdditionalGeoLocation.new(latitude,
65
+ longitude,
66
+ name)
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} latitude: #{@latitude}, longitude: #{@longitude}, name: #{@name}>"
73
+ end
74
+
75
+ # Provides a debugging-friendly string with detailed object information.
76
+ def inspect
77
+ class_name = self.class.name.split('::').last
78
+ "<#{class_name} latitude: #{@latitude.inspect}, longitude: #{@longitude.inspect}, name:"\
79
+ " #{@name.inspect}>"
80
+ end
81
+ end
82
+ end