Class: Verizon::RetrieveTheTriggersApi
- Defined in:
- lib/verizon/apis/retrieve_the_triggers_api.rb
Overview
RetrieveTheTriggersApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
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 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
#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/apis/retrieve_the_triggers_api.rb', line 11 def get_all_available_triggers @api_call .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 49 |
# File 'lib/verizon/apis/retrieve_the_triggers_api.rb', line 31 def get_all_triggers_by_account_name(account_name) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/m2m/v2/triggers/accounts/{accountName}', Server::THINGSPACE) .template_param(new_parameter(account_name, key: 'accountName') .is_required(true) .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
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/verizon/apis/retrieve_the_triggers_api.rb', line 54 def get_all_triggers_by_trigger_category @api_call .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
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/verizon/apis/retrieve_the_triggers_api.rb', line 75 def get_triggers_by_id(trigger_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/m2m/v2/triggers/{triggerId}', Server::THINGSPACE) .template_param(new_parameter(trigger_id, key: 'triggerId') .is_required(true) .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 |