Class: NewStoreApi::PhavdaNotificationsController

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

Overview

PhavdaNotificationsController

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_phavda_notification(event_name, x_request_id, x_tenant, x_newstore_tenant, idempotency_key, body, team: nil) ⇒ void

This method returns an undefined value.

🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
here here description here for every message, else the existing message will be overwritten. Only alpha-numeric values and hyphens with size between 4 and 64 is allowed. Eg: fcbe151f-7ff4-4fd3-ab14-c5f564932f8b

Parameters:

  • event_name (String)

    Required parameter: TODO: type description

  • x_request_id (String)

    Required parameter: TODO: type description

  • x_tenant (String)

    Required parameter: TODO: type description here

  • x_newstore_tenant (String)

    Required parameter: TODO: type

  • idempotency_key (String)

    Required parameter: Value should be unique

  • body (Object)

    Required parameter: TODO: type description here

  • team (String) (defaults to: nil)

    Optional parameter: TODO: type description here



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/new_store_api/controllers/phavda_notifications_controller.rb', line 32

def create_phavda_notification(event_name,
                               x_request_id,
                               x_tenant,
                               x_newstore_tenant,
                               idempotency_key,
                               body,
                               team: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/order-management/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_tenant, key: 'x-tenant'))
               .header_param(new_parameter(x_newstore_tenant, key: 'x-newstore-tenant'))
               .header_param(new_parameter(idempotency_key, key: 'idempotency-key'))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter(team, key: 'team'))
               .body_serializer(APIHelper.method(:json_serialize))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .is_response_void(true))
    .execute
end