Class: Verizon::AccountsApi
- Defined in:
- lib/verizon/apis/accounts_api.rb
Overview
AccountsApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
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 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_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 30 |
# File 'lib/verizon/apis/accounts_api.rb', line 12 def get_account_information(aname) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/m2m/v1/accounts/{aname}', Server::THINGSPACE) .template_param(new_parameter(aname, key: 'aname') .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(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.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/verizon/apis/accounts_api.rb', line 63 def list_account_leads(aname, mnext: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/m2m/v1/leads/{aname}', Server::THINGSPACE) .template_param(new_parameter(aname, key: 'aname') .is_required(true) .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.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/verizon/apis/accounts_api.rb', line 36 def list_account_states_and_services(aname) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/m2m/v1/accounts/{aname}/statesandservices', Server::THINGSPACE) .template_param(new_parameter(aname, key: 'aname') .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(AccountStatesAndServices.method(:from_hash)) .is_api_response(true) .local_error('400', 'Error response.', ConnectivityManagementResultException)) .execute end |