Class: NewStoreApi::DeviceSubscriptionsController
- Inherits:
-
BaseController
- Object
- BaseController
- NewStoreApi::DeviceSubscriptionsController
- Defined in:
- lib/new_store_api/controllers/device_subscriptions_controller.rb
Overview
DeviceSubscriptionsController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#create_subscription(body: nil) ⇒ SubscriptionResponse
🚧 BETA: This endpoint is in beta and may change.
- #destroy_subscription ⇒ void
🚧 BETA: This endpoint is in beta and may change.- #list_subscriptions ⇒ SubscriptionsResponse
🚧 BETA: This endpoint is in beta and may change.Methods inherited from BaseController
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent
Constructor Details
This class inherits a constructor from NewStoreApi::BaseController
Instance Method Details
#create_subscription(body: nil) ⇒ SubscriptionResponse
🚧 BETA: This endpoint is in beta and may change.Creates a subscription for push notifications description here
See API Lifecycle Documentation for details.68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
# File 'lib/new_store_api/controllers/device_subscriptions_controller.rb', line 68 def create_subscription(body: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/retail-org/devices/subscriptions', Server::API) .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('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(SubscriptionResponse.method(:from_hash))) .execute end
#destroy_subscription ⇒ void
This method returns an undefined value.
🚧 BETA: This endpoint is in beta and may change.Delete subscriptions for push notifications
See API Lifecycle Documentation for details.20 21 22 23 24 25 26 27 28 29
# File 'lib/new_store_api/controllers/device_subscriptions_controller.rb', line 20 def destroy_subscription @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/retail-org/devices/subscriptions', Server::API) .auth(Single.new('oauth'))) .response(new_response_handler .is_response_void(true)) .execute end
#list_subscriptions ⇒ SubscriptionsResponse
🚧 BETA: This endpoint is in beta and may change.Reads subscriptions for push notifications
See API Lifecycle Documentation for details.42 43 44 45 46 47 48 49 50 51 52 53
# File 'lib/new_store_api/controllers/device_subscriptions_controller.rb', line 42 def list_subscriptions @api_call .request(new_request_builder(HttpMethodEnum::GET, '/retail-org/devices/subscriptions', Server::API) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(SubscriptionsResponse.method(:from_hash))) .execute end
- #destroy_subscription ⇒ void