Class: Verizon::MapDataManagerApi
- Defined in:
- lib/verizon/apis/map_data_manager_api.rb
Overview
MapDataManagerApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#download_map_data_message(vendor_id, geofence) ⇒ ApiResponse
This endpoint allows user to download SAE J2735 MAP messages in ASN.1 UPER format.
-
#upload_map_data_message(vendor_id, body) ⇒ ApiResponse
This endpoint allows the user to upload map messages in SAE J2735 MAP messages in ASN.1 UPER or JER (JSON) formats.
Methods inherited from BaseApi
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from Verizon::BaseApi
Instance Method Details
#download_map_data_message(vendor_id, geofence) ⇒ ApiResponse
This endpoint allows user to download SAE J2735 MAP messages in ASN.1 UPER format. The area for the MAP messages is needed to be defined in the query. Vendor registration call. wants to receive MAP data from.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/verizon/apis/map_data_manager_api.rb', line 64 def (vendor_id, geofence) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/api/v2/mapdata', Server::IMP_SERVER) .header_param(new_parameter(vendor_id, key: 'VendorID') .is_required(true)) .query_param(new_parameter(geofence, key: 'Geofence') .is_required(true)) .auth(And.new('thingspace_oauth', 'SessionToken'))) .response(new_response_handler .deserializer(APIHelper.method(:deserialize_primitive_types)) .deserialize_into(proc do |response| response&.to_s end) .is_api_response(true) .is_primitive_response(true) .local_error('400', 'Invalid request', MapDataResponseErrorException) .local_error('401', 'Unauthorized', MapDataResponseErrorException) .local_error('403', 'Forbidden Request', MapDataResponseErrorException) .local_error('429', 'Too Many Requests', MapDataResponseErrorException) .local_error('503', 'Internal server Error', MapDataResponseErrorException) .local_error('default', 'Unexpected Error', MapDataResponseErrorException)) .execute end |
#upload_map_data_message(vendor_id, body) ⇒ ApiResponse
This endpoint allows the user to upload map messages in SAE J2735 MAP messages in ASN.1 UPER or JER (JSON) formats. The MAP data message can have more than one intersections in it. Note: The user needs to authenticate with their ThingSpace credentials using the Access/Bearer and Session/M2M tokens in order to call this API. Vendor registration call.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/verizon/apis/map_data_manager_api.rb', line 18 def (vendor_id, body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/api/v2/mapdata', Server::IMP_SERVER) .header_param(new_parameter(vendor_id, key: 'VendorID') .is_required(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body) .is_required(true)) .auth(And.new('thingspace_oauth', 'SessionToken'))) .response(new_response_handler .deserializer(APIHelper.method(:deserialize_primitive_types)) .deserialize_into(proc do |response| response&.to_s end) .is_api_response(true) .is_primitive_response(true) .local_error('400', 'Invalid request', MapDataResponseErrorException) .local_error('401', 'Unauthorized', MapDataResponseErrorException) .local_error('403', 'Forbidden Request', MapDataResponseErrorException) .local_error('429', 'Too Many Requests', MapDataResponseErrorException) .local_error('503', 'Internal server Error', MapDataResponseErrorException) .local_error('default', 'Unexpected Error', MapDataResponseErrorException)) .execute end |