Class: Verizon::BillingApi
- Defined in:
- lib/verizon/apis/billing_api.rb
Overview
BillingApi
Constant Summary
Constants inherited from BaseApi
Verizon::BaseApi::GLOBAL_ERRORS
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#add_account(body) ⇒ ApiResponse
This endpoint allows user to add managed accounts to a primary account.
-
#cancel_managed_account_action(body) ⇒ ApiResponse
Deactivates a managed billing service relationship between a managed account and the primary account.
-
#list_managed_account(account_name, service_name) ⇒ ApiResponse
This endpoint allows user to retrieve the list of all accounts managed by a primary account.
-
#managed_account_action(body) ⇒ ApiResponse
Activates a managed billing service relationship between a managed account and the primary 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
#add_account(body) ⇒ ApiResponse
This endpoint allows user to add managed accounts to a primary account. and list of accounts to add
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/verizon/apis/billing_api.rb', line 13 def add_account(body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/managedaccounts/actions/add', Server::SUBSCRIPTION_SERVER) .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(ManagedAccountsAddResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Unexpected error', DeviceLocationResultException)) .execute end |
#cancel_managed_account_action(body) ⇒ ApiResponse
Deactivates a managed billing service relationship between a managed account and the primary account. and list of accounts to add
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/verizon/apis/billing_api.rb', line 65 def cancel_managed_account_action(body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/managedaccounts/actions/cancel', Server::SUBSCRIPTION_SERVER) .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(ManagedAccountCancelResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Unexpected error', DeviceLocationResultException)) .execute end |
#list_managed_account(account_name, service_name) ⇒ ApiResponse
This endpoint allows user to retrieve the list of all accounts managed by a primary account. identifier
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/verizon/apis/billing_api.rb', line 92 def list_managed_account(account_name, service_name) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/managedaccounts/{accountName}/service/{serviceName}', Server::SUBSCRIPTION_SERVER) .template_param(new_parameter(account_name, key: 'accountName') .is_required(true) .should_encode(true)) .template_param(new_parameter(service_name, key: 'serviceName') .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(ManagedAccountsGetAllResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Unexpected error', DeviceLocationResultException)) .execute end |
#managed_account_action(body) ⇒ ApiResponse
Activates a managed billing service relationship between a managed account and the primary account. name and list of accounts to add
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/verizon/apis/billing_api.rb', line 39 def managed_account_action(body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/managedaccounts/actions/provision', Server::SUBSCRIPTION_SERVER) .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(ManagedAccountsProvisionResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Unexpected error', DeviceLocationResultException)) .execute end |