Module: Mattermost::Endpoint::Compliance

Included in:
Mattermost::Endpoint
Defined in:
lib/mattermost/endpoint/compliance.rb

Instance Method Summary collapse

Instance Method Details

#create_compliance_reportObject



7
8
9
# File 'lib/mattermost/endpoint/compliance.rb', line 7

def create_compliance_report
	post("/compliance/reports")
end

#download_compliance_report(report_id, file_name) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/mattermost/endpoint/compliance.rb', line 19

def download_compliance_report(report_id, file_name)
	File.open(file_name, "w") do |file|
		file.binmode
		get(download_compliance_report_url(report_id), stream_body: true) do |fragment|
			file.write(fragment)
		end
	end
end

#download_compliance_report_url(report_id) ⇒ Object



28
29
30
# File 'lib/mattermost/endpoint/compliance.rb', line 28

def download_compliance_report_url(report_id)
	"/compliance/reports/#{report_id}/download"
end

#get_compliance_report(report_id) ⇒ Object



15
16
17
# File 'lib/mattermost/endpoint/compliance.rb', line 15

def get_compliance_report(report_id)
	get("/compliance/reports/#{report_id}")
end

#get_compliance_reports(max = 60) ⇒ Object



11
12
13
# File 'lib/mattermost/endpoint/compliance.rb', line 11

def get_compliance_reports(max = 60)
	get("/compliance/reports?per_page=#{max}")
end