Class: NewStoreApi::EventsController
- Inherits:
-
BaseController
- Object
- BaseController
- NewStoreApi::EventsController
- Defined in:
- lib/new_store_api/controllers/events_controller.rb
Overview
EventsController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#create_event(event_name, team, service, entity_id, tenant, idempotency_key, body, correlation_ids: nil) ⇒ Object
đ§ 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_event(event_name, team, service, entity_id, tenant, idempotency_key, body, correlation_ids: nil) ⇒ Object
đ§ BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.âšī¸ Rate Limit: This endpoint is rate limited to 100 requests per second.publish (e.g. order.created). allowlist. event is about. deduplication. 40 MiB. keys: `order_id`, `customer_id`.39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
# File 'lib/new_store_api/controllers/events_controller.rb', line 39 def create_event(event_name, team, service, entity_id, tenant, idempotency_key, body, correlation_ids: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/event-stream/events/{event_name}', Server::API) .template_param(new_parameter(event_name, key: 'event_name') .should_encode(true)) .header_param(new_parameter(team, key: 'Team')) .header_param(new_parameter(service, key: 'Service')) .header_param(new_parameter(entity_id, key: 'Entity-Id')) .header_param(new_parameter(tenant, key: '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(correlation_ids, key: 'Correlation-Ids')) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(APIHelper.method(:json_serialize)) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize))) .execute end