Class: Verizon::SoftwareManagementLicensesV1Api

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

Overview

SoftwareManagementLicensesV1Api

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

#assign_licenses_to_devices(account, body) ⇒ ApiResponse

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:

  • (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
38
39
40
41
# File 'lib/verizon/apis/software_management_licenses_v1_api.rb', line 16

def assign_licenses_to_devices(,
                               body)
  warn 'Endpoint assign_licenses_to_devices in SoftwareManagementLicensesV'\
       '1Api is deprecated'
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/licenses/{account}/assign',
                                 Server::SOFTWARE_MANAGEMENT_V1)
               .template_param(new_parameter(, key: 'account')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('thingspace_oauth', 'VZ-M2M-Token')))
    .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) ⇒ ApiResponse

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:

  • (ApiResponse)

    Complete http response with raw body and status code.



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

def create_list_of_licenses_to_remove(,
                                      body)
  warn 'Endpoint create_list_of_licenses_to_remove in SoftwareManagementLi'\
       'censesV1Api is deprecated'
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/licenses/{account}/cancel',
                                 Server::SOFTWARE_MANAGEMENT_V1)
               .template_param(new_parameter(, key: 'account')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('thingspace_oauth', 'VZ-M2M-Token')))
    .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) ⇒ ApiResponse

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

Parameters:

  • account (String)

    Required parameter: Account identifier in

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/verizon/apis/software_management_licenses_v1_api.rb', line 114

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

#list_licenses_to_remove(account, start_index) ⇒ ApiResponse

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:

  • (ApiResponse)

    Complete http response with raw body and status code.



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/verizon/apis/software_management_licenses_v1_api.rb', line 145

def list_licenses_to_remove(,
                            start_index)
  warn 'Endpoint list_licenses_to_remove in SoftwareManagementLicensesV1Ap'\
       'i is deprecated'
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/licenses/{account}/cancel/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(V1ListOfLicensesToRemove.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Unexpected error.',
                             FotaV1ResultException))
    .execute
end

#remove_licenses_from_devices(account, body) ⇒ ApiResponse

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

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/verizon/apis/software_management_licenses_v1_api.rb', line 49

def remove_licenses_from_devices(,
                                 body)
  warn 'Endpoint remove_licenses_from_devices in SoftwareManagementLicense'\
       'sV1Api is deprecated'
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/licenses/{account}/remove',
                                 Server::SOFTWARE_MANAGEMENT_V1)
               .template_param(new_parameter(, key: 'account')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('thingspace_oauth', 'VZ-M2M-Token')))
    .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