Class: Verizon::AccountsController
- Inherits:
-
BaseController
- Object
- BaseController
- Verizon::AccountsController
- Defined in:
- lib/verizon/controllers/accounts_controller.rb
Overview
AccountsController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#get_account_information(aname) ⇒ ApiResponse
Returns information about a specified account.
-
#list_account_leads(aname, mnext: nil) ⇒ ApiResponse
When HTTP status is 202, a URL will be returned in the Location header of the form /leads/aname?next=token.
-
#list_account_states_and_services(aname) ⇒ ApiResponse
Returns a list and details of all custom services and states defined for a specified account.
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_information(aname) ⇒ ApiResponse
Returns information about a specified account.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/verizon/controllers/accounts_controller.rb', line 12 def get_account_information(aname) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/m2m/v1/accounts/{aname}', Server::THINGSPACE) .template_param(new_parameter(aname, key: 'aname') .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(Account.method(:from_hash)) .is_api_response(true) .local_error('400', 'Error response.', ConnectivityManagementResultException)) .execute end |
#list_account_leads(aname, mnext: nil) ⇒ ApiResponse
When HTTP status is 202, a URL will be returned in the Location header of the form /leads/aname?next=token. This URL can be used to request the next set of leads. from the pageUrl in Location Header.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/verizon/controllers/accounts_controller.rb', line 61 def list_account_leads(aname, mnext: nil) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/m2m/v1/leads/{aname}', Server::THINGSPACE) .template_param(new_parameter(aname, key: 'aname') .should_encode(true)) .query_param(new_parameter(mnext, key: 'next')) .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(AccountLeadsResult.method(:from_hash)) .is_api_response(true) .local_error('400', 'Error response.', ConnectivityManagementResultException)) .execute end |
#list_account_states_and_services(aname) ⇒ ApiResponse
Returns a list and details of all custom services and states defined for a specified account.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/verizon/controllers/accounts_controller.rb', line 35 def list_account_states_and_services(aname) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/m2m/v1/accounts/{aname}/statesandservices', Server::THINGSPACE) .template_param(new_parameter(aname, key: 'aname') .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(AccountStatesAndServices.method(:from_hash)) .is_api_response(true) .local_error('400', 'Error response.', ConnectivityManagementResultException)) .execute end |