Class: Verizon::SoftwareManagementReportsV2Api

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

Overview

SoftwareManagementReportsV2Api

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

The report endpoint allows user to get the full list of device of a campaign. identifier.

Parameters:

  • account (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.



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/verizon/apis/software_management_reports_v2_api.rb', line 141

def get_campaign_device_status(,
                               campaign_id,
                               last_seen_device_id: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reports/{account}/campaigns/{campaignId}/devices',
                                 Server::SOFTWARE_MANAGEMENT_V2)
               .template_param(new_parameter(, key: 'account')
                                .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(V2CampaignDevice.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Unexpected error.',
                             FotaV2ResultException))
    .execute
end

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

The report endpoint allows user to get campaign history of an account for specified status. campaign. campaign Id.

Parameters:

  • account (String)

    Required parameter: Account identifier.

  • campaign_status (String)

    Required parameter: Status of the

  • last_seen_campaign_id (String) (defaults to: nil)

    Optional parameter: Last seen

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/verizon/apis/software_management_reports_v2_api.rb', line 109

def get_campaign_history_by_status(,
                                   campaign_status,
                                   last_seen_campaign_id: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reports/{account}/campaigns',
                                 Server::SOFTWARE_MANAGEMENT_V2)
               .template_param(new_parameter(, key: 'account')
                                .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(V2CampaignHistory.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Unexpected error.',
                             FotaV2ResultException))
    .execute
end

#get_device_firmware_upgrade_history(account, device_id) ⇒ ApiResponse

The endpoint allows user to get software upgrade history of a device based on device IMEI.

Parameters:

  • account (String)

    Required parameter: Account identifier.

  • device_id (String)

    Required parameter: Device IMEI identifier.

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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

def get_device_firmware_upgrade_history(,
                                        device_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reports/{account}/devices/{deviceId}',
                                 Server::SOFTWARE_MANAGEMENT_V2)
               .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(DeviceSoftwareUpgrade.method(:from_hash))
                .is_api_response(true)
                .is_response_array(true)
                .local_error('400',
                             'Unexpected error.',
                             FotaV2ResultException))
    .execute
end

#list_account_devices(account, last_seen_device_id: nil, distribution_type: nil) ⇒ ApiResponse

The device endpoint gets devices information of an account. identifier. distributionType to get specific type of devices. Values is LWM2M, OMD-DM or HTTP.

Parameters:

  • account (String)

    Required parameter: Account identifier.

  • last_seen_device_id (String) (defaults to: nil)

    Optional parameter: Last seen device

  • distribution_type (String) (defaults to: nil)

    Optional parameter: Filter

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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_v2_api.rb', line 47

def (,
                         last_seen_device_id: nil,
                         distribution_type: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/devices/{account}',
                                 Server::SOFTWARE_MANAGEMENT_V2)
               .template_param(new_parameter(, key: 'account')
                                .is_required(true)
                                .should_encode(true))
               .query_param(new_parameter(last_seen_device_id, key: 'lastSeenDeviceId'))
               .query_param(new_parameter(distribution_type, key: 'distributionType'))
               .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(V2AccountDeviceList.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Unexpected error.',
                             FotaV2ResultException))
    .execute
end

#list_available_software(account, distribution_type: nil) ⇒ ApiResponse

This endpoint allows user to list a certain type of software of an account. distributionType to get specific type of software. Value is LWM2M, OMD-DM or HTTP.

Parameters:

  • account (String)

    Required parameter: Account identifier.

  • distribution_type (String) (defaults to: nil)

    Optional parameter: Filter

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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

def list_available_software(,
                            distribution_type: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/software/{account}',
                                 Server::SOFTWARE_MANAGEMENT_V2)
               .template_param(new_parameter(, key: 'account')
                                .is_required(true)
                                .should_encode(true))
               .query_param(new_parameter(distribution_type, key: 'distributionType'))
               .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(SoftwarePackage.method(:from_hash))
                .is_api_response(true)
                .is_response_array(true)
                .local_error('400',
                             'Unexpected error.',
                             FotaV2ResultException))
    .execute
end