Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tap_chargify/chargify.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ def price_points(self, bookmark=None):
for o in self.get("products/{product_id}/price_points.json".format(product_id=l["product"]["id"])):
for m in o["price_points"]:
yield m


def component_price_points(self, bookmark=None):
for i in self.get("product_families.json"):
for j in i:
for k in self.get("product_families/{product_family_id}/components.json".format(product_family_id=j["product_family"]["id"])):
for l in k:
for o in self.get("components/{component_id}/price_points.json".format(component_id=l["component"]["id"])):
for m in o["price_points"]:
yield m


def coupons(self, bookmark=None):
Expand Down
109 changes: 109 additions & 0 deletions tap_chargify/schemas/component_price_points.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"type": [
"null",
"object"
],
"properties": {
"id": {
"type": [
"null",
"integer"
]
},
"default": {
"type": [
"null",
"boolean"
]
},
"name": {
"type": [
"null",
"string"
]
},
"pricing_scheme": {
"type": [
"null",
"string"
]
},
"component_id": {
"type": [
"null",
"integer"
]
},
"handle": {
"type": [
"null",
"string"
]
},
"archived_at": {
"type": [
"null",
"string"
],
"format": "date-time"
},
"created_at": {
"type": [
"null",
"string"
],
"format": "date-time"
},
"updated_at": {
"type": [
"null",
"string"
],
"format": "date-time"
},
"prices": {
"type": [
"null",
"array"
],
"items": {
"type": [
"null",
"object"
],
"properties": {
"id": {
"type": [
"null",
"integer"
]
},
"component_id": {
"type": [
"null",
"integer"
]
},
"starting_quantity": {
"type": [
"null",
"integer"
]
},
"ending_quantity": {
"type": [
"null",
"integer"
]
},
"unit_price": {
"type": [
"null",
"string"
]
}
}
}
}
}
}
6 changes: 6 additions & 0 deletions tap_chargify/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ class Coupons(Stream):
class Components(Stream):
name = "components"
replication_method = "FULL_TABLE"


class ComponentPricePoints(Stream):
name = "component_price_points"
replication_method = "FULL_TABLE"


class Subscriptions(Stream):
Expand Down Expand Up @@ -187,6 +192,7 @@ class Events(Stream):
"price_points": PricePoints,
"coupons": Coupons,
"components": Components,
"component_price_points": ComponentPricePoints,
"subscriptions": Subscriptions,
"transactions": Transactions,
"statements": Statements,
Expand Down