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,107 @@
|
|
|
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 eMSP provides a Token that has to be used by the Charge Point.
|
|
8
|
+
class StartSession < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# URL that the CommandResult POST should be sent to. This URL might contain
|
|
13
|
+
# a unique ID to be able to distinguish between StartSession requests.
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :response_url
|
|
16
|
+
|
|
17
|
+
# The Token object describes the token information of an eMSP. CPOs can use
|
|
18
|
+
# this to build
|
|
19
|
+
# a cache of known Tokens. When a request to authorize comes from a Charge
|
|
20
|
+
# Point, the CPO
|
|
21
|
+
# can check against this cache to know to which eMSP they can later send a
|
|
22
|
+
# CDR.
|
|
23
|
+
# @return [StartSessionToken]
|
|
24
|
+
attr_accessor :token
|
|
25
|
+
|
|
26
|
+
# Location.id of the Location (belonging to the CPO this request is sent to)
|
|
27
|
+
# on which a session is to be started.
|
|
28
|
+
# @return [String]
|
|
29
|
+
attr_accessor :location_id
|
|
30
|
+
|
|
31
|
+
# EVSE.uid of the EVSE of this Location on which a session is to be started.
|
|
32
|
+
# @return [String]
|
|
33
|
+
attr_accessor :evse_uid
|
|
34
|
+
|
|
35
|
+
# Optional Connector.id of the Connector of the EVSE on which a session is
|
|
36
|
+
# to be started. This field is required when the capability
|
|
37
|
+
# START_SESSION_CONNECTOR_REQUIRED is set on the EVSE.
|
|
38
|
+
# @return [String]
|
|
39
|
+
attr_accessor :connector_id
|
|
40
|
+
|
|
41
|
+
# A mapping from model property names to API property names.
|
|
42
|
+
def self.names
|
|
43
|
+
@_hash = {} if @_hash.nil?
|
|
44
|
+
@_hash['response_url'] = 'response_url'
|
|
45
|
+
@_hash['token'] = 'token'
|
|
46
|
+
@_hash['location_id'] = 'location_id'
|
|
47
|
+
@_hash['evse_uid'] = 'evse_uid'
|
|
48
|
+
@_hash['connector_id'] = 'connector_id'
|
|
49
|
+
@_hash
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# An array for optional fields
|
|
53
|
+
def self.optionals
|
|
54
|
+
%w[
|
|
55
|
+
connector_id
|
|
56
|
+
]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# An array for nullable fields
|
|
60
|
+
def self.nullables
|
|
61
|
+
[]
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def initialize(response_url = nil, token = nil, location_id = nil,
|
|
65
|
+
evse_uid = nil, connector_id = SKIP)
|
|
66
|
+
@response_url = response_url
|
|
67
|
+
@token = token
|
|
68
|
+
@location_id = location_id
|
|
69
|
+
@evse_uid = evse_uid
|
|
70
|
+
@connector_id = connector_id unless connector_id == SKIP
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Creates an instance of the object from a hash.
|
|
74
|
+
def self.from_hash(hash)
|
|
75
|
+
return nil unless hash
|
|
76
|
+
|
|
77
|
+
# Extract variables from the hash.
|
|
78
|
+
response_url = hash.key?('response_url') ? hash['response_url'] : nil
|
|
79
|
+
token = StartSessionToken.from_hash(hash['token']) if hash['token']
|
|
80
|
+
location_id = hash.key?('location_id') ? hash['location_id'] : nil
|
|
81
|
+
evse_uid = hash.key?('evse_uid') ? hash['evse_uid'] : nil
|
|
82
|
+
connector_id = hash.key?('connector_id') ? hash['connector_id'] : SKIP
|
|
83
|
+
|
|
84
|
+
# Create object from extracted values.
|
|
85
|
+
StartSession.new(response_url,
|
|
86
|
+
token,
|
|
87
|
+
location_id,
|
|
88
|
+
evse_uid,
|
|
89
|
+
connector_id)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Provides a human-readable string representation of the object.
|
|
93
|
+
def to_s
|
|
94
|
+
class_name = self.class.name.split('::').last
|
|
95
|
+
"<#{class_name} response_url: #{@response_url}, token: #{@token}, location_id:"\
|
|
96
|
+
" #{@location_id}, evse_uid: #{@evse_uid}, connector_id: #{@connector_id}>"
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
100
|
+
def inspect
|
|
101
|
+
class_name = self.class.name.split('::').last
|
|
102
|
+
"<#{class_name} response_url: #{@response_url.inspect}, token: #{@token.inspect},"\
|
|
103
|
+
" location_id: #{@location_id.inspect}, evse_uid: #{@evse_uid.inspect}, connector_id:"\
|
|
104
|
+
" #{@connector_id.inspect}>"
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
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
|
+
# The Token object describes the token information of an eMSP. CPOs can use
|
|
8
|
+
# this to build a cache of known Tokens. When a request to authorize comes
|
|
9
|
+
# from a Charge Point, the CPO can check against this cache to know to which
|
|
10
|
+
# eMSP they can later send a CDR.
|
|
11
|
+
class StartSessionToken < BaseModel
|
|
12
|
+
SKIP = Object.new
|
|
13
|
+
private_constant :SKIP
|
|
14
|
+
|
|
15
|
+
# Uniquely identifies the EV Driver contract token within the eMSP's
|
|
16
|
+
# platform (and
|
|
17
|
+
# suboperator platforms). Recommended to follow the specification for eMA ID
|
|
18
|
+
# from
|
|
19
|
+
# "E-mobility ID-codes: the purpose of IDs, ID usage and ID format"
|
|
20
|
+
# (https://evroaming.org/contract-evse-ids/).
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :contract_id
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['contract_id'] = 'contract_id'
|
|
28
|
+
@_hash
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# An array for optional fields
|
|
32
|
+
def self.optionals
|
|
33
|
+
[]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(contract_id = nil)
|
|
42
|
+
@contract_id = contract_id
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Creates an instance of the object from a hash.
|
|
46
|
+
def self.from_hash(hash)
|
|
47
|
+
return nil unless hash
|
|
48
|
+
|
|
49
|
+
# Extract variables from the hash.
|
|
50
|
+
contract_id = hash.key?('contract_id') ? hash['contract_id'] : nil
|
|
51
|
+
|
|
52
|
+
# Create object from extracted values.
|
|
53
|
+
StartSessionToken.new(contract_id)
|
|
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} contract_id: #{@contract_id}>"
|
|
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} contract_id: #{@contract_id.inspect}>"
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
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
|
+
# Status2.
|
|
8
|
+
class Status2Enum
|
|
9
|
+
STATUS2_ENUM = [
|
|
10
|
+
# TODO: Write general description for ACTIVE
|
|
11
|
+
ACTIVE = 'ACTIVE'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for BLOCKED
|
|
14
|
+
BLOCKED = 'BLOCKED'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for DEACTIVATED
|
|
17
|
+
DEACTIVATED = 'DEACTIVATED'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for EXPIRED
|
|
20
|
+
EXPIRED = 'EXPIRED'.freeze
|
|
21
|
+
].freeze
|
|
22
|
+
|
|
23
|
+
def self.validate(value)
|
|
24
|
+
return false if value.nil?
|
|
25
|
+
|
|
26
|
+
STATUS2_ENUM.include?(value)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.from_value(value, default_value = ACTIVE)
|
|
30
|
+
return default_value if value.nil?
|
|
31
|
+
|
|
32
|
+
str = value.to_s.strip
|
|
33
|
+
|
|
34
|
+
case str.downcase
|
|
35
|
+
when 'active' then ACTIVE
|
|
36
|
+
when 'blocked' then BLOCKED
|
|
37
|
+
when 'deactivated' then DEACTIVATED
|
|
38
|
+
when 'expired' then EXPIRED
|
|
39
|
+
else
|
|
40
|
+
default_value
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
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 status of an EVSE.
|
|
8
|
+
class StatusEnum
|
|
9
|
+
STATUS_ENUM = [
|
|
10
|
+
# TODO: Write general description for AVAILABLE
|
|
11
|
+
AVAILABLE = 'AVAILABLE'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for BLOCKED
|
|
14
|
+
BLOCKED = 'BLOCKED'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for CHARGING
|
|
17
|
+
CHARGING = 'CHARGING'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for INOPERATIVE
|
|
20
|
+
INOPERATIVE = 'INOPERATIVE'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for OUTOFORDER
|
|
23
|
+
OUTOFORDER = 'OUTOFORDER'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for PLANNED
|
|
26
|
+
PLANNED = 'PLANNED'.freeze,
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for REMOVED
|
|
29
|
+
REMOVED = 'REMOVED'.freeze,
|
|
30
|
+
|
|
31
|
+
# TODO: Write general description for RESERVED
|
|
32
|
+
RESERVED = 'RESERVED'.freeze,
|
|
33
|
+
|
|
34
|
+
# TODO: Write general description for UNKNOWN
|
|
35
|
+
UNKNOWN = 'UNKNOWN'.freeze
|
|
36
|
+
].freeze
|
|
37
|
+
|
|
38
|
+
def self.validate(value)
|
|
39
|
+
return false if value.nil?
|
|
40
|
+
|
|
41
|
+
STATUS_ENUM.include?(value)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def self.from_value(value, default_value = AVAILABLE)
|
|
45
|
+
return default_value if value.nil?
|
|
46
|
+
|
|
47
|
+
str = value.to_s.strip
|
|
48
|
+
|
|
49
|
+
case str.downcase
|
|
50
|
+
when 'available' then AVAILABLE
|
|
51
|
+
when 'blocked' then BLOCKED
|
|
52
|
+
when 'charging' then CHARGING
|
|
53
|
+
when 'inoperative' then INOPERATIVE
|
|
54
|
+
when 'outoforder' then OUTOFORDER
|
|
55
|
+
when 'planned' then PLANNED
|
|
56
|
+
when 'removed' then REMOVED
|
|
57
|
+
when 'reserved' then RESERVED
|
|
58
|
+
when 'unknown' then UNKNOWN
|
|
59
|
+
else
|
|
60
|
+
default_value
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
# This type is used to schedule status periods in the future. The eMSP can
|
|
9
|
+
# provide this information to the EV user for trip planning purposes. A period
|
|
10
|
+
# MAY have no end.
|
|
11
|
+
class StatusSchedule < BaseModel
|
|
12
|
+
SKIP = Object.new
|
|
13
|
+
private_constant :SKIP
|
|
14
|
+
|
|
15
|
+
# Begin of the scheduled period.
|
|
16
|
+
# @return [DateTime]
|
|
17
|
+
attr_accessor :period_begin
|
|
18
|
+
|
|
19
|
+
# End of the scheduled period, if known.
|
|
20
|
+
# @return [DateTime]
|
|
21
|
+
attr_accessor :period_end
|
|
22
|
+
|
|
23
|
+
# The status of an EVSE.
|
|
24
|
+
# @return [StatusEnum]
|
|
25
|
+
attr_accessor :status
|
|
26
|
+
|
|
27
|
+
# A mapping from model property names to API property names.
|
|
28
|
+
def self.names
|
|
29
|
+
@_hash = {} if @_hash.nil?
|
|
30
|
+
@_hash['period_begin'] = 'period_begin'
|
|
31
|
+
@_hash['period_end'] = 'period_end'
|
|
32
|
+
@_hash['status'] = 'status'
|
|
33
|
+
@_hash
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for optional fields
|
|
37
|
+
def self.optionals
|
|
38
|
+
%w[
|
|
39
|
+
period_end
|
|
40
|
+
]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# An array for nullable fields
|
|
44
|
+
def self.nullables
|
|
45
|
+
[]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def initialize(period_begin = nil, status = nil, period_end = SKIP)
|
|
49
|
+
@period_begin = period_begin
|
|
50
|
+
@period_end = period_end unless period_end == SKIP
|
|
51
|
+
@status = status
|
|
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
|
+
period_begin = if hash.key?('period_begin')
|
|
60
|
+
(DateTimeHelper.from_rfc3339(hash['period_begin']) if hash['period_begin'])
|
|
61
|
+
end
|
|
62
|
+
status = hash.key?('status') ? hash['status'] : nil
|
|
63
|
+
period_end = if hash.key?('period_end')
|
|
64
|
+
(DateTimeHelper.from_rfc3339(hash['period_end']) if hash['period_end'])
|
|
65
|
+
else
|
|
66
|
+
SKIP
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Create object from extracted values.
|
|
70
|
+
StatusSchedule.new(period_begin,
|
|
71
|
+
status,
|
|
72
|
+
period_end)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def to_custom_period_begin
|
|
76
|
+
DateTimeHelper.to_rfc3339(period_begin)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def to_custom_period_end
|
|
80
|
+
DateTimeHelper.to_rfc3339(period_end)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Provides a human-readable string representation of the object.
|
|
84
|
+
def to_s
|
|
85
|
+
class_name = self.class.name.split('::').last
|
|
86
|
+
"<#{class_name} period_begin: #{@period_begin}, period_end: #{@period_end}, status:"\
|
|
87
|
+
" #{@status}>"
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
91
|
+
def inspect
|
|
92
|
+
class_name = self.class.name.split('::').last
|
|
93
|
+
"<#{class_name} period_begin: #{@period_begin.inspect}, period_end: #{@period_end.inspect},"\
|
|
94
|
+
" status: #{@status.inspect}>"
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
# Object to stop an ongoing session.
|
|
8
|
+
class StopSession < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# URL that the CommandResult POST should be sent to. This URL might contain
|
|
13
|
+
# a unique ID to be able to distinguish between StopSession requests.
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :response_url
|
|
16
|
+
|
|
17
|
+
# Session.id of the Session that is requested to be stopped.
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :session_id
|
|
20
|
+
|
|
21
|
+
# A mapping from model property names to API property names.
|
|
22
|
+
def self.names
|
|
23
|
+
@_hash = {} if @_hash.nil?
|
|
24
|
+
@_hash['response_url'] = 'response_url'
|
|
25
|
+
@_hash['session_id'] = 'session_id'
|
|
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(response_url = nil, session_id = nil)
|
|
40
|
+
@response_url = response_url
|
|
41
|
+
@session_id = session_id
|
|
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
|
+
response_url = hash.key?('response_url') ? hash['response_url'] : nil
|
|
50
|
+
session_id = hash.key?('session_id') ? hash['session_id'] : nil
|
|
51
|
+
|
|
52
|
+
# Create object from extracted values.
|
|
53
|
+
StopSession.new(response_url,
|
|
54
|
+
session_id)
|
|
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} response_url: #{@response_url}, session_id: #{@session_id}>"
|
|
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} response_url: #{@response_url.inspect}, session_id:"\
|
|
67
|
+
" #{@session_id.inspect}>"
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
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
|
+
# Subscription renewal frequency.
|
|
8
|
+
class SubscriptionRenewalCadenceEnum
|
|
9
|
+
SUBSCRIPTION_RENEWAL_CADENCE_ENUM = [
|
|
10
|
+
# TODO: Write general description for NO_RENEWAL
|
|
11
|
+
NO_RENEWAL = 'NO_RENEWAL'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for MONTHLY
|
|
14
|
+
MONTHLY = 'MONTHLY'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for QUARTERLY
|
|
17
|
+
QUARTERLY = 'QUARTERLY'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for YEARLY
|
|
20
|
+
YEARLY = 'YEARLY'.freeze
|
|
21
|
+
].freeze
|
|
22
|
+
|
|
23
|
+
def self.validate(value)
|
|
24
|
+
return false if value.nil?
|
|
25
|
+
|
|
26
|
+
SUBSCRIPTION_RENEWAL_CADENCE_ENUM.include?(value)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.from_value(value, default_value = NO_RENEWAL)
|
|
30
|
+
return default_value if value.nil?
|
|
31
|
+
|
|
32
|
+
str = value.to_s.strip
|
|
33
|
+
|
|
34
|
+
case str.downcase
|
|
35
|
+
when 'no_renewal' then NO_RENEWAL
|
|
36
|
+
when 'monthly' then MONTHLY
|
|
37
|
+
when 'quarterly' then QUARTERLY
|
|
38
|
+
when 'yearly' then YEARLY
|
|
39
|
+
else
|
|
40
|
+
default_value
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|