Class: MethodRuby::Resources::Simulate::Events

Inherits:
Object
  • Object
show all
Defined in:
lib/method_ruby/resources/simulate/events.rb

Overview

Sandbox event simulation

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Events

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Events.

Parameters:



47
48
49
# File 'lib/method_ruby/resources/simulate/events.rb', line 47

def initialize(client:)
  @client = client
end

Instance Method Details

#create(resource_id:, type:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Simulate::EventCreateResponse

Some parameter documentations has been truncated, see Models::Simulate::EventCreateParams for more details.

Creates a simulated webhook event in the sandbox environment. Use this to test webhook handling and event processing during development.

**Development only** - This endpoint is only available in the sandbox environment.

Parameters:

Returns:

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/method_ruby/resources/simulate/events.rb', line 30

def create(params)
  parsed, options = MethodRuby::Simulate::EventCreateParams.dump_request(params)
  header_params = {method_version: "method-version"}
  @client.request(
    method: :post,
    path: "simulate/events",
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: MethodRuby::Models::Simulate::EventCreateResponse,
    security: {secret_key: true},
    options: options
  )
end