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.
Files changed (130) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +167 -0
  4. data/bin/console +15 -0
  5. data/lib/e_mobility_vmspocpiap_is/api_helper.rb +10 -0
  6. data/lib/e_mobility_vmspocpiap_is/client.rb +138 -0
  7. data/lib/e_mobility_vmspocpiap_is/configuration.rb +176 -0
  8. data/lib/e_mobility_vmspocpiap_is/controllers/account_controller.rb +53 -0
  9. data/lib/e_mobility_vmspocpiap_is/controllers/base_controller.rb +60 -0
  10. data/lib/e_mobility_vmspocpiap_is/controllers/cd_rs_pull_controller.rb +103 -0
  11. data/lib/e_mobility_vmspocpiap_is/controllers/cd_rs_push_controller.rb +51 -0
  12. data/lib/e_mobility_vmspocpiap_is/controllers/commands_callback_controller.rb +56 -0
  13. data/lib/e_mobility_vmspocpiap_is/controllers/commands_controller.rb +102 -0
  14. data/lib/e_mobility_vmspocpiap_is/controllers/locations_pull_controller.rb +125 -0
  15. data/lib/e_mobility_vmspocpiap_is/controllers/locations_push_controller.rb +68 -0
  16. data/lib/e_mobility_vmspocpiap_is/controllers/sessions_pull_controller.rb +91 -0
  17. data/lib/e_mobility_vmspocpiap_is/controllers/sessions_push_controller.rb +74 -0
  18. data/lib/e_mobility_vmspocpiap_is/controllers/tariffs_pull_controller.rb +117 -0
  19. data/lib/e_mobility_vmspocpiap_is/controllers/tariffs_push_controller.rb +62 -0
  20. data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_error_response_exception.rb +69 -0
  21. data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_response_exception.rb +67 -0
  22. data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_unauthorized_response_exception.rb +64 -0
  23. data/lib/e_mobility_vmspocpiap_is/exceptions/api_exception.rb +21 -0
  24. data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_error_response_exception.rb +71 -0
  25. data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_response_error_exception.rb +67 -0
  26. data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_unauthorized_response_exception.rb +64 -0
  27. data/lib/e_mobility_vmspocpiap_is/exceptions/v3_commands_startsession400_error_exception.rb +67 -0
  28. data/lib/e_mobility_vmspocpiap_is/http/auth/bearer_authorization.rb +53 -0
  29. data/lib/e_mobility_vmspocpiap_is/http/auth/ocpi_authorization.rb +52 -0
  30. data/lib/e_mobility_vmspocpiap_is/http/http_call_back.rb +10 -0
  31. data/lib/e_mobility_vmspocpiap_is/http/http_method_enum.rb +10 -0
  32. data/lib/e_mobility_vmspocpiap_is/http/http_request.rb +10 -0
  33. data/lib/e_mobility_vmspocpiap_is/http/http_response.rb +10 -0
  34. data/lib/e_mobility_vmspocpiap_is/http/proxy_settings.rb +22 -0
  35. data/lib/e_mobility_vmspocpiap_is/models/account_details.rb +237 -0
  36. data/lib/e_mobility_vmspocpiap_is/models/account_details2.rb +237 -0
  37. data/lib/e_mobility_vmspocpiap_is/models/account_response.rb +98 -0
  38. data/lib/e_mobility_vmspocpiap_is/models/account_state_enum.rb +46 -0
  39. data/lib/e_mobility_vmspocpiap_is/models/account_state_reason_enum.rb +67 -0
  40. data/lib/e_mobility_vmspocpiap_is/models/add_on_fee.rb +101 -0
  41. data/lib/e_mobility_vmspocpiap_is/models/add_on_fee_type_enum.rb +52 -0
  42. data/lib/e_mobility_vmspocpiap_is/models/additional_geo_location.rb +82 -0
  43. data/lib/e_mobility_vmspocpiap_is/models/auth_method_enum.rb +40 -0
  44. data/lib/e_mobility_vmspocpiap_is/models/base_model.rb +110 -0
  45. data/lib/e_mobility_vmspocpiap_is/models/benefit.rb +181 -0
  46. data/lib/e_mobility_vmspocpiap_is/models/booking_restriction_type_enum.rb +44 -0
  47. data/lib/e_mobility_vmspocpiap_is/models/business_details.rb +84 -0
  48. data/lib/e_mobility_vmspocpiap_is/models/capability_enum.rb +88 -0
  49. data/lib/e_mobility_vmspocpiap_is/models/cdr.rb +462 -0
  50. data/lib/e_mobility_vmspocpiap_is/models/cdr1.rb +457 -0
  51. data/lib/e_mobility_vmspocpiap_is/models/cdr_dimension.rb +71 -0
  52. data/lib/e_mobility_vmspocpiap_is/models/cdr_dimension_type_enum.rb +97 -0
  53. data/lib/e_mobility_vmspocpiap_is/models/cdr_location.rb +206 -0
  54. data/lib/e_mobility_vmspocpiap_is/models/cdr_token.rb +91 -0
  55. data/lib/e_mobility_vmspocpiap_is/models/charge_type_enum.rb +52 -0
  56. data/lib/e_mobility_vmspocpiap_is/models/charging_period.rb +100 -0
  57. data/lib/e_mobility_vmspocpiap_is/models/command_response.rb +92 -0
  58. data/lib/e_mobility_vmspocpiap_is/models/command_response1.rb +91 -0
  59. data/lib/e_mobility_vmspocpiap_is/models/command_response_type_enum.rb +44 -0
  60. data/lib/e_mobility_vmspocpiap_is/models/command_result.rb +81 -0
  61. data/lib/e_mobility_vmspocpiap_is/models/command_result_type_enum.rb +64 -0
  62. data/lib/e_mobility_vmspocpiap_is/models/connector.rb +184 -0
  63. data/lib/e_mobility_vmspocpiap_is/models/connector_format_enum.rb +36 -0
  64. data/lib/e_mobility_vmspocpiap_is/models/connector_type_enum.rb +196 -0
  65. data/lib/e_mobility_vmspocpiap_is/models/day_of_week_enum.rb +56 -0
  66. data/lib/e_mobility_vmspocpiap_is/models/display_text.rb +68 -0
  67. data/lib/e_mobility_vmspocpiap_is/models/emaid.rb +137 -0
  68. data/lib/e_mobility_vmspocpiap_is/models/energy_mix.rb +127 -0
  69. data/lib/e_mobility_vmspocpiap_is/models/energy_source.rb +69 -0
  70. data/lib/e_mobility_vmspocpiap_is/models/energy_source_category_enum.rb +60 -0
  71. data/lib/e_mobility_vmspocpiap_is/models/environmental_impact.rb +68 -0
  72. data/lib/e_mobility_vmspocpiap_is/models/environmental_impact_category_enum.rb +36 -0
  73. data/lib/e_mobility_vmspocpiap_is/models/evse.rb +250 -0
  74. data/lib/e_mobility_vmspocpiap_is/models/exceptional_period.rb +84 -0
  75. data/lib/e_mobility_vmspocpiap_is/models/facility_enum.rb +108 -0
  76. data/lib/e_mobility_vmspocpiap_is/models/geo_location.rb +73 -0
  77. data/lib/e_mobility_vmspocpiap_is/models/hours.rb +127 -0
  78. data/lib/e_mobility_vmspocpiap_is/models/image.rb +114 -0
  79. data/lib/e_mobility_vmspocpiap_is/models/image_category_enum.rb +58 -0
  80. data/lib/e_mobility_vmspocpiap_is/models/location.rb +379 -0
  81. data/lib/e_mobility_vmspocpiap_is/models/location1.rb +375 -0
  82. data/lib/e_mobility_vmspocpiap_is/models/ocpi_command_response.rb +62 -0
  83. data/lib/e_mobility_vmspocpiap_is/models/ocpi_response.rb +98 -0
  84. data/lib/e_mobility_vmspocpiap_is/models/parking_direction_enum.rb +40 -0
  85. data/lib/e_mobility_vmspocpiap_is/models/parking_restriction_enum.rb +61 -0
  86. data/lib/e_mobility_vmspocpiap_is/models/parking_type_enum.rb +53 -0
  87. data/lib/e_mobility_vmspocpiap_is/models/power_type_enum.rb +48 -0
  88. data/lib/e_mobility_vmspocpiap_is/models/price.rb +80 -0
  89. data/lib/e_mobility_vmspocpiap_is/models/price_component.rb +99 -0
  90. data/lib/e_mobility_vmspocpiap_is/models/price_limit.rb +71 -0
  91. data/lib/e_mobility_vmspocpiap_is/models/product.rb +186 -0
  92. data/lib/e_mobility_vmspocpiap_is/models/publish_token_type.rb +106 -0
  93. data/lib/e_mobility_vmspocpiap_is/models/regular_hours.rb +80 -0
  94. data/lib/e_mobility_vmspocpiap_is/models/reservation_restriction_type_enum.rb +36 -0
  95. data/lib/e_mobility_vmspocpiap_is/models/session.rb +298 -0
  96. data/lib/e_mobility_vmspocpiap_is/models/session_status_enum.rb +60 -0
  97. data/lib/e_mobility_vmspocpiap_is/models/signed_data.rb +116 -0
  98. data/lib/e_mobility_vmspocpiap_is/models/signed_value.rb +85 -0
  99. data/lib/e_mobility_vmspocpiap_is/models/start_session.rb +107 -0
  100. data/lib/e_mobility_vmspocpiap_is/models/start_session_token.rb +68 -0
  101. data/lib/e_mobility_vmspocpiap_is/models/status2_enum.rb +44 -0
  102. data/lib/e_mobility_vmspocpiap_is/models/status_enum.rb +64 -0
  103. data/lib/e_mobility_vmspocpiap_is/models/status_schedule.rb +97 -0
  104. data/lib/e_mobility_vmspocpiap_is/models/stop_session.rb +70 -0
  105. data/lib/e_mobility_vmspocpiap_is/models/subscription_renewal_cadence_enum.rb +44 -0
  106. data/lib/e_mobility_vmspocpiap_is/models/tariff.rb +347 -0
  107. data/lib/e_mobility_vmspocpiap_is/models/tariff1.rb +336 -0
  108. data/lib/e_mobility_vmspocpiap_is/models/tariff_dimension_type_enum.rb +60 -0
  109. data/lib/e_mobility_vmspocpiap_is/models/tariff_element.rb +91 -0
  110. data/lib/e_mobility_vmspocpiap_is/models/tariff_restrictions.rb +310 -0
  111. data/lib/e_mobility_vmspocpiap_is/models/tariff_type_enum.rb +48 -0
  112. data/lib/e_mobility_vmspocpiap_is/models/tax_amount.rb +95 -0
  113. data/lib/e_mobility_vmspocpiap_is/models/tax_included_enum.rb +40 -0
  114. data/lib/e_mobility_vmspocpiap_is/models/token_type_enum.rb +48 -0
  115. data/lib/e_mobility_vmspocpiap_is/models/type_of_emaid_enum.rb +36 -0
  116. data/lib/e_mobility_vmspocpiap_is/models/url_enum.rb +36 -0
  117. data/lib/e_mobility_vmspocpiap_is/models/v3_cdrs_response.rb +107 -0
  118. data/lib/e_mobility_vmspocpiap_is/models/v3_cdrs_response1.rb +98 -0
  119. data/lib/e_mobility_vmspocpiap_is/models/v3_commands_startsession_response.rb +98 -0
  120. data/lib/e_mobility_vmspocpiap_is/models/v3_commands_stopsession_response.rb +98 -0
  121. data/lib/e_mobility_vmspocpiap_is/models/v3_locations_response.rb +107 -0
  122. data/lib/e_mobility_vmspocpiap_is/models/v3_locations_response1.rb +98 -0
  123. data/lib/e_mobility_vmspocpiap_is/models/v3_sessions_response.rb +107 -0
  124. data/lib/e_mobility_vmspocpiap_is/models/v3_tariffs_response.rb +107 -0
  125. data/lib/e_mobility_vmspocpiap_is/models/v3_tariffs_response1.rb +98 -0
  126. data/lib/e_mobility_vmspocpiap_is/models/vehicle_type_enum.rb +64 -0
  127. data/lib/e_mobility_vmspocpiap_is/utilities/date_time_helper.rb +11 -0
  128. data/lib/e_mobility_vmspocpiap_is/utilities/file_wrapper.rb +28 -0
  129. data/lib/e_mobility_vmspocpiap_is.rb +164 -0
  130. metadata +213 -0
@@ -0,0 +1,74 @@
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
+ # SessionsPUSHController
8
+ class SessionsPUSHController < BaseController
9
+ # Inform the eMSP's system about a new/updated Session object in the CPO's
10
+ # system.
11
+ # When a PUT request is received for an existing Session object (the object
12
+ # is PUT to the
13
+ # same URL), the newly received Session object SHALL replace the existing
14
+ # object.
15
+ # Any charging_periods from the existing object SHALL be replaced by the
16
+ # charging_periods
17
+ # from the newly received Session object. If the new Session object does not
18
+ # contain
19
+ # charging_periods (field is omitted or contains an empty list), the
20
+ # charging_periods of
21
+ # the existing object SHALL be removed (replaced by the new empty list).
22
+ # @param [String] x_request_id Required parameter: Every request SHALL
23
+ # contain a unique request ID, the response to this request SHALL contain
24
+ # the same ID. It is advised to use GUID/UUID as values.
25
+ # @param [String] x_correlation_id Required parameter: Every
26
+ # request/response SHALL contain a unique correlation ID, every response to
27
+ # this request SHALL contain the same ID. It is advised to use GUID/UUID as
28
+ # values. When a Hub forwards a request to a party, the request SHALL
29
+ # contain the same X-Correlation-ID HTTP header (with the same value).
30
+ # @param [String] country_code Required parameter: Country code of the CPO
31
+ # that 'owns' this object (ISO-3166 alpha-2).
32
+ # @param [String] party_id Required parameter: Party ID (Provider ID) of the
33
+ # CPO that 'owns' this object (following the ISO-15118 standard).
34
+ # @param [String] session_id Required parameter: Session.id of the Session
35
+ # object to retrieve or update.
36
+ # @param [Session] body Required parameter: New or updated Session object.
37
+ # @return [OCPIResponse] Response from the API call.
38
+ def receiver_put_session(x_request_id,
39
+ x_correlation_id,
40
+ country_code,
41
+ party_id,
42
+ session_id,
43
+ body)
44
+ @api_call
45
+ .request(new_request_builder(HttpMethodEnum::PUT,
46
+ '/v3/sessions/{country_code}/{party_id}/{session_id}',
47
+ Server::DEFAULT)
48
+ .header_param(new_parameter(x_request_id, key: 'X-Request-ID'))
49
+ .header_param(new_parameter(x_correlation_id, key: 'X-Correlation-ID'))
50
+ .template_param(new_parameter(country_code, key: 'country_code')
51
+ .should_encode(true))
52
+ .template_param(new_parameter(party_id, key: 'party_id')
53
+ .should_encode(true))
54
+ .template_param(new_parameter(session_id, key: 'session_id')
55
+ .should_encode(true))
56
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
57
+ .body_param(new_parameter(body))
58
+ .header_param(new_parameter('application/json', key: 'accept'))
59
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
60
+ .auth(Or.new('ocpiAuthorization', 'bearerAuthorization')))
61
+ .response(new_response_handler
62
+ .deserializer(APIHelper.method(:custom_type_deserializer))
63
+ .deserialize_into(OCPIResponse.method(:from_hash))
64
+ .local_error('400',
65
+ 'OCPI error response envelope',
66
+ OCPIErrorResponseException)
67
+ .local_error('401',
68
+ "Authorization failed. The credentials token is missing,'\
69
+ ' invalid, or does not\nmatch any known party.\n",
70
+ OCPIUnauthorizedResponseException))
71
+ .execute
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,117 @@
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
+ # TariffsPULLController
8
+ class TariffsPULLController < BaseController
9
+ # Fetch information about all Tariffs. If additional parameters date_from
10
+ # and/or date_to
11
+ # are provided, only Tariffs with last_updated between the given date_from
12
+ # (including)
13
+ # and date_to (excluding) will be returned. This request is paginated.
14
+ # @param [String] x_request_id Required parameter: Every request SHALL
15
+ # contain a unique request ID, the response to this request SHALL contain
16
+ # the same ID. It is advised to use GUID/UUID as values.
17
+ # @param [String] x_correlation_id Required parameter: Every
18
+ # request/response SHALL contain a unique correlation ID, every response to
19
+ # this request SHALL contain the same ID. It is advised to use GUID/UUID as
20
+ # values. When a Hub forwards a request to a party, the request SHALL
21
+ # contain the same X-Correlation-ID HTTP header (with the same value).
22
+ # @param [DateTime] date_from Optional parameter: Only return objects that
23
+ # have last_updated after or equal to this Date/Time (inclusive).
24
+ # @param [DateTime] date_to Optional parameter: Only return objects that
25
+ # have last_updated up to this Date/Time, but not including (exclusive).
26
+ # @param [Integer] offset Optional parameter: The offset of the first object
27
+ # returned. Default is 0.
28
+ # @param [Integer] limit Optional parameter: Maximum number of objects to
29
+ # GET.
30
+ # @return [V3TariffsResponse] Response from the API call.
31
+ def sender_get_tariffs(x_request_id,
32
+ x_correlation_id,
33
+ date_from: nil,
34
+ date_to: nil,
35
+ offset: 0,
36
+ limit: nil)
37
+ @api_call
38
+ .request(new_request_builder(HttpMethodEnum::GET,
39
+ '/v3/tariffs',
40
+ Server::DEFAULT)
41
+ .header_param(new_parameter(x_request_id, key: 'X-Request-ID'))
42
+ .header_param(new_parameter(x_correlation_id, key: 'X-Correlation-ID'))
43
+ .query_param(new_parameter(date_from, key: 'date_from'))
44
+ .query_param(new_parameter(date_to, key: 'date_to'))
45
+ .query_param(new_parameter(offset, key: 'offset'))
46
+ .query_param(new_parameter(limit, key: 'limit'))
47
+ .header_param(new_parameter('application/json', key: 'accept'))
48
+ .auth(Single.new('bearerAuthorization')))
49
+ .response(new_response_handler
50
+ .deserializer(APIHelper.method(:custom_type_deserializer))
51
+ .deserialize_into(V3TariffsResponse.method(:from_hash))
52
+ .local_error('400',
53
+ 'OCPI error response envelope',
54
+ OCPIErrorResponseException)
55
+ .local_error('401',
56
+ "Authorization failed. The credentials token is missing,'\
57
+ ' invalid, or does not\nmatch any known party.\n",
58
+ OCPIUnauthorizedResponseException))
59
+ .execute
60
+ end
61
+
62
+ # Fetch a specific Tariff by its ID.
63
+ # @param [String] x_request_id Required parameter: Every request SHALL
64
+ # contain a unique request ID, the response to this request SHALL contain
65
+ # the same ID. It is advised to use GUID/UUID as values.
66
+ # @param [String] x_correlation_id Required parameter: Every
67
+ # request/response SHALL contain a unique correlation ID, every response to
68
+ # this request SHALL contain the same ID. It is advised to use GUID/UUID as
69
+ # values. When a Hub forwards a request to a party, the request SHALL
70
+ # contain the same X-Correlation-ID HTTP header (with the same value).
71
+ # @param [String] tariff_id Required parameter: Tariff.id of the Tariff
72
+ # object to retrieve, update, or delete.
73
+ # @param [String] ocpi_to_country_code Optional parameter: 'country code' of
74
+ # the CPO this message is to be sent to. This must match the `country_code`
75
+ # field of the entity. When it is not provided, the country code is "US".
76
+ # @param [String] ocpi_to_party_id Optional parameter: 'party id' of the CPO
77
+ # this message is to be sent to. This must match the `party_id` field of the
78
+ # entity. When no party ID is provided and the entity_id starts with three
79
+ # alphanumeric characters followed by an underscore (e.g., "TSL_1234" or
80
+ # "A1B_1234"), those first three characters are used as the party ID ("TSL"
81
+ # or "A1B"). Otherwise (e.g., "HBA1234"), the default party ID "GRL" is
82
+ # used.
83
+ # @return [V3TariffsResponse1] Response from the API call.
84
+ def sender_get_tariff(x_request_id,
85
+ x_correlation_id,
86
+ tariff_id,
87
+ ocpi_to_country_code: 'US',
88
+ ocpi_to_party_id: nil)
89
+ @api_call
90
+ .request(new_request_builder(HttpMethodEnum::GET,
91
+ '/v3/tariffs/{tariff_id}',
92
+ Server::DEFAULT)
93
+ .header_param(new_parameter(x_request_id, key: 'X-Request-ID'))
94
+ .header_param(new_parameter(x_correlation_id, key: 'X-Correlation-ID'))
95
+ .template_param(new_parameter(tariff_id, key: 'tariff_id')
96
+ .should_encode(true))
97
+ .header_param(new_parameter(ocpi_to_country_code, key: 'OCPI-to-country-code'))
98
+ .header_param(new_parameter(ocpi_to_party_id, key: 'OCPI-to-party-id'))
99
+ .header_param(new_parameter('application/json', key: 'accept'))
100
+ .auth(Single.new('bearerAuthorization')))
101
+ .response(new_response_handler
102
+ .deserializer(APIHelper.method(:custom_type_deserializer))
103
+ .deserialize_into(V3TariffsResponse1.method(:from_hash))
104
+ .local_error('400',
105
+ 'OCPI error response envelope',
106
+ OCPIErrorResponseException)
107
+ .local_error('401',
108
+ "Authorization failed. The credentials token is missing,'\
109
+ ' invalid, or does not\nmatch any known party.\n",
110
+ OCPIUnauthorizedResponseException)
111
+ .local_error('404',
112
+ 'The requested resource was not found.',
113
+ OCPIResponseErrorException))
114
+ .execute
115
+ end
116
+ end
117
+ end
@@ -0,0 +1,62 @@
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
+ # TariffsPUSHController
8
+ class TariffsPUSHController < BaseController
9
+ # Push new or updated Tariff object to the eMSP.
10
+ # @param [String] x_request_id Required parameter: Every request SHALL
11
+ # contain a unique request ID, the response to this request SHALL contain
12
+ # the same ID. It is advised to use GUID/UUID as values.
13
+ # @param [String] x_correlation_id Required parameter: Every
14
+ # request/response SHALL contain a unique correlation ID, every response to
15
+ # this request SHALL contain the same ID. It is advised to use GUID/UUID as
16
+ # values. When a Hub forwards a request to a party, the request SHALL
17
+ # contain the same X-Correlation-ID HTTP header (with the same value).
18
+ # @param [String] country_code Required parameter: Country code of the CPO
19
+ # that 'owns' this object (ISO-3166 alpha-2).
20
+ # @param [String] party_id Required parameter: Party ID (Provider ID) of the
21
+ # CPO that 'owns' this object (following the ISO-15118 standard).
22
+ # @param [String] tariff_id Required parameter: Tariff.id of the Tariff
23
+ # object to retrieve, update, or delete.
24
+ # @param [Tariff] body Required parameter: New or updated Tariff object.
25
+ # @return [OCPIResponse] Response from the API call.
26
+ def receiver_put_tariff(x_request_id,
27
+ x_correlation_id,
28
+ country_code,
29
+ party_id,
30
+ tariff_id,
31
+ body)
32
+ @api_call
33
+ .request(new_request_builder(HttpMethodEnum::PUT,
34
+ '/v3/tariffs/{country_code}/{party_id}/{tariff_id}',
35
+ Server::DEFAULT)
36
+ .header_param(new_parameter(x_request_id, key: 'X-Request-ID'))
37
+ .header_param(new_parameter(x_correlation_id, key: 'X-Correlation-ID'))
38
+ .template_param(new_parameter(country_code, key: 'country_code')
39
+ .should_encode(true))
40
+ .template_param(new_parameter(party_id, key: 'party_id')
41
+ .should_encode(true))
42
+ .template_param(new_parameter(tariff_id, key: 'tariff_id')
43
+ .should_encode(true))
44
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
45
+ .body_param(new_parameter(body))
46
+ .header_param(new_parameter('application/json', key: 'accept'))
47
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
48
+ .auth(Or.new('ocpiAuthorization', 'bearerAuthorization')))
49
+ .response(new_response_handler
50
+ .deserializer(APIHelper.method(:custom_type_deserializer))
51
+ .deserialize_into(OCPIResponse.method(:from_hash))
52
+ .local_error('400',
53
+ 'OCPI error response envelope',
54
+ OCPIErrorResponseException)
55
+ .local_error('401',
56
+ "Authorization failed. The credentials token is missing,'\
57
+ ' invalid, or does not\nmatch any known party.\n",
58
+ OCPIUnauthorizedResponseException))
59
+ .execute
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,69 @@
1
+ # e_mobility_vmspocpiap_is
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module EMobilityVmspocpiapIs
8
+ # AccountsOCPIErrorResponse class.
9
+ class AccountsOCPIErrorResponseException < APIException
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [Object]
15
+ attr_accessor :data
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [Integer]
19
+ attr_accessor :status_code
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [String]
23
+ attr_accessor :status_message
24
+
25
+ # TODO: Write general description for this method
26
+ # @return [DateTime]
27
+ attr_accessor :timestamp
28
+
29
+ # The constructor.
30
+ # @param [String] reason The reason for raising an exception.
31
+ # @param [HttpResponse] response The HttpReponse of the API call.
32
+ def initialize(reason, response)
33
+ super(reason, response)
34
+ hash = APIHelper.json_deserialize(@response.raw_body)
35
+ unbox(hash)
36
+ end
37
+
38
+ # Populates this object by extracting properties from a hash.
39
+ # @param [Hash] hash The deserialized response sent by the server in the
40
+ # response body.
41
+ def unbox(hash)
42
+ return nil unless hash
43
+
44
+ @data = hash.key?('data') ? hash['data'] : SKIP
45
+ @status_code = hash.key?('status_code') ? hash['status_code'] : SKIP
46
+ @status_message =
47
+ hash.key?('status_message') ? hash['status_message'] : SKIP
48
+ @timestamp = if hash.key?('timestamp')
49
+ (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
50
+ else
51
+ SKIP
52
+ end
53
+ end
54
+
55
+ # Provides a human-readable string representation of the object.
56
+ def to_s
57
+ class_name = self.class.name.split('::').last
58
+ "<#{class_name} data: #{@data}, status_code: #{@status_code}, status_message:"\
59
+ " #{@status_message}, timestamp: #{@timestamp}>"
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} data: #{@data.inspect}, status_code: #{@status_code.inspect},"\
66
+ " status_message: #{@status_message.inspect}, timestamp: #{@timestamp.inspect}>"
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,67 @@
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
+ # OCPI Response envelope wrapping all successful responses.
9
+ class AccountsOCPIResponseException < APIException
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # OCPI status code, 1000 for success.
14
+ # @return [Integer]
15
+ attr_accessor :status_code
16
+
17
+ # An optional status message which may help when debugging.
18
+ # @return [String]
19
+ attr_accessor :status_message
20
+
21
+ # The time this message was generated.
22
+ # @return [DateTime]
23
+ attr_accessor :timestamp
24
+
25
+ # Response data object or list of objects.
26
+ # @return [Object]
27
+ attr_accessor :data
28
+
29
+ # The constructor.
30
+ # @param [String] reason The reason for raising an exception.
31
+ # @param [HttpResponse] response The HttpReponse of the API call.
32
+ def initialize(reason, response)
33
+ super(reason, response)
34
+ hash = APIHelper.json_deserialize(@response.raw_body)
35
+ unbox(hash)
36
+ end
37
+
38
+ # Populates this object by extracting properties from a hash.
39
+ # @param [Hash] hash The deserialized response sent by the server in the
40
+ # response body.
41
+ def unbox(hash)
42
+ return nil unless hash
43
+
44
+ @status_code = hash.key?('status_code') ? hash['status_code'] : nil
45
+ @status_message =
46
+ hash.key?('status_message') ? hash['status_message'] : SKIP
47
+ @timestamp = if hash.key?('timestamp')
48
+ (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
49
+ end
50
+ @data = hash.key?('data') ? hash['data'] : SKIP
51
+ end
52
+
53
+ # Provides a human-readable string representation of the object.
54
+ def to_s
55
+ class_name = self.class.name.split('::').last
56
+ "<#{class_name} status_code: #{@status_code}, status_message: #{@status_message},"\
57
+ " timestamp: #{@timestamp}, data: #{@data}>"
58
+ end
59
+
60
+ # Provides a debugging-friendly string with detailed object information.
61
+ def inspect
62
+ class_name = self.class.name.split('::').last
63
+ "<#{class_name} status_code: #{@status_code.inspect}, status_message:"\
64
+ " #{@status_message.inspect}, timestamp: #{@timestamp.inspect}, data: #{@data.inspect}>"
65
+ end
66
+ end
67
+ 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
+ require 'date'
7
+ module EMobilityVmspocpiapIs
8
+ # AccountsOCPIUnauthorizedResponse class.
9
+ class AccountsOCPIUnauthorizedResponseException < APIException
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [Integer]
15
+ attr_accessor :status_code
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [String]
19
+ attr_accessor :status_message
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [DateTime]
23
+ attr_accessor :timestamp
24
+
25
+ # The constructor.
26
+ # @param [String] reason The reason for raising an exception.
27
+ # @param [HttpResponse] response The HttpReponse of the API call.
28
+ def initialize(reason, response)
29
+ super(reason, response)
30
+ hash = APIHelper.json_deserialize(@response.raw_body)
31
+ unbox(hash)
32
+ end
33
+
34
+ # Populates this object by extracting properties from a hash.
35
+ # @param [Hash] hash The deserialized response sent by the server in the
36
+ # response body.
37
+ def unbox(hash)
38
+ return nil unless hash
39
+
40
+ @status_code = hash.key?('status_code') ? hash['status_code'] : SKIP
41
+ @status_message =
42
+ hash.key?('status_message') ? hash['status_message'] : SKIP
43
+ @timestamp = if hash.key?('timestamp')
44
+ (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
45
+ else
46
+ SKIP
47
+ end
48
+ end
49
+
50
+ # Provides a human-readable string representation of the object.
51
+ def to_s
52
+ class_name = self.class.name.split('::').last
53
+ "<#{class_name} status_code: #{@status_code}, status_message: #{@status_message},"\
54
+ " timestamp: #{@timestamp}>"
55
+ end
56
+
57
+ # Provides a debugging-friendly string with detailed object information.
58
+ def inspect
59
+ class_name = self.class.name.split('::').last
60
+ "<#{class_name} status_code: #{@status_code.inspect}, status_message:"\
61
+ " #{@status_message.inspect}, timestamp: #{@timestamp.inspect}>"
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,21 @@
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
+ # Class for exceptions when there is a network error, status code error, etc.
8
+ class APIException < CoreLibrary::ApiException
9
+ # Provides a human-readable string representation of the object.
10
+ def to_s
11
+ class_name = self.class.name.split('::').last
12
+ "<#{class_name} status_code: #{@response_code}, reason: #{@reason}>"
13
+ end
14
+
15
+ # Provides a debugging-friendly string with detailed object information.
16
+ def inspect
17
+ class_name = self.class.name.split('::').last
18
+ "<#{class_name} status_code: #{@response_code.inspect}, reason: #{@reason.inspect}>"
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,71 @@
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
+ # OCPIErrorResponse class.
9
+ class OCPIErrorResponseException < APIException
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Optional additional error information.
14
+ # Content is not strictly defined by OCPI and may be null.
15
+ # @return [Object]
16
+ attr_accessor :data
17
+
18
+ # OCPI status code.
19
+ # Any value other than 1000 indicates an error.
20
+ # @return [Integer]
21
+ attr_accessor :status_code
22
+
23
+ # Human-readable description of the error.
24
+ # @return [String]
25
+ attr_accessor :status_message
26
+
27
+ # Timestamp when the error occurred.
28
+ # @return [DateTime]
29
+ attr_accessor :timestamp
30
+
31
+ # The constructor.
32
+ # @param [String] reason The reason for raising an exception.
33
+ # @param [HttpResponse] response The HttpReponse of the API call.
34
+ def initialize(reason, response)
35
+ super(reason, response)
36
+ hash = APIHelper.json_deserialize(@response.raw_body)
37
+ unbox(hash)
38
+ end
39
+
40
+ # Populates this object by extracting properties from a hash.
41
+ # @param [Hash] hash The deserialized response sent by the server in the
42
+ # response body.
43
+ def unbox(hash)
44
+ return nil unless hash
45
+
46
+ @data = hash.key?('data') ? hash['data'] : SKIP
47
+ @status_code = hash.key?('status_code') ? hash['status_code'] : SKIP
48
+ @status_message =
49
+ hash.key?('status_message') ? hash['status_message'] : SKIP
50
+ @timestamp = if hash.key?('timestamp')
51
+ (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
52
+ else
53
+ SKIP
54
+ end
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} data: #{@data}, status_code: #{@status_code}, status_message:"\
61
+ " #{@status_message}, timestamp: #{@timestamp}>"
62
+ end
63
+
64
+ # Provides a debugging-friendly string with detailed object information.
65
+ def inspect
66
+ class_name = self.class.name.split('::').last
67
+ "<#{class_name} data: #{@data.inspect}, status_code: #{@status_code.inspect},"\
68
+ " status_message: #{@status_message.inspect}, timestamp: #{@timestamp.inspect}>"
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,67 @@
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
+ # OCPI Response envelope wrapping all successful responses.
9
+ class OCPIResponseErrorException < APIException
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # OCPI status code, 1000 for success.
14
+ # @return [Integer]
15
+ attr_accessor :status_code
16
+
17
+ # An optional status message which may help when debugging.
18
+ # @return [String]
19
+ attr_accessor :status_message
20
+
21
+ # The time this message was generated.
22
+ # @return [DateTime]
23
+ attr_accessor :timestamp
24
+
25
+ # Response data object or list of objects.
26
+ # @return [Object]
27
+ attr_accessor :data
28
+
29
+ # The constructor.
30
+ # @param [String] reason The reason for raising an exception.
31
+ # @param [HttpResponse] response The HttpReponse of the API call.
32
+ def initialize(reason, response)
33
+ super(reason, response)
34
+ hash = APIHelper.json_deserialize(@response.raw_body)
35
+ unbox(hash)
36
+ end
37
+
38
+ # Populates this object by extracting properties from a hash.
39
+ # @param [Hash] hash The deserialized response sent by the server in the
40
+ # response body.
41
+ def unbox(hash)
42
+ return nil unless hash
43
+
44
+ @status_code = hash.key?('status_code') ? hash['status_code'] : nil
45
+ @status_message =
46
+ hash.key?('status_message') ? hash['status_message'] : SKIP
47
+ @timestamp = if hash.key?('timestamp')
48
+ (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
49
+ end
50
+ @data = hash.key?('data') ? hash['data'] : SKIP
51
+ end
52
+
53
+ # Provides a human-readable string representation of the object.
54
+ def to_s
55
+ class_name = self.class.name.split('::').last
56
+ "<#{class_name} status_code: #{@status_code}, status_message: #{@status_message},"\
57
+ " timestamp: #{@timestamp}, data: #{@data}>"
58
+ end
59
+
60
+ # Provides a debugging-friendly string with detailed object information.
61
+ def inspect
62
+ class_name = self.class.name.split('::').last
63
+ "<#{class_name} status_code: #{@status_code.inspect}, status_message:"\
64
+ " #{@status_message.inspect}, timestamp: #{@timestamp.inspect}, data: #{@data.inspect}>"
65
+ end
66
+ end
67
+ end