Skip to content

Commit

Permalink
Codegen for openapi 771c6f1
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed May 13, 2021
1 parent e70949b commit 04456e7
Show file tree
Hide file tree
Showing 17 changed files with 68 additions and 20 deletions.
3 changes: 2 additions & 1 deletion stripe/api_resources/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
)
@nested_resource_class_methods("login_link", operations=["create"])
@nested_resource_class_methods(
"person", operations=["create", "retrieve", "update", "delete", "list"]
"person",
operations=["create", "retrieve", "update", "delete", "list"],
)
class Account(
CreateableAPIResource,
Expand Down
4 changes: 3 additions & 1 deletion stripe/api_resources/apple_pay_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@


class ApplePayDomain(
CreateableAPIResource, DeletableAPIResource, ListableAPIResource
CreateableAPIResource,
DeletableAPIResource,
ListableAPIResource,
):
OBJECT_NAME = "apple_pay_domain"

Expand Down
3 changes: 2 additions & 1 deletion stripe/api_resources/application_fee.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@


@nested_resource_class_methods(
"refund", operations=["create", "retrieve", "update", "list"]
"refund",
operations=["create", "retrieve", "update", "list"],
)
class ApplicationFee(ListableAPIResource):
OBJECT_NAME = "application_fee"
Expand Down
4 changes: 3 additions & 1 deletion stripe/api_resources/billing_portal/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@


class Configuration(
CreateableAPIResource, ListableAPIResource, UpdateableAPIResource
CreateableAPIResource,
ListableAPIResource,
UpdateableAPIResource,
):
OBJECT_NAME = "billing_portal.configuration"
4 changes: 3 additions & 1 deletion stripe/api_resources/credit_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

@custom_method("void_credit_note", http_verb="post", http_path="void")
class CreditNote(
CreateableAPIResource, ListableAPIResource, UpdateableAPIResource
CreateableAPIResource,
ListableAPIResource,
UpdateableAPIResource,
):
OBJECT_NAME = "credit_note"

Expand Down
9 changes: 6 additions & 3 deletions stripe/api_resources/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@

@custom_method("delete_discount", http_verb="delete", http_path="discount")
@nested_resource_class_methods(
"balance_transaction", operations=["create", "retrieve", "update", "list"]
"balance_transaction",
operations=["create", "retrieve", "update", "list"],
)
@nested_resource_class_methods(
"source", operations=["create", "retrieve", "update", "delete", "list"]
"source",
operations=["create", "retrieve", "update", "delete", "list"],
)
@nested_resource_class_methods(
"tax_id", operations=["create", "retrieve", "delete", "list"]
"tax_id",
operations=["create", "retrieve", "delete", "list"],
)
class Customer(
CreateableAPIResource,
Expand Down
4 changes: 3 additions & 1 deletion stripe/api_resources/file_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@


class FileLink(
CreateableAPIResource, ListableAPIResource, UpdateableAPIResource
CreateableAPIResource,
ListableAPIResource,
UpdateableAPIResource,
):
OBJECT_NAME = "file_link"
4 changes: 3 additions & 1 deletion stripe/api_resources/issuing/cardholder.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@


class Cardholder(
CreateableAPIResource, ListableAPIResource, UpdateableAPIResource
CreateableAPIResource,
ListableAPIResource,
UpdateableAPIResource,
):
OBJECT_NAME = "issuing.cardholder"
4 changes: 3 additions & 1 deletion stripe/api_resources/issuing/dispute.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

@custom_method("submit", http_verb="post")
class Dispute(
CreateableAPIResource, ListableAPIResource, UpdateableAPIResource
CreateableAPIResource,
ListableAPIResource,
UpdateableAPIResource,
):
OBJECT_NAME = "issuing.dispute"

Expand Down
11 changes: 10 additions & 1 deletion stripe/api_resources/payment_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
@custom_method("cancel", http_verb="post")
@custom_method("capture", http_verb="post")
@custom_method("confirm", http_verb="post")
@custom_method("verify_microdeposits", http_verb="post")
class PaymentIntent(
CreateableAPIResource, ListableAPIResource, UpdateableAPIResource
CreateableAPIResource,
ListableAPIResource,
UpdateableAPIResource,
):
OBJECT_NAME = "payment_intent"

Expand All @@ -32,3 +35,9 @@ def confirm(self, idempotency_key=None, **params):
headers = util.populate_headers(idempotency_key)
self.refresh_from(self.request("post", url, params, headers))
return self

def verify_microdeposits(self, idempotency_key=None, **params):
url = self.instance_url() + "/verify_microdeposits"
headers = util.populate_headers(idempotency_key)
self.refresh_from(self.request("post", url, params, headers))
return self
4 changes: 3 additions & 1 deletion stripe/api_resources/payment_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
@custom_method("attach", http_verb="post")
@custom_method("detach", http_verb="post")
class PaymentMethod(
CreateableAPIResource, ListableAPIResource, UpdateableAPIResource
CreateableAPIResource,
ListableAPIResource,
UpdateableAPIResource,
):
OBJECT_NAME = "payment_method"

Expand Down
4 changes: 3 additions & 1 deletion stripe/api_resources/promotion_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@


class PromotionCode(
CreateableAPIResource, ListableAPIResource, UpdateableAPIResource
CreateableAPIResource,
ListableAPIResource,
UpdateableAPIResource,
):
OBJECT_NAME = "promotion_code"
4 changes: 3 additions & 1 deletion stripe/api_resources/radar/value_list_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@


class ValueListItem(
CreateableAPIResource, DeletableAPIResource, ListableAPIResource
CreateableAPIResource,
DeletableAPIResource,
ListableAPIResource,
):
OBJECT_NAME = "radar.value_list_item"
11 changes: 10 additions & 1 deletion stripe/api_resources/setup_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@

@custom_method("cancel", http_verb="post")
@custom_method("confirm", http_verb="post")
@custom_method("verify_microdeposits", http_verb="post")
class SetupIntent(
CreateableAPIResource, ListableAPIResource, UpdateableAPIResource
CreateableAPIResource,
ListableAPIResource,
UpdateableAPIResource,
):
OBJECT_NAME = "setup_intent"

Expand All @@ -25,3 +28,9 @@ def confirm(self, idempotency_key=None, **params):
headers = util.populate_headers(idempotency_key)
self.refresh_from(self.request("post", url, params, headers))
return self

def verify_microdeposits(self, idempotency_key=None, **params):
url = self.instance_url() + "/verify_microdeposits"
headers = util.populate_headers(idempotency_key)
self.refresh_from(self.request("post", url, params, headers))
return self
4 changes: 3 additions & 1 deletion stripe/api_resources/subscription_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
@custom_method("cancel", http_verb="post")
@custom_method("release", http_verb="post")
class SubscriptionSchedule(
CreateableAPIResource, ListableAPIResource, UpdateableAPIResource
CreateableAPIResource,
ListableAPIResource,
UpdateableAPIResource,
):
OBJECT_NAME = "subscription_schedule"

Expand Down
4 changes: 3 additions & 1 deletion stripe/api_resources/tax_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@


class TaxRate(
CreateableAPIResource, ListableAPIResource, UpdateableAPIResource
CreateableAPIResource,
ListableAPIResource,
UpdateableAPIResource,
):
OBJECT_NAME = "tax_rate"
7 changes: 5 additions & 2 deletions stripe/api_resources/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@

@custom_method("cancel", http_verb="post")
@nested_resource_class_methods(
"reversal", operations=["create", "retrieve", "update", "list"]
"reversal",
operations=["create", "retrieve", "update", "list"],
)
class Transfer(
CreateableAPIResource, ListableAPIResource, UpdateableAPIResource
CreateableAPIResource,
ListableAPIResource,
UpdateableAPIResource,
):
OBJECT_NAME = "transfer"

Expand Down

0 comments on commit 04456e7

Please sign in to comment.