From f6354938b1a48945af132a607042a00f1fcaa4d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dias=20Conde=20Azevedo?= Date: Wed, 23 Mar 2022 11:05:49 +0000 Subject: [PATCH 1/2] feat: general order chat methods --- CHANGELOG.md | 1 + src/ripe/order.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 999f35a..b46f7a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Entire bulk order module for feature parity with JS SDK * Pylint config and pylint command to the CI environment * Added new methods `video` and `video_thumbnail` that return a video and video thumbnail related to a given mode, video name and customization - [ripe-white/#996](https://github.com/ripe-tech/ripe-white/issues/996) +* General order chat methods - [ripe-core/#4702](https://github.com/ripe-tech/ripe-core/issues/4702) ### Changed diff --git a/src/ripe/order.py b/src/ripe/order.py index 6e1f1cb..0f85bce 100644 --- a/src/ripe/order.py +++ b/src/ripe/order.py @@ -82,6 +82,26 @@ def log_order(self, number): contents = self.get(url) return contents + def chat_order(self, number): + url = self.base_url + "orders/%d/chat" % number + contents = self.get(url) + return contents + + def chat_lines_order(self, number): + url = self.base_url + "orders/%d/chat/lines" % number + contents = self.get(url) + return contents + + def chat_lines_count_order(self, number): + url = self.base_url + "orders/%d/chat/lines/count" % number + contents = self.get(url) + return contents + + def chat_create_line_order(self, number, content): + url = self.base_url + "orders/%d/chat/lines/count" % number + contents = self.post(url, data_j = content) + return contents + def states_order(self, number): url = self.base_url + "orders/%d/states" % number contents = self.get(url) From 2125fde8eea175ae2b20d4a391e7e195381b2c7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dias=20Conde=20Azevedo?= Date: Wed, 23 Mar 2022 11:39:23 +0000 Subject: [PATCH 2/2] fix: pass down kwargs to allow using states=true --- src/ripe/order.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ripe/order.py b/src/ripe/order.py index 0f85bce..01c44d3 100644 --- a/src/ripe/order.py +++ b/src/ripe/order.py @@ -87,9 +87,9 @@ def chat_order(self, number): contents = self.get(url) return contents - def chat_lines_order(self, number): + def chat_lines_order(self, number, *args, **kwargs): url = self.base_url + "orders/%d/chat/lines" % number - contents = self.get(url) + contents = self.get(url, **kwargs) return contents def chat_lines_count_order(self, number):