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,206 @@
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
+ # The CdrLocation class contains only the relevant information from the
8
+ # Location object that is needed in a CDR.
9
+ class CdrLocation < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Uniquely identifies the location within the CPO's platform (and
14
+ # suboperator platforms). This field can never be changed, modified or
15
+ # renamed.
16
+ # @return [String]
17
+ attr_accessor :id
18
+
19
+ # Display name of the location.
20
+ # @return [String]
21
+ attr_accessor :name
22
+
23
+ # Street/block name and house number if available.
24
+ # @return [String]
25
+ attr_accessor :address
26
+
27
+ # City or town.
28
+ # @return [String]
29
+ attr_accessor :city
30
+
31
+ # Postal code of the location, may only be omitted when the location has no
32
+ # postal code.
33
+ # @return [String]
34
+ attr_accessor :postal_code
35
+
36
+ # State or province of the location, only to be used when relevant.
37
+ # @return [String]
38
+ attr_accessor :state
39
+
40
+ # ISO 3166-1 alpha-3 code for the country of this location.
41
+ # @return [String]
42
+ attr_accessor :country
43
+
44
+ # This class defines the geo location of the Charge Point. The geodetic
45
+ # system to be used is WGS 84.
46
+ # Five decimal places is seen as a minimum for GPS coordinates as this gives
47
+ # approximately 1 meter precision.
48
+ # More is always better. Seven decimal places gives approximately 1cm
49
+ # precision.
50
+ # @return [GeoLocation]
51
+ attr_accessor :coordinates
52
+
53
+ # Uniquely identifies the EVSE within the CPO's platform (and suboperator
54
+ # platforms).
55
+ # Allowed to be set to '#NA' when this CDR is created for a reservation that
56
+ # never
57
+ # resulted in a charging session.
58
+ # @return [String]
59
+ attr_accessor :evse_uid
60
+
61
+ # Compliant with the following specification for EVSE ID: "E-mobility
62
+ # ID-codes: the purpose
63
+ # of IDs, ID usage and ID format"
64
+ # (https://evroaming.org/contract-evse-ids/). Allowed to be
65
+ # set to '#NA' when this CDR is created for a reservation that never
66
+ # resulted in a charging
67
+ # session.
68
+ # @return [String]
69
+ attr_accessor :evse_id
70
+
71
+ # Identifier of the connector within the EVSE. Allowed to be set to '#NA'
72
+ # when this CDR
73
+ # is created for a reservation that never resulted in a charging session.
74
+ # @return [String]
75
+ attr_accessor :connector_id
76
+
77
+ # The socket or plug standard of the charging point.
78
+ # @return [ConnectorTypeEnum]
79
+ attr_accessor :connector_standard
80
+
81
+ # The format of the connector, whether it is a socket or a plug.
82
+ # @return [ConnectorFormatEnum]
83
+ attr_accessor :connector_format
84
+
85
+ # The type of power at the connector.
86
+ # @return [PowerTypeEnum]
87
+ attr_accessor :connector_power_type
88
+
89
+ # A mapping from model property names to API property names.
90
+ def self.names
91
+ @_hash = {} if @_hash.nil?
92
+ @_hash['id'] = 'id'
93
+ @_hash['name'] = 'name'
94
+ @_hash['address'] = 'address'
95
+ @_hash['city'] = 'city'
96
+ @_hash['postal_code'] = 'postal_code'
97
+ @_hash['state'] = 'state'
98
+ @_hash['country'] = 'country'
99
+ @_hash['coordinates'] = 'coordinates'
100
+ @_hash['evse_uid'] = 'evse_uid'
101
+ @_hash['evse_id'] = 'evse_id'
102
+ @_hash['connector_id'] = 'connector_id'
103
+ @_hash['connector_standard'] = 'connector_standard'
104
+ @_hash['connector_format'] = 'connector_format'
105
+ @_hash['connector_power_type'] = 'connector_power_type'
106
+ @_hash
107
+ end
108
+
109
+ # An array for optional fields
110
+ def self.optionals
111
+ %w[
112
+ name
113
+ postal_code
114
+ state
115
+ ]
116
+ end
117
+
118
+ # An array for nullable fields
119
+ def self.nullables
120
+ []
121
+ end
122
+
123
+ def initialize(id = nil, address = nil, city = nil, country = nil,
124
+ coordinates = nil, evse_uid = nil, evse_id = nil,
125
+ connector_id = nil, connector_standard = nil,
126
+ connector_format = nil, connector_power_type = nil,
127
+ name = SKIP, postal_code = SKIP, state = SKIP)
128
+ @id = id
129
+ @name = name unless name == SKIP
130
+ @address = address
131
+ @city = city
132
+ @postal_code = postal_code unless postal_code == SKIP
133
+ @state = state unless state == SKIP
134
+ @country = country
135
+ @coordinates = coordinates
136
+ @evse_uid = evse_uid
137
+ @evse_id = evse_id
138
+ @connector_id = connector_id
139
+ @connector_standard = connector_standard
140
+ @connector_format = connector_format
141
+ @connector_power_type = connector_power_type
142
+ end
143
+
144
+ # Creates an instance of the object from a hash.
145
+ def self.from_hash(hash)
146
+ return nil unless hash
147
+
148
+ # Extract variables from the hash.
149
+ id = hash.key?('id') ? hash['id'] : nil
150
+ address = hash.key?('address') ? hash['address'] : nil
151
+ city = hash.key?('city') ? hash['city'] : nil
152
+ country = hash.key?('country') ? hash['country'] : nil
153
+ coordinates = GeoLocation.from_hash(hash['coordinates']) if hash['coordinates']
154
+ evse_uid = hash.key?('evse_uid') ? hash['evse_uid'] : nil
155
+ evse_id = hash.key?('evse_id') ? hash['evse_id'] : nil
156
+ connector_id = hash.key?('connector_id') ? hash['connector_id'] : nil
157
+ connector_standard =
158
+ hash.key?('connector_standard') ? hash['connector_standard'] : nil
159
+ connector_format =
160
+ hash.key?('connector_format') ? hash['connector_format'] : nil
161
+ connector_power_type =
162
+ hash.key?('connector_power_type') ? hash['connector_power_type'] : nil
163
+ name = hash.key?('name') ? hash['name'] : SKIP
164
+ postal_code = hash.key?('postal_code') ? hash['postal_code'] : SKIP
165
+ state = hash.key?('state') ? hash['state'] : SKIP
166
+
167
+ # Create object from extracted values.
168
+ CdrLocation.new(id,
169
+ address,
170
+ city,
171
+ country,
172
+ coordinates,
173
+ evse_uid,
174
+ evse_id,
175
+ connector_id,
176
+ connector_standard,
177
+ connector_format,
178
+ connector_power_type,
179
+ name,
180
+ postal_code,
181
+ state)
182
+ end
183
+
184
+ # Provides a human-readable string representation of the object.
185
+ def to_s
186
+ class_name = self.class.name.split('::').last
187
+ "<#{class_name} id: #{@id}, name: #{@name}, address: #{@address}, city: #{@city},"\
188
+ " postal_code: #{@postal_code}, state: #{@state}, country: #{@country}, coordinates:"\
189
+ " #{@coordinates}, evse_uid: #{@evse_uid}, evse_id: #{@evse_id}, connector_id:"\
190
+ " #{@connector_id}, connector_standard: #{@connector_standard}, connector_format:"\
191
+ " #{@connector_format}, connector_power_type: #{@connector_power_type}>"
192
+ end
193
+
194
+ # Provides a debugging-friendly string with detailed object information.
195
+ def inspect
196
+ class_name = self.class.name.split('::').last
197
+ "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, address: #{@address.inspect},"\
198
+ " city: #{@city.inspect}, postal_code: #{@postal_code.inspect}, state: #{@state.inspect},"\
199
+ " country: #{@country.inspect}, coordinates: #{@coordinates.inspect}, evse_uid:"\
200
+ " #{@evse_uid.inspect}, evse_id: #{@evse_id.inspect}, connector_id:"\
201
+ " #{@connector_id.inspect}, connector_standard: #{@connector_standard.inspect},"\
202
+ " connector_format: #{@connector_format.inspect}, connector_power_type:"\
203
+ " #{@connector_power_type.inspect}>"
204
+ end
205
+ end
206
+ end
@@ -0,0 +1,91 @@
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
+ # Token information used to start a charging session, containing all relevant
8
+ # information to identify the unique token.
9
+ class CdrToken < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # ISO-3166 alpha-2 country code of the eMSP that 'owns' this Token.
14
+ # @return [String]
15
+ attr_accessor :country_code
16
+
17
+ # ID of the eMSP that 'owns' this Token (following the ISO-15118 standard).
18
+ # @return [String]
19
+ attr_accessor :party_id
20
+
21
+ # The type of token.
22
+ # @return [TokenTypeEnum]
23
+ attr_accessor :type
24
+
25
+ # Uniquely identifies the EV Driver contract token within the eMSP's
26
+ # platform (and suboperator platforms). Recommended to follow the
27
+ # specification for eMA ID from "E-mobility ID-codes: the purpose of IDs, ID
28
+ # usage and ID format" (https://evroaming.org/contract-evse-ids/).
29
+ # @return [String]
30
+ attr_accessor :contract_id
31
+
32
+ # A mapping from model property names to API property names.
33
+ def self.names
34
+ @_hash = {} if @_hash.nil?
35
+ @_hash['country_code'] = 'country_code'
36
+ @_hash['party_id'] = 'party_id'
37
+ @_hash['type'] = 'type'
38
+ @_hash['contract_id'] = 'contract_id'
39
+ @_hash
40
+ end
41
+
42
+ # An array for optional fields
43
+ def self.optionals
44
+ []
45
+ end
46
+
47
+ # An array for nullable fields
48
+ def self.nullables
49
+ []
50
+ end
51
+
52
+ def initialize(country_code = nil, party_id = nil, type = nil,
53
+ contract_id = nil)
54
+ @country_code = country_code
55
+ @party_id = party_id
56
+ @type = type
57
+ @contract_id = contract_id
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
+ country_code = hash.key?('country_code') ? hash['country_code'] : nil
66
+ party_id = hash.key?('party_id') ? hash['party_id'] : nil
67
+ type = hash.key?('type') ? hash['type'] : nil
68
+ contract_id = hash.key?('contract_id') ? hash['contract_id'] : nil
69
+
70
+ # Create object from extracted values.
71
+ CdrToken.new(country_code,
72
+ party_id,
73
+ type,
74
+ contract_id)
75
+ end
76
+
77
+ # Provides a human-readable string representation of the object.
78
+ def to_s
79
+ class_name = self.class.name.split('::').last
80
+ "<#{class_name} country_code: #{@country_code}, party_id: #{@party_id}, type: #{@type},"\
81
+ " contract_id: #{@contract_id}>"
82
+ end
83
+
84
+ # Provides a debugging-friendly string with detailed object information.
85
+ def inspect
86
+ class_name = self.class.name.split('::').last
87
+ "<#{class_name} country_code: #{@country_code.inspect}, party_id: #{@party_id.inspect},"\
88
+ " type: #{@type.inspect}, contract_id: #{@contract_id.inspect}>"
89
+ end
90
+ end
91
+ 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
+ # ChargeType.
8
+ class ChargeTypeEnum
9
+ CHARGE_TYPE_ENUM = [
10
+ # TODO: Write general description for TAX
11
+ TAX = 'TAX'.freeze,
12
+
13
+ # TODO: Write general description for CC_FEE
14
+ CC_FEE = 'CC_FEE'.freeze,
15
+
16
+ # TODO: Write general description for RFID_FEE
17
+ RFID_FEE = 'RFID_FEE'.freeze,
18
+
19
+ # TODO: Write general description for PARKING_FEE
20
+ PARKING_FEE = 'PARKING_FEE'.freeze,
21
+
22
+ # TODO: Write general description for TRANSACTION_FEE
23
+ TRANSACTION_FEE = 'TRANSACTION_FEE'.freeze,
24
+
25
+ # TODO: Write general description for ROAMING_FEE
26
+ ROAMING_FEE = 'ROAMING_FEE'.freeze
27
+ ].freeze
28
+
29
+ def self.validate(value)
30
+ return false if value.nil?
31
+
32
+ CHARGE_TYPE_ENUM.include?(value)
33
+ end
34
+
35
+ def self.from_value(value, default_value = TAX)
36
+ return default_value if value.nil?
37
+
38
+ str = value.to_s.strip
39
+
40
+ case str.downcase
41
+ when 'tax' then TAX
42
+ when 'cc_fee' then CC_FEE
43
+ when 'rfid_fee' then RFID_FEE
44
+ when 'parking_fee' then PARKING_FEE
45
+ when 'transaction_fee' then TRANSACTION_FEE
46
+ when 'roaming_fee' then ROAMING_FEE
47
+ else
48
+ default_value
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,100 @@
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
+ # A Charging Period consists of a start timestamp and a list of possible
9
+ # values that influence this period, for example: amount of energy charged
10
+ # this period, maximum current during this period etc.
11
+ class ChargingPeriod < BaseModel
12
+ SKIP = Object.new
13
+ private_constant :SKIP
14
+
15
+ # Start timestamp of the charging period. A period ends when the next period
16
+ # starts. The last period ends when the session ends.
17
+ # @return [DateTime]
18
+ attr_accessor :start_date_time
19
+
20
+ # List of relevant values for this charging period.
21
+ # @return [Array[CdrDimension]]
22
+ attr_accessor :dimensions
23
+
24
+ # Unique identifier of the Tariff that is relevant for this Charging Period.
25
+ # If not provided, no Tariff is relevant during this period.
26
+ # @return [String]
27
+ attr_accessor :tariff_id
28
+
29
+ # A mapping from model property names to API property names.
30
+ def self.names
31
+ @_hash = {} if @_hash.nil?
32
+ @_hash['start_date_time'] = 'start_date_time'
33
+ @_hash['dimensions'] = 'dimensions'
34
+ @_hash['tariff_id'] = 'tariff_id'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ %w[
41
+ tariff_id
42
+ ]
43
+ end
44
+
45
+ # An array for nullable fields
46
+ def self.nullables
47
+ []
48
+ end
49
+
50
+ def initialize(start_date_time = nil, dimensions = nil, tariff_id = SKIP)
51
+ @start_date_time = start_date_time
52
+ @dimensions = dimensions
53
+ @tariff_id = tariff_id unless tariff_id == 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
+ start_date_time = if hash.key?('start_date_time')
62
+ (DateTimeHelper.from_rfc3339(hash['start_date_time']) if hash['start_date_time'])
63
+ end
64
+ # Parameter is an array, so we need to iterate through it
65
+ dimensions = nil
66
+ unless hash['dimensions'].nil?
67
+ dimensions = []
68
+ hash['dimensions'].each do |structure|
69
+ dimensions << (CdrDimension.from_hash(structure) if structure)
70
+ end
71
+ end
72
+
73
+ dimensions = nil unless hash.key?('dimensions')
74
+ tariff_id = hash.key?('tariff_id') ? hash['tariff_id'] : SKIP
75
+
76
+ # Create object from extracted values.
77
+ ChargingPeriod.new(start_date_time,
78
+ dimensions,
79
+ tariff_id)
80
+ end
81
+
82
+ def to_custom_start_date_time
83
+ DateTimeHelper.to_rfc3339(start_date_time)
84
+ end
85
+
86
+ # Provides a human-readable string representation of the object.
87
+ def to_s
88
+ class_name = self.class.name.split('::').last
89
+ "<#{class_name} start_date_time: #{@start_date_time}, dimensions: #{@dimensions},"\
90
+ " tariff_id: #{@tariff_id}>"
91
+ end
92
+
93
+ # Provides a debugging-friendly string with detailed object information.
94
+ def inspect
95
+ class_name = self.class.name.split('::').last
96
+ "<#{class_name} start_date_time: #{@start_date_time.inspect}, dimensions:"\
97
+ " #{@dimensions.inspect}, tariff_id: #{@tariff_id.inspect}>"
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,92 @@
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
+ # The CommandResponse object is sent in the HTTP response body. It contains
8
+ # the direct response from the CPO, not the response from the Charge Point.
9
+ class CommandResponse < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Response to the command request from the eMSP to the CPO.
14
+ # @return [CommandResponseTypeEnum]
15
+ attr_accessor :result
16
+
17
+ # Timeout for this command in seconds. When the Result is not received
18
+ # within this timeout, the eMSP can assume that the message might never be
19
+ # sent.
20
+ # @return [Integer]
21
+ attr_accessor :timeout
22
+
23
+ # Human-readable description of the result (if one can be provided),
24
+ # multiple languages can be provided.
25
+ # @return [Array[DisplayText]]
26
+ attr_accessor :message
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['result'] = 'result'
32
+ @_hash['timeout'] = 'timeout'
33
+ @_hash['message'] = 'message'
34
+ @_hash
35
+ end
36
+
37
+ # An array for optional fields
38
+ def self.optionals
39
+ %w[
40
+ message
41
+ ]
42
+ end
43
+
44
+ # An array for nullable fields
45
+ def self.nullables
46
+ []
47
+ end
48
+
49
+ def initialize(result = nil, timeout = nil, message = SKIP)
50
+ @result = result
51
+ @timeout = timeout
52
+ @message = message unless message == SKIP
53
+ end
54
+
55
+ # Creates an instance of the object from a hash.
56
+ def self.from_hash(hash)
57
+ return nil unless hash
58
+
59
+ # Extract variables from the hash.
60
+ result = hash.key?('result') ? hash['result'] : nil
61
+ timeout = hash.key?('timeout') ? hash['timeout'] : nil
62
+ # Parameter is an array, so we need to iterate through it
63
+ message = nil
64
+ unless hash['message'].nil?
65
+ message = []
66
+ hash['message'].each do |structure|
67
+ message << (DisplayText.from_hash(structure) if structure)
68
+ end
69
+ end
70
+
71
+ message = SKIP unless hash.key?('message')
72
+
73
+ # Create object from extracted values.
74
+ CommandResponse.new(result,
75
+ timeout,
76
+ message)
77
+ end
78
+
79
+ # Provides a human-readable string representation of the object.
80
+ def to_s
81
+ class_name = self.class.name.split('::').last
82
+ "<#{class_name} result: #{@result}, timeout: #{@timeout}, message: #{@message}>"
83
+ end
84
+
85
+ # Provides a debugging-friendly string with detailed object information.
86
+ def inspect
87
+ class_name = self.class.name.split('::').last
88
+ "<#{class_name} result: #{@result.inspect}, timeout: #{@timeout.inspect}, message:"\
89
+ " #{@message.inspect}>"
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,91 @@
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
+ # Response data object or list of objects.
8
+ class CommandResponse1 < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Response to the command request from the eMSP to the CPO.
13
+ # @return [CommandResponseTypeEnum]
14
+ attr_accessor :result
15
+
16
+ # Timeout for this command in seconds. When the Result is not received
17
+ # within this timeout, the eMSP can assume that the message might never be
18
+ # sent.
19
+ # @return [Integer]
20
+ attr_accessor :timeout
21
+
22
+ # Human-readable description of the result (if one can be provided),
23
+ # multiple languages can be provided.
24
+ # @return [Array[DisplayText]]
25
+ attr_accessor :message
26
+
27
+ # A mapping from model property names to API property names.
28
+ def self.names
29
+ @_hash = {} if @_hash.nil?
30
+ @_hash['result'] = 'result'
31
+ @_hash['timeout'] = 'timeout'
32
+ @_hash['message'] = 'message'
33
+ @_hash
34
+ end
35
+
36
+ # An array for optional fields
37
+ def self.optionals
38
+ %w[
39
+ message
40
+ ]
41
+ end
42
+
43
+ # An array for nullable fields
44
+ def self.nullables
45
+ []
46
+ end
47
+
48
+ def initialize(result = nil, timeout = nil, message = SKIP)
49
+ @result = result
50
+ @timeout = timeout
51
+ @message = message unless message == 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
+ result = hash.key?('result') ? hash['result'] : nil
60
+ timeout = hash.key?('timeout') ? hash['timeout'] : nil
61
+ # Parameter is an array, so we need to iterate through it
62
+ message = nil
63
+ unless hash['message'].nil?
64
+ message = []
65
+ hash['message'].each do |structure|
66
+ message << (DisplayText.from_hash(structure) if structure)
67
+ end
68
+ end
69
+
70
+ message = SKIP unless hash.key?('message')
71
+
72
+ # Create object from extracted values.
73
+ CommandResponse1.new(result,
74
+ timeout,
75
+ message)
76
+ end
77
+
78
+ # Provides a human-readable string representation of the object.
79
+ def to_s
80
+ class_name = self.class.name.split('::').last
81
+ "<#{class_name} result: #{@result}, timeout: #{@timeout}, message: #{@message}>"
82
+ end
83
+
84
+ # Provides a debugging-friendly string with detailed object information.
85
+ def inspect
86
+ class_name = self.class.name.split('::').last
87
+ "<#{class_name} result: #{@result.inspect}, timeout: #{@timeout.inspect}, message:"\
88
+ " #{@message.inspect}>"
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,44 @@
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
+ # Response to the command request from the eMSP to the CPO.
8
+ class CommandResponseTypeEnum
9
+ COMMAND_RESPONSE_TYPE_ENUM = [
10
+ # TODO: Write general description for NOT_SUPPORTED
11
+ NOT_SUPPORTED = 'NOT_SUPPORTED'.freeze,
12
+
13
+ # TODO: Write general description for REJECTED
14
+ REJECTED = 'REJECTED'.freeze,
15
+
16
+ # TODO: Write general description for ACCEPTED
17
+ ACCEPTED = 'ACCEPTED'.freeze,
18
+
19
+ # TODO: Write general description for UNKNOWN_SESSION
20
+ UNKNOWN_SESSION = 'UNKNOWN_SESSION'.freeze
21
+ ].freeze
22
+
23
+ def self.validate(value)
24
+ return false if value.nil?
25
+
26
+ COMMAND_RESPONSE_TYPE_ENUM.include?(value)
27
+ end
28
+
29
+ def self.from_value(value, default_value = NOT_SUPPORTED)
30
+ return default_value if value.nil?
31
+
32
+ str = value.to_s.strip
33
+
34
+ case str.downcase
35
+ when 'not_supported' then NOT_SUPPORTED
36
+ when 'rejected' then REJECTED
37
+ when 'accepted' then ACCEPTED
38
+ when 'unknown_session' then UNKNOWN_SESSION
39
+ else
40
+ default_value
41
+ end
42
+ end
43
+ end
44
+ end