Method: Orchestrate::Client#purge_event

Defined in:
lib/orchestrate/client.rb

#purge_event(collection, key, event_type, timestamp, ordinal, ref = nil) ⇒ Object

Parameters:

  • collection (#to_s)

    The name of the collection.

  • key (#to_s)

    The name of the key.

  • event_type (#to_s)

    The category for the event.

  • timestamp (Time, Date, Integer, String, nil)

    The timestamp for the event. If a String, must match the Timestamp specification and include the milliseconds portion.

  • ordinal (Integer, #to_s)

    The ordinal for the event in the given timestamp.

  • ref (nil, #to_s) (defaults to: nil)

    If provided, used as If-Match, and event will only update if its current value has the provided ref. If omitted, updates the event regardless.

Returns:

  • Orchestrate::API::Response

Raises:

  • Orchestrate::API::VersionMismatch The event's current value has a ref that does not match the provided ref.

  • Orchestrate::API::MalformedRef If the ref provided is not a valid ref.

[View source]

328
329
330
331
332
333
334
# File 'lib/orchestrate/client.rb', line 328

def purge_event(collection, key, event_type, timestamp, ordinal, ref=nil)
  timestamp = API::Helpers.timestamp(timestamp)
  path = [collection, key, 'events', event_type, timestamp, ordinal]
  headers = {}
  headers['If-Match'] = API::Helpers.format_ref(ref) if ref
  send_request :delete, path, { query: { purge: true }, headers: headers }
end