Class: Verity::Resources::Compliance

Inherits:
Object
  • Object
show all
Defined in:
lib/verity/resources/compliance.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Compliance

Returns a new instance of Compliance.



6
7
8
# File 'lib/verity/resources/compliance.rb', line 6

def initialize(client)
  @client = client
end

Instance Method Details

#acknowledge(diff_id:, notes: nil) ⇒ Object



18
19
20
21
22
23
# File 'lib/verity/resources/compliance.rb', line 18

def acknowledge(diff_id:, notes: nil)
  body = { diff_id: diff_id }
  body[:notes] = notes if notes

  @client.request(:post, '/compliance/ack', body: body)
end

#bulk_acknowledge(diff_ids:, notes: nil) ⇒ Object



25
26
27
28
29
30
# File 'lib/verity/resources/compliance.rb', line 25

def bulk_acknowledge(diff_ids:, notes: nil)
  body = { diff_ids: diff_ids }
  body[:notes] = notes if notes

  @client.request(:post, '/compliance/ack/bulk', body: body)
end

#statsObject



32
33
34
# File 'lib/verity/resources/compliance.rb', line 32

def stats
  @client.request(:get, '/compliance/stats')
end

#unreviewed(change_type: nil, cursor: nil, limit: 50) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/verity/resources/compliance.rb', line 10

def unreviewed(change_type: nil, cursor: nil, limit: 50)
  params = { limit: limit }
  params[:change_type] = change_type if change_type
  params[:cursor] = cursor if cursor

  @client.request(:get, '/compliance/unreviewed', params: params)
end