Class: Verizon::RetrieveTheTriggersController
- Inherits:
-
BaseController
- Object
- BaseController
- Verizon::RetrieveTheTriggersController
- Defined in:
- lib/verizon/controllers/retrieve_the_triggers_controller.rb
Overview
RetrieveTheTriggersController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#get_all_available_triggers ⇒ ApiResponse
Retrieves all of the available triggers for pseudo-MDN.
-
#get_all_triggers_by_account_name(account_name) ⇒ ApiResponse
Retrieve the triggers associated with an account name.
-
#get_all_triggers_by_trigger_category ⇒ ApiResponse
Retrieves all of the triggers for the specified account associated with the PromoAlert category.
-
#get_triggers_by_id(trigger_id) ⇒ ApiResponse
Retrives a specific trigger by its ID.
Methods inherited from BaseController
#initialize, #new_api_call_builder, #new_parameter, #new_request_builder, #new_response_handler, user_agent
Constructor Details
This class inherits a constructor from Verizon::BaseController
Instance Method Details
#get_all_available_triggers ⇒ ApiResponse
Retrieves all of the available triggers for pseudo-MDN.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/verizon/controllers/retrieve_the_triggers_controller.rb', line 11 def get_all_available_triggers new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/m2m/v2/triggers', Server::THINGSPACE) .header_param(new_parameter('application/json', key: 'accept')) .auth(And.new('thingspace_oauth', 'VZ-M2M-Token'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(TriggerValueResponse.method(:from_hash)) .is_api_response(true) .local_error('default', 'Error response', ReadySimRestErrorResponseException)) .execute end |
#get_all_triggers_by_account_name(account_name) ⇒ ApiResponse
Retrieve the triggers associated with an account name.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/verizon/controllers/retrieve_the_triggers_controller.rb', line 31 def get_all_triggers_by_account_name(account_name) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/m2m/v2/triggers/accounts/{accountName}', Server::THINGSPACE) .template_param(new_parameter(account_name, key: 'accountName') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(And.new('thingspace_oauth', 'VZ-M2M-Token'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(TriggerValueResponse.method(:from_hash)) .is_api_response(true) .local_error('default', 'Error response', ReadySimRestErrorResponseException)) .execute end |
#get_all_triggers_by_trigger_category ⇒ ApiResponse
Retrieves all of the triggers for the specified account associated with the PromoAlert category
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/verizon/controllers/retrieve_the_triggers_controller.rb', line 53 def get_all_triggers_by_trigger_category new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/m2m/v2/triggers/categories/PromoAlerts', Server::THINGSPACE) .header_param(new_parameter('application/json', key: 'accept')) .auth(And.new('thingspace_oauth', 'VZ-M2M-Token'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(TriggerValueResponse2.method(:from_hash)) .is_api_response(true) .local_error('default', 'Error response', ReadySimRestErrorResponseException)) .execute end |
#get_triggers_by_id(trigger_id) ⇒ ApiResponse
Retrives a specific trigger by its ID. trigger
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/verizon/controllers/retrieve_the_triggers_controller.rb', line 74 def get_triggers_by_id(trigger_id) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/m2m/v2/triggers/{triggerId}', Server::THINGSPACE) .template_param(new_parameter(trigger_id, key: 'triggerId') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(And.new('thingspace_oauth', 'VZ-M2M-Token'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(TriggerValueResponse2.method(:from_hash)) .is_api_response(true) .local_error('default', 'Error response', ReadySimRestErrorResponseException)) .execute end |