Class: Paddle::Report
- Inherits:
-
Object
- Object
- OpenStruct
- Object
- Paddle::Report
show all
- Defined in:
- lib/paddle/models/report.rb
Class Method Summary
collapse
Methods inherited from Object
#initialize, #to_ostruct, #update
Constructor Details
This class inherits a constructor from Paddle::Object
Class Method Details
.create(type:, filters:, **params) ⇒ Object
9
10
11
12
13
|
# File 'lib/paddle/models/report.rb', line 9
def create(type:, filters:, **params)
attrs = { type: type, filters: filters }
response = Client.post_request("reports", body: attrs.merge(params))
Report.new(response.body["data"])
end
|
20
21
22
23
24
25
|
# File 'lib/paddle/models/report.rb', line 20
def csv(id:)
response = Client.get_request("reports/#{id}/download-url")
if response.success?
response.body["data"]["url"]
end
end
|
.retrieve(id:) ⇒ Object
15
16
17
18
|
# File 'lib/paddle/models/report.rb', line 15
def retrieve(id:)
response = Client.get_request("reports/#{id}")
Report.new(response.body["data"])
end
|