-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for ScheduledQueryRun #666
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,7 @@ | |
require "stripe/recipient_transfer" | ||
require "stripe/refund" | ||
require "stripe/reversal" | ||
require "stripe/sigma/scheduled_query_run" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kind of nice/lucky that this wasn't brought in until you'd established the new namespacing convention. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. full disclosure, I saw that resource once and tried on a week end, and failed and thought "well no one has asked for it so it's okay" 😂 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lol! Well, pretty nice that it's a piece of cake nowadays right? |
||
require "stripe/sku" | ||
require "stripe/source" | ||
require "stripe/source_transaction" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module Stripe | ||
module Sigma | ||
class ScheduledQueryRun < Stripe::APIResource | ||
extend Stripe::APIOperations::List | ||
|
||
OBJECT_NAME = "scheduled_query_run".freeze | ||
|
||
def self.resource_url | ||
"/v1/sigma/scheduled_query_runs" | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,8 +38,6 @@ class MainResource < APIResource | |
OBJECT_NAME = "mainresource".freeze | ||
nested_resource_class_methods :nested, | ||
operations: %i[create retrieve update delete list] | ||
|
||
OBJECT_NAME = "mainresource".freeze | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noticed a weird warning today. This likely should have been caught by the test suite though so it's worth investigating what caused it to not be seen though it's just in tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Arg yes, I've run into this type of thing before. Unfortunately, there doesn't seem to be any easy way to have Ruby treat warnings as errors (I don't really want to monkeypatch These don't come up that often though, so I'm not sure it's a huge problem. |
||
end | ||
|
||
should "define a create method" do | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
require File.expand_path("../../../test_helper", __FILE__) | ||
|
||
module Stripe | ||
module Issuing | ||
class ScheduledQueryRunTest < Test::Unit::TestCase | ||
should "be listable" do | ||
stub_request(:get, "#{Stripe.api_base}/v1/sigma/scheduled_query_runs") | ||
.to_return(body: JSON.generate(object: "list", data: [{ id: "sqr_123", object: "scheduled_query_run" }])) | ||
|
||
runs = Stripe::Sigma::ScheduledQueryRun.list | ||
assert_requested :get, "#{Stripe.api_base}/v1/sigma/scheduled_query_runs" | ||
assert runs.data.is_a?(Array) | ||
assert runs.data[0].is_a?(Stripe::Sigma::ScheduledQueryRun) | ||
end | ||
|
||
should "be retrievable" do | ||
stub_request(:get, "#{Stripe.api_base}/v1/sigma/scheduled_query_runs/sqr_123") | ||
.to_return(body: JSON.generate(id: "sqr_123", object: "scheduled_query_run")) | ||
run = Stripe::Sigma::ScheduledQueryRun.retrieve("sqr_123") | ||
assert_requested :get, "#{Stripe.api_base}/v1/sigma/scheduled_query_runs/sqr_123" | ||
assert run.is_a?(Stripe::Sigma::ScheduledQueryRun) | ||
end | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those changes are getting a little bit annoying. We're basically incrementing each time and making those rules irrelevant. Wanted to flag as we likely should disable the rule for the 2 specific parts of code we care about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we should just kill these. I can do it.