Class: Verizon::SoftwareManagementSubscriptionsV1Controller

Inherits:
BaseController
  • Object
show all
Defined in:
lib/verizon/controllers/software_management_subscriptions_v1_controller.rb

Overview

SoftwareManagementSubscriptionsV1Controller

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

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_account_license_status(account, start_index) ⇒ ApiResponse

Returns information about an account’s Software Management Services licenses and a list of licensed devices. “##########-#####”. the first record to return. Set startIndex=0 for the first request. If there are more than 1,000 devices in the response, set startIndex=1000 for the second request, 2000 for the third request, etc.

Parameters:

  • account (String)

    Required parameter: Account identifier in

  • start_index (String)

    Required parameter: The zero-based number of

Returns:

  • (ApiResponse)

    the complete http response with raw body and status code.



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/verizon/controllers/software_management_subscriptions_v1_controller.rb', line 42

def (,
                               start_index)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/licenses/{account}/index/{startIndex}',
                                 Server::SOFTWARE_MANAGEMENT_V1)
               .template_param(new_parameter(, 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(And.new('thingspace_oauth', 'VZ-M2M-Token')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(AccountLicenseInfo.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Unexpected error.',
                             FotaV1ResultException))
    .execute
end

#get_account_subscription_status(account) ⇒ ApiResponse

This subscriptions endpoint retrieves an account’s current Software Management Service subscription status. “##########-#####”.

Parameters:

  • account (String)

    Required parameter: Account identifier in

Returns:

  • (ApiResponse)

    the complete http response with raw body and status code.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/verizon/controllers/software_management_subscriptions_v1_controller.rb', line 14

def ()
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/subscriptions/{account}',
                                 Server::SOFTWARE_MANAGEMENT_V1)
               .template_param(new_parameter(, key: 'account')
                                .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(V1AccountSubscription.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Unexpected error.',
                             FotaV1ResultException))
    .execute
end