Class: Verizon::SoftwareManagementReportsV1Controller
- Inherits:
-
BaseController
- Object
- BaseController
- Verizon::SoftwareManagementReportsV1Controller
- Defined in:
- lib/verizon/controllers/software_management_reports_v1_controller.rb
Overview
SoftwareManagementReportsV1Controller
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#get_device_firmware_upgrade_history(account, device_id) ⇒ Array[DeviceUpgradeHistory]
Returns the upgrade history of the specified device from the previous six months.
-
#list_account_devices(account, start_index) ⇒ DeviceListQueryResult
Returns an array of all devices in the specified account.
-
#list_upgrades_for_specified_status(account, upgrade_status, start_index) ⇒ UpgradeListQueryResult
Returns a list of all upgrades with a specified status.
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_device_firmware_upgrade_history(account, device_id) ⇒ Array[DeviceUpgradeHistory]
Returns the upgrade history of the specified device from the previous six months. “##########-#####”.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/verizon/controllers/software_management_reports_v1_controller.rb', line 82 def get_device_firmware_upgrade_history(account, device_id) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/reports/{account}/devices/{deviceId}', Server::SOFTWARE_MANAGEMENT_V1) .template_param(new_parameter(account, key: 'account') .should_encode(true)) .template_param(new_parameter(device_id, key: 'deviceId') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oAuth2'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(DeviceUpgradeHistory.method(:from_hash)) .is_api_response(true) .is_response_array(true) .local_error('400', 'Unexpected error.', FotaV1ResultException)) .execute end |
#list_account_devices(account, start_index) ⇒ DeviceListQueryResult
Returns an array of all devices in the specified account. Each device object includes information needed for managing firmware, including the device make and model, MDN and IMEI, and current firmware version. “##########-#####”. IMEIs larger than this value. Use 0 for the first request. If ‘hasMoreData`=true in the response, use the `lastSeenDeviceId` value from the response as the startIndex in the next request.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/verizon/controllers/software_management_reports_v1_controller.rb', line 19 def list_account_devices(account, start_index) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/devices/{account}/index/{startIndex}', Server::SOFTWARE_MANAGEMENT_V1) .template_param(new_parameter(account, key: 'account') .should_encode(true)) .template_param(new_parameter(start_index, key: 'startIndex') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oAuth2'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(DeviceListQueryResult.method(:from_hash)) .is_api_response(true) .local_error('400', 'Unexpected error.', FotaV1ResultException)) .execute end |
#list_upgrades_for_specified_status(account, upgrade_status, start_index) ⇒ UpgradeListQueryResult
Returns a list of all upgrades with a specified status. “##########-#####”. of the upgrades that you want to retrieve. the first record to return. Set startIndex=0 for the first request. If ‘hasMoreFlag`=true in the response, use the `lastSeenUpgradeId` value from the response as the startIndex in the next request.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/verizon/controllers/software_management_reports_v1_controller.rb', line 51 def list_upgrades_for_specified_status(account, upgrade_status, start_index) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/reports/{account}/status/{upgradeStatus}/index/{startIndex}', Server::SOFTWARE_MANAGEMENT_V1) .template_param(new_parameter(account, key: 'account') .should_encode(true)) .template_param(new_parameter(upgrade_status, key: 'upgradeStatus') .should_encode(true)) .template_param(new_parameter(start_index, key: 'startIndex') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oAuth2'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(UpgradeListQueryResult.method(:from_hash)) .is_api_response(true) .local_error('400', 'Unexpected error.', FotaV1ResultException)) .execute end |