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.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +167 -0
- data/bin/console +15 -0
- data/lib/e_mobility_vmspocpiap_is/api_helper.rb +10 -0
- data/lib/e_mobility_vmspocpiap_is/client.rb +138 -0
- data/lib/e_mobility_vmspocpiap_is/configuration.rb +176 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/account_controller.rb +53 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/base_controller.rb +60 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/cd_rs_pull_controller.rb +103 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/cd_rs_push_controller.rb +51 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/commands_callback_controller.rb +56 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/commands_controller.rb +102 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/locations_pull_controller.rb +125 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/locations_push_controller.rb +68 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/sessions_pull_controller.rb +91 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/sessions_push_controller.rb +74 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/tariffs_pull_controller.rb +117 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/tariffs_push_controller.rb +62 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_error_response_exception.rb +69 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_response_exception.rb +67 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_unauthorized_response_exception.rb +64 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/api_exception.rb +21 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_error_response_exception.rb +71 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_response_error_exception.rb +67 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_unauthorized_response_exception.rb +64 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/v3_commands_startsession400_error_exception.rb +67 -0
- data/lib/e_mobility_vmspocpiap_is/http/auth/bearer_authorization.rb +53 -0
- data/lib/e_mobility_vmspocpiap_is/http/auth/ocpi_authorization.rb +52 -0
- data/lib/e_mobility_vmspocpiap_is/http/http_call_back.rb +10 -0
- data/lib/e_mobility_vmspocpiap_is/http/http_method_enum.rb +10 -0
- data/lib/e_mobility_vmspocpiap_is/http/http_request.rb +10 -0
- data/lib/e_mobility_vmspocpiap_is/http/http_response.rb +10 -0
- data/lib/e_mobility_vmspocpiap_is/http/proxy_settings.rb +22 -0
- data/lib/e_mobility_vmspocpiap_is/models/account_details.rb +237 -0
- data/lib/e_mobility_vmspocpiap_is/models/account_details2.rb +237 -0
- data/lib/e_mobility_vmspocpiap_is/models/account_response.rb +98 -0
- data/lib/e_mobility_vmspocpiap_is/models/account_state_enum.rb +46 -0
- data/lib/e_mobility_vmspocpiap_is/models/account_state_reason_enum.rb +67 -0
- data/lib/e_mobility_vmspocpiap_is/models/add_on_fee.rb +101 -0
- data/lib/e_mobility_vmspocpiap_is/models/add_on_fee_type_enum.rb +52 -0
- data/lib/e_mobility_vmspocpiap_is/models/additional_geo_location.rb +82 -0
- data/lib/e_mobility_vmspocpiap_is/models/auth_method_enum.rb +40 -0
- data/lib/e_mobility_vmspocpiap_is/models/base_model.rb +110 -0
- data/lib/e_mobility_vmspocpiap_is/models/benefit.rb +181 -0
- data/lib/e_mobility_vmspocpiap_is/models/booking_restriction_type_enum.rb +44 -0
- data/lib/e_mobility_vmspocpiap_is/models/business_details.rb +84 -0
- data/lib/e_mobility_vmspocpiap_is/models/capability_enum.rb +88 -0
- data/lib/e_mobility_vmspocpiap_is/models/cdr.rb +462 -0
- data/lib/e_mobility_vmspocpiap_is/models/cdr1.rb +457 -0
- data/lib/e_mobility_vmspocpiap_is/models/cdr_dimension.rb +71 -0
- data/lib/e_mobility_vmspocpiap_is/models/cdr_dimension_type_enum.rb +97 -0
- data/lib/e_mobility_vmspocpiap_is/models/cdr_location.rb +206 -0
- data/lib/e_mobility_vmspocpiap_is/models/cdr_token.rb +91 -0
- data/lib/e_mobility_vmspocpiap_is/models/charge_type_enum.rb +52 -0
- data/lib/e_mobility_vmspocpiap_is/models/charging_period.rb +100 -0
- data/lib/e_mobility_vmspocpiap_is/models/command_response.rb +92 -0
- data/lib/e_mobility_vmspocpiap_is/models/command_response1.rb +91 -0
- data/lib/e_mobility_vmspocpiap_is/models/command_response_type_enum.rb +44 -0
- data/lib/e_mobility_vmspocpiap_is/models/command_result.rb +81 -0
- data/lib/e_mobility_vmspocpiap_is/models/command_result_type_enum.rb +64 -0
- data/lib/e_mobility_vmspocpiap_is/models/connector.rb +184 -0
- data/lib/e_mobility_vmspocpiap_is/models/connector_format_enum.rb +36 -0
- data/lib/e_mobility_vmspocpiap_is/models/connector_type_enum.rb +196 -0
- data/lib/e_mobility_vmspocpiap_is/models/day_of_week_enum.rb +56 -0
- data/lib/e_mobility_vmspocpiap_is/models/display_text.rb +68 -0
- data/lib/e_mobility_vmspocpiap_is/models/emaid.rb +137 -0
- data/lib/e_mobility_vmspocpiap_is/models/energy_mix.rb +127 -0
- data/lib/e_mobility_vmspocpiap_is/models/energy_source.rb +69 -0
- data/lib/e_mobility_vmspocpiap_is/models/energy_source_category_enum.rb +60 -0
- data/lib/e_mobility_vmspocpiap_is/models/environmental_impact.rb +68 -0
- data/lib/e_mobility_vmspocpiap_is/models/environmental_impact_category_enum.rb +36 -0
- data/lib/e_mobility_vmspocpiap_is/models/evse.rb +250 -0
- data/lib/e_mobility_vmspocpiap_is/models/exceptional_period.rb +84 -0
- data/lib/e_mobility_vmspocpiap_is/models/facility_enum.rb +108 -0
- data/lib/e_mobility_vmspocpiap_is/models/geo_location.rb +73 -0
- data/lib/e_mobility_vmspocpiap_is/models/hours.rb +127 -0
- data/lib/e_mobility_vmspocpiap_is/models/image.rb +114 -0
- data/lib/e_mobility_vmspocpiap_is/models/image_category_enum.rb +58 -0
- data/lib/e_mobility_vmspocpiap_is/models/location.rb +379 -0
- data/lib/e_mobility_vmspocpiap_is/models/location1.rb +375 -0
- data/lib/e_mobility_vmspocpiap_is/models/ocpi_command_response.rb +62 -0
- data/lib/e_mobility_vmspocpiap_is/models/ocpi_response.rb +98 -0
- data/lib/e_mobility_vmspocpiap_is/models/parking_direction_enum.rb +40 -0
- data/lib/e_mobility_vmspocpiap_is/models/parking_restriction_enum.rb +61 -0
- data/lib/e_mobility_vmspocpiap_is/models/parking_type_enum.rb +53 -0
- data/lib/e_mobility_vmspocpiap_is/models/power_type_enum.rb +48 -0
- data/lib/e_mobility_vmspocpiap_is/models/price.rb +80 -0
- data/lib/e_mobility_vmspocpiap_is/models/price_component.rb +99 -0
- data/lib/e_mobility_vmspocpiap_is/models/price_limit.rb +71 -0
- data/lib/e_mobility_vmspocpiap_is/models/product.rb +186 -0
- data/lib/e_mobility_vmspocpiap_is/models/publish_token_type.rb +106 -0
- data/lib/e_mobility_vmspocpiap_is/models/regular_hours.rb +80 -0
- data/lib/e_mobility_vmspocpiap_is/models/reservation_restriction_type_enum.rb +36 -0
- data/lib/e_mobility_vmspocpiap_is/models/session.rb +298 -0
- data/lib/e_mobility_vmspocpiap_is/models/session_status_enum.rb +60 -0
- data/lib/e_mobility_vmspocpiap_is/models/signed_data.rb +116 -0
- data/lib/e_mobility_vmspocpiap_is/models/signed_value.rb +85 -0
- data/lib/e_mobility_vmspocpiap_is/models/start_session.rb +107 -0
- data/lib/e_mobility_vmspocpiap_is/models/start_session_token.rb +68 -0
- data/lib/e_mobility_vmspocpiap_is/models/status2_enum.rb +44 -0
- data/lib/e_mobility_vmspocpiap_is/models/status_enum.rb +64 -0
- data/lib/e_mobility_vmspocpiap_is/models/status_schedule.rb +97 -0
- data/lib/e_mobility_vmspocpiap_is/models/stop_session.rb +70 -0
- data/lib/e_mobility_vmspocpiap_is/models/subscription_renewal_cadence_enum.rb +44 -0
- data/lib/e_mobility_vmspocpiap_is/models/tariff.rb +347 -0
- data/lib/e_mobility_vmspocpiap_is/models/tariff1.rb +336 -0
- data/lib/e_mobility_vmspocpiap_is/models/tariff_dimension_type_enum.rb +60 -0
- data/lib/e_mobility_vmspocpiap_is/models/tariff_element.rb +91 -0
- data/lib/e_mobility_vmspocpiap_is/models/tariff_restrictions.rb +310 -0
- data/lib/e_mobility_vmspocpiap_is/models/tariff_type_enum.rb +48 -0
- data/lib/e_mobility_vmspocpiap_is/models/tax_amount.rb +95 -0
- data/lib/e_mobility_vmspocpiap_is/models/tax_included_enum.rb +40 -0
- data/lib/e_mobility_vmspocpiap_is/models/token_type_enum.rb +48 -0
- data/lib/e_mobility_vmspocpiap_is/models/type_of_emaid_enum.rb +36 -0
- data/lib/e_mobility_vmspocpiap_is/models/url_enum.rb +36 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_cdrs_response.rb +107 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_cdrs_response1.rb +98 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_commands_startsession_response.rb +98 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_commands_stopsession_response.rb +98 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_locations_response.rb +107 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_locations_response1.rb +98 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_sessions_response.rb +107 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_tariffs_response.rb +107 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_tariffs_response1.rb +98 -0
- data/lib/e_mobility_vmspocpiap_is/models/vehicle_type_enum.rb +64 -0
- data/lib/e_mobility_vmspocpiap_is/utilities/date_time_helper.rb +11 -0
- data/lib/e_mobility_vmspocpiap_is/utilities/file_wrapper.rb +28 -0
- data/lib/e_mobility_vmspocpiap_is.rb +164 -0
- metadata +213 -0
|
@@ -0,0 +1,137 @@
|
|
|
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
|
+
# Emaid Model.
|
|
9
|
+
class Emaid < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# The eMAID string
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :emaid
|
|
16
|
+
|
|
17
|
+
# Vehicle Identification Number
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :vin
|
|
20
|
+
|
|
21
|
+
# Payment Contract ID
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :pcid
|
|
24
|
+
|
|
25
|
+
# PKI contract start date
|
|
26
|
+
# @return [DateTime]
|
|
27
|
+
attr_accessor :pki_contract_start_date
|
|
28
|
+
|
|
29
|
+
# PKI contract end date
|
|
30
|
+
# @return [DateTime]
|
|
31
|
+
attr_accessor :pki_contract_end_date
|
|
32
|
+
|
|
33
|
+
# The type of eMAID.
|
|
34
|
+
# @return [TypeOfEmaidEnum]
|
|
35
|
+
attr_accessor :type_of_emaid
|
|
36
|
+
|
|
37
|
+
# The type of eMAID.
|
|
38
|
+
# @return [Status2Enum]
|
|
39
|
+
attr_accessor :status
|
|
40
|
+
|
|
41
|
+
# A mapping from model property names to API property names.
|
|
42
|
+
def self.names
|
|
43
|
+
@_hash = {} if @_hash.nil?
|
|
44
|
+
@_hash['emaid'] = 'emaid'
|
|
45
|
+
@_hash['vin'] = 'vin'
|
|
46
|
+
@_hash['pcid'] = 'pcid'
|
|
47
|
+
@_hash['pki_contract_start_date'] = 'pki_contract_start_date'
|
|
48
|
+
@_hash['pki_contract_end_date'] = 'pki_contract_end_date'
|
|
49
|
+
@_hash['type_of_emaid'] = 'type_of_emaid'
|
|
50
|
+
@_hash['status'] = 'status'
|
|
51
|
+
@_hash
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# An array for optional fields
|
|
55
|
+
def self.optionals
|
|
56
|
+
%w[
|
|
57
|
+
vin
|
|
58
|
+
pcid
|
|
59
|
+
pki_contract_start_date
|
|
60
|
+
pki_contract_end_date
|
|
61
|
+
]
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# An array for nullable fields
|
|
65
|
+
def self.nullables
|
|
66
|
+
[]
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def initialize(emaid = nil, type_of_emaid = nil, status = nil, vin = SKIP,
|
|
70
|
+
pcid = SKIP, pki_contract_start_date = SKIP,
|
|
71
|
+
pki_contract_end_date = SKIP)
|
|
72
|
+
@emaid = emaid
|
|
73
|
+
@vin = vin unless vin == SKIP
|
|
74
|
+
@pcid = pcid unless pcid == SKIP
|
|
75
|
+
@pki_contract_start_date = pki_contract_start_date unless pki_contract_start_date == SKIP
|
|
76
|
+
@pki_contract_end_date = pki_contract_end_date unless pki_contract_end_date == SKIP
|
|
77
|
+
@type_of_emaid = type_of_emaid
|
|
78
|
+
@status = status
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Creates an instance of the object from a hash.
|
|
82
|
+
def self.from_hash(hash)
|
|
83
|
+
return nil unless hash
|
|
84
|
+
|
|
85
|
+
# Extract variables from the hash.
|
|
86
|
+
emaid = hash.key?('emaid') ? hash['emaid'] : nil
|
|
87
|
+
type_of_emaid = hash.key?('type_of_emaid') ? hash['type_of_emaid'] : nil
|
|
88
|
+
status = hash.key?('status') ? hash['status'] : nil
|
|
89
|
+
vin = hash.key?('vin') ? hash['vin'] : SKIP
|
|
90
|
+
pcid = hash.key?('pcid') ? hash['pcid'] : SKIP
|
|
91
|
+
pki_contract_start_date = if hash.key?('pki_contract_start_date')
|
|
92
|
+
(DateTimeHelper.from_rfc3339(hash['pki_contract_start_date']) if hash['pki_contract_start_date'])
|
|
93
|
+
else
|
|
94
|
+
SKIP
|
|
95
|
+
end
|
|
96
|
+
pki_contract_end_date = if hash.key?('pki_contract_end_date')
|
|
97
|
+
(DateTimeHelper.from_rfc3339(hash['pki_contract_end_date']) if hash['pki_contract_end_date'])
|
|
98
|
+
else
|
|
99
|
+
SKIP
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Create object from extracted values.
|
|
103
|
+
Emaid.new(emaid,
|
|
104
|
+
type_of_emaid,
|
|
105
|
+
status,
|
|
106
|
+
vin,
|
|
107
|
+
pcid,
|
|
108
|
+
pki_contract_start_date,
|
|
109
|
+
pki_contract_end_date)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def to_custom_pki_contract_start_date
|
|
113
|
+
DateTimeHelper.to_rfc3339(pki_contract_start_date)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def to_custom_pki_contract_end_date
|
|
117
|
+
DateTimeHelper.to_rfc3339(pki_contract_end_date)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Provides a human-readable string representation of the object.
|
|
121
|
+
def to_s
|
|
122
|
+
class_name = self.class.name.split('::').last
|
|
123
|
+
"<#{class_name} emaid: #{@emaid}, vin: #{@vin}, pcid: #{@pcid}, pki_contract_start_date:"\
|
|
124
|
+
" #{@pki_contract_start_date}, pki_contract_end_date: #{@pki_contract_end_date},"\
|
|
125
|
+
" type_of_emaid: #{@type_of_emaid}, status: #{@status}>"
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
129
|
+
def inspect
|
|
130
|
+
class_name = self.class.name.split('::').last
|
|
131
|
+
"<#{class_name} emaid: #{@emaid.inspect}, vin: #{@vin.inspect}, pcid: #{@pcid.inspect},"\
|
|
132
|
+
" pki_contract_start_date: #{@pki_contract_start_date.inspect}, pki_contract_end_date:"\
|
|
133
|
+
" #{@pki_contract_end_date.inspect}, type_of_emaid: #{@type_of_emaid.inspect}, status:"\
|
|
134
|
+
" #{@status.inspect}>"
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
end
|
|
@@ -0,0 +1,127 @@
|
|
|
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 type is used to specify the energy mix and environmental impact of the
|
|
8
|
+
# supplied energy at a location or in a tariff.
|
|
9
|
+
class EnergyMix < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# True if 100% from regenerative sources. (CO2 and nuclear waste is zero)
|
|
14
|
+
# @return [TrueClass | FalseClass]
|
|
15
|
+
attr_accessor :is_green_energy
|
|
16
|
+
|
|
17
|
+
# Key-value pairs (enum + percentage) of energy sources of this location's
|
|
18
|
+
# tariff.
|
|
19
|
+
# @return [Array[EnergySource]]
|
|
20
|
+
attr_accessor :energy_sources
|
|
21
|
+
|
|
22
|
+
# Key-value pairs (enum + percentage) of nuclear waste and CO2 exhaust of
|
|
23
|
+
# this location's tariff.
|
|
24
|
+
# @return [Array[EnvironmentalImpact]]
|
|
25
|
+
attr_accessor :environ_impact
|
|
26
|
+
|
|
27
|
+
# Name of the energy supplier, delivering the energy for this location or
|
|
28
|
+
# tariff.
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :supplier_name
|
|
31
|
+
|
|
32
|
+
# Name of the energy supplier's product/tariff plan used at this location.
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :energy_product_name
|
|
35
|
+
|
|
36
|
+
# A mapping from model property names to API property names.
|
|
37
|
+
def self.names
|
|
38
|
+
@_hash = {} if @_hash.nil?
|
|
39
|
+
@_hash['is_green_energy'] = 'is_green_energy'
|
|
40
|
+
@_hash['energy_sources'] = 'energy_sources'
|
|
41
|
+
@_hash['environ_impact'] = 'environ_impact'
|
|
42
|
+
@_hash['supplier_name'] = 'supplier_name'
|
|
43
|
+
@_hash['energy_product_name'] = 'energy_product_name'
|
|
44
|
+
@_hash
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# An array for optional fields
|
|
48
|
+
def self.optionals
|
|
49
|
+
%w[
|
|
50
|
+
energy_sources
|
|
51
|
+
environ_impact
|
|
52
|
+
supplier_name
|
|
53
|
+
energy_product_name
|
|
54
|
+
]
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# An array for nullable fields
|
|
58
|
+
def self.nullables
|
|
59
|
+
[]
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def initialize(is_green_energy = nil, energy_sources = SKIP,
|
|
63
|
+
environ_impact = SKIP, supplier_name = SKIP,
|
|
64
|
+
energy_product_name = SKIP)
|
|
65
|
+
@is_green_energy = is_green_energy
|
|
66
|
+
@energy_sources = energy_sources unless energy_sources == SKIP
|
|
67
|
+
@environ_impact = environ_impact unless environ_impact == SKIP
|
|
68
|
+
@supplier_name = supplier_name unless supplier_name == SKIP
|
|
69
|
+
@energy_product_name = energy_product_name unless energy_product_name == SKIP
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Creates an instance of the object from a hash.
|
|
73
|
+
def self.from_hash(hash)
|
|
74
|
+
return nil unless hash
|
|
75
|
+
|
|
76
|
+
# Extract variables from the hash.
|
|
77
|
+
is_green_energy =
|
|
78
|
+
hash.key?('is_green_energy') ? hash['is_green_energy'] : nil
|
|
79
|
+
# Parameter is an array, so we need to iterate through it
|
|
80
|
+
energy_sources = nil
|
|
81
|
+
unless hash['energy_sources'].nil?
|
|
82
|
+
energy_sources = []
|
|
83
|
+
hash['energy_sources'].each do |structure|
|
|
84
|
+
energy_sources << (EnergySource.from_hash(structure) if structure)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
energy_sources = SKIP unless hash.key?('energy_sources')
|
|
89
|
+
# Parameter is an array, so we need to iterate through it
|
|
90
|
+
environ_impact = nil
|
|
91
|
+
unless hash['environ_impact'].nil?
|
|
92
|
+
environ_impact = []
|
|
93
|
+
hash['environ_impact'].each do |structure|
|
|
94
|
+
environ_impact << (EnvironmentalImpact.from_hash(structure) if structure)
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
environ_impact = SKIP unless hash.key?('environ_impact')
|
|
99
|
+
supplier_name = hash.key?('supplier_name') ? hash['supplier_name'] : SKIP
|
|
100
|
+
energy_product_name =
|
|
101
|
+
hash.key?('energy_product_name') ? hash['energy_product_name'] : SKIP
|
|
102
|
+
|
|
103
|
+
# Create object from extracted values.
|
|
104
|
+
EnergyMix.new(is_green_energy,
|
|
105
|
+
energy_sources,
|
|
106
|
+
environ_impact,
|
|
107
|
+
supplier_name,
|
|
108
|
+
energy_product_name)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Provides a human-readable string representation of the object.
|
|
112
|
+
def to_s
|
|
113
|
+
class_name = self.class.name.split('::').last
|
|
114
|
+
"<#{class_name} is_green_energy: #{@is_green_energy}, energy_sources: #{@energy_sources},"\
|
|
115
|
+
" environ_impact: #{@environ_impact}, supplier_name: #{@supplier_name}, energy_product_name:"\
|
|
116
|
+
" #{@energy_product_name}>"
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
120
|
+
def inspect
|
|
121
|
+
class_name = self.class.name.split('::').last
|
|
122
|
+
"<#{class_name} is_green_energy: #{@is_green_energy.inspect}, energy_sources:"\
|
|
123
|
+
" #{@energy_sources.inspect}, environ_impact: #{@environ_impact.inspect}, supplier_name:"\
|
|
124
|
+
" #{@supplier_name.inspect}, energy_product_name: #{@energy_product_name.inspect}>"
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
# Key-value pairs (enum + percentage) of energy sources. All given values of
|
|
8
|
+
# all categories should add up to 100 percent.
|
|
9
|
+
class EnergySource < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# Categories of energy sources.
|
|
14
|
+
# @return [EnergySourceCategoryEnum]
|
|
15
|
+
attr_accessor :source
|
|
16
|
+
|
|
17
|
+
# Percentage of this source (0-100) in the mix.
|
|
18
|
+
# @return [Float]
|
|
19
|
+
attr_accessor :percentage
|
|
20
|
+
|
|
21
|
+
# A mapping from model property names to API property names.
|
|
22
|
+
def self.names
|
|
23
|
+
@_hash = {} if @_hash.nil?
|
|
24
|
+
@_hash['source'] = 'source'
|
|
25
|
+
@_hash['percentage'] = 'percentage'
|
|
26
|
+
@_hash
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# An array for optional fields
|
|
30
|
+
def self.optionals
|
|
31
|
+
[]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# An array for nullable fields
|
|
35
|
+
def self.nullables
|
|
36
|
+
[]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def initialize(source = nil, percentage = nil)
|
|
40
|
+
@source = source
|
|
41
|
+
@percentage = percentage
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Creates an instance of the object from a hash.
|
|
45
|
+
def self.from_hash(hash)
|
|
46
|
+
return nil unless hash
|
|
47
|
+
|
|
48
|
+
# Extract variables from the hash.
|
|
49
|
+
source = hash.key?('source') ? hash['source'] : nil
|
|
50
|
+
percentage = hash.key?('percentage') ? hash['percentage'] : nil
|
|
51
|
+
|
|
52
|
+
# Create object from extracted values.
|
|
53
|
+
EnergySource.new(source,
|
|
54
|
+
percentage)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Provides a human-readable string representation of the object.
|
|
58
|
+
def to_s
|
|
59
|
+
class_name = self.class.name.split('::').last
|
|
60
|
+
"<#{class_name} source: #{@source}, percentage: #{@percentage}>"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
64
|
+
def inspect
|
|
65
|
+
class_name = self.class.name.split('::').last
|
|
66
|
+
"<#{class_name} source: #{@source.inspect}, percentage: #{@percentage.inspect}>"
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -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
|
+
# Categories of energy sources.
|
|
8
|
+
class EnergySourceCategoryEnum
|
|
9
|
+
ENERGY_SOURCE_CATEGORY_ENUM = [
|
|
10
|
+
# TODO: Write general description for NUCLEAR
|
|
11
|
+
NUCLEAR = 'NUCLEAR'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for GENERAL_FOSSIL
|
|
14
|
+
GENERAL_FOSSIL = 'GENERAL_FOSSIL'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for COAL
|
|
17
|
+
COAL = 'COAL'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for GAS
|
|
20
|
+
GAS = 'GAS'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for GENERAL_GREEN
|
|
23
|
+
GENERAL_GREEN = 'GENERAL_GREEN'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for SOLAR
|
|
26
|
+
SOLAR = 'SOLAR'.freeze,
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for WIND
|
|
29
|
+
WIND = 'WIND'.freeze,
|
|
30
|
+
|
|
31
|
+
# TODO: Write general description for WATER
|
|
32
|
+
WATER = 'WATER'.freeze
|
|
33
|
+
].freeze
|
|
34
|
+
|
|
35
|
+
def self.validate(value)
|
|
36
|
+
return false if value.nil?
|
|
37
|
+
|
|
38
|
+
ENERGY_SOURCE_CATEGORY_ENUM.include?(value)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def self.from_value(value, default_value = NUCLEAR)
|
|
42
|
+
return default_value if value.nil?
|
|
43
|
+
|
|
44
|
+
str = value.to_s.strip
|
|
45
|
+
|
|
46
|
+
case str.downcase
|
|
47
|
+
when 'nuclear' then NUCLEAR
|
|
48
|
+
when 'general_fossil' then GENERAL_FOSSIL
|
|
49
|
+
when 'coal' then COAL
|
|
50
|
+
when 'gas' then GAS
|
|
51
|
+
when 'general_green' then GENERAL_GREEN
|
|
52
|
+
when 'solar' then SOLAR
|
|
53
|
+
when 'wind' then WIND
|
|
54
|
+
when 'water' then WATER
|
|
55
|
+
else
|
|
56
|
+
default_value
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
# Amount of waste produced/emitted per kWh.
|
|
8
|
+
class EnvironmentalImpact < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Categories of environmental impact values.
|
|
13
|
+
# @return [EnvironmentalImpactCategoryEnum]
|
|
14
|
+
attr_accessor :category
|
|
15
|
+
|
|
16
|
+
# Amount of this portion in g/kWh.
|
|
17
|
+
# @return [Float]
|
|
18
|
+
attr_accessor :amount
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['category'] = 'category'
|
|
24
|
+
@_hash['amount'] = 'amount'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for nullable fields
|
|
34
|
+
def self.nullables
|
|
35
|
+
[]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def initialize(category = nil, amount = nil)
|
|
39
|
+
@category = category
|
|
40
|
+
@amount = amount
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Creates an instance of the object from a hash.
|
|
44
|
+
def self.from_hash(hash)
|
|
45
|
+
return nil unless hash
|
|
46
|
+
|
|
47
|
+
# Extract variables from the hash.
|
|
48
|
+
category = hash.key?('category') ? hash['category'] : nil
|
|
49
|
+
amount = hash.key?('amount') ? hash['amount'] : nil
|
|
50
|
+
|
|
51
|
+
# Create object from extracted values.
|
|
52
|
+
EnvironmentalImpact.new(category,
|
|
53
|
+
amount)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Provides a human-readable string representation of the object.
|
|
57
|
+
def to_s
|
|
58
|
+
class_name = self.class.name.split('::').last
|
|
59
|
+
"<#{class_name} category: #{@category}, amount: #{@amount}>"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
63
|
+
def inspect
|
|
64
|
+
class_name = self.class.name.split('::').last
|
|
65
|
+
"<#{class_name} category: #{@category.inspect}, amount: #{@amount.inspect}>"
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
# Categories of environmental impact values.
|
|
8
|
+
class EnvironmentalImpactCategoryEnum
|
|
9
|
+
ENVIRONMENTAL_IMPACT_CATEGORY_ENUM = [
|
|
10
|
+
# TODO: Write general description for NUCLEAR_WASTE
|
|
11
|
+
NUCLEAR_WASTE = 'NUCLEAR_WASTE'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for CARBON_DIOXIDE
|
|
14
|
+
CARBON_DIOXIDE = 'CARBON_DIOXIDE'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
ENVIRONMENTAL_IMPACT_CATEGORY_ENUM.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = NUCLEAR_WASTE)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'nuclear_waste' then NUCLEAR_WASTE
|
|
30
|
+
when 'carbon_dioxide' then CARBON_DIOXIDE
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|