Class: Verizon::ExclusionsApi
- Defined in:
- lib/verizon/apis/exclusions_api.rb
Overview
ExclusionsApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#devices_location_get_consent_async(account_name, device_id: nil) ⇒ ApiResponse
Get the consent settings for the entire account or device list in an account.
-
#devices_location_give_consent_async(body: nil) ⇒ ApiResponse
Create a consent record to use location services as an asynchronous request.
-
#devices_location_update_consent(body: nil) ⇒ ApiResponse
Update the location services consent record for an entire account.
-
#exclude_devices(body) ⇒ ApiResponse
This consents endpoint sets a new exclusion list.
-
#list_excluded_devices(account_name, start_index) ⇒ ApiResponse
This consents endpoint retrieves a list of excluded devices in an account.
-
#remove_devices_from_exclusion_list(account_name, device_list) ⇒ ApiResponse
Removes devices from the exclusion list so that they can be located with Device Location Services requests.
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
#devices_location_get_consent_async(account_name, device_id: nil) ⇒ ApiResponse
Get the consent settings for the entire account or device list in an account. account. queried
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/verizon/apis/exclusions_api.rb', line 16 def (account_name, device_id: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/devicelocations/action/consents', Server::DEVICE_LOCATION) .query_param(new_parameter(account_name, key: 'accountName') .is_required(true)) .query_param(new_parameter(device_id, key: 'deviceId')) .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(GetAccountDeviceConsent.method(:from_hash)) .is_api_response(true) .local_error('default', 'Unexpected error.', DeviceLocationResultException)) .execute end |
#devices_location_give_consent_async(body: nil) ⇒ ApiResponse
Create a consent record to use location services as an asynchronous request. create a consent record.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/verizon/apis/exclusions_api.rb', line 42 def (body: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/devicelocations/action/consents', Server::DEVICE_LOCATION) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(And.new('thingspace_oauth', 'VZ-M2M-Token'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConsentTransactionId.method(:from_hash)) .is_api_response(true) .local_error('default', 'Unexpected error.', DeviceLocationResultException)) .execute end |
#devices_location_update_consent(body: nil) ⇒ ApiResponse
Update the location services consent record for an entire account. update a consent record.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/verizon/apis/exclusions_api.rb', line 66 def (body: nil) @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/devicelocations/action/consents', Server::DEVICE_LOCATION) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(And.new('thingspace_oauth', 'VZ-M2M-Token'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConsentTransactionId.method(:from_hash)) .is_api_response(true) .local_error('default', 'Unexpected error.', DeviceLocationResultException)) .execute end |
#exclude_devices(body) ⇒ ApiResponse
This consents endpoint sets a new exclusion list. consent exclusion list.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/verizon/apis/exclusions_api.rb', line 90 def exclude_devices(body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/consents', Server::DEVICE_LOCATION) .header_param(new_parameter('*/*', key: 'Content-Type')) .body_param(new_parameter(body) .is_required(true)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(And.new('thingspace_oauth', 'VZ-M2M-Token'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(DeviceLocationSuccessResult.method(:from_hash)) .is_api_response(true) .local_error('400', 'Unexpected error.', DeviceLocationResultException)) .execute end |
#list_excluded_devices(account_name, start_index) ⇒ ApiResponse
This consents endpoint retrieves a list of excluded devices in an account. “##########-#####”. first record to return.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/verizon/apis/exclusions_api.rb', line 146 def list_excluded_devices(account_name, start_index) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/consents/{accountName}/index/{startIndex}', Server::DEVICE_LOCATION) .template_param(new_parameter(account_name, key: 'accountName') .is_required(true) .should_encode(true)) .template_param(new_parameter(start_index, key: 'startIndex') .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(DevicesConsentResult.method(:from_hash)) .is_api_response(true) .local_error('400', 'Unexpected error.', DeviceLocationResultException)) .execute end |
#remove_devices_from_exclusion_list(account_name, device_list) ⇒ ApiResponse
Removes devices from the exclusion list so that they can be located with Device Location Services requests. account. to remove from the exclusion list.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/verizon/apis/exclusions_api.rb', line 118 def remove_devices_from_exclusion_list(account_name, device_list) @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/consents', Server::DEVICE_LOCATION) .query_param(new_parameter(account_name, key: 'accountName') .is_required(true)) .query_param(new_parameter(device_list, key: 'deviceList') .is_required(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(DeviceLocationSuccessResult.method(:from_hash)) .is_api_response(true) .local_error('400', 'Unexpected error.', DeviceLocationResultException)) .execute end |