-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Added api for bank account, dimensions and dimension_set lines (#…
…23) * Feat: Added api for bank account, dimensions and dimension_set lines * comment resolved * added count for bank account * added count api for dimension values * comment resolved * bump up version
- Loading branch information
1 parent
efa614e
commit a4898f6
Showing
7 changed files
with
121 additions
and
5 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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from .api_base import ApiBase | ||
|
||
|
||
class BankAccounts(ApiBase): | ||
"""Class for Bank Accounts APIs.""" | ||
|
||
GET_BANK_ACCOUNT = '/bankAccounts' | ||
COUNT_BANK_ACCOUNT = '/bankAccounts/$count' | ||
|
||
def get_all(self, **kwargs): | ||
""" | ||
Get all bank accounts | ||
:return: returns all bank accounts | ||
""" | ||
return self._get_request({ | ||
**kwargs | ||
}, BankAccounts.GET_BANK_ACCOUNT)['value'] | ||
|
||
def count(self, **kwargs): | ||
""" | ||
Get counts of locations | ||
:return: Count in Int | ||
""" | ||
return self._get_request_for_count({ | ||
**kwargs | ||
}, BankAccounts.COUNT_BANK_ACCOUNT)['value'] |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from .api_base import ApiBase | ||
|
||
|
||
class Dimensions(ApiBase): | ||
"""Class for Locations APIs.""" | ||
|
||
GET_DIMENSION = '/dimensions' | ||
GET_DIMENSION_VALUES = '/dimensions({0})/dimensionValues' | ||
COUNT_DIMENSIONS = '/dimensions/$count' | ||
COUNT_DIMENSIONS_VALUES = '/dimensions({0})/dimensionValues/$count' | ||
|
||
def get_all_dimensions(self, **kwargs): | ||
""" | ||
Get all dimensions | ||
:return: returns all companies | ||
""" | ||
return self._get_request({ | ||
**kwargs | ||
}, Dimensions.GET_DIMENSION)['value'] | ||
|
||
def get_all_dimension_values(self, dimension_id:str, **kwargs): | ||
""" | ||
Get all dimension_values | ||
Parameters: | ||
dimension_name (str): Dimension name. | ||
:return: returns all companies | ||
""" | ||
return self._get_request({ | ||
**kwargs | ||
}, (Dimensions.GET_DIMENSION_VALUES).format(dimension_id))['value'] | ||
|
||
def count(self, **kwargs): | ||
""" | ||
Get counts of dimensions | ||
:return: Count in Int | ||
""" | ||
return self._get_request_for_count({ | ||
**kwargs | ||
}, Dimensions.COUNT_DIMENSIONS)['value'] | ||
|
||
def count_dimension_values(self, destination_id:str, **kwargs): | ||
""" | ||
Get counts of dimensions values with the given destination_id | ||
:return: Count in Int | ||
""" | ||
|
||
return self._get_request_for_count({ | ||
**kwargs | ||
}, (Dimensions.COUNT_DIMENSIONS_VALUES).format(destination_id))['value'] |
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