Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleted unnecessary checks if certain fields were None #13

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions ynab/models/hybrid_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.youneedabudget.com # noqa: E501

OpenAPI spec version: 1.0.0

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

Expand Down Expand Up @@ -202,7 +202,7 @@ def memo(self, memo):
:type: str
"""
if memo is None:
raise ValueError("Invalid value for `memo`, must not be `None`") # noqa: E501
memo = ""

self._memo = memo

Expand Down Expand Up @@ -283,8 +283,9 @@ def flag_color(self, flag_color):
:type: str
"""
if flag_color is None:
raise ValueError("Invalid value for `flag_color`, must not be `None`") # noqa: E501
allowed_values = ["red", "orange", "yellow", "green", "blue", "purple"] # noqa: E501
flag_color = ""

allowed_values = ["red", "orange", "yellow", "green", "blue", "purple", ""] # noqa: E501
if flag_color not in allowed_values:
raise ValueError(
"Invalid value for `flag_color` ({0}), must be one of {1}" # noqa: E501
Expand Down Expand Up @@ -335,7 +336,7 @@ def payee_id(self, payee_id):
:type: str
"""
if payee_id is None:
raise ValueError("Invalid value for `payee_id`, must not be `None`") # noqa: E501
payee_id = ""

self._payee_id = payee_id

Expand Down Expand Up @@ -381,7 +382,8 @@ def transfer_account_id(self, transfer_account_id):
:type: str
"""
if transfer_account_id is None:
raise ValueError("Invalid value for `transfer_account_id`, must not be `None`") # noqa: E501
transfer_account_id = ""


self._transfer_account_id = transfer_account_id

Expand All @@ -406,7 +408,7 @@ def import_id(self, import_id):
:type: str
"""
if import_id is None:
raise ValueError("Invalid value for `import_id`, must not be `None`") # noqa: E501
import_id = ""

self._import_id = import_id

Expand Down Expand Up @@ -462,7 +464,7 @@ def parent_transaction_id(self, parent_transaction_id):
:type: str
"""
if parent_transaction_id is None:
raise ValueError("Invalid value for `parent_transaction_id`, must not be `None`") # noqa: E501
parent_transaction_id = ""

self._parent_transaction_id = parent_transaction_id

Expand Down Expand Up @@ -508,7 +510,7 @@ def payee_name(self, payee_name):
:type: str
"""
if payee_name is None:
raise ValueError("Invalid value for `payee_name`, must not be `None`") # noqa: E501
payee_name = ""

self._payee_name = payee_name

Expand All @@ -531,7 +533,7 @@ def category_name(self, category_name):
:type: str
"""
if category_name is None:
raise ValueError("Invalid value for `category_name`, must not be `None`") # noqa: E501
category_name = ""

self._category_name = category_name

Expand Down
4 changes: 2 additions & 2 deletions ynab/models/sub_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.youneedabudget.com # noqa: E501

OpenAPI spec version: 1.0.0

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

Expand Down Expand Up @@ -160,7 +160,7 @@ def memo(self, memo):
:type: str
"""
if memo is None:
raise ValueError("Invalid value for `memo`, must not be `None`") # noqa: E501
memo = ''

self._memo = memo

Expand Down