ev-recharge-sdk 1.0.0 → 1.1.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.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +38 -21
  3. data/lib/shell_ev/client.rb +8 -8
  4. data/lib/shell_ev/configuration.rb +13 -17
  5. data/lib/shell_ev/controllers/base_controller.rb +9 -9
  6. data/lib/shell_ev/controllers/charging_controller.rb +121 -154
  7. data/lib/shell_ev/controllers/locations_controller.rb +226 -142
  8. data/lib/shell_ev/controllers/o_auth_authorization_controller.rb +8 -8
  9. data/lib/shell_ev/exceptions/bad_request_exception.rb +33 -18
  10. data/lib/shell_ev/exceptions/{m405_error_response_error1_exception.rb → internal_server_error_exception.rb} +31 -26
  11. data/lib/shell_ev/exceptions/not_found_exception.rb +36 -19
  12. data/lib/shell_ev/exceptions/o_auth_provider_exception.rb +15 -15
  13. data/lib/shell_ev/exceptions/{m400_error_response_error1_exception.rb → serviceunavailable_exception.rb} +28 -28
  14. data/lib/shell_ev/exceptions/{m401_error_response_error1_exception.rb → too_many_requests_exception.rb} +28 -28
  15. data/lib/shell_ev/exceptions/unauthorized_exception.rb +32 -18
  16. data/lib/shell_ev/http/auth/o_auth2.rb +54 -10
  17. data/lib/shell_ev/models/accessibility.rb +1 -2
  18. data/lib/shell_ev/models/active_response200_json.rb +11 -13
  19. data/lib/shell_ev/models/address.rb +1 -3
  20. data/lib/shell_ev/models/bad_request_err_msg.rb +82 -0
  21. data/lib/shell_ev/models/{stop_charge_session_request_body_json.rb → charge_error.rb} +21 -10
  22. data/lib/shell_ev/models/charge_retrieve_state.rb +63 -0
  23. data/lib/shell_ev/models/chargesession_start_body.rb +7 -9
  24. data/lib/shell_ev/models/connector_vo.rb +4 -9
  25. data/lib/shell_ev/models/coordinates.rb +1 -2
  26. data/lib/shell_ev/models/data_active.rb +27 -45
  27. data/lib/shell_ev/models/data_retrieve.rb +31 -49
  28. data/lib/shell_ev/models/electrical_properties.rb +1 -3
  29. data/lib/shell_ev/models/evse_vo.rb +3 -8
  30. data/lib/shell_ev/models/get_charge_session_retrieve_response200_json.rb +11 -13
  31. data/lib/shell_ev/models/{get_markers_list_authorization_methods_enum.rb → get_ev_locations_authorization_methods_enum.rb} +4 -4
  32. data/lib/shell_ev/models/{get_markers_list_connector_types_enum.rb → get_ev_locations_connector_types_enum.rb} +4 -4
  33. data/lib/shell_ev/models/{get_markers_list_evse_status_enum.rb → get_ev_locations_evse_status_enum.rb} +4 -4
  34. data/lib/shell_ev/models/inline_response202.rb +9 -11
  35. data/lib/shell_ev/models/inline_response2021.rb +5 -6
  36. data/lib/shell_ev/models/inline_response202_data.rb +7 -5
  37. data/lib/shell_ev/models/internal_error_object.rb +70 -0
  38. data/lib/shell_ev/models/location_respone_object.rb +4 -11
  39. data/lib/shell_ev/models/{get_locations_list_authorization_methods_enum.rb → locations_markers_authorization_methods_enum.rb} +4 -4
  40. data/lib/shell_ev/models/{get_locations_list_connector_types_enum.rb → locations_markers_connector_types_enum.rb} +4 -4
  41. data/lib/shell_ev/models/{get_locations_list_evse_status_enum.rb → locations_markers_evse_status_enum.rb} +4 -4
  42. data/lib/shell_ev/models/multi_location_marker.rb +2 -6
  43. data/lib/shell_ev/models/{get_nearby_locations_authorization_methods_enum.rb → nearby_locations_authorization_methods_enum.rb} +4 -4
  44. data/lib/shell_ev/models/{get_nearby_locations_connector_types_enum.rb → nearby_locations_connector_types_enum.rb} +4 -4
  45. data/lib/shell_ev/models/{get_nearby_locations_evse_status_enum.rb → nearby_locations_evse_status_enum.rb} +4 -4
  46. data/lib/shell_ev/models/not_found_err_msg.rb +82 -0
  47. data/lib/shell_ev/models/o_auth_token.rb +2 -6
  48. data/lib/shell_ev/models/opening_hours_object.rb +1 -3
  49. data/lib/shell_ev/models/ratelimit_err_msg.rb +82 -0
  50. data/lib/shell_ev/models/response.rb +78 -0
  51. data/lib/shell_ev/models/serviceunavailable_err_msg.rb +82 -0
  52. data/lib/shell_ev/models/single_location_marker.rb +5 -11
  53. data/lib/shell_ev/models/single_location_marker_authorization_methods_items_enum.rb +1 -1
  54. data/lib/shell_ev/models/single_location_marker_response.rb +81 -0
  55. data/lib/shell_ev/models/tariff_vo.rb +3 -7
  56. data/lib/shell_ev/models/unauthorized_err_msg.rb +82 -0
  57. data/lib/shell_ev/utilities/file_wrapper.rb +9 -9
  58. data/lib/shell_ev/utilities/union_type_lookup.rb +3 -2
  59. data/lib/shell_ev.rb +40 -60
  60. data/test/controllers/controller_test_base.rb +0 -5
  61. data/test/controllers/test_charging_controller.rb +74 -17
  62. data/test/controllers/test_locations_controller.rb +65 -0
  63. metadata +31 -49
  64. data/lib/shell_ev/exceptions/http401_error_response_exception.rb +0 -52
  65. data/lib/shell_ev/exceptions/m404_error_response_error1_exception.rb +0 -53
  66. data/lib/shell_ev/exceptions/m429_error_response_error1_exception.rb +0 -52
  67. data/lib/shell_ev/exceptions/m500_error_response_error1_exception.rb +0 -52
  68. data/lib/shell_ev/exceptions/m503_error_response_error1_exception.rb +0 -52
  69. data/lib/shell_ev/models/data_active_session_code_enum.rb +0 -44
  70. data/lib/shell_ev/models/data_active_session_state_enum.rb +0 -35
  71. data/lib/shell_ev/models/data_retrieve_session_code_enum.rb +0 -44
  72. data/lib/shell_ev/models/data_retrieve_session_state_enum.rb +0 -35
  73. data/lib/shell_ev/models/env_enum.rb +0 -23
  74. data/lib/shell_ev/models/m400_error_response.rb +0 -78
  75. data/lib/shell_ev/models/m400_error_response_error.rb +0 -80
  76. data/lib/shell_ev/models/m401_error_response.rb +0 -78
  77. data/lib/shell_ev/models/m401_error_response_error.rb +0 -80
  78. data/lib/shell_ev/models/m404_error_response.rb +0 -79
  79. data/lib/shell_ev/models/m404_error_response_error.rb +0 -80
  80. data/lib/shell_ev/models/m405_error_response.rb +0 -78
  81. data/lib/shell_ev/models/m405_error_response_error.rb +0 -80
  82. data/lib/shell_ev/models/m429_error_response.rb +0 -78
  83. data/lib/shell_ev/models/m429_error_response_error.rb +0 -80
  84. data/lib/shell_ev/models/m500_error_response.rb +0 -78
  85. data/lib/shell_ev/models/m500_error_response_error.rb +0 -80
  86. data/lib/shell_ev/models/m503_error_response.rb +0 -78
  87. data/lib/shell_ev/models/m503_error_response_error.rb +0 -80
  88. data/lib/shell_ev/models/response_base_status_enum.rb +0 -26
  89. data/lib/shell_ev/models/response_error401_all_of1.rb +0 -57
  90. data/lib/shell_ev/models/response_error401_all_of1_errors_items.rb +0 -80
  91. data/lib/shell_ev/models/success_response.rb +0 -58
@@ -1,44 +0,0 @@
1
- # shell_ev
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module ShellEv
7
- # Session code e.g InternalError
8
- class DataActiveSessionCodeEnum
9
- DATA_ACTIVE_SESSION_CODE_ENUM = [
10
- # TODO: Write general description for INTERNALERROR
11
- INTERNALERROR = 'InternalError'.freeze,
12
-
13
- # TODO: Write general description for SERVICEUNAVAILABLE
14
- SERVICEUNAVAILABLE = 'ServiceUnavailable'.freeze,
15
-
16
- # TODO: Write general description for CHARGETOKENNOTSUPPORTED
17
- CHARGETOKENNOTSUPPORTED = 'ChargeTokenNotSupported'.freeze,
18
-
19
- # TODO: Write general description for SESSIONINVALID
20
- SESSIONINVALID = 'SessionInvalid'.freeze,
21
-
22
- # TODO: Write general description for EVNOTCONNECTEDTOEVSE
23
- EVNOTCONNECTEDTOEVSE = 'EvNotConnectedToEvse'.freeze,
24
-
25
- # TODO: Write general description for EVSEINUSE
26
- EVSEINUSE = 'EvseInUse'.freeze,
27
-
28
- # TODO: Write general description for EVSEOUTOFSERVICE
29
- EVSEOUTOFSERVICE = 'EvseOutOfService'.freeze,
30
-
31
- # TODO: Write general description for EVSENOTFOUND
32
- EVSENOTFOUND = 'EvseNotFound'.freeze,
33
-
34
- # TODO: Write general description for EVSENOTSUPPORTED
35
- EVSENOTSUPPORTED = 'EvseNotSupported'.freeze
36
- ].freeze
37
-
38
- def self.validate(value)
39
- return false if value.nil?
40
-
41
- DATA_ACTIVE_SESSION_CODE_ENUM.include?(value)
42
- end
43
- end
44
- end
@@ -1,35 +0,0 @@
1
- # shell_ev
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module ShellEv
7
- # Describes the session state
8
- class DataActiveSessionStateEnum
9
- DATA_ACTIVE_SESSION_STATE_ENUM = [
10
- # TODO: Write general description for STARTED
11
- STARTED = 'started'.freeze,
12
-
13
- # TODO: Write general description for STOPPED
14
- STOPPED = 'stopped'.freeze,
15
-
16
- # TODO: Write general description for STARTREQUESTED
17
- STARTREQUESTED = 'start-requested'.freeze,
18
-
19
- # TODO: Write general description for STOPREQUESTED
20
- STOPREQUESTED = 'stop-requested'.freeze,
21
-
22
- # TODO: Write general description for FAILEDTOSTART
23
- FAILEDTOSTART = 'failed-to-start'.freeze,
24
-
25
- # TODO: Write general description for FAILEDTOSTOP
26
- FAILEDTOSTOP = 'failed-to-stop'.freeze
27
- ].freeze
28
-
29
- def self.validate(value)
30
- return false if value.nil?
31
-
32
- DATA_ACTIVE_SESSION_STATE_ENUM.include?(value)
33
- end
34
- end
35
- end
@@ -1,44 +0,0 @@
1
- # shell_ev
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module ShellEv
7
- # Session code e.g InternalError
8
- class DataRetrieveSessionCodeEnum
9
- DATA_RETRIEVE_SESSION_CODE_ENUM = [
10
- # TODO: Write general description for INTERNALERROR
11
- INTERNALERROR = 'InternalError'.freeze,
12
-
13
- # TODO: Write general description for SERVICEUNAVAILABLE
14
- SERVICEUNAVAILABLE = 'ServiceUnavailable'.freeze,
15
-
16
- # TODO: Write general description for CHARGETOKENNOTSUPPORTED
17
- CHARGETOKENNOTSUPPORTED = 'ChargeTokenNotSupported'.freeze,
18
-
19
- # TODO: Write general description for SESSIONINVALID
20
- SESSIONINVALID = 'SessionInvalid'.freeze,
21
-
22
- # TODO: Write general description for EVNOTCONNECTEDTOEVSE
23
- EVNOTCONNECTEDTOEVSE = 'EvNotConnectedToEvse'.freeze,
24
-
25
- # TODO: Write general description for EVSEINUSE
26
- EVSEINUSE = 'EvseInUse'.freeze,
27
-
28
- # TODO: Write general description for EVSEOUTOFSERVICE
29
- EVSEOUTOFSERVICE = 'EvseOutOfService'.freeze,
30
-
31
- # TODO: Write general description for EVSENOTFOUND
32
- EVSENOTFOUND = 'EvseNotFound'.freeze,
33
-
34
- # TODO: Write general description for EVSENOTSUPPORTED
35
- EVSENOTSUPPORTED = 'EvseNotSupported'.freeze
36
- ].freeze
37
-
38
- def self.validate(value)
39
- return false if value.nil?
40
-
41
- DATA_RETRIEVE_SESSION_CODE_ENUM.include?(value)
42
- end
43
- end
44
- end
@@ -1,35 +0,0 @@
1
- # shell_ev
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module ShellEv
7
- # Describes the session state
8
- class DataRetrieveSessionStateEnum
9
- DATA_RETRIEVE_SESSION_STATE_ENUM = [
10
- # TODO: Write general description for STARTED
11
- STARTED = 'started'.freeze,
12
-
13
- # TODO: Write general description for STOPPED
14
- STOPPED = 'stopped'.freeze,
15
-
16
- # TODO: Write general description for STARTREQUESTED
17
- STARTREQUESTED = 'start-requested'.freeze,
18
-
19
- # TODO: Write general description for STOPREQUESTED
20
- STOPREQUESTED = 'stop-requested'.freeze,
21
-
22
- # TODO: Write general description for FAILEDTOSTART
23
- FAILEDTOSTART = 'failed-to-start'.freeze,
24
-
25
- # TODO: Write general description for FAILEDTOSTOP
26
- FAILEDTOSTOP = 'failed-to-stop'.freeze
27
- ].freeze
28
-
29
- def self.validate(value)
30
- return false if value.nil?
31
-
32
- DATA_RETRIEVE_SESSION_STATE_ENUM.include?(value)
33
- end
34
- end
35
- end
@@ -1,23 +0,0 @@
1
- # shell_ev
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module ShellEv
7
- # env.
8
- class EnvEnum
9
- ENV_ENUM = [
10
- # TODO: Write general description for ENUM_APITESTSHELLCOM
11
- ENUM_APITESTSHELLCOM = 'api-test.shell.com'.freeze,
12
-
13
- # TODO: Write general description for ENUM_APISHELLCOM
14
- ENUM_APISHELLCOM = 'api.shell.com'.freeze
15
- ].freeze
16
-
17
- def self.validate(value)
18
- return false if value.nil?
19
-
20
- ENV_ENUM.include?(value)
21
- end
22
- end
23
- end
@@ -1,78 +0,0 @@
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
@@ -1,80 +0,0 @@
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
@@ -1,78 +0,0 @@
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
@@ -1,80 +0,0 @@
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
@@ -1,79 +0,0 @@
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
@@ -1,80 +0,0 @@
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