The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::API::Stripe::Sigma::ScheduledQueryRun - A Stripe Schedule Query Run Object

SYNOPSIS

    my $query = $stripe->schedule_query({
        created => '2020-06-12T08:00:00',
        data_load_time => '2020-06-12T08:00:02',
        file => $file_object,
        livemode => $stripe->false,
        result_available_until => '2020-05-31',
        sql => <<EOT,
        select
          id,
          amount,
          fee,
          currency
        from balance_transactions
        where
          created < data_load_time and
          created >= data_load_time - interval '1' month
        order by created desc
        limit 10
    EOT
        status => 'completed',
        title => 'Monthly balance transactions',
    });

See documentation in Net::API::Stripe for example to make api calls to Stripe to create those objects.

VERSION

    0.1

DESCRIPTION

If you have scheduled a Sigma query, you'll receive a sigma.scheduled_query_run.created webhook each time the query runs. The webhook contains a ScheduledQueryRun object, which you can use to retrieve the query results.

CONSTRUCTOR

new( %ARG )

Creates a new Net::API::Stripe::Sigma::ScheduledQueryRun object. It may also take an hash like arguments, that also are method of the same name.

METHODS

id string

Unique identifier for the object.

object string, value is "scheduled_query_run"

String representing the object’s type. Objects of the same type share the same value.

created timestamp

Time at which the object was created. Measured in seconds since the Unix epoch.

data_load_time timestamp

When the query was run, Sigma contained a snapshot of your Stripe data at this time.

error hash

If the query run was not successful, this field contains information about the failure.

This is a Net::API::Stripe::Error object.

file hash

The file object representing the results of the query.

This is a Net::API::Stripe::File object.

livemode boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

result_available_until timestamp

Time at which the result expires and is no longer available for download.

sql string

SQL for the query.

status string

The query’s execution status, which will be completed for successful runs, and canceled, failed, or timed_out otherwise.

title string

Title of the query.

API SAMPLE

        {
          "id": "sqr_fake123456789",
          "object": "scheduled_query_run",
          "created": 1571480457,
          "data_load_time": 1571270400,
          "file": {
                "id": "file_fake123456789",
                "object": "file",
                "created": 1537498020,
                "filename": "path",
                "links": {
                  "object": "list",
                  "data": [],
                  "has_more": false,
                  "url": "/v1/file_links?file=file_fake123456789"
                },
                "purpose": "sigma_scheduled_query",
                "size": 500,
                "title": null,
                "type": "csv",
                "url": "https://files.stripe.com/v1/files/file_fake123456789/contents"
          },
          "livemode": false,
          "result_available_until": 1603065600,
          "sql": "SELECT count(*) from charges",
          "status": "completed",
          "title": "Count all charges"
        }

HISTORY

v0.1

Initial version

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Stripe API documentation:

https://stripe.com/docs/api/sigma/scheduled_queries, https://stripe.com/docs/sigma/scheduled-queries

COPYRIGHT & LICENSE

Copyright (c) 2019-2020 DEGUEST Pte. Ltd.

You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.