Class: Verizon::SoftwareManagementReportsV1Api

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/verizon/apis/software_management_reports_v1_api.rb

Overview

SoftwareManagementReportsV1Api

Constant Summary

Constants inherited from BaseApi

BaseApi::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseApi

#config, #http_call_back

Instance Method Summary collapse

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_device_firmware_upgrade_history(account, device_id) ⇒ ApiResponse

Returns the upgrade history of the specified device from the previous six months. “##########-#####”.

Parameters:

  • account (String)

    Required parameter: Account identifier in

  • device_id (String)

    Required parameter: The IMEI of the device.

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/verizon/apis/software_management_reports_v1_api.rb', line 87

def get_device_firmware_upgrade_history(,
                                        device_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reports/{account}/devices/{deviceId}',
                                 Server::SOFTWARE_MANAGEMENT_V1)
               .template_param(new_parameter(, key: 'account')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(device_id, key: 'deviceId')
                                .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(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) ⇒ ApiResponse

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.

Parameters:

  • account (String)

    Required parameter: Account identifier in

  • start_index (String)

    Required parameter: Only return devices with

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/verizon/apis/software_management_reports_v1_api.rb', line 19

def (,
                         start_index)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/devices/{account}/index/{startIndex}',
                                 Server::SOFTWARE_MANAGEMENT_V1)
               .template_param(new_parameter(, key: 'account')
                                .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(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) ⇒ ApiResponse

Returns a list of all upgrades with a specified status. “##########-#####”. 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.

Parameters:

  • account (String)

    Required parameter: Account identifier in

  • upgrade_status (UpgradeStatus)

    Required parameter: The status of

  • start_index (String)

    Required parameter: The zero-based number of

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/verizon/apis/software_management_reports_v1_api.rb', line 53

def list_upgrades_for_specified_status(,
                                       upgrade_status,
                                       start_index)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reports/{account}/status/{upgradeStatus}/index/{startIndex}',
                                 Server::SOFTWARE_MANAGEMENT_V1)
               .template_param(new_parameter(, key: 'account')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(upgrade_status, key: 'upgradeStatus')
                                .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(UpgradeListQueryResult.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Unexpected error.',
                             FotaV1ResultException))
    .execute
end