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,60 @@
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
+ # Defines the dimension of a tariff.
8
+ class TariffDimensionTypeEnum
9
+ TARIFF_DIMENSION_TYPE_ENUM = [
10
+ # TODO: Write general description for CONGESTION_TIME
11
+ CONGESTION_TIME = 'CONGESTION_TIME'.freeze,
12
+
13
+ # TODO: Write general description for ENERGY
14
+ ENERGY = 'ENERGY'.freeze,
15
+
16
+ # TODO: Write general description for FLAT
17
+ FLAT = 'FLAT'.freeze,
18
+
19
+ # TODO: Write general description for PARKING_TIME
20
+ PARKING_TIME = 'PARKING_TIME'.freeze,
21
+
22
+ # TODO: Write general description for TIME
23
+ TIME = 'TIME'.freeze,
24
+
25
+ # TODO: Write general description for SESSION_TIME
26
+ SESSION_TIME = 'SESSION_TIME'.freeze,
27
+
28
+ # TODO: Write general description for MIN
29
+ MIN = 'MIN'.freeze,
30
+
31
+ # TODO: Write general description for MAX
32
+ MAX = 'MAX'.freeze
33
+ ].freeze
34
+
35
+ def self.validate(value)
36
+ return false if value.nil?
37
+
38
+ TARIFF_DIMENSION_TYPE_ENUM.include?(value)
39
+ end
40
+
41
+ def self.from_value(value, default_value = CONGESTION_TIME)
42
+ return default_value if value.nil?
43
+
44
+ str = value.to_s.strip
45
+
46
+ case str.downcase
47
+ when 'congestion_time' then CONGESTION_TIME
48
+ when 'energy' then ENERGY
49
+ when 'flat' then FLAT
50
+ when 'parking_time' then PARKING_TIME
51
+ when 'time' then TIME
52
+ when 'session_time' then SESSION_TIME
53
+ when 'min' then MIN
54
+ when 'max' then MAX
55
+ else
56
+ default_value
57
+ end
58
+ end
59
+ end
60
+ 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
+ # A Tariff Element is a group of Price Components that share a set of
8
+ # restrictions under which they apply. That the Price Components share the
9
+ # same restrictions does not mean that at any time, they either all apply or
10
+ # all do not apply. Applicable Price Components are looked up separately for
11
+ # each dimension.
12
+ class TariffElement < BaseModel
13
+ SKIP = Object.new
14
+ private_constant :SKIP
15
+
16
+ # List of Price Components that each describe how a certain dimension is
17
+ # priced.
18
+ # @return [Array[PriceComponent]]
19
+ attr_accessor :price_components
20
+
21
+ # A TariffRestrictions object describes if and when a Tariff Element becomes
22
+ # active or
23
+ # inactive during a Charging Session. These restrictions are not to be
24
+ # interpreted as making
25
+ # the Tariff Element applicable or not applicable for the entire Charging
26
+ # Session. When more
27
+ # than one restriction is set, they are to be treated as a logical AND.
28
+ # @return [TariffRestrictions]
29
+ attr_accessor :restrictions
30
+
31
+ # A mapping from model property names to API property names.
32
+ def self.names
33
+ @_hash = {} if @_hash.nil?
34
+ @_hash['price_components'] = 'price_components'
35
+ @_hash['restrictions'] = 'restrictions'
36
+ @_hash
37
+ end
38
+
39
+ # An array for optional fields
40
+ def self.optionals
41
+ %w[
42
+ restrictions
43
+ ]
44
+ end
45
+
46
+ # An array for nullable fields
47
+ def self.nullables
48
+ []
49
+ end
50
+
51
+ def initialize(price_components = nil, restrictions = SKIP)
52
+ @price_components = price_components
53
+ @restrictions = restrictions unless restrictions == 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
+ # Parameter is an array, so we need to iterate through it
62
+ price_components = nil
63
+ unless hash['price_components'].nil?
64
+ price_components = []
65
+ hash['price_components'].each do |structure|
66
+ price_components << (PriceComponent.from_hash(structure) if structure)
67
+ end
68
+ end
69
+
70
+ price_components = nil unless hash.key?('price_components')
71
+ restrictions = TariffRestrictions.from_hash(hash['restrictions']) if hash['restrictions']
72
+
73
+ # Create object from extracted values.
74
+ TariffElement.new(price_components,
75
+ restrictions)
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} price_components: #{@price_components}, restrictions: #{@restrictions}>"
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} price_components: #{@price_components.inspect}, restrictions:"\
88
+ " #{@restrictions.inspect}>"
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,310 @@
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
+ # A TariffRestrictions object describes if and when a Tariff Element becomes
8
+ # active or inactive during a Charging Session. These restrictions are not to
9
+ # be interpreted as making the Tariff Element applicable or not applicable for
10
+ # the entire Charging Session. When more than one restriction is set, they are
11
+ # to be treated as a logical AND.
12
+ class TariffRestrictions < BaseModel
13
+ SKIP = Object.new
14
+ private_constant :SKIP
15
+
16
+ # Start time of day in local time, the time zone is defined in the time_zone
17
+ # field of
18
+ # the Location, for example 13:30, valid from this time of the day. Must be
19
+ # in 24h
20
+ # format with leading zeros. Hour/Minute separator ":".
21
+ # @return [String]
22
+ attr_accessor :start_time
23
+
24
+ # End time of day in local time, the time zone is defined in the time_zone
25
+ # field of
26
+ # the Location, for example 19:45, valid until this time of the day. Same
27
+ # syntax as
28
+ # start_time. If end_time < start_time then the period wraps around to the
29
+ # next day.
30
+ # To stop at end of the day use 00:00.
31
+ # @return [String]
32
+ attr_accessor :end_time
33
+
34
+ # Start date in local time, the time zone is defined in the time_zone field
35
+ # of the
36
+ # Location, for example 2015-12-24, valid from this day (inclusive). Format
37
+ # YYYY-MM-DD.
38
+ # @return [String]
39
+ attr_accessor :start_date
40
+
41
+ # End date in local time, the time zone is defined in the time_zone field of
42
+ # the
43
+ # Location, for example 2015-12-27, valid until this day (exclusive). Format
44
+ # YYYY-MM-DD.
45
+ # @return [String]
46
+ attr_accessor :end_date
47
+
48
+ # Minimum consumed energy in kWh, for example 20, valid from this amount of
49
+ # energy (inclusive) being used.
50
+ # @return [Float]
51
+ attr_accessor :min_kwh
52
+
53
+ # Maximum consumed energy in kWh, for example 50, valid until this amount of
54
+ # energy (exclusive) being used.
55
+ # @return [Float]
56
+ attr_accessor :max_kwh
57
+
58
+ # Sum of the minimum current (in Amperes) over all phases, for example 5.
59
+ # When the EV
60
+ # is charging with more than, or equal to, the defined amount of current,
61
+ # this
62
+ # TariffElement is/becomes active. If the charging current is or becomes
63
+ # lower, this
64
+ # TariffElement is not or no longer valid and becomes inactive.
65
+ # @return [Float]
66
+ attr_accessor :min_current
67
+
68
+ # Sum of the maximum current (in Amperes) over all phases, for example 20.
69
+ # When the EV
70
+ # is charging with less than the defined amount of current, this
71
+ # TariffElement
72
+ # becomes/is active. If the charging current is or becomes higher, this
73
+ # TariffElement
74
+ # is not or no longer valid and becomes inactive.
75
+ # @return [Float]
76
+ attr_accessor :max_current
77
+
78
+ # Minimum power in kW, for example 5. When the EV is charging with more
79
+ # than, or equal
80
+ # to, the defined amount of power, this TariffElement is/becomes active. If
81
+ # the charging
82
+ # power is or becomes lower, this TariffElement is not or no longer valid
83
+ # and becomes
84
+ # inactive.
85
+ # @return [Float]
86
+ attr_accessor :min_power
87
+
88
+ # Maximum power in kW, for example 20. When the EV is charging with less
89
+ # than the
90
+ # defined amount of power, this TariffElement becomes/is active. If the
91
+ # charging power
92
+ # is or becomes higher, this TariffElement is not or no longer valid and
93
+ # becomes
94
+ # inactive.
95
+ # @return [Float]
96
+ attr_accessor :max_power
97
+
98
+ # Minimum duration in seconds the Charging Session MUST last (inclusive).
99
+ # When the
100
+ # duration of a Charging Session is longer than the defined value, this
101
+ # TariffElement
102
+ # is or becomes active. Before that moment, this TariffElement is not yet
103
+ # active.
104
+ # @return [Integer]
105
+ attr_accessor :min_duration
106
+
107
+ # Maximum duration in seconds the Charging Session MUST last (exclusive).
108
+ # When the
109
+ # duration of a Charging Session is shorter than the defined value, this
110
+ # TariffElement
111
+ # is or becomes active. After that moment, this TariffElement is no longer
112
+ # active.
113
+ # @return [Integer]
114
+ attr_accessor :max_duration
115
+
116
+ # Which day(s) of the week this TariffElement is active.
117
+ # @return [Array[DayOfWeekEnum]]
118
+ attr_accessor :day_of_week
119
+
120
+ # Defines if a TariffElement is applicable for a reservation.
121
+ # @return [ReservationRestrictionTypeEnum]
122
+ attr_accessor :reservation
123
+
124
+ # Defines if a TariffElement is applicable for booking costs.
125
+ # @return [BookingRestrictionTypeEnum]
126
+ attr_accessor :booking
127
+
128
+ # Minimum vehicle state of charge in percentage. This TariffElement becomes
129
+ # active when the vehicle state of charge is greater than or equal to this
130
+ # value. This field is specific for Tesla chargers.
131
+ # @return [Integer]
132
+ attr_accessor :min_vehicle_soc
133
+
134
+ # Minimum site congestion threshold in percentage. This TariffElement
135
+ # becomes active when the site's congestion level is greater than or equal
136
+ # to this value. This field is specific for Tesla chargers.
137
+ # @return [Integer]
138
+ attr_accessor :min_congestion_threshold
139
+
140
+ # Tesla specific: for charging idle fees
141
+ # @return [Integer]
142
+ attr_accessor :max_congestion
143
+
144
+ # Tesla specific: for charging idle fees
145
+ # @return [Integer]
146
+ attr_accessor :min_congestion
147
+
148
+ # A mapping from model property names to API property names.
149
+ def self.names
150
+ @_hash = {} if @_hash.nil?
151
+ @_hash['start_time'] = 'start_time'
152
+ @_hash['end_time'] = 'end_time'
153
+ @_hash['start_date'] = 'start_date'
154
+ @_hash['end_date'] = 'end_date'
155
+ @_hash['min_kwh'] = 'min_kwh'
156
+ @_hash['max_kwh'] = 'max_kwh'
157
+ @_hash['min_current'] = 'min_current'
158
+ @_hash['max_current'] = 'max_current'
159
+ @_hash['min_power'] = 'min_power'
160
+ @_hash['max_power'] = 'max_power'
161
+ @_hash['min_duration'] = 'min_duration'
162
+ @_hash['max_duration'] = 'max_duration'
163
+ @_hash['day_of_week'] = 'day_of_week'
164
+ @_hash['reservation'] = 'reservation'
165
+ @_hash['booking'] = 'booking'
166
+ @_hash['min_vehicle_soc'] = 'min_vehicle_soc'
167
+ @_hash['min_congestion_threshold'] = 'min_congestion_threshold'
168
+ @_hash['max_congestion'] = 'max_congestion'
169
+ @_hash['min_congestion'] = 'min_congestion'
170
+ @_hash
171
+ end
172
+
173
+ # An array for optional fields
174
+ def self.optionals
175
+ %w[
176
+ start_time
177
+ end_time
178
+ start_date
179
+ end_date
180
+ min_kwh
181
+ max_kwh
182
+ min_current
183
+ max_current
184
+ min_power
185
+ max_power
186
+ min_duration
187
+ max_duration
188
+ day_of_week
189
+ reservation
190
+ booking
191
+ min_vehicle_soc
192
+ min_congestion_threshold
193
+ max_congestion
194
+ min_congestion
195
+ ]
196
+ end
197
+
198
+ # An array for nullable fields
199
+ def self.nullables
200
+ []
201
+ end
202
+
203
+ def initialize(start_time = SKIP, end_time = SKIP, start_date = SKIP,
204
+ end_date = SKIP, min_kwh = SKIP, max_kwh = SKIP,
205
+ min_current = SKIP, max_current = SKIP, min_power = SKIP,
206
+ max_power = SKIP, min_duration = SKIP, max_duration = SKIP,
207
+ day_of_week = SKIP, reservation = SKIP, booking = SKIP,
208
+ min_vehicle_soc = SKIP, min_congestion_threshold = SKIP,
209
+ max_congestion = SKIP, min_congestion = SKIP)
210
+ @start_time = start_time unless start_time == SKIP
211
+ @end_time = end_time unless end_time == SKIP
212
+ @start_date = start_date unless start_date == SKIP
213
+ @end_date = end_date unless end_date == SKIP
214
+ @min_kwh = min_kwh unless min_kwh == SKIP
215
+ @max_kwh = max_kwh unless max_kwh == SKIP
216
+ @min_current = min_current unless min_current == SKIP
217
+ @max_current = max_current unless max_current == SKIP
218
+ @min_power = min_power unless min_power == SKIP
219
+ @max_power = max_power unless max_power == SKIP
220
+ @min_duration = min_duration unless min_duration == SKIP
221
+ @max_duration = max_duration unless max_duration == SKIP
222
+ @day_of_week = day_of_week unless day_of_week == SKIP
223
+ @reservation = reservation unless reservation == SKIP
224
+ @booking = booking unless booking == SKIP
225
+ @min_vehicle_soc = min_vehicle_soc unless min_vehicle_soc == SKIP
226
+ @min_congestion_threshold = min_congestion_threshold unless min_congestion_threshold == SKIP
227
+ @max_congestion = max_congestion unless max_congestion == SKIP
228
+ @min_congestion = min_congestion unless min_congestion == SKIP
229
+ end
230
+
231
+ # Creates an instance of the object from a hash.
232
+ def self.from_hash(hash)
233
+ return nil unless hash
234
+
235
+ # Extract variables from the hash.
236
+ start_time = hash.key?('start_time') ? hash['start_time'] : SKIP
237
+ end_time = hash.key?('end_time') ? hash['end_time'] : SKIP
238
+ start_date = hash.key?('start_date') ? hash['start_date'] : SKIP
239
+ end_date = hash.key?('end_date') ? hash['end_date'] : SKIP
240
+ min_kwh = hash.key?('min_kwh') ? hash['min_kwh'] : SKIP
241
+ max_kwh = hash.key?('max_kwh') ? hash['max_kwh'] : SKIP
242
+ min_current = hash.key?('min_current') ? hash['min_current'] : SKIP
243
+ max_current = hash.key?('max_current') ? hash['max_current'] : SKIP
244
+ min_power = hash.key?('min_power') ? hash['min_power'] : SKIP
245
+ max_power = hash.key?('max_power') ? hash['max_power'] : SKIP
246
+ min_duration = hash.key?('min_duration') ? hash['min_duration'] : SKIP
247
+ max_duration = hash.key?('max_duration') ? hash['max_duration'] : SKIP
248
+ day_of_week = hash.key?('day_of_week') ? hash['day_of_week'] : SKIP
249
+ reservation = hash.key?('reservation') ? hash['reservation'] : SKIP
250
+ booking = hash.key?('booking') ? hash['booking'] : SKIP
251
+ min_vehicle_soc =
252
+ hash.key?('min_vehicle_soc') ? hash['min_vehicle_soc'] : SKIP
253
+ min_congestion_threshold =
254
+ hash.key?('min_congestion_threshold') ? hash['min_congestion_threshold'] : SKIP
255
+ max_congestion =
256
+ hash.key?('max_congestion') ? hash['max_congestion'] : SKIP
257
+ min_congestion =
258
+ hash.key?('min_congestion') ? hash['min_congestion'] : SKIP
259
+
260
+ # Create object from extracted values.
261
+ TariffRestrictions.new(start_time,
262
+ end_time,
263
+ start_date,
264
+ end_date,
265
+ min_kwh,
266
+ max_kwh,
267
+ min_current,
268
+ max_current,
269
+ min_power,
270
+ max_power,
271
+ min_duration,
272
+ max_duration,
273
+ day_of_week,
274
+ reservation,
275
+ booking,
276
+ min_vehicle_soc,
277
+ min_congestion_threshold,
278
+ max_congestion,
279
+ min_congestion)
280
+ end
281
+
282
+ # Provides a human-readable string representation of the object.
283
+ def to_s
284
+ class_name = self.class.name.split('::').last
285
+ "<#{class_name} start_time: #{@start_time}, end_time: #{@end_time}, start_date:"\
286
+ " #{@start_date}, end_date: #{@end_date}, min_kwh: #{@min_kwh}, max_kwh: #{@max_kwh},"\
287
+ " min_current: #{@min_current}, max_current: #{@max_current}, min_power: #{@min_power},"\
288
+ " max_power: #{@max_power}, min_duration: #{@min_duration}, max_duration: #{@max_duration},"\
289
+ " day_of_week: #{@day_of_week}, reservation: #{@reservation}, booking: #{@booking},"\
290
+ " min_vehicle_soc: #{@min_vehicle_soc}, min_congestion_threshold:"\
291
+ " #{@min_congestion_threshold}, max_congestion: #{@max_congestion}, min_congestion:"\
292
+ " #{@min_congestion}>"
293
+ end
294
+
295
+ # Provides a debugging-friendly string with detailed object information.
296
+ def inspect
297
+ class_name = self.class.name.split('::').last
298
+ "<#{class_name} start_time: #{@start_time.inspect}, end_time: #{@end_time.inspect},"\
299
+ " start_date: #{@start_date.inspect}, end_date: #{@end_date.inspect}, min_kwh:"\
300
+ " #{@min_kwh.inspect}, max_kwh: #{@max_kwh.inspect}, min_current: #{@min_current.inspect},"\
301
+ " max_current: #{@max_current.inspect}, min_power: #{@min_power.inspect}, max_power:"\
302
+ " #{@max_power.inspect}, min_duration: #{@min_duration.inspect}, max_duration:"\
303
+ " #{@max_duration.inspect}, day_of_week: #{@day_of_week.inspect}, reservation:"\
304
+ " #{@reservation.inspect}, booking: #{@booking.inspect}, min_vehicle_soc:"\
305
+ " #{@min_vehicle_soc.inspect}, min_congestion_threshold:"\
306
+ " #{@min_congestion_threshold.inspect}, max_congestion: #{@max_congestion.inspect},"\
307
+ " min_congestion: #{@min_congestion.inspect}>"
308
+ end
309
+ end
310
+ end
@@ -0,0 +1,48 @@
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
+ # Type of tariff.
8
+ class TariffTypeEnum
9
+ TARIFF_TYPE_ENUM = [
10
+ # TODO: Write general description for AD_HOC_PAYMENT
11
+ AD_HOC_PAYMENT = 'AD_HOC_PAYMENT'.freeze,
12
+
13
+ # TODO: Write general description for PROFILE_CHEAP
14
+ PROFILE_CHEAP = 'PROFILE_CHEAP'.freeze,
15
+
16
+ # TODO: Write general description for PROFILE_FAST
17
+ PROFILE_FAST = 'PROFILE_FAST'.freeze,
18
+
19
+ # TODO: Write general description for PROFILE_GREEN
20
+ PROFILE_GREEN = 'PROFILE_GREEN'.freeze,
21
+
22
+ # TODO: Write general description for REGULAR
23
+ REGULAR = 'REGULAR'.freeze
24
+ ].freeze
25
+
26
+ def self.validate(value)
27
+ return false if value.nil?
28
+
29
+ TARIFF_TYPE_ENUM.include?(value)
30
+ end
31
+
32
+ def self.from_value(value, default_value = AD_HOC_PAYMENT)
33
+ return default_value if value.nil?
34
+
35
+ str = value.to_s.strip
36
+
37
+ case str.downcase
38
+ when 'ad_hoc_payment' then AD_HOC_PAYMENT
39
+ when 'profile_cheap' then PROFILE_CHEAP
40
+ when 'profile_fast' then PROFILE_FAST
41
+ when 'profile_green' then PROFILE_GREEN
42
+ when 'regular' then REGULAR
43
+ else
44
+ default_value
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,95 @@
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
+ # Tax information for a price component.
8
+ class TaxAmount < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # A description of the tax. In countries where a tax name is required like
13
+ # Canada this can be something like "QST". In countries where this is not
14
+ # required, this can be something more generic like "VAT" or "General Sales
15
+ # Tax".
16
+ # @return [String]
17
+ attr_accessor :name
18
+
19
+ # Tax Account Number of the business entity remitting these taxes. Optional
20
+ # as this is not required in all countries.
21
+ # @return [String]
22
+ attr_accessor :account_number
23
+
24
+ # Tax percentage. Optional as this is not required in all countries.
25
+ # @return [Float]
26
+ attr_accessor :percentage
27
+
28
+ # The amount of money of this tax that is due.
29
+ # @return [Float]
30
+ attr_accessor :amount
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['account_number'] = 'account_number'
37
+ @_hash['percentage'] = 'percentage'
38
+ @_hash['amount'] = 'amount'
39
+ @_hash
40
+ end
41
+
42
+ # An array for optional fields
43
+ def self.optionals
44
+ %w[
45
+ account_number
46
+ percentage
47
+ ]
48
+ end
49
+
50
+ # An array for nullable fields
51
+ def self.nullables
52
+ []
53
+ end
54
+
55
+ def initialize(name = nil, amount = nil, account_number = SKIP,
56
+ percentage = SKIP)
57
+ @name = name
58
+ @account_number = account_number unless account_number == SKIP
59
+ @percentage = percentage unless percentage == SKIP
60
+ @amount = amount
61
+ end
62
+
63
+ # Creates an instance of the object from a hash.
64
+ def self.from_hash(hash)
65
+ return nil unless hash
66
+
67
+ # Extract variables from the hash.
68
+ name = hash.key?('name') ? hash['name'] : nil
69
+ amount = hash.key?('amount') ? hash['amount'] : nil
70
+ account_number =
71
+ hash.key?('account_number') ? hash['account_number'] : SKIP
72
+ percentage = hash.key?('percentage') ? hash['percentage'] : SKIP
73
+
74
+ # Create object from extracted values.
75
+ TaxAmount.new(name,
76
+ amount,
77
+ account_number,
78
+ percentage)
79
+ end
80
+
81
+ # Provides a human-readable string representation of the object.
82
+ def to_s
83
+ class_name = self.class.name.split('::').last
84
+ "<#{class_name} name: #{@name}, account_number: #{@account_number}, percentage:"\
85
+ " #{@percentage}, amount: #{@amount}>"
86
+ end
87
+
88
+ # Provides a debugging-friendly string with detailed object information.
89
+ def inspect
90
+ class_name = self.class.name.split('::').last
91
+ "<#{class_name} name: #{@name.inspect}, account_number: #{@account_number.inspect},"\
92
+ " percentage: #{@percentage.inspect}, amount: #{@amount.inspect}>"
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,40 @@
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
+ # Indicates whether tax is included in the tariff price components.
8
+ class TaxIncludedEnum
9
+ TAX_INCLUDED_ENUM = [
10
+ # TODO: Write general description for YES
11
+ YES = 'YES'.freeze,
12
+
13
+ # TODO: Write general description for NO
14
+ NO = 'NO'.freeze,
15
+
16
+ # TODO: Write general description for ENUM_NA
17
+ ENUM_NA = 'N/A'.freeze
18
+ ].freeze
19
+
20
+ def self.validate(value)
21
+ return false if value.nil?
22
+
23
+ TAX_INCLUDED_ENUM.include?(value)
24
+ end
25
+
26
+ def self.from_value(value, default_value = YES)
27
+ return default_value if value.nil?
28
+
29
+ str = value.to_s.strip
30
+
31
+ case str.downcase
32
+ when 'yes' then YES
33
+ when 'no' then NO
34
+ when 'enum_na' then ENUM_NA
35
+ else
36
+ default_value
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,48 @@
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 type of token.
8
+ class TokenTypeEnum
9
+ TOKEN_TYPE_ENUM = [
10
+ # TODO: Write general description for AD_HOC_USER
11
+ AD_HOC_USER = 'AD_HOC_USER'.freeze,
12
+
13
+ # TODO: Write general description for APP_USER
14
+ APP_USER = 'APP_USER'.freeze,
15
+
16
+ # TODO: Write general description for EMAID
17
+ EMAID = 'EMAID'.freeze,
18
+
19
+ # TODO: Write general description for OTHER
20
+ OTHER = 'OTHER'.freeze,
21
+
22
+ # TODO: Write general description for RFID
23
+ RFID = 'RFID'.freeze
24
+ ].freeze
25
+
26
+ def self.validate(value)
27
+ return false if value.nil?
28
+
29
+ TOKEN_TYPE_ENUM.include?(value)
30
+ end
31
+
32
+ def self.from_value(value, default_value = AD_HOC_USER)
33
+ return default_value if value.nil?
34
+
35
+ str = value.to_s.strip
36
+
37
+ case str.downcase
38
+ when 'ad_hoc_user' then AD_HOC_USER
39
+ when 'app_user' then APP_USER
40
+ when 'emaid' then EMAID
41
+ when 'other' then OTHER
42
+ when 'rfid' then RFID
43
+ else
44
+ default_value
45
+ end
46
+ end
47
+ end
48
+ end