Class: Stripe::V2::Data::Reporting::QueryRunService

Inherits:
StripeService
  • Object
show all
Defined in:
lib/stripe/services/v2/data/reporting/query_run_service.rb

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

#create(params = {}, opts = {}) ⇒ Object

Creates a query run to execute ad-hoc SQL and returns a ‘QueryRun` object to track progress and retrieve results.



10
11
12
13
14
15
16
17
18
# File 'lib/stripe/services/v2/data/reporting/query_run_service.rb', line 10

def create(params = {}, opts = {})
  request(
    method: :post,
    path: "/v2/data/reporting/query_runs",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#retrieve(id, params = {}, opts = {}) ⇒ Object

Fetches the current state and details of a previously created ‘QueryRun`. If the `QueryRun` has succeeded, the endpoint will provide details for how to retrieve the results.



22
23
24
25
26
27
28
29
30
# File 'lib/stripe/services/v2/data/reporting/query_run_service.rb', line 22

def retrieve(id, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v2/data/reporting/query_runs/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end