From 15af3d19ec6cc1bc30c2ccc66969c0f08177a2b7 Mon Sep 17 00:00:00 2001 From: xacadil <92389481+xacadil@users.noreply.github.com> Date: Wed, 20 Dec 2023 22:00:48 +0500 Subject: [PATCH] Added tax rates stream (#7) --- tap_stripe/streams.py | 25 +++++++++++++++++++++++++ tap_stripe/tap.py | 6 ++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/tap_stripe/streams.py b/tap_stripe/streams.py index d0a2734..a2a8d71 100644 --- a/tap_stripe/streams.py +++ b/tap_stripe/streams.py @@ -683,5 +683,30 @@ def validate_response(self, response: requests.Response) -> None: msg = self.response_error_message(response) raise RetriableAPIError(msg, response) +class TaxRatesStream(stripeStream): + + name = "tax_rates" + path = "tax_rates" + object = "tax_rate" + replication_key = "created" + + schema = th.PropertiesList( + th.Property("id", th.StringType), + th.Property("object", th.StringType), + th.Property("created", th.DateTimeType), + th.Property("active", th.BooleanType), + th.Property("country", th.StringType), + th.Property("description", th.StringType), + th.Property("display_name", th.StringType), + th.Property("inclusive", th.BooleanType), + th.Property("jurisdiction", th.StringType), + th.Property("metadata", th.CustomType({"type": ["object", "string"]})), + th.Property("percentage", th.NumberType), + th.Property("state", th.StringType), + th.Property("state", th.StringType), + th.Property("tax_type", th.StringType), + + ).to_dict() + diff --git a/tap_stripe/tap.py b/tap_stripe/tap.py index 75004ad..ccc100d 100644 --- a/tap_stripe/tap.py +++ b/tap_stripe/tap.py @@ -18,7 +18,8 @@ Subscriptions, SubscriptionItemStream, SubscriptionSchedulesStream, - UsageRecordsStream + UsageRecordsStream, + TaxRatesStream, ) STREAM_TYPES = [ @@ -34,7 +35,8 @@ Subscriptions, SubscriptionItemStream, SubscriptionSchedulesStream, - UsageRecordsStream + UsageRecordsStream, + TaxRatesStream ]