Class: Verizon::ThingSpaceQualityOfServiceAPIActionsController
- Inherits:
-
BaseController
- Object
- BaseController
- Verizon::ThingSpaceQualityOfServiceAPIActionsController
- Defined in:
- lib/verizon/controllers/thing_space_quality_of_service_api_actions_controller.rb
Overview
ThingSpaceQualityOfServiceAPIActionsController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#create_a_thing_space_quality_of_service_api_subscription(body) ⇒ M201success
Creates a QoS elevation subscription ID and activates the subscription.
-
#stop_a_thing_space_quality_of_service_api_subscription(account_name, qos_subscription_id) ⇒ M201success
Stops an active ThingSpace Quality of Service API subscription using the account name and the subscription ID.
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
#create_a_thing_space_quality_of_service_api_subscription(body) ⇒ M201success
Creates a QoS elevation subscription ID and activates the subscription. create a ThingSpace Quality of Service API subscription.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/verizon/controllers/thing_space_quality_of_service_api_actions_controller.rb', line 13 def create_a_thing_space_quality_of_service_api_subscription(body) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, '/m2m/v1/devices/actions/enhanceQoS', Server::THINGSPACE) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('thingspace_oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(M201success.method(:from_hash)) .is_api_response(true) .local_error('default', 'Error Response', DefaultResponseException)) .execute end |
#stop_a_thing_space_quality_of_service_api_subscription(account_name, qos_subscription_id) ⇒ M201success
Stops an active ThingSpace Quality of Service API subscription using the account name and the subscription ID.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/verizon/controllers/thing_space_quality_of_service_api_actions_controller.rb', line 38 def stop_a_thing_space_quality_of_service_api_subscription(account_name, qos_subscription_id) new_api_call_builder .request(new_request_builder(HttpMethodEnum::DELETE, '/m2m/v1/devices/actions/enhanceQoS', Server::THINGSPACE) .query_param(new_parameter(account_name, key: 'accountName')) .query_param(new_parameter(qos_subscription_id, key: 'qosSubscriptionId')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('thingspace_oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(M201success.method(:from_hash)) .is_api_response(true) .local_error('default', 'Error Response', DefaultResponseException)) .execute end |