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,103 @@
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
+ # CDRsPULLController
8
+ class CDRsPULLController < BaseController
9
+ # Fetch CDRs from the CPO's system. If additional parameters date_from
10
+ # and/or date_to
11
+ # are provided, only CDRs with last_updated between the given date_from
12
+ # (including) and
13
+ # 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 [V3CdrsResponse] Response from the API call.
31
+ def sender_get_cdrs(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/cdrs',
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(V3CdrsResponse.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 CDR 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] cdr_id Required parameter: CDR.id of the CDR object to
72
+ # retrieve.
73
+ # @return [V3CdrsResponse1] Response from the API call.
74
+ def sender_get_cdr(x_request_id,
75
+ x_correlation_id,
76
+ cdr_id)
77
+ @api_call
78
+ .request(new_request_builder(HttpMethodEnum::GET,
79
+ '/v3/cdrs/{cdr_id}',
80
+ Server::DEFAULT)
81
+ .header_param(new_parameter(x_request_id, key: 'X-Request-ID'))
82
+ .header_param(new_parameter(x_correlation_id, key: 'X-Correlation-ID'))
83
+ .template_param(new_parameter(cdr_id, key: 'cdr_id')
84
+ .should_encode(true))
85
+ .header_param(new_parameter('application/json', key: 'accept'))
86
+ .auth(Single.new('bearerAuthorization')))
87
+ .response(new_response_handler
88
+ .deserializer(APIHelper.method(:custom_type_deserializer))
89
+ .deserialize_into(V3CdrsResponse1.method(:from_hash))
90
+ .local_error('400',
91
+ 'OCPI error response envelope',
92
+ OCPIErrorResponseException)
93
+ .local_error('401',
94
+ "Authorization failed. The credentials token is missing,'\
95
+ ' invalid, or does not\nmatch any known party.\n",
96
+ OCPIUnauthorizedResponseException)
97
+ .local_error('404',
98
+ 'The requested resource was not found.',
99
+ OCPIResponseErrorException))
100
+ .execute
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,51 @@
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
+ # CDRsPUSHController
8
+ class CDRsPUSHController < BaseController
9
+ # Creates a new CDR. The POST method should contain the full and final CDR
10
+ # object.
11
+ # CDRs cannot be changed or replaced once sent. Instead, a Credit CDR can be
12
+ # sent. Even though CDRs cannot change, it is possible that CDRs are
13
+ # delivered more than once.
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 [CDR] body Required parameter: The new CDR object.
23
+ # @return [OCPIResponse] Response from the API call.
24
+ def receiver_post_cdr(x_request_id,
25
+ x_correlation_id,
26
+ body)
27
+ @api_call
28
+ .request(new_request_builder(HttpMethodEnum::POST,
29
+ '/v3/cdrs',
30
+ Server::DEFAULT)
31
+ .header_param(new_parameter(x_request_id, key: 'X-Request-ID'))
32
+ .header_param(new_parameter(x_correlation_id, key: 'X-Correlation-ID'))
33
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
34
+ .body_param(new_parameter(body))
35
+ .header_param(new_parameter('application/json', key: 'accept'))
36
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
37
+ .auth(Or.new('ocpiAuthorization', 'bearerAuthorization')))
38
+ .response(new_response_handler
39
+ .deserializer(APIHelper.method(:custom_type_deserializer))
40
+ .deserialize_into(OCPIResponse.method(:from_hash))
41
+ .local_error('400',
42
+ 'OCPI error response envelope',
43
+ OCPIErrorResponseException)
44
+ .local_error('401',
45
+ "Authorization failed. The credentials token is missing,'\
46
+ ' invalid, or does not\nmatch any known party.\n",
47
+ OCPIUnauthorizedResponseException))
48
+ .execute
49
+ end
50
+ end
51
+ 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
+ # CommandsCallbackController
8
+ class CommandsCallbackController < BaseController
9
+ # The MSP receives the asynchronous result of a previously sent command.
10
+ # The URL to this endpoint is provided in the response_url field of each
11
+ # command request.
12
+ # The path shown here is a typical implementation pattern.
13
+ # @param [String] x_request_id Required parameter: Every request SHALL
14
+ # contain a unique request ID, the response to this request SHALL contain
15
+ # the same ID. It is advised to use GUID/UUID as values.
16
+ # @param [String] x_correlation_id Required parameter: Every
17
+ # request/response SHALL contain a unique correlation ID, every response to
18
+ # this request SHALL contain the same ID. It is advised to use GUID/UUID as
19
+ # values. When a Hub forwards a request to a party, the request SHALL
20
+ # contain the same X-Correlation-ID HTTP header (with the same value).
21
+ # @param [String] uid Required parameter: Unique ID relating to the original
22
+ # command request.
23
+ # @param [CommandResult] body Required parameter: TODO: type description
24
+ # here
25
+ # @return [OCPIResponse] Response from the API call.
26
+ def sender_post_command_result(x_request_id,
27
+ x_correlation_id,
28
+ uid,
29
+ body)
30
+ @api_call
31
+ .request(new_request_builder(HttpMethodEnum::POST,
32
+ '/v3/commands/{uid}',
33
+ Server::DEFAULT)
34
+ .header_param(new_parameter(x_request_id, key: 'X-Request-ID'))
35
+ .header_param(new_parameter(x_correlation_id, key: 'X-Correlation-ID'))
36
+ .template_param(new_parameter(uid, key: 'uid')
37
+ .should_encode(true))
38
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
39
+ .body_param(new_parameter(body))
40
+ .header_param(new_parameter('application/json', key: 'accept'))
41
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
42
+ .auth(Or.new('ocpiAuthorization', 'bearerAuthorization')))
43
+ .response(new_response_handler
44
+ .deserializer(APIHelper.method(:custom_type_deserializer))
45
+ .deserialize_into(OCPIResponse.method(:from_hash))
46
+ .local_error('400',
47
+ 'OCPI error response envelope',
48
+ OCPIErrorResponseException)
49
+ .local_error('401',
50
+ "Authorization failed. The credentials token is missing,'\
51
+ ' invalid, or does not\nmatch any known party.\n",
52
+ OCPIUnauthorizedResponseException))
53
+ .execute
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,102 @@
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
+ # CommandsController
8
+ class CommandsController < BaseController
9
+ # Request the Charge Point to start a transaction on the given
10
+ # EVSE/Connector.
11
+ # @param [String] x_request_id Required parameter: Every request SHALL
12
+ # contain a unique request ID, the response to this request SHALL contain
13
+ # the same ID. It is advised to use GUID/UUID as values.
14
+ # @param [String] x_correlation_id Required parameter: Every
15
+ # request/response SHALL contain a unique correlation ID, every response to
16
+ # this request SHALL contain the same ID. It is advised to use GUID/UUID as
17
+ # values. When a Hub forwards a request to a party, the request SHALL
18
+ # contain the same X-Correlation-ID HTTP header (with the same value).
19
+ # @param [StartSession] body Required parameter: TODO: type description
20
+ # here
21
+ # @param [String] ocpi_to_country_code Optional parameter: 'country code' of
22
+ # the CPO this message is to be sent to. This must match the `country_code`
23
+ # field of the entity. When it is not provided, the country code is "US".
24
+ # @param [String] ocpi_to_party_id Optional parameter: 'party id' of the CPO
25
+ # this message is to be sent to. This must match the `party_id` field of the
26
+ # entity. When no party ID is provided and the entity_id starts with three
27
+ # alphanumeric characters followed by an underscore (e.g., "TSL_1234" or
28
+ # "A1B_1234"), those first three characters are used as the party ID ("TSL"
29
+ # or "A1B"). Otherwise (e.g., "HBA1234"), the default party ID "GRL" is
30
+ # used.
31
+ # @return [V3CommandsSTARTSESSIONResponse] Response from the API call.
32
+ def receiver_post_start_session(x_request_id,
33
+ x_correlation_id,
34
+ body,
35
+ ocpi_to_country_code: 'US',
36
+ ocpi_to_party_id: nil)
37
+ @api_call
38
+ .request(new_request_builder(HttpMethodEnum::POST,
39
+ '/v3/commands/START_SESSION',
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
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
44
+ .body_param(new_parameter(body))
45
+ .header_param(new_parameter(ocpi_to_country_code, key: 'OCPI-to-country-code'))
46
+ .header_param(new_parameter(ocpi_to_party_id, key: 'OCPI-to-party-id'))
47
+ .header_param(new_parameter('application/json', key: 'accept'))
48
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
49
+ .auth(Single.new('bearerAuthorization')))
50
+ .response(new_response_handler
51
+ .deserializer(APIHelper.method(:custom_type_deserializer))
52
+ .deserialize_into(V3CommandsSTARTSESSIONResponse.method(:from_hash))
53
+ .local_error('400',
54
+ 'Request not accepted.',
55
+ V3CommandsSTARTSESSION400ErrorException)
56
+ .local_error('401',
57
+ "Authorization failed. The credentials token is missing,'\
58
+ ' invalid, or does not\nmatch any known party.\n",
59
+ OCPIUnauthorizedResponseException))
60
+ .execute
61
+ end
62
+
63
+ # Request the Charge Point to stop an ongoing session.
64
+ # @param [String] x_request_id Required parameter: Every request SHALL
65
+ # contain a unique request ID, the response to this request SHALL contain
66
+ # the same ID. It is advised to use GUID/UUID as values.
67
+ # @param [String] x_correlation_id Required parameter: Every
68
+ # request/response SHALL contain a unique correlation ID, every response to
69
+ # this request SHALL contain the same ID. It is advised to use GUID/UUID as
70
+ # values. When a Hub forwards a request to a party, the request SHALL
71
+ # contain the same X-Correlation-ID HTTP header (with the same value).
72
+ # @param [StopSession] body Required parameter: TODO: type description
73
+ # here
74
+ # @return [V3CommandsSTOPSESSIONResponse] Response from the API call.
75
+ def receiver_post_stop_session(x_request_id,
76
+ x_correlation_id,
77
+ body)
78
+ @api_call
79
+ .request(new_request_builder(HttpMethodEnum::POST,
80
+ '/v3/commands/STOP_SESSION',
81
+ Server::DEFAULT)
82
+ .header_param(new_parameter(x_request_id, key: 'X-Request-ID'))
83
+ .header_param(new_parameter(x_correlation_id, key: 'X-Correlation-ID'))
84
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
85
+ .body_param(new_parameter(body))
86
+ .header_param(new_parameter('application/json', key: 'accept'))
87
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
88
+ .auth(Single.new('bearerAuthorization')))
89
+ .response(new_response_handler
90
+ .deserializer(APIHelper.method(:custom_type_deserializer))
91
+ .deserialize_into(V3CommandsSTOPSESSIONResponse.method(:from_hash))
92
+ .local_error('400',
93
+ 'OCPI error response envelope',
94
+ OCPIErrorResponseException)
95
+ .local_error('401',
96
+ "Authorization failed. The credentials token is missing,'\
97
+ ' invalid, or does not\nmatch any known party.\n",
98
+ OCPIUnauthorizedResponseException))
99
+ .execute
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,125 @@
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
+ # LocationsPULLController
8
+ class LocationsPULLController < BaseController
9
+ # Fetch a list of Locations (paginated) and optionally filter on
10
+ # last_updated using date_from/date_to.
11
+ # If the optional parameters date_from and/or date_to are provided, only
12
+ # Locations with
13
+ # last_updated between the given date_from (including) and date_to
14
+ # (excluding) will be returned.
15
+ # In order for this to work properly, the following logic MUST be
16
+ # implemented accordingly:
17
+ # If an EVSE is updated, also the 'parent' Location's last_updated field
18
+ # needs to be updated.
19
+ # Similarly, if a Connector is updated, the EVSE's last_updated and the
20
+ # Location's last_updated
21
+ # fields need to be updated.
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 [DateTime] date_from Optional parameter: Only return objects that
31
+ # have last_updated after or equal to this Date/Time (inclusive).
32
+ # @param [DateTime] date_to Optional parameter: Only return objects that
33
+ # have last_updated up to this Date/Time, but not including (exclusive).
34
+ # @param [Integer] limit Optional parameter: Maximum number of objects to
35
+ # GET.
36
+ # @param [Integer] offset Optional parameter: The offset of the first object
37
+ # returned. Default is 0.
38
+ # @return [V3LocationsResponse] Response from the API call.
39
+ def sender_get_locations(x_request_id,
40
+ x_correlation_id,
41
+ date_from: nil,
42
+ date_to: nil,
43
+ limit: nil,
44
+ offset: 0)
45
+ @api_call
46
+ .request(new_request_builder(HttpMethodEnum::GET,
47
+ '/v3/locations',
48
+ Server::DEFAULT)
49
+ .header_param(new_parameter(x_request_id, key: 'X-Request-ID'))
50
+ .header_param(new_parameter(x_correlation_id, key: 'X-Correlation-ID'))
51
+ .query_param(new_parameter(date_from, key: 'date_from'))
52
+ .query_param(new_parameter(date_to, key: 'date_to'))
53
+ .query_param(new_parameter(limit, key: 'limit'))
54
+ .query_param(new_parameter(offset, key: 'offset'))
55
+ .header_param(new_parameter('application/json', key: 'accept'))
56
+ .auth(Single.new('bearerAuthorization')))
57
+ .response(new_response_handler
58
+ .deserializer(APIHelper.method(:custom_type_deserializer))
59
+ .deserialize_into(V3LocationsResponse.method(:from_hash))
60
+ .local_error('400',
61
+ 'OCPI error response envelope',
62
+ OCPIErrorResponseException)
63
+ .local_error('401',
64
+ "Authorization failed. The credentials token is missing,'\
65
+ ' invalid, or does not\nmatch any known party.\n",
66
+ OCPIUnauthorizedResponseException))
67
+ .execute
68
+ end
69
+
70
+ # Fetch a specific Location by its ID.
71
+ # @param [String] x_request_id Required parameter: Every request SHALL
72
+ # contain a unique request ID, the response to this request SHALL contain
73
+ # the same ID. It is advised to use GUID/UUID as values.
74
+ # @param [String] x_correlation_id Required parameter: Every
75
+ # request/response SHALL contain a unique correlation ID, every response to
76
+ # this request SHALL contain the same ID. It is advised to use GUID/UUID as
77
+ # values. When a Hub forwards a request to a party, the request SHALL
78
+ # contain the same X-Correlation-ID HTTP header (with the same value).
79
+ # @param [String] location_id Required parameter: Location.id of the
80
+ # Location object to retrieve or update.
81
+ # @param [String] ocpi_to_country_code Optional parameter: 'country code' of
82
+ # the CPO this message is to be sent to. This must match the `country_code`
83
+ # field of the entity. When it is not provided, the country code is "US".
84
+ # @param [String] ocpi_to_party_id Optional parameter: 'party id' of the CPO
85
+ # this message is to be sent to. This must match the `party_id` field of the
86
+ # entity. When no party ID is provided and the entity_id starts with three
87
+ # alphanumeric characters followed by an underscore (e.g., "TSL_1234" or
88
+ # "A1B_1234"), those first three characters are used as the party ID ("TSL"
89
+ # or "A1B"). Otherwise (e.g., "HBA1234"), the default party ID "GRL" is
90
+ # used.
91
+ # @return [V3LocationsResponse1] Response from the API call.
92
+ def sender_get_location(x_request_id,
93
+ x_correlation_id,
94
+ location_id,
95
+ ocpi_to_country_code: 'US',
96
+ ocpi_to_party_id: nil)
97
+ @api_call
98
+ .request(new_request_builder(HttpMethodEnum::GET,
99
+ '/v3/locations/{location_id}',
100
+ Server::DEFAULT)
101
+ .header_param(new_parameter(x_request_id, key: 'X-Request-ID'))
102
+ .header_param(new_parameter(x_correlation_id, key: 'X-Correlation-ID'))
103
+ .template_param(new_parameter(location_id, key: 'location_id')
104
+ .should_encode(true))
105
+ .header_param(new_parameter(ocpi_to_country_code, key: 'OCPI-to-country-code'))
106
+ .header_param(new_parameter(ocpi_to_party_id, key: 'OCPI-to-party-id'))
107
+ .header_param(new_parameter('application/json', key: 'accept'))
108
+ .auth(Single.new('bearerAuthorization')))
109
+ .response(new_response_handler
110
+ .deserializer(APIHelper.method(:custom_type_deserializer))
111
+ .deserialize_into(V3LocationsResponse1.method(:from_hash))
112
+ .local_error('400',
113
+ 'OCPI error response envelope',
114
+ OCPIErrorResponseException)
115
+ .local_error('401',
116
+ "Authorization failed. The credentials token is missing,'\
117
+ ' invalid, or does not\nmatch any known party.\n",
118
+ OCPIUnauthorizedResponseException)
119
+ .local_error('404',
120
+ 'The requested resource was not found.',
121
+ OCPIResponseErrorException))
122
+ .execute
123
+ end
124
+ end
125
+ 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
+ # LocationsPUSHController
8
+ class LocationsPUSHController < BaseController
9
+ # The CPO pushes available Location objects to the eMSP.
10
+ # PUT can be used to send new Location objects to the eMSP but also to
11
+ # replace existing Locations.
12
+ # The country_code and party_id in the URL SHALL be the same value as the
13
+ # country_code and
14
+ # party_id in the Location object being pushed.
15
+ # @param [String] x_request_id Required parameter: Every request SHALL
16
+ # contain a unique request ID, the response to this request SHALL contain
17
+ # the same ID. It is advised to use GUID/UUID as values.
18
+ # @param [String] x_correlation_id Required parameter: Every
19
+ # request/response SHALL contain a unique correlation ID, every response to
20
+ # this request SHALL contain the same ID. It is advised to use GUID/UUID as
21
+ # values. When a Hub forwards a request to a party, the request SHALL
22
+ # contain the same X-Correlation-ID HTTP header (with the same value).
23
+ # @param [String] country_code Required parameter: Country code of the CPO
24
+ # that 'owns' this object (ISO-3166 alpha-2).
25
+ # @param [String] party_id Required parameter: Party ID (Provider ID) of the
26
+ # CPO that 'owns' this object (following the ISO-15118 standard).
27
+ # @param [String] location_id Required parameter: Location.id of the
28
+ # Location object to retrieve or update.
29
+ # @param [Location] body Required parameter: New Location object, or
30
+ # Location object to replace.
31
+ # @return [OCPIResponse] Response from the API call.
32
+ def receiver_put_location(x_request_id,
33
+ x_correlation_id,
34
+ country_code,
35
+ party_id,
36
+ location_id,
37
+ body)
38
+ @api_call
39
+ .request(new_request_builder(HttpMethodEnum::PUT,
40
+ '/v3/locations/{country_code}/{party_id}/{location_id}',
41
+ Server::DEFAULT)
42
+ .header_param(new_parameter(x_request_id, key: 'X-Request-ID'))
43
+ .header_param(new_parameter(x_correlation_id, key: 'X-Correlation-ID'))
44
+ .template_param(new_parameter(country_code, key: 'country_code')
45
+ .should_encode(true))
46
+ .template_param(new_parameter(party_id, key: 'party_id')
47
+ .should_encode(true))
48
+ .template_param(new_parameter(location_id, key: 'location_id')
49
+ .should_encode(true))
50
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
51
+ .body_param(new_parameter(body))
52
+ .header_param(new_parameter('application/json', key: 'accept'))
53
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
54
+ .auth(Or.new('ocpiAuthorization', 'bearerAuthorization')))
55
+ .response(new_response_handler
56
+ .deserializer(APIHelper.method(:custom_type_deserializer))
57
+ .deserialize_into(OCPIResponse.method(:from_hash))
58
+ .local_error('400',
59
+ 'OCPI error response envelope',
60
+ OCPIErrorResponseException)
61
+ .local_error('401',
62
+ "Authorization failed. The credentials token is missing,'\
63
+ ' invalid, or does not\nmatch any known party.\n",
64
+ OCPIUnauthorizedResponseException))
65
+ .execute
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,91 @@
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
+ # SessionsPULLController
8
+ class SessionsPULLController < BaseController
9
+ # Fetch a list of Sessions from the CPO system (paginated).
10
+ # Only Sessions with last_updated between the given date_from (including)
11
+ # and date_to (excluding) will be returned.
12
+ # `date_from` is required unless at least one `session_id` is provided.
13
+ # @param [String] x_request_id Required parameter: Every request SHALL
14
+ # contain a unique request ID, the response to this request SHALL contain
15
+ # the same ID. It is advised to use GUID/UUID as values.
16
+ # @param [String] x_correlation_id Required parameter: Every
17
+ # request/response SHALL contain a unique correlation ID, every response to
18
+ # this request SHALL contain the same ID. It is advised to use GUID/UUID as
19
+ # values. When a Hub forwards a request to a party, the request SHALL
20
+ # contain the same X-Correlation-ID HTTP header (with the same value).
21
+ # @param [String] ocpi_to_country_code Optional parameter: When
22
+ # `location_id` is specified, this header can be used to identify the right
23
+ # CPO that owns the location. 'country code' of the CPO that owns this
24
+ # location. This must match the `country_code` field of the location. When
25
+ # it is not provided, the country code is "US".
26
+ # @param [String] ocpi_to_party_id Optional parameter: When `location_id` is
27
+ # specified, this header can be used to identify the right CPO that owns the
28
+ # location. 'party id' of the CPO that owns this location. This must match
29
+ # the `party_id` field of the entity. When no party ID is provided and the
30
+ # `location_id` starts with three alphanumeric characters followed by an
31
+ # underscore (e.g., "TSL_1234" or "A1B_1234"), those first three characters
32
+ # are used as the party ID ("TSL" or "A1B"). Otherwise (e.g., "HBA1234"),
33
+ # the default party ID "GRL" is used.
34
+ # @param [DateTime] date_from Optional parameter: Only return Sessions that
35
+ # have last_updated after or equal to this Date/Time (inclusive). Required
36
+ # unless at least one session_id is provided.
37
+ # @param [DateTime] date_to Optional parameter: Only return objects that
38
+ # have last_updated up to this Date/Time, but not including (exclusive).
39
+ # @param [Array[String]] session_id Optional parameter: Filter sessions by
40
+ # one or more Session IDs. This parameter may be repeated to request
41
+ # multiple sessions, e.g. `/v3/sessions?session_id=1&session_id=2`. When the
42
+ # session is not found, the `session_id` is ignored and not returned in the
43
+ # response. When no session is found, an empty list will be returned.
44
+ # @param [String] location_id Optional parameter: Filter sessions by
45
+ # Location ID. Only sessions that took place at the given location will be
46
+ # returned.
47
+ # @param [Integer] offset Optional parameter: The offset of the first object
48
+ # returned. Default is 0.
49
+ # @param [Integer] limit Optional parameter: Maximum number of objects to
50
+ # GET.
51
+ # @return [V3SessionsResponse] Response from the API call.
52
+ def sender_get_sessions(x_request_id,
53
+ x_correlation_id,
54
+ ocpi_to_country_code: 'US',
55
+ ocpi_to_party_id: nil,
56
+ date_from: nil,
57
+ date_to: nil,
58
+ session_id: nil,
59
+ location_id: nil,
60
+ offset: 0,
61
+ limit: nil)
62
+ @api_call
63
+ .request(new_request_builder(HttpMethodEnum::GET,
64
+ '/v3/sessions',
65
+ Server::DEFAULT)
66
+ .header_param(new_parameter(x_request_id, key: 'X-Request-ID'))
67
+ .header_param(new_parameter(x_correlation_id, key: 'X-Correlation-ID'))
68
+ .header_param(new_parameter(ocpi_to_country_code, key: 'OCPI-to-country-code'))
69
+ .header_param(new_parameter(ocpi_to_party_id, key: 'OCPI-to-party-id'))
70
+ .query_param(new_parameter(date_from, key: 'date_from'))
71
+ .query_param(new_parameter(date_to, key: 'date_to'))
72
+ .query_param(new_parameter(session_id, key: 'session_id'))
73
+ .query_param(new_parameter(location_id, key: 'location_id'))
74
+ .query_param(new_parameter(offset, key: 'offset'))
75
+ .query_param(new_parameter(limit, key: 'limit'))
76
+ .header_param(new_parameter('application/json', key: 'accept'))
77
+ .auth(Single.new('bearerAuthorization')))
78
+ .response(new_response_handler
79
+ .deserializer(APIHelper.method(:custom_type_deserializer))
80
+ .deserialize_into(V3SessionsResponse.method(:from_hash))
81
+ .local_error('400',
82
+ 'OCPI error response envelope',
83
+ OCPIErrorResponseException)
84
+ .local_error('401',
85
+ "Authorization failed. The credentials token is missing,'\
86
+ ' invalid, or does not\nmatch any known party.\n",
87
+ OCPIUnauthorizedResponseException))
88
+ .execute
89
+ end
90
+ end
91
+ end