ev-recharge-sdk 1.0.0
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 +92 -0
- data/lib/shell_ev/api_helper.rb +10 -0
- data/lib/shell_ev/client.rb +77 -0
- data/lib/shell_ev/configuration.rb +110 -0
- data/lib/shell_ev/controllers/base_controller.rb +66 -0
- data/lib/shell_ev/controllers/charging_controller.rb +216 -0
- data/lib/shell_ev/controllers/locations_controller.rb +352 -0
- data/lib/shell_ev/controllers/o_auth_authorization_controller.rb +42 -0
- data/lib/shell_ev/exceptions/api_exception.rb +10 -0
- data/lib/shell_ev/exceptions/bad_request_exception.rb +37 -0
- data/lib/shell_ev/exceptions/http401_error_response_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m400_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m401_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m404_error_response_error1_exception.rb +53 -0
- data/lib/shell_ev/exceptions/m405_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m429_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m500_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m503_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/not_found_exception.rb +37 -0
- data/lib/shell_ev/exceptions/o_auth_provider_exception.rb +48 -0
- data/lib/shell_ev/exceptions/unauthorized_exception.rb +37 -0
- data/lib/shell_ev/http/auth/o_auth2.rb +90 -0
- data/lib/shell_ev/http/http_call_back.rb +10 -0
- data/lib/shell_ev/http/http_method_enum.rb +10 -0
- data/lib/shell_ev/http/http_request.rb +10 -0
- data/lib/shell_ev/http/http_response.rb +10 -0
- data/lib/shell_ev/models/accessibility.rb +60 -0
- data/lib/shell_ev/models/accessibility_status_enum.rb +29 -0
- data/lib/shell_ev/models/active_response200_json.rb +78 -0
- data/lib/shell_ev/models/active_response200_json_status_enum.rb +23 -0
- data/lib/shell_ev/models/address.rb +81 -0
- data/lib/shell_ev/models/base_model.rb +62 -0
- data/lib/shell_ev/models/chargesession_start_body.rb +59 -0
- data/lib/shell_ev/models/connector_vo.rb +134 -0
- data/lib/shell_ev/models/connector_vo_connector_type_enum.rb +71 -0
- data/lib/shell_ev/models/connector_vo_updated_by_enum.rb +29 -0
- data/lib/shell_ev/models/coordinates.rb +70 -0
- data/lib/shell_ev/models/data_active.rb +153 -0
- data/lib/shell_ev/models/data_active_session_code_enum.rb +44 -0
- data/lib/shell_ev/models/data_active_session_state_enum.rb +35 -0
- data/lib/shell_ev/models/data_retrieve.rb +152 -0
- data/lib/shell_ev/models/data_retrieve_session_code_enum.rb +44 -0
- data/lib/shell_ev/models/data_retrieve_session_state_enum.rb +35 -0
- data/lib/shell_ev/models/electrical_properties.rb +81 -0
- data/lib/shell_ev/models/electrical_properties_power_type_enum.rb +26 -0
- data/lib/shell_ev/models/env_enum.rb +23 -0
- data/lib/shell_ev/models/evse_vo.rb +143 -0
- data/lib/shell_ev/models/evse_vo_authorization_methods_enum.rb +26 -0
- data/lib/shell_ev/models/evse_vo_status_enum.rb +29 -0
- data/lib/shell_ev/models/get_charge_session_retrieve_response200_json.rb +78 -0
- data/lib/shell_ev/models/get_charge_session_retrieve_response200_json_status_enum.rb +23 -0
- data/lib/shell_ev/models/get_locations_list_authorization_methods_enum.rb +26 -0
- data/lib/shell_ev/models/get_locations_list_connector_types_enum.rb +71 -0
- data/lib/shell_ev/models/get_locations_list_evse_status_enum.rb +29 -0
- data/lib/shell_ev/models/get_markers_list_authorization_methods_enum.rb +26 -0
- data/lib/shell_ev/models/get_markers_list_connector_types_enum.rb +71 -0
- data/lib/shell_ev/models/get_markers_list_evse_status_enum.rb +29 -0
- data/lib/shell_ev/models/get_nearby_locations_authorization_methods_enum.rb +26 -0
- data/lib/shell_ev/models/get_nearby_locations_connector_types_enum.rb +71 -0
- data/lib/shell_ev/models/get_nearby_locations_evse_status_enum.rb +29 -0
- data/lib/shell_ev/models/inline_response202.rb +76 -0
- data/lib/shell_ev/models/inline_response2021.rb +58 -0
- data/lib/shell_ev/models/inline_response2021_status_enum.rb +23 -0
- data/lib/shell_ev/models/inline_response202_data.rb +48 -0
- data/lib/shell_ev/models/inline_response202_status_enum.rb +23 -0
- data/lib/shell_ev/models/location_respone_object.rb +172 -0
- data/lib/shell_ev/models/m400_error_response.rb +78 -0
- data/lib/shell_ev/models/m400_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m401_error_response.rb +78 -0
- data/lib/shell_ev/models/m401_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m404_error_response.rb +79 -0
- data/lib/shell_ev/models/m404_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m405_error_response.rb +78 -0
- data/lib/shell_ev/models/m405_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m429_error_response.rb +78 -0
- data/lib/shell_ev/models/m429_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m500_error_response.rb +78 -0
- data/lib/shell_ev/models/m500_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m503_error_response.rb +78 -0
- data/lib/shell_ev/models/m503_error_response_error.rb +80 -0
- data/lib/shell_ev/models/multi_location_marker.rb +126 -0
- data/lib/shell_ev/models/o_auth_provider_error_enum.rb +45 -0
- data/lib/shell_ev/models/o_auth_token.rb +100 -0
- data/lib/shell_ev/models/opening_hours_object.rb +70 -0
- data/lib/shell_ev/models/opening_hours_object_week_day_enum.rb +38 -0
- data/lib/shell_ev/models/response_base_status_enum.rb +26 -0
- data/lib/shell_ev/models/response_error401_all_of1.rb +57 -0
- data/lib/shell_ev/models/response_error401_all_of1_errors_items.rb +80 -0
- data/lib/shell_ev/models/single_location_marker.rb +157 -0
- data/lib/shell_ev/models/single_location_marker_authorization_methods_items_enum.rb +26 -0
- data/lib/shell_ev/models/single_location_marker_status_enum.rb +30 -0
- data/lib/shell_ev/models/stop_charge_session_request_body_json.rb +48 -0
- data/lib/shell_ev/models/success_response.rb +58 -0
- data/lib/shell_ev/models/tariff_vo.rb +111 -0
- data/lib/shell_ev/models/tariff_vo_updated_by_enum.rb +29 -0
- data/lib/shell_ev/utilities/date_time_helper.rb +11 -0
- data/lib/shell_ev/utilities/file_wrapper.rb +16 -0
- data/lib/shell_ev/utilities/union_type_lookup.rb +38 -0
- data/lib/shell_ev.rb +125 -0
- data/test/controllers/controller_test_base.rb +34 -0
- data/test/controllers/test_charging_controller.rb +78 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +224 -0
@@ -0,0 +1,172 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# LocationResponeObject Model.
|
8
|
+
class LocationResponeObject < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Unique Internal identifier used to refer to this Location by Shell
|
13
|
+
# Recharge
|
14
|
+
# @return [Integer]
|
15
|
+
attr_accessor :uid
|
16
|
+
|
17
|
+
# Identifier as given by the Shell Recharge Operator, unique for that
|
18
|
+
# Operator
|
19
|
+
# @return [String]
|
20
|
+
attr_accessor :external_id
|
21
|
+
|
22
|
+
# Coordinates of the Shell Recharge Site Location
|
23
|
+
# @return [Coordinates]
|
24
|
+
attr_accessor :coordinates
|
25
|
+
|
26
|
+
# Operator of this Shell Recharge Location
|
27
|
+
# @return [String]
|
28
|
+
attr_accessor :operator_name
|
29
|
+
|
30
|
+
# Address of the Shell Recharge Location
|
31
|
+
# @return [Address]
|
32
|
+
attr_accessor :address
|
33
|
+
|
34
|
+
# Accessibility of the Location
|
35
|
+
# @return [Accessibility]
|
36
|
+
attr_accessor :accessibility
|
37
|
+
|
38
|
+
# Accessibility of the Location
|
39
|
+
# @return [Array[EvseVO]]
|
40
|
+
attr_accessor :evses
|
41
|
+
|
42
|
+
# Optional Opening Hours of the Location. Please note that it is not
|
43
|
+
# available for all sites.
|
44
|
+
# @return [Array[OpeningHoursObject]]
|
45
|
+
attr_accessor :opening_hours
|
46
|
+
|
47
|
+
# ISO8601-compliant UTC datetime of the last update of the location
|
48
|
+
# @return [String]
|
49
|
+
attr_accessor :updated
|
50
|
+
|
51
|
+
# optional Operator-wide arbitrary text (eg promotional, warning)
|
52
|
+
# @return [String]
|
53
|
+
attr_accessor :operator_comment
|
54
|
+
|
55
|
+
# the type of the location. Could be "UNKNOWN".
|
56
|
+
# @return [String]
|
57
|
+
attr_accessor :location_type
|
58
|
+
|
59
|
+
# A mapping from model property names to API property names.
|
60
|
+
def self.names
|
61
|
+
@_hash = {} if @_hash.nil?
|
62
|
+
@_hash['uid'] = 'uid'
|
63
|
+
@_hash['external_id'] = 'externalId'
|
64
|
+
@_hash['coordinates'] = 'coordinates'
|
65
|
+
@_hash['operator_name'] = 'operatorName'
|
66
|
+
@_hash['address'] = 'address'
|
67
|
+
@_hash['accessibility'] = 'accessibility'
|
68
|
+
@_hash['evses'] = 'evses'
|
69
|
+
@_hash['opening_hours'] = 'openingHours'
|
70
|
+
@_hash['updated'] = 'updated'
|
71
|
+
@_hash['operator_comment'] = 'operatorComment'
|
72
|
+
@_hash['location_type'] = 'locationType'
|
73
|
+
@_hash
|
74
|
+
end
|
75
|
+
|
76
|
+
# An array for optional fields
|
77
|
+
def self.optionals
|
78
|
+
%w[
|
79
|
+
uid
|
80
|
+
external_id
|
81
|
+
coordinates
|
82
|
+
operator_name
|
83
|
+
address
|
84
|
+
accessibility
|
85
|
+
evses
|
86
|
+
opening_hours
|
87
|
+
updated
|
88
|
+
operator_comment
|
89
|
+
location_type
|
90
|
+
]
|
91
|
+
end
|
92
|
+
|
93
|
+
# An array for nullable fields
|
94
|
+
def self.nullables
|
95
|
+
[]
|
96
|
+
end
|
97
|
+
|
98
|
+
def initialize(uid = SKIP,
|
99
|
+
external_id = SKIP,
|
100
|
+
coordinates = SKIP,
|
101
|
+
operator_name = SKIP,
|
102
|
+
address = SKIP,
|
103
|
+
accessibility = SKIP,
|
104
|
+
evses = SKIP,
|
105
|
+
opening_hours = SKIP,
|
106
|
+
updated = SKIP,
|
107
|
+
operator_comment = SKIP,
|
108
|
+
location_type = SKIP)
|
109
|
+
@uid = uid unless uid == SKIP
|
110
|
+
@external_id = external_id unless external_id == SKIP
|
111
|
+
@coordinates = coordinates unless coordinates == SKIP
|
112
|
+
@operator_name = operator_name unless operator_name == SKIP
|
113
|
+
@address = address unless address == SKIP
|
114
|
+
@accessibility = accessibility unless accessibility == SKIP
|
115
|
+
@evses = evses unless evses == SKIP
|
116
|
+
@opening_hours = opening_hours unless opening_hours == SKIP
|
117
|
+
@updated = updated unless updated == SKIP
|
118
|
+
@operator_comment = operator_comment unless operator_comment == SKIP
|
119
|
+
@location_type = location_type unless location_type == SKIP
|
120
|
+
end
|
121
|
+
|
122
|
+
# Creates an instance of the object from a hash.
|
123
|
+
def self.from_hash(hash)
|
124
|
+
return nil unless hash
|
125
|
+
|
126
|
+
# Extract variables from the hash.
|
127
|
+
uid = hash.key?('uid') ? hash['uid'] : SKIP
|
128
|
+
external_id = hash.key?('externalId') ? hash['externalId'] : SKIP
|
129
|
+
coordinates = Coordinates.from_hash(hash['coordinates']) if hash['coordinates']
|
130
|
+
operator_name = hash.key?('operatorName') ? hash['operatorName'] : SKIP
|
131
|
+
address = Address.from_hash(hash['address']) if hash['address']
|
132
|
+
accessibility = Accessibility.from_hash(hash['accessibility']) if hash['accessibility']
|
133
|
+
# Parameter is an array, so we need to iterate through it
|
134
|
+
evses = nil
|
135
|
+
unless hash['evses'].nil?
|
136
|
+
evses = []
|
137
|
+
hash['evses'].each do |structure|
|
138
|
+
evses << (EvseVO.from_hash(structure) if structure)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
evses = SKIP unless hash.key?('evses')
|
143
|
+
# Parameter is an array, so we need to iterate through it
|
144
|
+
opening_hours = nil
|
145
|
+
unless hash['openingHours'].nil?
|
146
|
+
opening_hours = []
|
147
|
+
hash['openingHours'].each do |structure|
|
148
|
+
opening_hours << (OpeningHoursObject.from_hash(structure) if structure)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
opening_hours = SKIP unless hash.key?('openingHours')
|
153
|
+
updated = hash.key?('updated') ? hash['updated'] : SKIP
|
154
|
+
operator_comment =
|
155
|
+
hash.key?('operatorComment') ? hash['operatorComment'] : SKIP
|
156
|
+
location_type = hash.key?('locationType') ? hash['locationType'] : SKIP
|
157
|
+
|
158
|
+
# Create object from extracted values.
|
159
|
+
LocationResponeObject.new(uid,
|
160
|
+
external_id,
|
161
|
+
coordinates,
|
162
|
+
operator_name,
|
163
|
+
address,
|
164
|
+
accessibility,
|
165
|
+
evses,
|
166
|
+
opening_hours,
|
167
|
+
updated,
|
168
|
+
operator_comment,
|
169
|
+
location_type)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Bad Request
|
8
|
+
class M400ErrorResponse < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Mandatory UUID (according to RFC 4122 standards) for requests and
|
13
|
+
# responses. This will be played back in the response from the request.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :request_id
|
16
|
+
|
17
|
+
# Indicates overall status of the request
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :status
|
20
|
+
|
21
|
+
# Indicates overall status of the request
|
22
|
+
# @return [Array[M400ErrorResponseError]]
|
23
|
+
attr_accessor :errors
|
24
|
+
|
25
|
+
# A mapping from model property names to API property names.
|
26
|
+
def self.names
|
27
|
+
@_hash = {} if @_hash.nil?
|
28
|
+
@_hash['request_id'] = 'RequestId'
|
29
|
+
@_hash['status'] = 'Status'
|
30
|
+
@_hash['errors'] = 'Errors'
|
31
|
+
@_hash
|
32
|
+
end
|
33
|
+
|
34
|
+
# An array for optional fields
|
35
|
+
def self.optionals
|
36
|
+
%w[
|
37
|
+
errors
|
38
|
+
]
|
39
|
+
end
|
40
|
+
|
41
|
+
# An array for nullable fields
|
42
|
+
def self.nullables
|
43
|
+
[]
|
44
|
+
end
|
45
|
+
|
46
|
+
def initialize(request_id = nil,
|
47
|
+
status = nil,
|
48
|
+
errors = SKIP)
|
49
|
+
@request_id = request_id
|
50
|
+
@status = status
|
51
|
+
@errors = errors unless errors == SKIP
|
52
|
+
end
|
53
|
+
|
54
|
+
# Creates an instance of the object from a hash.
|
55
|
+
def self.from_hash(hash)
|
56
|
+
return nil unless hash
|
57
|
+
|
58
|
+
# Extract variables from the hash.
|
59
|
+
request_id = hash.key?('RequestId') ? hash['RequestId'] : nil
|
60
|
+
status = hash.key?('Status') ? hash['Status'] : nil
|
61
|
+
# Parameter is an array, so we need to iterate through it
|
62
|
+
errors = nil
|
63
|
+
unless hash['Errors'].nil?
|
64
|
+
errors = []
|
65
|
+
hash['Errors'].each do |structure|
|
66
|
+
errors << (M400ErrorResponseError.from_hash(structure) if structure)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
errors = SKIP unless hash.key?('Errors')
|
71
|
+
|
72
|
+
# Create object from extracted values.
|
73
|
+
M400ErrorResponse.new(request_id,
|
74
|
+
status,
|
75
|
+
errors)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# M400ErrorResponseError Model.
|
8
|
+
class M400ErrorResponseError < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Error code that logically best represents the error encountered
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :code
|
15
|
+
|
16
|
+
# Description of the error type
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :title
|
19
|
+
|
20
|
+
# Details of the error that can help under the cause of the error
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :detail
|
23
|
+
|
24
|
+
# Details of the error that can help under the cause of the error
|
25
|
+
# @return [Hash[String, String]]
|
26
|
+
attr_accessor :additional_info
|
27
|
+
|
28
|
+
# A mapping from model property names to API property names.
|
29
|
+
def self.names
|
30
|
+
@_hash = {} if @_hash.nil?
|
31
|
+
@_hash['code'] = 'Code'
|
32
|
+
@_hash['title'] = 'Title'
|
33
|
+
@_hash['detail'] = 'Detail'
|
34
|
+
@_hash['additional_info'] = 'AdditionalInfo'
|
35
|
+
@_hash
|
36
|
+
end
|
37
|
+
|
38
|
+
# An array for optional fields
|
39
|
+
def self.optionals
|
40
|
+
%w[
|
41
|
+
additional_info
|
42
|
+
]
|
43
|
+
end
|
44
|
+
|
45
|
+
# An array for nullable fields
|
46
|
+
def self.nullables
|
47
|
+
%w[
|
48
|
+
additional_info
|
49
|
+
]
|
50
|
+
end
|
51
|
+
|
52
|
+
def initialize(code = nil,
|
53
|
+
title = nil,
|
54
|
+
detail = nil,
|
55
|
+
additional_info = SKIP)
|
56
|
+
@code = code
|
57
|
+
@title = title
|
58
|
+
@detail = detail
|
59
|
+
@additional_info = additional_info unless additional_info == SKIP
|
60
|
+
end
|
61
|
+
|
62
|
+
# Creates an instance of the object from a hash.
|
63
|
+
def self.from_hash(hash)
|
64
|
+
return nil unless hash
|
65
|
+
|
66
|
+
# Extract variables from the hash.
|
67
|
+
code = hash.key?('Code') ? hash['Code'] : nil
|
68
|
+
title = hash.key?('Title') ? hash['Title'] : nil
|
69
|
+
detail = hash.key?('Detail') ? hash['Detail'] : nil
|
70
|
+
additional_info =
|
71
|
+
hash.key?('AdditionalInfo') ? hash['AdditionalInfo'] : SKIP
|
72
|
+
|
73
|
+
# Create object from extracted values.
|
74
|
+
M400ErrorResponseError.new(code,
|
75
|
+
title,
|
76
|
+
detail,
|
77
|
+
additional_info)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Unauthorized
|
8
|
+
class M401ErrorResponse < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Mandatory UUID (according to RFC 4122 standards) for requests and
|
13
|
+
# responses. This will be played back in the response from the request.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :request_id
|
16
|
+
|
17
|
+
# Indicates overall status of the request
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :status
|
20
|
+
|
21
|
+
# Indicates overall status of the request
|
22
|
+
# @return [Array[M401ErrorResponseError]]
|
23
|
+
attr_accessor :errors
|
24
|
+
|
25
|
+
# A mapping from model property names to API property names.
|
26
|
+
def self.names
|
27
|
+
@_hash = {} if @_hash.nil?
|
28
|
+
@_hash['request_id'] = 'RequestId'
|
29
|
+
@_hash['status'] = 'Status'
|
30
|
+
@_hash['errors'] = 'Errors'
|
31
|
+
@_hash
|
32
|
+
end
|
33
|
+
|
34
|
+
# An array for optional fields
|
35
|
+
def self.optionals
|
36
|
+
%w[
|
37
|
+
errors
|
38
|
+
]
|
39
|
+
end
|
40
|
+
|
41
|
+
# An array for nullable fields
|
42
|
+
def self.nullables
|
43
|
+
[]
|
44
|
+
end
|
45
|
+
|
46
|
+
def initialize(request_id = nil,
|
47
|
+
status = nil,
|
48
|
+
errors = SKIP)
|
49
|
+
@request_id = request_id
|
50
|
+
@status = status
|
51
|
+
@errors = errors unless errors == SKIP
|
52
|
+
end
|
53
|
+
|
54
|
+
# Creates an instance of the object from a hash.
|
55
|
+
def self.from_hash(hash)
|
56
|
+
return nil unless hash
|
57
|
+
|
58
|
+
# Extract variables from the hash.
|
59
|
+
request_id = hash.key?('RequestId') ? hash['RequestId'] : nil
|
60
|
+
status = hash.key?('Status') ? hash['Status'] : nil
|
61
|
+
# Parameter is an array, so we need to iterate through it
|
62
|
+
errors = nil
|
63
|
+
unless hash['Errors'].nil?
|
64
|
+
errors = []
|
65
|
+
hash['Errors'].each do |structure|
|
66
|
+
errors << (M401ErrorResponseError.from_hash(structure) if structure)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
errors = SKIP unless hash.key?('Errors')
|
71
|
+
|
72
|
+
# Create object from extracted values.
|
73
|
+
M401ErrorResponse.new(request_id,
|
74
|
+
status,
|
75
|
+
errors)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# M401ErrorResponseError Model.
|
8
|
+
class M401ErrorResponseError < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Error code that logically best represents the error encountered
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :code
|
15
|
+
|
16
|
+
# Description of the error type
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :title
|
19
|
+
|
20
|
+
# Details of the error that can help under the cause of the error
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :detail
|
23
|
+
|
24
|
+
# Details of the error that can help under the cause of the error
|
25
|
+
# @return [Hash[String, String]]
|
26
|
+
attr_accessor :additional_info
|
27
|
+
|
28
|
+
# A mapping from model property names to API property names.
|
29
|
+
def self.names
|
30
|
+
@_hash = {} if @_hash.nil?
|
31
|
+
@_hash['code'] = 'Code'
|
32
|
+
@_hash['title'] = 'Title'
|
33
|
+
@_hash['detail'] = 'Detail'
|
34
|
+
@_hash['additional_info'] = 'AdditionalInfo'
|
35
|
+
@_hash
|
36
|
+
end
|
37
|
+
|
38
|
+
# An array for optional fields
|
39
|
+
def self.optionals
|
40
|
+
%w[
|
41
|
+
additional_info
|
42
|
+
]
|
43
|
+
end
|
44
|
+
|
45
|
+
# An array for nullable fields
|
46
|
+
def self.nullables
|
47
|
+
%w[
|
48
|
+
additional_info
|
49
|
+
]
|
50
|
+
end
|
51
|
+
|
52
|
+
def initialize(code = nil,
|
53
|
+
title = nil,
|
54
|
+
detail = nil,
|
55
|
+
additional_info = SKIP)
|
56
|
+
@code = code
|
57
|
+
@title = title
|
58
|
+
@detail = detail
|
59
|
+
@additional_info = additional_info unless additional_info == SKIP
|
60
|
+
end
|
61
|
+
|
62
|
+
# Creates an instance of the object from a hash.
|
63
|
+
def self.from_hash(hash)
|
64
|
+
return nil unless hash
|
65
|
+
|
66
|
+
# Extract variables from the hash.
|
67
|
+
code = hash.key?('Code') ? hash['Code'] : nil
|
68
|
+
title = hash.key?('Title') ? hash['Title'] : nil
|
69
|
+
detail = hash.key?('Detail') ? hash['Detail'] : nil
|
70
|
+
additional_info =
|
71
|
+
hash.key?('AdditionalInfo') ? hash['AdditionalInfo'] : SKIP
|
72
|
+
|
73
|
+
# Create object from extracted values.
|
74
|
+
M401ErrorResponseError.new(code,
|
75
|
+
title,
|
76
|
+
detail,
|
77
|
+
additional_info)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Invalid charge token with given EmaId was not found. Backend HTTP 410 should
|
8
|
+
# be transformed to 404.
|
9
|
+
class M404ErrorResponse < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# Mandatory UUID (according to RFC 4122 standards) for requests and
|
14
|
+
# responses. This will be played back in the response from the request.
|
15
|
+
# @return [String]
|
16
|
+
attr_accessor :request_id
|
17
|
+
|
18
|
+
# Indicates overall status of the request
|
19
|
+
# @return [String]
|
20
|
+
attr_accessor :status
|
21
|
+
|
22
|
+
# Indicates overall status of the request
|
23
|
+
# @return [Array[M404ErrorResponseError]]
|
24
|
+
attr_accessor :errors
|
25
|
+
|
26
|
+
# A mapping from model property names to API property names.
|
27
|
+
def self.names
|
28
|
+
@_hash = {} if @_hash.nil?
|
29
|
+
@_hash['request_id'] = 'RequestId'
|
30
|
+
@_hash['status'] = 'Status'
|
31
|
+
@_hash['errors'] = 'Errors'
|
32
|
+
@_hash
|
33
|
+
end
|
34
|
+
|
35
|
+
# An array for optional fields
|
36
|
+
def self.optionals
|
37
|
+
%w[
|
38
|
+
errors
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
# An array for nullable fields
|
43
|
+
def self.nullables
|
44
|
+
[]
|
45
|
+
end
|
46
|
+
|
47
|
+
def initialize(request_id = nil,
|
48
|
+
status = nil,
|
49
|
+
errors = SKIP)
|
50
|
+
@request_id = request_id
|
51
|
+
@status = status
|
52
|
+
@errors = errors unless errors == SKIP
|
53
|
+
end
|
54
|
+
|
55
|
+
# Creates an instance of the object from a hash.
|
56
|
+
def self.from_hash(hash)
|
57
|
+
return nil unless hash
|
58
|
+
|
59
|
+
# Extract variables from the hash.
|
60
|
+
request_id = hash.key?('RequestId') ? hash['RequestId'] : nil
|
61
|
+
status = hash.key?('Status') ? hash['Status'] : nil
|
62
|
+
# Parameter is an array, so we need to iterate through it
|
63
|
+
errors = nil
|
64
|
+
unless hash['Errors'].nil?
|
65
|
+
errors = []
|
66
|
+
hash['Errors'].each do |structure|
|
67
|
+
errors << (M404ErrorResponseError.from_hash(structure) if structure)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
errors = SKIP unless hash.key?('Errors')
|
72
|
+
|
73
|
+
# Create object from extracted values.
|
74
|
+
M404ErrorResponse.new(request_id,
|
75
|
+
status,
|
76
|
+
errors)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# M404ErrorResponseError Model.
|
8
|
+
class M404ErrorResponseError < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Error code that logically best represents the error encountered
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :code
|
15
|
+
|
16
|
+
# Description of the error type
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :title
|
19
|
+
|
20
|
+
# Details of the error that can help under the cause of the error
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :detail
|
23
|
+
|
24
|
+
# Details of the error that can help under the cause of the error
|
25
|
+
# @return [Hash[String, String]]
|
26
|
+
attr_accessor :additional_info
|
27
|
+
|
28
|
+
# A mapping from model property names to API property names.
|
29
|
+
def self.names
|
30
|
+
@_hash = {} if @_hash.nil?
|
31
|
+
@_hash['code'] = 'Code'
|
32
|
+
@_hash['title'] = 'Title'
|
33
|
+
@_hash['detail'] = 'Detail'
|
34
|
+
@_hash['additional_info'] = 'AdditionalInfo'
|
35
|
+
@_hash
|
36
|
+
end
|
37
|
+
|
38
|
+
# An array for optional fields
|
39
|
+
def self.optionals
|
40
|
+
%w[
|
41
|
+
additional_info
|
42
|
+
]
|
43
|
+
end
|
44
|
+
|
45
|
+
# An array for nullable fields
|
46
|
+
def self.nullables
|
47
|
+
%w[
|
48
|
+
additional_info
|
49
|
+
]
|
50
|
+
end
|
51
|
+
|
52
|
+
def initialize(code = nil,
|
53
|
+
title = nil,
|
54
|
+
detail = nil,
|
55
|
+
additional_info = SKIP)
|
56
|
+
@code = code
|
57
|
+
@title = title
|
58
|
+
@detail = detail
|
59
|
+
@additional_info = additional_info unless additional_info == SKIP
|
60
|
+
end
|
61
|
+
|
62
|
+
# Creates an instance of the object from a hash.
|
63
|
+
def self.from_hash(hash)
|
64
|
+
return nil unless hash
|
65
|
+
|
66
|
+
# Extract variables from the hash.
|
67
|
+
code = hash.key?('Code') ? hash['Code'] : nil
|
68
|
+
title = hash.key?('Title') ? hash['Title'] : nil
|
69
|
+
detail = hash.key?('Detail') ? hash['Detail'] : nil
|
70
|
+
additional_info =
|
71
|
+
hash.key?('AdditionalInfo') ? hash['AdditionalInfo'] : SKIP
|
72
|
+
|
73
|
+
# Create object from extracted values.
|
74
|
+
M404ErrorResponseError.new(code,
|
75
|
+
title,
|
76
|
+
detail,
|
77
|
+
additional_info)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|