Class: Verizon::SoftwareManagementLicensesV1Controller

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

Overview

SoftwareManagementLicensesV1Controller

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

#assign_licenses_to_devices(account, body) ⇒ V1LicensesAssignedRemovedResult

Assigns licenses to a specified list of devices so that firmware upgrades can be scheduled for those devices. “##########-#####”. of the devices to assign licenses to.

Parameters:

Returns:



16
17
18
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_licenses_v1_controller.rb', line 16

def assign_licenses_to_devices(,
                               body)
  warn 'Endpoint assign_licenses_to_devices in SoftwareManagementLicensesV'\
       '1Controller is deprecated'
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/licenses/{account}/assign',
                                 Server::SOFTWARE_MANAGEMENT_V1)
               .template_param(new_parameter(, key: 'account')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('oAuth2')))
    .response(new_response_handler
               .deserializer(APIHelper.method(:custom_type_deserializer))
               .deserialize_into(V1LicensesAssignedRemovedResult.method(:from_hash))
               .is_api_response(true)
               .local_error('400',
                            'Unexpected error.',
                            FotaV1ResultException))
    .execute
end

#create_list_of_licenses_to_remove(account, body) ⇒ V1ListOfLicensesToRemoveResult

Creates a list of devices from which licenses will be removed if the number of MRC licenses becomes less than the number of assigned licenses. “##########-#####”. Cancellation candidate device list.

Parameters:

Returns:



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/controllers/software_management_licenses_v1_controller.rb', line 79

def create_list_of_licenses_to_remove(,
                                      body)
  warn 'Endpoint create_list_of_licenses_to_remove in SoftwareManagementLi'\
       'censesV1Controller is deprecated'
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/licenses/{account}/cancel',
                                 Server::SOFTWARE_MANAGEMENT_V1)
               .template_param(new_parameter(, key: 'account')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('oAuth2')))
    .response(new_response_handler
               .deserializer(APIHelper.method(:custom_type_deserializer))
               .deserialize_into(V1ListOfLicensesToRemoveResult.method(:from_hash))
               .is_api_response(true)
               .local_error('400',
                            'Unexpected error.',
                            FotaV1ResultException))
    .execute
end

#delete_list_of_licenses_to_remove(account) ⇒ FotaV1SuccessResult

Deletes the entire list of cancellation candidate devices. “##########-#####”.

Parameters:

  • account (String)

    Required parameter: Account identifier in

Returns:



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/verizon/controllers/software_management_licenses_v1_controller.rb', line 108

def delete_list_of_licenses_to_remove()
  warn 'Endpoint delete_list_of_licenses_to_remove in SoftwareManagementLi'\
       'censesV1Controller is deprecated'
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/licenses/{account}/cancel',
                                 Server::SOFTWARE_MANAGEMENT_V1)
               .template_param(new_parameter(, key: 'account')
                                .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(FotaV1SuccessResult.method(:from_hash))
               .is_api_response(true)
               .local_error('400',
                            'Unexpected error.',
                            FotaV1ResultException))
    .execute
end

#list_licenses_to_remove(account, start_index) ⇒ V1ListOfLicensesToRemove

Returns a list of devices from which licenses will be removed if the number of MRC licenses becomes less than the number of assigned licenses. “##########-#####”. 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:



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/verizon/controllers/software_management_licenses_v1_controller.rb', line 138

def list_licenses_to_remove(,
                            start_index)
  warn 'Endpoint list_licenses_to_remove in SoftwareManagementLicensesV1Co'\
       'ntroller is deprecated'
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/licenses/{account}/cancel/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(Single.new('oAuth2')))
    .response(new_response_handler
               .deserializer(APIHelper.method(:custom_type_deserializer))
               .deserialize_into(V1ListOfLicensesToRemove.method(:from_hash))
               .is_api_response(true)
               .local_error('400',
                            'Unexpected error.',
                            FotaV1ResultException))
    .execute
end

#remove_licenses_from_devices(account, body) ⇒ V1LicensesAssignedRemovedResult

Remove unused licenses from device. “##########-#####”. of the devices to remove licenses from.

Parameters:

Returns:



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

def remove_licenses_from_devices(,
                                 body)
  warn 'Endpoint remove_licenses_from_devices in SoftwareManagementLicense'\
       'sV1Controller is deprecated'
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/licenses/{account}/remove',
                                 Server::SOFTWARE_MANAGEMENT_V1)
               .template_param(new_parameter(, key: 'account')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('oAuth2')))
    .response(new_response_handler
               .deserializer(APIHelper.method(:custom_type_deserializer))
               .deserialize_into(V1LicensesAssignedRemovedResult.method(:from_hash))
               .is_api_response(true)
               .local_error('400',
                            'Unexpected error.',
                            FotaV1ResultException))
    .execute
end