Class: Verizon::DeviceRoleControllerApi

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

Overview

DeviceRoleControllerApi

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_acl_rules_by_vendor_id(vendor_id) ⇒ ApiResponse

This API allows the user to get the access control rules defined for them.

Parameters:

  • vendor_id (String)

    Required parameter: The user’s Vendor ID

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



12
13
14
15
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
42
43
44
45
# File 'lib/verizon/apis/device_role_controller_api.rb', line 12

def get_acl_rules_by_vendor_id(vendor_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/api/v1/device-roles/vendor',
                                 Server::IMP_SERVER)
               .query_param(new_parameter(vendor_id, key: 'VendorID')
                             .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(And.new('thingspace_oauth', 'SessionToken')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(DeviceRole.method(:from_hash))
                .is_api_response(true)
                .is_response_array(true)
                .local_error('400',
                             'Bad Request',
                             APIException)
                .local_error('401',
                             'Unauthorized',
                             APIException)
                .local_error('403',
                             'Forbidden',
                             APIException)
                .local_error('406',
                             'Not Acceptable',
                             APIException)
                .local_error('429',
                             'Too many requests',
                             APIException)
                .local_error('default',
                             'unexpected error',
                             APIException))
    .execute
end