Class: NewStoreApi::NotificationsController

Inherits:
BaseController show all
Defined in:
lib/new_store_api/controllers/notifications_controller.rb

Overview

NotificationsController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

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_notification(event_name, x_request_id, x_new_store_tenant, idempotency_key: nil, body: nil) ⇒ void

This method returns an undefined value.

🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
here description here here here

Parameters:

  • event_name (EventNameEnum)

    Required parameter: Example:

  • x_request_id (String)

    Required parameter: TODO: type description

  • x_new_store_tenant (String)

    Required parameter: TODO: type

  • idempotency_key (String) (defaults to: nil)

    Optional parameter: TODO: type description

  • body (ProfileDeleted) (defaults to: nil)

    Optional parameter: TODO: type description



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/new_store_api/controllers/notifications_controller.rb', line 28

def create_notification(event_name,
                        x_request_id,
                        x_new_store_tenant,
                        idempotency_key: nil,
                        body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/checkout/rtbf-notifications',
                                 Server::API)
               .header_param(new_parameter(event_name, key: 'Event-Name'))
               .header_param(new_parameter(x_request_id, key: 'X-Request-Id'))
               .header_param(new_parameter(x_new_store_tenant, key: 'X-NewStore-Tenant'))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
               .body_param(new_parameter(body))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .is_response_void(true))
    .execute
end