소스 검색

API cleanup

Nikola Kotur 5 년 전
부모
커밋
b0744af0d9
4개의 변경된 파일0개의 추가작업 그리고 112개의 파일을 삭제
  1. 0 15
      ynab/models/month_detail.py
  2. 0 9
      ynab/models/payee.py
  3. 0 44
      ynab/models/scheduled_transaction_summary.py
  4. 0 44
      ynab/models/transaction_summary.py

+ 0 - 15
ynab/models/month_detail.py

@@ -83,9 +83,6 @@ class MonthDetail(object):
         :param month: The month of this MonthDetail.  # noqa: E501
         :type: date
         """
-        if month is None:
-            raise ValueError("Invalid value for `month`, must not be `None`")  # noqa: E501
-
         self._month = month
 
     @property
@@ -106,9 +103,6 @@ class MonthDetail(object):
         :param note: The note of this MonthDetail.  # noqa: E501
         :type: str
         """
-        if note is None:
-            raise ValueError("Invalid value for `note`, must not be `None`")  # noqa: E501
-
         self._note = note
 
     @property
@@ -131,9 +125,6 @@ class MonthDetail(object):
         :param to_be_budgeted: The to_be_budgeted of this MonthDetail.  # noqa: E501
         :type: float
         """
-        if to_be_budgeted is None:
-            raise ValueError("Invalid value for `to_be_budgeted`, must not be `None`")  # noqa: E501
-
         self._to_be_budgeted = to_be_budgeted
 
     @property
@@ -154,9 +145,6 @@ class MonthDetail(object):
         :param age_of_money: The age_of_money of this MonthDetail.  # noqa: E501
         :type: float
         """
-        if age_of_money is None:
-            raise ValueError("Invalid value for `age_of_money`, must not be `None`")  # noqa: E501
-
         self._age_of_money = age_of_money
 
     @property
@@ -179,9 +167,6 @@ class MonthDetail(object):
         :param categories: The categories of this MonthDetail.  # noqa: E501
         :type: list[Category]
         """
-        if categories is None:
-            raise ValueError("Invalid value for `categories`, must not be `None`")  # noqa: E501
-
         self._categories = categories
 
     def to_dict(self):

+ 0 - 9
ynab/models/payee.py

@@ -72,9 +72,6 @@ class Payee(object):
         :param id: The id of this Payee.  # noqa: E501
         :type: str
         """
-        if id is None:
-            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501
-
         self._id = id
 
     @property
@@ -95,9 +92,6 @@ class Payee(object):
         :param name: The name of this Payee.  # noqa: E501
         :type: str
         """
-        if name is None:
-            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501
-
         self._name = name
 
     @property
@@ -120,9 +114,6 @@ class Payee(object):
         :param transfer_account_id: The transfer_account_id of this Payee.  # noqa: E501
         :type: str
         """
-        if transfer_account_id is None:
-            raise ValueError("Invalid value for `transfer_account_id`, must not be `None`")  # noqa: E501
-
         self._transfer_account_id = transfer_account_id
 
     def to_dict(self):

+ 0 - 44
ynab/models/scheduled_transaction_summary.py

@@ -104,9 +104,6 @@ class ScheduledTransactionSummary(object):
         :param id: The id of this ScheduledTransactionSummary.  # noqa: E501
         :type: str
         """
-        if id is None:
-            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501
-
         self._id = id
 
     @property
@@ -129,9 +126,6 @@ class ScheduledTransactionSummary(object):
         :param date_first: The date_first of this ScheduledTransactionSummary.  # noqa: E501
         :type: date
         """
-        if date_first is None:
-            raise ValueError("Invalid value for `date_first`, must not be `None`")  # noqa: E501
-
         self._date_first = date_first
 
     @property
@@ -154,9 +148,6 @@ class ScheduledTransactionSummary(object):
         :param date_next: The date_next of this ScheduledTransactionSummary.  # noqa: E501
         :type: date
         """
-        if date_next is None:
-            raise ValueError("Invalid value for `date_next`, must not be `None`")  # noqa: E501
-
         self._date_next = date_next
 
     @property
@@ -177,15 +168,6 @@ class ScheduledTransactionSummary(object):
         :param frequency: The frequency of this ScheduledTransactionSummary.  # noqa: E501
         :type: str
         """
-        if frequency is None:
-            raise ValueError("Invalid value for `frequency`, must not be `None`")  # noqa: E501
-        allowed_values = ["never", "daily", "weekly", "everyOtherWeek", "twiceAMonth", "every4Weeks", "monthly", "everyOtherMonth", "every3Months", "every4Months", "twiceAYear", "yearly", "everyOtherYear"]  # noqa: E501
-        if frequency not in allowed_values:
-            raise ValueError(
-                "Invalid value for `frequency` ({0}), must be one of {1}"  # noqa: E501
-                .format(frequency, allowed_values)
-            )
-
         self._frequency = frequency
 
     @property
@@ -208,9 +190,6 @@ class ScheduledTransactionSummary(object):
         :param amount: The amount of this ScheduledTransactionSummary.  # noqa: E501
         :type: float
         """
-        if amount is None:
-            raise ValueError("Invalid value for `amount`, must not be `None`")  # noqa: E501
-
         self._amount = amount
 
     @property
@@ -231,9 +210,6 @@ class ScheduledTransactionSummary(object):
         :param memo: The memo of this ScheduledTransactionSummary.  # noqa: E501
         :type: str
         """
-        if memo is None:
-            raise ValueError("Invalid value for `memo`, must not be `None`")  # noqa: E501
-
         self._memo = memo
 
     @property
@@ -256,14 +232,6 @@ class ScheduledTransactionSummary(object):
         :param flag_color: The flag_color of this ScheduledTransactionSummary.  # noqa: E501
         :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
-        if flag_color not in allowed_values:
-            raise ValueError(
-                "Invalid value for `flag_color` ({0}), must be one of {1}"  # noqa: E501
-                .format(flag_color, allowed_values)
-            )
 
         self._flag_color = flag_color
 
@@ -285,9 +253,6 @@ class ScheduledTransactionSummary(object):
         :param account_id: The account_id of this ScheduledTransactionSummary.  # noqa: E501
         :type: str
         """
-        if account_id is None:
-            raise ValueError("Invalid value for `account_id`, must not be `None`")  # noqa: E501
-
         self._account_id = account_id
 
     @property
@@ -308,9 +273,6 @@ class ScheduledTransactionSummary(object):
         :param payee_id: The payee_id of this ScheduledTransactionSummary.  # noqa: E501
         :type: str
         """
-        if payee_id is None:
-            raise ValueError("Invalid value for `payee_id`, must not be `None`")  # noqa: E501
-
         self._payee_id = payee_id
 
     @property
@@ -331,9 +293,6 @@ class ScheduledTransactionSummary(object):
         :param category_id: The category_id of this ScheduledTransactionSummary.  # noqa: E501
         :type: str
         """
-        if category_id is None:
-            raise ValueError("Invalid value for `category_id`, must not be `None`")  # noqa: E501
-
         self._category_id = category_id
 
     @property
@@ -356,9 +315,6 @@ class ScheduledTransactionSummary(object):
         :param transfer_account_id: The transfer_account_id of this ScheduledTransactionSummary.  # noqa: E501
         :type: str
         """
-        if transfer_account_id is None:
-            raise ValueError("Invalid value for `transfer_account_id`, must not be `None`")  # noqa: E501
-
         self._transfer_account_id = transfer_account_id
 
     def to_dict(self):

+ 0 - 44
ynab/models/transaction_summary.py

@@ -131,8 +131,6 @@ class TransactionSummary(object):
         :param date: The date of this TransactionSummary.  # noqa: E501
         :type: date
         """
-        if date is None:
-            raise ValueError("Invalid value for `date`, must not be `None`")  # noqa: E501
 
         self._date = date
 
@@ -156,9 +154,6 @@ class TransactionSummary(object):
         :param amount: The amount of this TransactionSummary.  # noqa: E501
         :type: float
         """
-        if amount is None:
-            raise ValueError("Invalid value for `amount`, must not be `None`")  # noqa: E501
-
         self._amount = amount
 
     @property
@@ -179,9 +174,6 @@ class TransactionSummary(object):
         :param memo: The memo of this TransactionSummary.  # noqa: E501
         :type: str
         """
-        if memo is None:
-            raise ValueError("Invalid value for `memo`, must not be `None`")  # noqa: E501
-
         self._memo = memo
 
     @property
@@ -204,15 +196,6 @@ class TransactionSummary(object):
         :param cleared: The cleared of this TransactionSummary.  # noqa: E501
         :type: str
         """
-        if cleared is None:
-            raise ValueError("Invalid value for `cleared`, must not be `None`")  # noqa: E501
-        allowed_values = ["cleared", "uncleared", "reconciled"]  # noqa: E501
-        if cleared not in allowed_values:
-            raise ValueError(
-                "Invalid value for `cleared` ({0}), must be one of {1}"  # noqa: E501
-                .format(cleared, allowed_values)
-            )
-
         self._cleared = cleared
 
     @property
@@ -235,9 +218,6 @@ class TransactionSummary(object):
         :param approved: The approved of this TransactionSummary.  # noqa: E501
         :type: bool
         """
-        if approved is None:
-            raise ValueError("Invalid value for `approved`, must not be `None`")  # noqa: E501
-
         self._approved = approved
 
     @property
@@ -260,15 +240,6 @@ class TransactionSummary(object):
         :param flag_color: The flag_color of this TransactionSummary.  # noqa: E501
         :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
-        if flag_color not in allowed_values:
-            raise ValueError(
-                "Invalid value for `flag_color` ({0}), must be one of {1}"  # noqa: E501
-                .format(flag_color, allowed_values)
-            )
-
         self._flag_color = flag_color
 
     @property
@@ -289,9 +260,6 @@ class TransactionSummary(object):
         :param account_id: The account_id of this TransactionSummary.  # noqa: E501
         :type: str
         """
-        if account_id is None:
-            raise ValueError("Invalid value for `account_id`, must not be `None`")  # noqa: E501
-
         self._account_id = account_id
 
     @property
@@ -312,9 +280,6 @@ class TransactionSummary(object):
         :param payee_id: The payee_id of this TransactionSummary.  # noqa: E501
         :type: str
         """
-        if payee_id is None:
-            raise ValueError("Invalid value for `payee_id`, must not be `None`")  # noqa: E501
-
         self._payee_id = payee_id
 
     @property
@@ -335,9 +300,6 @@ class TransactionSummary(object):
         :param category_id: The category_id of this TransactionSummary.  # noqa: E501
         :type: str
         """
-        if category_id is None:
-            raise ValueError("Invalid value for `category_id`, must not be `None`")  # noqa: E501
-
         self._category_id = category_id
 
     @property
@@ -358,9 +320,6 @@ class TransactionSummary(object):
         :param transfer_account_id: The transfer_account_id of this TransactionSummary.  # noqa: E501
         :type: str
         """
-        if transfer_account_id is None:
-            raise ValueError("Invalid value for `transfer_account_id`, must not be `None`")  # noqa: E501
-
         self._transfer_account_id = transfer_account_id
 
     @property
@@ -383,9 +342,6 @@ class TransactionSummary(object):
         :param import_id: The import_id of this TransactionSummary.  # noqa: E501
         :type: str
         """
-        if import_id is None:
-            raise ValueError("Invalid value for `import_id`, must not be `None`")  # noqa: E501
-
         self._import_id = import_id
 
     def to_dict(self):