github.com/stripe/stripe-go/v76@v76.25.0/sigma_scheduledqueryrun.go (about)

     1  //
     2  //
     3  // File generated from our OpenAPI spec
     4  //
     5  //
     6  
     7  package stripe
     8  
     9  // The query's execution status, which will be `completed` for successful runs, and `canceled`, `failed`, or `timed_out` otherwise.
    10  type SigmaScheduledQueryRunStatus string
    11  
    12  // List of values that SigmaScheduledQueryRunStatus can take
    13  const (
    14  	SigmaScheduledQueryRunStatusCanceled  SigmaScheduledQueryRunStatus = "canceled"
    15  	SigmaScheduledQueryRunStatusCompleted SigmaScheduledQueryRunStatus = "completed"
    16  	SigmaScheduledQueryRunStatusFailed    SigmaScheduledQueryRunStatus = "failed"
    17  	SigmaScheduledQueryRunStatusTimedOut  SigmaScheduledQueryRunStatus = "timed_out"
    18  )
    19  
    20  // Returns a list of scheduled query runs.
    21  type SigmaScheduledQueryRunListParams struct {
    22  	ListParams `form:"*"`
    23  	// Specifies which fields in the response should be expanded.
    24  	Expand []*string `form:"expand"`
    25  }
    26  
    27  // AddExpand appends a new field to expand.
    28  func (p *SigmaScheduledQueryRunListParams) AddExpand(f string) {
    29  	p.Expand = append(p.Expand, &f)
    30  }
    31  
    32  // Retrieves the details of an scheduled query run.
    33  type SigmaScheduledQueryRunParams struct {
    34  	Params `form:"*"`
    35  	// Specifies which fields in the response should be expanded.
    36  	Expand []*string `form:"expand"`
    37  }
    38  
    39  // AddExpand appends a new field to expand.
    40  func (p *SigmaScheduledQueryRunParams) AddExpand(f string) {
    41  	p.Expand = append(p.Expand, &f)
    42  }
    43  
    44  type SigmaScheduledQueryRunError struct {
    45  	// Information about the run failure.
    46  	Message string `json:"message"`
    47  }
    48  
    49  // If you have [scheduled a Sigma query](https://stripe.com/docs/sigma/scheduled-queries), you'll
    50  // receive a `sigma.scheduled_query_run.created` webhook each time the query
    51  // runs. The webhook contains a `ScheduledQueryRun` object, which you can use to
    52  // retrieve the query results.
    53  type SigmaScheduledQueryRun struct {
    54  	APIResource
    55  	// Time at which the object was created. Measured in seconds since the Unix epoch.
    56  	Created int64 `json:"created"`
    57  	// When the query was run, Sigma contained a snapshot of your Stripe data at this time.
    58  	DataLoadTime int64                        `json:"data_load_time"`
    59  	Error        *SigmaScheduledQueryRunError `json:"error"`
    60  	// The file object representing the results of the query.
    61  	File *File `json:"file"`
    62  	// Unique identifier for the object.
    63  	ID string `json:"id"`
    64  	// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
    65  	Livemode bool `json:"livemode"`
    66  	// String representing the object's type. Objects of the same type share the same value.
    67  	Object string `json:"object"`
    68  	// Time at which the result expires and is no longer available for download.
    69  	ResultAvailableUntil int64 `json:"result_available_until"`
    70  	// SQL for the query.
    71  	SQL string `json:"sql"`
    72  	// The query's execution status, which will be `completed` for successful runs, and `canceled`, `failed`, or `timed_out` otherwise.
    73  	Status SigmaScheduledQueryRunStatus `json:"status"`
    74  	// Title of the query.
    75  	Title string `json:"title"`
    76  }
    77  
    78  // SigmaScheduledQueryRunList is a list of ScheduledQueryRuns as retrieved from a list endpoint.
    79  type SigmaScheduledQueryRunList struct {
    80  	APIResource
    81  	ListMeta
    82  	Data []*SigmaScheduledQueryRun `json:"data"`
    83  }