Class: Hivehook::Resources::OutboundDLQService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/hivehook/resources/outbound_dlq_service.rb

Constant Summary collapse

FRAGMENT =
"id deliveryId messageId lastError replayedAt createdAt"

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

This class inherits a constructor from Hivehook::Resources::BaseService

Instance Method Details

#get(id) ⇒ Object



18
19
20
21
# File 'lib/hivehook/resources/outbound_dlq_service.rb', line 18

def get(id)
  query = "query($id: UUID!) { outboundDlqEntry(id: $id) { #{FRAGMENT} } }"
  @transport.execute(query, { "id" => id })["outboundDlqEntry"]
end

#list(options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/hivehook/resources/outbound_dlq_service.rb', line 8

def list(options = {})
  query = "query($messageId: UUID, $replayed: Boolean, $search: String, $limit: Int, $offset: Int, $after: String, $first: Int) {
    outboundDlqEntries(messageId: $messageId, replayed: $replayed, search: $search, limit: $limit, offset: $offset, after: $after, first: $first) {
      nodes { #{FRAGMENT} }
      pageInfo { total limit offset endCursor hasNextPage }
    }
  }"
  @transport.execute(query, build_variables(options, %w[messageId replayed search limit offset after first]))["outboundDlqEntries"]
end

#purge(older_than) ⇒ Object



33
34
35
36
# File 'lib/hivehook/resources/outbound_dlq_service.rb', line 33

def purge(older_than)
  query = "mutation($olderThan: String!) { purgeOutboundDlq(olderThan: $olderThan) { purged } }"
  @transport.execute(query, { "olderThan" => older_than })["purgeOutboundDlq"]
end

#replay(id) ⇒ Object



23
24
25
26
# File 'lib/hivehook/resources/outbound_dlq_service.rb', line 23

def replay(id)
  query = "mutation($id: UUID!) { replayOutboundDlqEntry(id: $id) }"
  @transport.execute(query, { "id" => id })["replayOutboundDlqEntry"]
end

#replay_allObject



28
29
30
31
# File 'lib/hivehook/resources/outbound_dlq_service.rb', line 28

def replay_all
  query = "mutation { replayAllOutboundDlq { deliveries } }"
  @transport.execute(query)["replayAllOutboundDlq"]
end