Skip to content
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

feat: added recent endpoints #33

Merged
merged 4 commits into from
Mar 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

*
* Added new `sku`, `invoice_rules` and `transport_rules` endpoints

### Changed

Expand Down
10 changes: 10 additions & 0 deletions src/ripe/invoice_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,13 @@ def delete_invoice_rule(self, id):
url = self.base_url + "invoice_rules/%d" % id
contents = self.delete(url)
return contents

def resolve_invoice_rules(self, brand = None, model = None, country = None):
url = self.base_url + "invoice_rules/resolve"
contents = self.get(
url,
brand = brand,
model = model,
country = country
)
return contents
14 changes: 12 additions & 2 deletions src/ripe/sku.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ class SkuAPI(object):

def list_skus(self):
url = self.base_url + "skus"
contents = self.get(url, auth = False)
contents = self.get(url)
return contents

def list_skus_csv(self):
url = self.base_url + "skus.csv"
contents = self.get(url)
return contents

def create_sku(self, sku):
Expand All @@ -18,7 +23,7 @@ def create_sku(self, sku):

def get_sku(self, id):
url = self.base_url + "skus/%d" % id
contents = self.get(url, auth = False)
contents = self.get(url)
return contents

def update_sku(self, id, sku):
Expand All @@ -38,3 +43,8 @@ def validate_sku(self, id):
url = self.base_url + "skus/%s/validate" % id
contents = self.get(url)
return contents

def count_skus(self):
url = self.base_url + "skus/count"
contents = self.get(url)
return contents
17 changes: 17 additions & 0 deletions src/ripe/transport_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,20 @@ def delete_transport_rule(self, id):
url = self.base_url + "transport_rules/%d" % id
contents = self.delete(url)
return contents

def resolve_transport_rules(
self,
brand = None,
model = None,
country = None,
factory = None
):
url = self.base_url + "transport_rules/resolve"
contents = self.get(
url,
brand = brand,
model = model,
country = country,
factory = factory
)
return contents