-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing dependent fields get function (#80)
* Fixing dependent fields get function * Adding param types * Adding separate resource for Dependent Field Values * Renaming class * Fixing messaging * Fixing names * Changing file name
- Loading branch information
Showing
4 changed files
with
36 additions
and
15 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
33 changes: 33 additions & 0 deletions
33
fyle/platform/apis/v1beta/admin/dependent_expense_field_values.py
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,33 @@ | ||
""" | ||
V1 Beta Admin Expense Fields | ||
""" | ||
from typing import Iterable | ||
from ....internals.list_all_resources import ListAllResources | ||
from ....internals.list_resources import ListResources | ||
from ....internals.post_resources import PostResources | ||
from ....internals.get_resources import GetResources | ||
from .... import exceptions | ||
|
||
|
||
class DependentExpenseFieldValues(ListResources, ListAllResources, PostResources, GetResources): | ||
"""Class for Dependent Expense Field Values APIs.""" | ||
|
||
DEPENDENT_FIELD_VALUES = '/dependent_expense_field_values' | ||
BULK_CREATE_DEPENDENT_EXPENSE_FIELDS_VALUES = '/dependent_expense_field_values/bulk' | ||
|
||
def __init__(self, version, role): | ||
super().__init__(version, role, DependentExpenseFieldValues.DEPENDENT_FIELD_VALUES) | ||
|
||
def list_all(self, query_params=None) -> Iterable: | ||
query_params = {} if query_params is None else query_params | ||
if 'expense_field_id' not in query_params: | ||
raise exceptions.WrongParamsError('expense_field_id is a mandatory query param.') | ||
if 'parent_expense_field_id' not in query_params: | ||
raise exceptions.WrongParamsError('parent_expense_field_id is a mandatory query param.') | ||
return super().list_all(query_params) | ||
|
||
def bulk_post_dependent_expense_field_values(self, payload): | ||
return self.api.make_post_request( | ||
api_url=DependentExpenseFieldValues.BULK_CREATE_DEPENDENT_EXPENSE_FIELDS_VALUES, | ||
payload=payload | ||
) |
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
setuptools.setup( | ||
name='fyle', | ||
version='v0.33.1', | ||
version='v0.34.0', | ||
author='Siva Narayanan', | ||
author_email='[email protected]', | ||
description='Python SDK for accessing Fyle Platform APIs', | ||
|