Class: Asdawqw::ValidationController
- Inherits:
-
BaseController
- Object
- BaseController
- Asdawqw::ValidationController
- Defined in:
- lib/asdawqw/controllers/validation_controller.rb
Overview
ValidationController
Class Attribute Summary collapse
-
.instance ⇒ Object
Returns the value of attribute instance.
Attributes inherited from BaseController
Instance Method Summary collapse
-
#create_booking_pal_validation_job_list_of_properties(content_type, body) ⇒ Object
This function will allow the PMS to call the BookingPal property validation job for a list of properties from request.
-
#get_booking_pal_validation_job_full_pm ⇒ Object
This function will allow the PMC to call the BookingPal property validation job for all properties identified which belong to the current user.
- #instance ⇒ Object
Methods inherited from BaseController
#execute_request, #initialize, #validate_parameters, #validate_response
Constructor Details
This class inherits a constructor from Asdawqw::BaseController
Class Attribute Details
.instance ⇒ Object
Returns the value of attribute instance.
12 13 14 |
# File 'lib/asdawqw/controllers/validation_controller.rb', line 12 def instance @instance end |
Instance Method Details
#create_booking_pal_validation_job_list_of_properties(content_type, body) ⇒ Object
This function will allow the PMS to call the BookingPal property validation job for a list of properties from request. These properties must belong to the current user and authorization token should be on PM level. Also, we will run validation only for properties that are activated. If you deactivate property - we will not validate this property. Example:
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/asdawqw/controllers/validation_controller.rb', line 78 def create_booking_pal_validation_job_list_of_properties(content_type, body) # Prepare query url. _path_url = '/validation' _query_builder = Configuration.get_base_uri _query_builder << _path_url _query_url = APIHelper.clean_url _query_builder # Prepare headers. _headers = { 'accept' => 'application/json', 'x-api-key' => Configuration.x_api_key, 'Content-Type' => content_type } # Prepare and execute HttpRequest. _request = @http_client.post( _query_url, headers: _headers, parameters: body.to_json ) CustomQueryAuth.apply(_request) _context = execute_request(_request) validate_response(_context) # Return appropriate response type. decoded = APIHelper.json_deserialize(_context.response.raw_body) APIResponseWithoutData.from_hash(decoded) end |
#get_booking_pal_validation_job_full_pm ⇒ Object
This function will allow the PMC to call the BookingPal property validation job for all properties identified which belong to the current user. Authorization token should be on PM level. Also we will run validation only for properties which are activated. If you deactivate property - we will not validate this property. After the request you will get a response indicating if messages were processed or not. If the request is good your request for the validator job will be put into a queue. Once the request is processed, BookingPal will send an async push message per property informing the user if a property is valid or not, and if it is not valid - with reasons why the validation failed. This message will be sent on the endpoint which was entered in section Push Notifications, field asyncPush. Note: If the property is distributed already on some channel - this property will not be moved to an Incomplete state. Also if you have property on Incomplete state because of some reason, and you update this data which causes that property is on ‘Incomplete’ property will not be moved automatically to a valid state. Instead, you should run a Validation job manually for that property or wait for our automatic validation job which we are running once per day. To make the property ready for Onboarding you should run validation first. if the property is valid - it will be ready for onboarding. Otherwise - the property will be in Incomplete state. Also, we will run validation only for properties that are activated. If you deactivate property - we will not validate this property.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/asdawqw/controllers/validation_controller.rb', line 44 def get_booking_pal_validation_job_full_pm # Prepare query url. _path_url = '/validation' _query_builder = Configuration.get_base_uri _query_builder << _path_url _query_url = APIHelper.clean_url _query_builder # Prepare headers. _headers = { 'accept' => 'application/json', 'x-api-key' => Configuration.x_api_key } # Prepare and execute HttpRequest. _request = @http_client.get( _query_url, headers: _headers ) CustomQueryAuth.apply(_request) _context = execute_request(_request) validate_response(_context) # Return appropriate response type. decoded = APIHelper.json_deserialize(_context.response.raw_body) APIResponseWithoutData.from_hash(decoded) end |
#instance ⇒ Object
15 16 17 |
# File 'lib/asdawqw/controllers/validation_controller.rb', line 15 def instance self.class.instance end |