From 7a3cd6cf6b96c05318b94c5db936f7e6e6efe55e Mon Sep 17 00:00:00 2001 From: Pedro Spoljaric Gomes Date: Fri, 26 May 2023 10:54:07 -0300 Subject: [PATCH 1/3] feat: add block object method --- .vscode/configurationCache.log | 1 + .vscode/dryrun.log | 5 + .vscode/settings.json | 3 + .vscode/targets.log | 379 +++++++++++++++++++++++++++++++++ correios/client.py | 10 + 5 files changed, 398 insertions(+) create mode 100644 .vscode/configurationCache.log create mode 100644 .vscode/dryrun.log create mode 100644 .vscode/settings.json create mode 100644 .vscode/targets.log diff --git a/.vscode/configurationCache.log b/.vscode/configurationCache.log new file mode 100644 index 0000000..8facb18 --- /dev/null +++ b/.vscode/configurationCache.log @@ -0,0 +1 @@ +{"buildTargets":["check-types","clean","cov-test","fix-imports","flake","help","install","isort","lint","outdated","test","update-wsdl"],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[],"compilerArgs":[]},"fileIndex":[]}} \ No newline at end of file diff --git a/.vscode/dryrun.log b/.vscode/dryrun.log new file mode 100644 index 0000000..e572a8a --- /dev/null +++ b/.vscode/dryrun.log @@ -0,0 +1,5 @@ +make --dry-run --always-make --keep-going --print-directory +make: Entering directory '/home/magalu/Documents/repos/correios' +awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $1, $2}' Makefile | sort +make: Leaving directory '/home/magalu/Documents/repos/correios' + diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..65e1ec0 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "makefile.extensionOutputFolder": "./.vscode" +} \ No newline at end of file diff --git a/.vscode/targets.log b/.vscode/targets.log new file mode 100644 index 0000000..b69480c --- /dev/null +++ b/.vscode/targets.log @@ -0,0 +1,379 @@ +make all --print-data-base --no-builtin-variables --no-builtin-rules --question +make: *** No rule to make target 'all'. Stop. + +# GNU Make 4.2.1 +# Built for x86_64-pc-linux-gnu +# Copyright (C) 1988-2016 Free Software Foundation, Inc. +# License GPLv3+: GNU GPL version 3 or later +# This is free software: you are free to change and redistribute it. +# There is NO WARRANTY, to the extent permitted by law. + +# Make data base, printed on Fri May 26 09:38:08 2023 + +# Variables + +# 'override' directive +GNUMAKEFLAGS := +# automatic + Date: Fri, 26 May 2023 11:03:19 -0300 Subject: [PATCH 2/3] Revert "feat: add block object method" This reverts commit 7a3cd6cf6b96c05318b94c5db936f7e6e6efe55e. --- .vscode/configurationCache.log | 1 - .vscode/dryrun.log | 5 - .vscode/settings.json | 3 - .vscode/targets.log | 379 --------------------------------- correios/client.py | 10 - 5 files changed, 398 deletions(-) delete mode 100644 .vscode/configurationCache.log delete mode 100644 .vscode/dryrun.log delete mode 100644 .vscode/settings.json delete mode 100644 .vscode/targets.log diff --git a/.vscode/configurationCache.log b/.vscode/configurationCache.log deleted file mode 100644 index 8facb18..0000000 --- a/.vscode/configurationCache.log +++ /dev/null @@ -1 +0,0 @@ -{"buildTargets":["check-types","clean","cov-test","fix-imports","flake","help","install","isort","lint","outdated","test","update-wsdl"],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[],"compilerArgs":[]},"fileIndex":[]}} \ No newline at end of file diff --git a/.vscode/dryrun.log b/.vscode/dryrun.log deleted file mode 100644 index e572a8a..0000000 --- a/.vscode/dryrun.log +++ /dev/null @@ -1,5 +0,0 @@ -make --dry-run --always-make --keep-going --print-directory -make: Entering directory '/home/magalu/Documents/repos/correios' -awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $1, $2}' Makefile | sort -make: Leaving directory '/home/magalu/Documents/repos/correios' - diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 65e1ec0..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "makefile.extensionOutputFolder": "./.vscode" -} \ No newline at end of file diff --git a/.vscode/targets.log b/.vscode/targets.log deleted file mode 100644 index b69480c..0000000 --- a/.vscode/targets.log +++ /dev/null @@ -1,379 +0,0 @@ -make all --print-data-base --no-builtin-variables --no-builtin-rules --question -make: *** No rule to make target 'all'. Stop. - -# GNU Make 4.2.1 -# Built for x86_64-pc-linux-gnu -# Copyright (C) 1988-2016 Free Software Foundation, Inc. -# License GPLv3+: GNU GPL version 3 or later -# This is free software: you are free to change and redistribute it. -# There is NO WARRANTY, to the extent permitted by law. - -# Make data base, printed on Fri May 26 09:38:08 2023 - -# Variables - -# 'override' directive -GNUMAKEFLAGS := -# automatic - Date: Fri, 26 May 2023 11:04:08 -0300 Subject: [PATCH 3/3] feat: add block object method --- correios/client.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/correios/client.py b/correios/client.py index e18169c..7526f4a 100644 --- a/correios/client.py +++ b/correios/client.py @@ -725,3 +725,13 @@ def calculate_delivery_time( def cancel_object(self, posting_card_number: Union[int, str], tracking_code: str): posting_card_number = str(posting_card_number) self._auth_call("cancelarObjeto", posting_card_number, tracking_code) + + def block_object(self, posting_card_number: Union[int, str], tracking_code: str): + posting_card_number = str(posting_card_number) + self._auth_call( + "bloquearObjeto", + numeroEtiqueta=tracking_code, + idPlp=posting_card_number, + tipoBloqueio="FRAUDE_BLOQUEIO", + acao="DEVOLVIDO_AO_REMETENTE" + )