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,81 @@
|
|
|
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
|
+
# Result of the command request as sent by the Charge Point to the CPO,
|
|
8
|
+
# forwarded to the eMSP.
|
|
9
|
+
class CommandResult < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# Result of the command that was sent to the Charge Point.
|
|
14
|
+
# @return [CommandResultTypeEnum]
|
|
15
|
+
attr_accessor :result
|
|
16
|
+
|
|
17
|
+
# Human-readable description of the reason (if one can be provided),
|
|
18
|
+
# multiple languages can be provided.
|
|
19
|
+
# @return [Array[DisplayText]]
|
|
20
|
+
attr_accessor :message
|
|
21
|
+
|
|
22
|
+
# A mapping from model property names to API property names.
|
|
23
|
+
def self.names
|
|
24
|
+
@_hash = {} if @_hash.nil?
|
|
25
|
+
@_hash['result'] = 'result'
|
|
26
|
+
@_hash['message'] = 'message'
|
|
27
|
+
@_hash
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for optional fields
|
|
31
|
+
def self.optionals
|
|
32
|
+
%w[
|
|
33
|
+
message
|
|
34
|
+
]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# An array for nullable fields
|
|
38
|
+
def self.nullables
|
|
39
|
+
[]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def initialize(result = nil, message = SKIP)
|
|
43
|
+
@result = result
|
|
44
|
+
@message = message unless message == SKIP
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Creates an instance of the object from a hash.
|
|
48
|
+
def self.from_hash(hash)
|
|
49
|
+
return nil unless hash
|
|
50
|
+
|
|
51
|
+
# Extract variables from the hash.
|
|
52
|
+
result = hash.key?('result') ? hash['result'] : nil
|
|
53
|
+
# Parameter is an array, so we need to iterate through it
|
|
54
|
+
message = nil
|
|
55
|
+
unless hash['message'].nil?
|
|
56
|
+
message = []
|
|
57
|
+
hash['message'].each do |structure|
|
|
58
|
+
message << (DisplayText.from_hash(structure) if structure)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
message = SKIP unless hash.key?('message')
|
|
63
|
+
|
|
64
|
+
# Create object from extracted values.
|
|
65
|
+
CommandResult.new(result,
|
|
66
|
+
message)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Provides a human-readable string representation of the object.
|
|
70
|
+
def to_s
|
|
71
|
+
class_name = self.class.name.split('::').last
|
|
72
|
+
"<#{class_name} result: #{@result}, message: #{@message}>"
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
76
|
+
def inspect
|
|
77
|
+
class_name = self.class.name.split('::').last
|
|
78
|
+
"<#{class_name} result: #{@result.inspect}, message: #{@message.inspect}>"
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
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
|
+
# Result of the command that was sent to the Charge Point.
|
|
8
|
+
class CommandResultTypeEnum
|
|
9
|
+
COMMAND_RESULT_TYPE_ENUM = [
|
|
10
|
+
# TODO: Write general description for ACCEPTED
|
|
11
|
+
ACCEPTED = 'ACCEPTED'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for CANCELED_RESERVATION
|
|
14
|
+
CANCELED_RESERVATION = 'CANCELED_RESERVATION'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for EVSE_OCCUPIED
|
|
17
|
+
EVSE_OCCUPIED = 'EVSE_OCCUPIED'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for EVSE_INOPERATIVE
|
|
20
|
+
EVSE_INOPERATIVE = 'EVSE_INOPERATIVE'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for FAILED
|
|
23
|
+
FAILED = 'FAILED'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for NOT_SUPPORTED
|
|
26
|
+
NOT_SUPPORTED = 'NOT_SUPPORTED'.freeze,
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for REJECTED
|
|
29
|
+
REJECTED = 'REJECTED'.freeze,
|
|
30
|
+
|
|
31
|
+
# TODO: Write general description for TIMEOUT
|
|
32
|
+
TIMEOUT = 'TIMEOUT'.freeze,
|
|
33
|
+
|
|
34
|
+
# TODO: Write general description for UNKNOWN_RESERVATION
|
|
35
|
+
UNKNOWN_RESERVATION = 'UNKNOWN_RESERVATION'.freeze
|
|
36
|
+
].freeze
|
|
37
|
+
|
|
38
|
+
def self.validate(value)
|
|
39
|
+
return false if value.nil?
|
|
40
|
+
|
|
41
|
+
COMMAND_RESULT_TYPE_ENUM.include?(value)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def self.from_value(value, default_value = ACCEPTED)
|
|
45
|
+
return default_value if value.nil?
|
|
46
|
+
|
|
47
|
+
str = value.to_s.strip
|
|
48
|
+
|
|
49
|
+
case str.downcase
|
|
50
|
+
when 'accepted' then ACCEPTED
|
|
51
|
+
when 'canceled_reservation' then CANCELED_RESERVATION
|
|
52
|
+
when 'evse_occupied' then EVSE_OCCUPIED
|
|
53
|
+
when 'evse_inoperative' then EVSE_INOPERATIVE
|
|
54
|
+
when 'failed' then FAILED
|
|
55
|
+
when 'not_supported' then NOT_SUPPORTED
|
|
56
|
+
when 'rejected' then REJECTED
|
|
57
|
+
when 'timeout' then TIMEOUT
|
|
58
|
+
when 'unknown_reservation' then UNKNOWN_RESERVATION
|
|
59
|
+
else
|
|
60
|
+
default_value
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,184 @@
|
|
|
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 Connector is the socket or cable and plug available for the EV to use. A
|
|
9
|
+
# single EVSE may provide multiple Connectors but only one of them can be in
|
|
10
|
+
# use at the same time. A Connector always belongs to an EVSE object.
|
|
11
|
+
class Connector < BaseModel
|
|
12
|
+
SKIP = Object.new
|
|
13
|
+
private_constant :SKIP
|
|
14
|
+
|
|
15
|
+
# Identifier of the Connector within the EVSE. Two Connectors may have the
|
|
16
|
+
# same id as long as they do not belong to the same EVSE object.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
# The socket or plug standard of the charging point.
|
|
21
|
+
# @return [ConnectorTypeEnum]
|
|
22
|
+
attr_accessor :standard
|
|
23
|
+
|
|
24
|
+
# The format of the connector, whether it is a socket or a plug.
|
|
25
|
+
# @return [ConnectorFormatEnum]
|
|
26
|
+
attr_accessor :format
|
|
27
|
+
|
|
28
|
+
# The type of power at the connector.
|
|
29
|
+
# @return [PowerTypeEnum]
|
|
30
|
+
attr_accessor :power_type
|
|
31
|
+
|
|
32
|
+
# Maximum voltage of the connector (line to neutral for AC_3_PHASE), in volt
|
|
33
|
+
# [V]. For example DC Chargers might vary the voltage during charging when
|
|
34
|
+
# battery almost full.
|
|
35
|
+
# @return [Integer]
|
|
36
|
+
attr_accessor :max_voltage
|
|
37
|
+
|
|
38
|
+
# Maximum amperage of the connector, in ampere [A].
|
|
39
|
+
# @return [Integer]
|
|
40
|
+
attr_accessor :max_amperage
|
|
41
|
+
|
|
42
|
+
# Maximum electric power that can be delivered by this connector, in Watts
|
|
43
|
+
# (W).
|
|
44
|
+
# When the maximum electric power is lower than the calculated value from
|
|
45
|
+
# voltage and amperage,
|
|
46
|
+
# this value should be set.
|
|
47
|
+
# @return [Integer]
|
|
48
|
+
attr_accessor :max_electric_power
|
|
49
|
+
|
|
50
|
+
# Identifiers of the currently valid charging tariffs.
|
|
51
|
+
# Multiple tariffs are possible, but only one of each Tariff.type can be
|
|
52
|
+
# active at the same time.
|
|
53
|
+
# Tariffs with the same type are only allowed if they are not active at the
|
|
54
|
+
# same time:
|
|
55
|
+
# start_date_time and end_date_time period not overlapping.
|
|
56
|
+
# For a "free of charge" tariff, this field should be set and point to a
|
|
57
|
+
# defined
|
|
58
|
+
# "free of charge" tariff.
|
|
59
|
+
# @return [Array[String]]
|
|
60
|
+
attr_accessor :tariff_ids
|
|
61
|
+
|
|
62
|
+
# Main tariff of the CPO. Shared for backwards compatibility, but deprecated
|
|
63
|
+
# in favor of tariff_ids.
|
|
64
|
+
# @return [String]
|
|
65
|
+
attr_accessor :tariff_id
|
|
66
|
+
|
|
67
|
+
# URL to the operator's terms and conditions.
|
|
68
|
+
# @return [String]
|
|
69
|
+
attr_accessor :terms_and_conditions
|
|
70
|
+
|
|
71
|
+
# Timestamp when this Connector was last updated (or created).
|
|
72
|
+
# @return [DateTime]
|
|
73
|
+
attr_accessor :last_updated
|
|
74
|
+
|
|
75
|
+
# A mapping from model property names to API property names.
|
|
76
|
+
def self.names
|
|
77
|
+
@_hash = {} if @_hash.nil?
|
|
78
|
+
@_hash['id'] = 'id'
|
|
79
|
+
@_hash['standard'] = 'standard'
|
|
80
|
+
@_hash['format'] = 'format'
|
|
81
|
+
@_hash['power_type'] = 'power_type'
|
|
82
|
+
@_hash['max_voltage'] = 'max_voltage'
|
|
83
|
+
@_hash['max_amperage'] = 'max_amperage'
|
|
84
|
+
@_hash['max_electric_power'] = 'max_electric_power'
|
|
85
|
+
@_hash['tariff_ids'] = 'tariff_ids'
|
|
86
|
+
@_hash['tariff_id'] = 'tariff_id'
|
|
87
|
+
@_hash['terms_and_conditions'] = 'terms_and_conditions'
|
|
88
|
+
@_hash['last_updated'] = 'last_updated'
|
|
89
|
+
@_hash
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# An array for optional fields
|
|
93
|
+
def self.optionals
|
|
94
|
+
%w[
|
|
95
|
+
max_electric_power
|
|
96
|
+
tariff_ids
|
|
97
|
+
tariff_id
|
|
98
|
+
terms_and_conditions
|
|
99
|
+
]
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# An array for nullable fields
|
|
103
|
+
def self.nullables
|
|
104
|
+
[]
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def initialize(id = nil, standard = nil, format = nil, power_type = nil,
|
|
108
|
+
max_voltage = nil, max_amperage = nil, last_updated = nil,
|
|
109
|
+
max_electric_power = SKIP, tariff_ids = SKIP,
|
|
110
|
+
tariff_id = SKIP, terms_and_conditions = SKIP)
|
|
111
|
+
@id = id
|
|
112
|
+
@standard = standard
|
|
113
|
+
@format = format
|
|
114
|
+
@power_type = power_type
|
|
115
|
+
@max_voltage = max_voltage
|
|
116
|
+
@max_amperage = max_amperage
|
|
117
|
+
@max_electric_power = max_electric_power unless max_electric_power == SKIP
|
|
118
|
+
@tariff_ids = tariff_ids unless tariff_ids == SKIP
|
|
119
|
+
@tariff_id = tariff_id unless tariff_id == SKIP
|
|
120
|
+
@terms_and_conditions = terms_and_conditions unless terms_and_conditions == SKIP
|
|
121
|
+
@last_updated = last_updated
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Creates an instance of the object from a hash.
|
|
125
|
+
def self.from_hash(hash)
|
|
126
|
+
return nil unless hash
|
|
127
|
+
|
|
128
|
+
# Extract variables from the hash.
|
|
129
|
+
id = hash.key?('id') ? hash['id'] : nil
|
|
130
|
+
standard = hash.key?('standard') ? hash['standard'] : nil
|
|
131
|
+
format = hash.key?('format') ? hash['format'] : nil
|
|
132
|
+
power_type = hash.key?('power_type') ? hash['power_type'] : nil
|
|
133
|
+
max_voltage = hash.key?('max_voltage') ? hash['max_voltage'] : nil
|
|
134
|
+
max_amperage = hash.key?('max_amperage') ? hash['max_amperage'] : nil
|
|
135
|
+
last_updated = if hash.key?('last_updated')
|
|
136
|
+
(DateTimeHelper.from_rfc3339(hash['last_updated']) if hash['last_updated'])
|
|
137
|
+
end
|
|
138
|
+
max_electric_power =
|
|
139
|
+
hash.key?('max_electric_power') ? hash['max_electric_power'] : SKIP
|
|
140
|
+
tariff_ids = hash.key?('tariff_ids') ? hash['tariff_ids'] : SKIP
|
|
141
|
+
tariff_id = hash.key?('tariff_id') ? hash['tariff_id'] : SKIP
|
|
142
|
+
terms_and_conditions =
|
|
143
|
+
hash.key?('terms_and_conditions') ? hash['terms_and_conditions'] : SKIP
|
|
144
|
+
|
|
145
|
+
# Create object from extracted values.
|
|
146
|
+
Connector.new(id,
|
|
147
|
+
standard,
|
|
148
|
+
format,
|
|
149
|
+
power_type,
|
|
150
|
+
max_voltage,
|
|
151
|
+
max_amperage,
|
|
152
|
+
last_updated,
|
|
153
|
+
max_electric_power,
|
|
154
|
+
tariff_ids,
|
|
155
|
+
tariff_id,
|
|
156
|
+
terms_and_conditions)
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
def to_custom_last_updated
|
|
160
|
+
DateTimeHelper.to_rfc3339(last_updated)
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Provides a human-readable string representation of the object.
|
|
164
|
+
def to_s
|
|
165
|
+
class_name = self.class.name.split('::').last
|
|
166
|
+
"<#{class_name} id: #{@id}, standard: #{@standard}, format: #{@format}, power_type:"\
|
|
167
|
+
" #{@power_type}, max_voltage: #{@max_voltage}, max_amperage: #{@max_amperage},"\
|
|
168
|
+
" max_electric_power: #{@max_electric_power}, tariff_ids: #{@tariff_ids}, tariff_id:"\
|
|
169
|
+
" #{@tariff_id}, terms_and_conditions: #{@terms_and_conditions}, last_updated:"\
|
|
170
|
+
" #{@last_updated}>"
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
174
|
+
def inspect
|
|
175
|
+
class_name = self.class.name.split('::').last
|
|
176
|
+
"<#{class_name} id: #{@id.inspect}, standard: #{@standard.inspect}, format:"\
|
|
177
|
+
" #{@format.inspect}, power_type: #{@power_type.inspect}, max_voltage:"\
|
|
178
|
+
" #{@max_voltage.inspect}, max_amperage: #{@max_amperage.inspect}, max_electric_power:"\
|
|
179
|
+
" #{@max_electric_power.inspect}, tariff_ids: #{@tariff_ids.inspect}, tariff_id:"\
|
|
180
|
+
" #{@tariff_id.inspect}, terms_and_conditions: #{@terms_and_conditions.inspect},"\
|
|
181
|
+
" last_updated: #{@last_updated.inspect}>"
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
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
|
+
# The format of the connector, whether it is a socket or a plug.
|
|
8
|
+
class ConnectorFormatEnum
|
|
9
|
+
CONNECTOR_FORMAT_ENUM = [
|
|
10
|
+
# TODO: Write general description for SOCKET
|
|
11
|
+
SOCKET = 'SOCKET'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for CABLE
|
|
14
|
+
CABLE = 'CABLE'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
CONNECTOR_FORMAT_ENUM.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = SOCKET)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'socket' then SOCKET
|
|
30
|
+
when 'cable' then CABLE
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,196 @@
|
|
|
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 socket or plug standard of the charging point.
|
|
8
|
+
class ConnectorTypeEnum
|
|
9
|
+
CONNECTOR_TYPE_ENUM = [
|
|
10
|
+
# TODO: Write general description for CHADEMO
|
|
11
|
+
CHADEMO = 'CHADEMO'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for CHAOJI
|
|
14
|
+
CHAOJI = 'CHAOJI'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for DOMESTIC_A
|
|
17
|
+
DOMESTIC_A = 'DOMESTIC_A'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for DOMESTIC_B
|
|
20
|
+
DOMESTIC_B = 'DOMESTIC_B'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for DOMESTIC_C
|
|
23
|
+
DOMESTIC_C = 'DOMESTIC_C'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for DOMESTIC_D
|
|
26
|
+
DOMESTIC_D = 'DOMESTIC_D'.freeze,
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for DOMESTIC_E
|
|
29
|
+
DOMESTIC_E = 'DOMESTIC_E'.freeze,
|
|
30
|
+
|
|
31
|
+
# TODO: Write general description for DOMESTIC_F
|
|
32
|
+
DOMESTIC_F = 'DOMESTIC_F'.freeze,
|
|
33
|
+
|
|
34
|
+
# TODO: Write general description for DOMESTIC_G
|
|
35
|
+
DOMESTIC_G = 'DOMESTIC_G'.freeze,
|
|
36
|
+
|
|
37
|
+
# TODO: Write general description for DOMESTIC_H
|
|
38
|
+
DOMESTIC_H = 'DOMESTIC_H'.freeze,
|
|
39
|
+
|
|
40
|
+
# TODO: Write general description for DOMESTIC_I
|
|
41
|
+
DOMESTIC_I = 'DOMESTIC_I'.freeze,
|
|
42
|
+
|
|
43
|
+
# TODO: Write general description for DOMESTIC_J
|
|
44
|
+
DOMESTIC_J = 'DOMESTIC_J'.freeze,
|
|
45
|
+
|
|
46
|
+
# TODO: Write general description for DOMESTIC_K
|
|
47
|
+
DOMESTIC_K = 'DOMESTIC_K'.freeze,
|
|
48
|
+
|
|
49
|
+
# TODO: Write general description for DOMESTIC_L
|
|
50
|
+
DOMESTIC_L = 'DOMESTIC_L'.freeze,
|
|
51
|
+
|
|
52
|
+
# TODO: Write general description for DOMESTIC_M
|
|
53
|
+
DOMESTIC_M = 'DOMESTIC_M'.freeze,
|
|
54
|
+
|
|
55
|
+
# TODO: Write general description for DOMESTIC_N
|
|
56
|
+
DOMESTIC_N = 'DOMESTIC_N'.freeze,
|
|
57
|
+
|
|
58
|
+
# TODO: Write general description for DOMESTIC_O
|
|
59
|
+
DOMESTIC_O = 'DOMESTIC_O'.freeze,
|
|
60
|
+
|
|
61
|
+
# TODO: Write general description for GBT_AC
|
|
62
|
+
GBT_AC = 'GBT_AC'.freeze,
|
|
63
|
+
|
|
64
|
+
# TODO: Write general description for GBT_DC
|
|
65
|
+
GBT_DC = 'GBT_DC'.freeze,
|
|
66
|
+
|
|
67
|
+
# TODO: Write general description for IEC_60309_2_SINGLE_16
|
|
68
|
+
IEC_60309_2_SINGLE_16 = 'IEC_60309_2_single_16'.freeze,
|
|
69
|
+
|
|
70
|
+
# TODO: Write general description for IEC_60309_2_THREE_16
|
|
71
|
+
IEC_60309_2_THREE_16 = 'IEC_60309_2_three_16'.freeze,
|
|
72
|
+
|
|
73
|
+
# TODO: Write general description for IEC_60309_2_THREE_32
|
|
74
|
+
IEC_60309_2_THREE_32 = 'IEC_60309_2_three_32'.freeze,
|
|
75
|
+
|
|
76
|
+
# TODO: Write general description for IEC_60309_2_THREE_64
|
|
77
|
+
IEC_60309_2_THREE_64 = 'IEC_60309_2_three_64'.freeze,
|
|
78
|
+
|
|
79
|
+
# TODO: Write general description for IEC_62196_T1
|
|
80
|
+
IEC_62196_T1 = 'IEC_62196_T1'.freeze,
|
|
81
|
+
|
|
82
|
+
# TODO: Write general description for IEC_62196_T1_COMBO
|
|
83
|
+
IEC_62196_T1_COMBO = 'IEC_62196_T1_COMBO'.freeze,
|
|
84
|
+
|
|
85
|
+
# TODO: Write general description for IEC_62196_T2
|
|
86
|
+
IEC_62196_T2 = 'IEC_62196_T2'.freeze,
|
|
87
|
+
|
|
88
|
+
# TODO: Write general description for IEC_62196_T2_COMBO
|
|
89
|
+
IEC_62196_T2_COMBO = 'IEC_62196_T2_COMBO'.freeze,
|
|
90
|
+
|
|
91
|
+
# TODO: Write general description for IEC_62196_T3A
|
|
92
|
+
IEC_62196_T3A = 'IEC_62196_T3A'.freeze,
|
|
93
|
+
|
|
94
|
+
# TODO: Write general description for IEC_62196_T3C
|
|
95
|
+
IEC_62196_T3C = 'IEC_62196_T3C'.freeze,
|
|
96
|
+
|
|
97
|
+
# TODO: Write general description for NEMA_5_20
|
|
98
|
+
NEMA_5_20 = 'NEMA_5_20'.freeze,
|
|
99
|
+
|
|
100
|
+
# TODO: Write general description for NEMA_6_30
|
|
101
|
+
NEMA_6_30 = 'NEMA_6_30'.freeze,
|
|
102
|
+
|
|
103
|
+
# TODO: Write general description for NEMA_6_50
|
|
104
|
+
NEMA_6_50 = 'NEMA_6_50'.freeze,
|
|
105
|
+
|
|
106
|
+
# TODO: Write general description for NEMA_10_30
|
|
107
|
+
NEMA_10_30 = 'NEMA_10_30'.freeze,
|
|
108
|
+
|
|
109
|
+
# TODO: Write general description for NEMA_10_50
|
|
110
|
+
NEMA_10_50 = 'NEMA_10_50'.freeze,
|
|
111
|
+
|
|
112
|
+
# TODO: Write general description for NEMA_14_30
|
|
113
|
+
NEMA_14_30 = 'NEMA_14_30'.freeze,
|
|
114
|
+
|
|
115
|
+
# TODO: Write general description for NEMA_14_50
|
|
116
|
+
NEMA_14_50 = 'NEMA_14_50'.freeze,
|
|
117
|
+
|
|
118
|
+
# TODO: Write general description for PANTOGRAPH_BOTTOM_UP
|
|
119
|
+
PANTOGRAPH_BOTTOM_UP = 'PANTOGRAPH_BOTTOM_UP'.freeze,
|
|
120
|
+
|
|
121
|
+
# TODO: Write general description for PANTOGRAPH_TOP_DOWN
|
|
122
|
+
PANTOGRAPH_TOP_DOWN = 'PANTOGRAPH_TOP_DOWN'.freeze,
|
|
123
|
+
|
|
124
|
+
# TODO: Write general description for MCS
|
|
125
|
+
MCS = 'MCS'.freeze,
|
|
126
|
+
|
|
127
|
+
# TODO: Write general description for SAE_J3400
|
|
128
|
+
SAE_J3400 = 'SAE_J3400'.freeze,
|
|
129
|
+
|
|
130
|
+
# TODO: Write general description for TESLA_R
|
|
131
|
+
TESLA_R = 'TESLA_R'.freeze,
|
|
132
|
+
|
|
133
|
+
# TODO: Write general description for TESLA_S
|
|
134
|
+
TESLA_S = 'TESLA_S'.freeze
|
|
135
|
+
].freeze
|
|
136
|
+
|
|
137
|
+
def self.validate(value)
|
|
138
|
+
return false if value.nil?
|
|
139
|
+
|
|
140
|
+
CONNECTOR_TYPE_ENUM.include?(value)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def self.from_value(value, default_value = CHADEMO)
|
|
144
|
+
return default_value if value.nil?
|
|
145
|
+
|
|
146
|
+
str = value.to_s.strip
|
|
147
|
+
|
|
148
|
+
case str.downcase
|
|
149
|
+
when 'chademo' then CHADEMO
|
|
150
|
+
when 'chaoji' then CHAOJI
|
|
151
|
+
when 'domestic_a' then DOMESTIC_A
|
|
152
|
+
when 'domestic_b' then DOMESTIC_B
|
|
153
|
+
when 'domestic_c' then DOMESTIC_C
|
|
154
|
+
when 'domestic_d' then DOMESTIC_D
|
|
155
|
+
when 'domestic_e' then DOMESTIC_E
|
|
156
|
+
when 'domestic_f' then DOMESTIC_F
|
|
157
|
+
when 'domestic_g' then DOMESTIC_G
|
|
158
|
+
when 'domestic_h' then DOMESTIC_H
|
|
159
|
+
when 'domestic_i' then DOMESTIC_I
|
|
160
|
+
when 'domestic_j' then DOMESTIC_J
|
|
161
|
+
when 'domestic_k' then DOMESTIC_K
|
|
162
|
+
when 'domestic_l' then DOMESTIC_L
|
|
163
|
+
when 'domestic_m' then DOMESTIC_M
|
|
164
|
+
when 'domestic_n' then DOMESTIC_N
|
|
165
|
+
when 'domestic_o' then DOMESTIC_O
|
|
166
|
+
when 'gbt_ac' then GBT_AC
|
|
167
|
+
when 'gbt_dc' then GBT_DC
|
|
168
|
+
when 'iec_60309_2_single_16' then IEC_60309_2_SINGLE_16
|
|
169
|
+
when 'iec_60309_2_three_16' then IEC_60309_2_THREE_16
|
|
170
|
+
when 'iec_60309_2_three_32' then IEC_60309_2_THREE_32
|
|
171
|
+
when 'iec_60309_2_three_64' then IEC_60309_2_THREE_64
|
|
172
|
+
when 'iec_62196_t1' then IEC_62196_T1
|
|
173
|
+
when 'iec_62196_t1_combo' then IEC_62196_T1_COMBO
|
|
174
|
+
when 'iec_62196_t2' then IEC_62196_T2
|
|
175
|
+
when 'iec_62196_t2_combo' then IEC_62196_T2_COMBO
|
|
176
|
+
when 'iec_62196_t3a' then IEC_62196_T3A
|
|
177
|
+
when 'iec_62196_t3c' then IEC_62196_T3C
|
|
178
|
+
when 'nema_5_20' then NEMA_5_20
|
|
179
|
+
when 'nema_6_30' then NEMA_6_30
|
|
180
|
+
when 'nema_6_50' then NEMA_6_50
|
|
181
|
+
when 'nema_10_30' then NEMA_10_30
|
|
182
|
+
when 'nema_10_50' then NEMA_10_50
|
|
183
|
+
when 'nema_14_30' then NEMA_14_30
|
|
184
|
+
when 'nema_14_50' then NEMA_14_50
|
|
185
|
+
when 'pantograph_bottom_up' then PANTOGRAPH_BOTTOM_UP
|
|
186
|
+
when 'pantograph_top_down' then PANTOGRAPH_TOP_DOWN
|
|
187
|
+
when 'mcs' then MCS
|
|
188
|
+
when 'sae_j3400' then SAE_J3400
|
|
189
|
+
when 'tesla_r' then TESLA_R
|
|
190
|
+
when 'tesla_s' then TESLA_S
|
|
191
|
+
else
|
|
192
|
+
default_value
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
# Day of the week.
|
|
8
|
+
class DayOfWeekEnum
|
|
9
|
+
DAY_OF_WEEK_ENUM = [
|
|
10
|
+
# TODO: Write general description for MONDAY
|
|
11
|
+
MONDAY = 'MONDAY'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for TUESDAY
|
|
14
|
+
TUESDAY = 'TUESDAY'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for WEDNESDAY
|
|
17
|
+
WEDNESDAY = 'WEDNESDAY'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for THURSDAY
|
|
20
|
+
THURSDAY = 'THURSDAY'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for FRIDAY
|
|
23
|
+
FRIDAY = 'FRIDAY'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for SATURDAY
|
|
26
|
+
SATURDAY = 'SATURDAY'.freeze,
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for SUNDAY
|
|
29
|
+
SUNDAY = 'SUNDAY'.freeze
|
|
30
|
+
].freeze
|
|
31
|
+
|
|
32
|
+
def self.validate(value)
|
|
33
|
+
return false if value.nil?
|
|
34
|
+
|
|
35
|
+
DAY_OF_WEEK_ENUM.include?(value)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def self.from_value(value, default_value = MONDAY)
|
|
39
|
+
return default_value if value.nil?
|
|
40
|
+
|
|
41
|
+
str = value.to_s.strip
|
|
42
|
+
|
|
43
|
+
case str.downcase
|
|
44
|
+
when 'monday' then MONDAY
|
|
45
|
+
when 'tuesday' then TUESDAY
|
|
46
|
+
when 'wednesday' then WEDNESDAY
|
|
47
|
+
when 'thursday' then THURSDAY
|
|
48
|
+
when 'friday' then FRIDAY
|
|
49
|
+
when 'saturday' then SATURDAY
|
|
50
|
+
when 'sunday' then SUNDAY
|
|
51
|
+
else
|
|
52
|
+
default_value
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
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
|
+
# Multi-language text with a language code and text value.
|
|
8
|
+
class DisplayText < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Language Code ISO 639-1.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :language
|
|
15
|
+
|
|
16
|
+
# Text to be displayed to an end user. No markup, html etc. allowed.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :text
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['language'] = 'language'
|
|
24
|
+
@_hash['text'] = 'text'
|
|
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(language = nil, text = nil)
|
|
39
|
+
@language = language
|
|
40
|
+
@text = text
|
|
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
|
+
language = hash.key?('language') ? hash['language'] : nil
|
|
49
|
+
text = hash.key?('text') ? hash['text'] : nil
|
|
50
|
+
|
|
51
|
+
# Create object from extracted values.
|
|
52
|
+
DisplayText.new(language,
|
|
53
|
+
text)
|
|
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} language: #{@language}, text: #{@text}>"
|
|
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} language: #{@language.inspect}, text: #{@text.inspect}>"
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|