forked from shift4developer/shift4-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michal Schielmann
committed
Aug 20, 2024
1 parent
eb1bbff
commit 840ec40
Showing
9 changed files
with
143 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
class RequestOptions: | ||
__idempotency_key = None | ||
_idempotency_key_option_name = "idempotency_key" | ||
_supported_options = [_idempotency_key_option_name] | ||
|
||
|
||
def set_idempotency_key(self, idempotency_key): | ||
self.__idempotency_key = idempotency_key | ||
class RequestOptions: | ||
def __init__(self, options): | ||
if options is not None: | ||
for key, value in options.items(): | ||
if key in _supported_options: | ||
setattr(self, key, value) | ||
|
||
def has_idempotency_key(self): | ||
return self.__idempotency_key is not None | ||
return hasattr(self, _idempotency_key_option_name) | ||
|
||
def get_idempotency_key(self): | ||
return self.__idempotency_key | ||
return getattr(self, _idempotency_key_option_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.