Class: Verizon::SoftwareManagementReportsV3Api

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

Overview

SoftwareManagementReportsV3Api

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_campaign_device_status(acc, campaign_id, last_seen_device_id: nil) ⇒ ApiResponse

Retrieve a list of all devices in a campaign and the status of each device. identifier.

Parameters:

  • acc (String)

    Required parameter: Account identifier.

  • campaign_id (String)

    Required parameter: Campaign identifier.

  • last_seen_device_id (String) (defaults to: nil)

    Optional parameter: Last seen device

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/verizon/apis/software_management_reports_v3_api.rb', line 78

def get_campaign_device_status(acc,
                               campaign_id,
                               last_seen_device_id: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reports/{acc}/campaigns/{campaignId}/devices',
                                 Server::SOFTWARE_MANAGEMENT_V3)
               .template_param(new_parameter(acc, key: 'acc')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(campaign_id, key: 'campaignId')
                                .is_required(true)
                                .should_encode(true))
               .query_param(new_parameter(last_seen_device_id, key: 'lastSeenDeviceId'))
               .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(V3CampaignDevice.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Unexpected error.',
                             FotaV3ResultException))
    .execute
end

#get_campaign_history_by_status(acc, campaign_status, last_seen_campaign_id: nil) ⇒ ApiResponse

Retrieve a list of campaigns for an account that have a specified campaign status. status. campaign Id.

Parameters:

  • acc (String)

    Required parameter: Account identifier.

  • campaign_status (CampaignStatus)

    Required parameter: Campaign

  • last_seen_campaign_id (String) (defaults to: nil)

    Optional parameter: Last seen

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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

def get_campaign_history_by_status(acc,
                                   campaign_status,
                                   last_seen_campaign_id: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reports/{acc}/firmware/campaigns',
                                 Server::SOFTWARE_MANAGEMENT_V3)
               .template_param(new_parameter(acc, key: 'acc')
                                .is_required(true)
                                .should_encode(true))
               .query_param(new_parameter(campaign_status, key: 'campaignStatus')
                             .is_required(true))
               .query_param(new_parameter(last_seen_campaign_id, key: 'lastSeenCampaignId'))
               .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(V3CampaignHistory.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Unexpected error.',
                             FotaV3ResultException))
    .execute
end

#get_device_firmware_upgrade_history(acc, device_id) ⇒ ApiResponse

Retrieve campaign history for a specific device.

Parameters:

  • acc (String)

    Required parameter: Account identifier.

  • device_id (String)

    Required parameter: Device IMEI identifier.

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/verizon/apis/software_management_reports_v3_api.rb', line 46

def get_device_firmware_upgrade_history(acc,
                                        device_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reports/{acc}/devices/{deviceId}',
                                 Server::SOFTWARE_MANAGEMENT_V3)
               .template_param(new_parameter(acc, key: 'acc')
                                .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(DeviceFirmwareUpgrade.method(:from_hash))
                .is_api_response(true)
                .is_response_array(true)
                .local_error('400',
                             'Unexpected error.',
                             FotaV3ResultException))
    .execute
end