ynab 2.4.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/README.md +1 -1
  2. package/dist/apis/AccountsApi.js +24 -1
  3. package/dist/apis/BudgetsApi.js +24 -1
  4. package/dist/apis/CategoriesApi.js +24 -1
  5. package/dist/apis/DeprecatedApi.js +24 -1
  6. package/dist/apis/MonthsApi.js +24 -1
  7. package/dist/apis/PayeeLocationsApi.js +24 -1
  8. package/dist/apis/PayeesApi.js +24 -1
  9. package/dist/apis/ScheduledTransactionsApi.js +24 -1
  10. package/dist/apis/TransactionsApi.js +24 -1
  11. package/dist/apis/UserApi.js +24 -1
  12. package/dist/browser/ynab.js +1 -1
  13. package/dist/esm/apis/AccountsApi.d.ts +1 -6
  14. package/dist/esm/apis/AccountsApi.js +2 -7
  15. package/dist/esm/apis/BudgetsApi.d.ts +1 -6
  16. package/dist/esm/apis/BudgetsApi.js +2 -7
  17. package/dist/esm/apis/CategoriesApi.d.ts +1 -6
  18. package/dist/esm/apis/CategoriesApi.js +2 -7
  19. package/dist/esm/apis/DeprecatedApi.js +1 -1
  20. package/dist/esm/apis/MonthsApi.d.ts +1 -6
  21. package/dist/esm/apis/MonthsApi.js +2 -7
  22. package/dist/esm/apis/PayeeLocationsApi.d.ts +1 -6
  23. package/dist/esm/apis/PayeeLocationsApi.js +2 -7
  24. package/dist/esm/apis/PayeesApi.d.ts +17 -7
  25. package/dist/esm/apis/PayeesApi.js +67 -8
  26. package/dist/esm/apis/ScheduledTransactionsApi.d.ts +16 -7
  27. package/dist/esm/apis/ScheduledTransactionsApi.js +64 -8
  28. package/dist/esm/apis/TransactionsApi.d.ts +40 -20
  29. package/dist/esm/apis/TransactionsApi.js +87 -17
  30. package/dist/esm/apis/UserApi.d.ts +1 -6
  31. package/dist/esm/apis/UserApi.js +2 -7
  32. package/dist/esm/models/Account.d.ts +2 -7
  33. package/dist/esm/models/Account.js +51 -51
  34. package/dist/esm/models/AccountResponse.d.ts +2 -7
  35. package/dist/esm/models/AccountResponse.js +8 -16
  36. package/dist/esm/models/AccountResponseData.d.ts +2 -7
  37. package/dist/esm/models/AccountResponseData.js +8 -16
  38. package/dist/esm/models/AccountType.d.ts +3 -7
  39. package/dist/esm/models/AccountType.js +11 -6
  40. package/dist/esm/models/AccountsResponse.d.ts +2 -7
  41. package/dist/esm/models/AccountsResponse.js +8 -16
  42. package/dist/esm/models/AccountsResponseData.d.ts +2 -7
  43. package/dist/esm/models/AccountsResponseData.js +11 -18
  44. package/dist/esm/models/BudgetDetail.d.ts +6 -11
  45. package/dist/esm/models/BudgetDetail.js +45 -53
  46. package/dist/esm/models/BudgetDetailResponse.d.ts +2 -7
  47. package/dist/esm/models/BudgetDetailResponse.js +8 -16
  48. package/dist/esm/models/BudgetDetailResponseData.d.ts +2 -7
  49. package/dist/esm/models/BudgetDetailResponseData.js +11 -18
  50. package/dist/esm/models/BudgetSettings.d.ts +2 -7
  51. package/dist/esm/models/BudgetSettings.js +11 -18
  52. package/dist/esm/models/BudgetSettingsResponse.d.ts +2 -7
  53. package/dist/esm/models/BudgetSettingsResponse.js +8 -16
  54. package/dist/esm/models/BudgetSettingsResponseData.d.ts +2 -7
  55. package/dist/esm/models/BudgetSettingsResponseData.js +8 -16
  56. package/dist/esm/models/BudgetSummary.d.ts +2 -7
  57. package/dist/esm/models/BudgetSummary.js +23 -31
  58. package/dist/esm/models/BudgetSummaryResponse.d.ts +2 -7
  59. package/dist/esm/models/BudgetSummaryResponse.js +8 -16
  60. package/dist/esm/models/BudgetSummaryResponseData.d.ts +2 -7
  61. package/dist/esm/models/BudgetSummaryResponseData.js +10 -19
  62. package/dist/esm/models/BulkResponse.d.ts +2 -7
  63. package/dist/esm/models/BulkResponse.js +8 -16
  64. package/dist/esm/models/BulkResponseData.d.ts +2 -7
  65. package/dist/esm/models/BulkResponseData.js +8 -16
  66. package/dist/esm/models/BulkResponseDataBulk.d.ts +2 -7
  67. package/dist/esm/models/BulkResponseDataBulk.js +11 -18
  68. package/dist/esm/models/BulkTransactions.d.ts +5 -10
  69. package/dist/esm/models/BulkTransactions.js +10 -18
  70. package/dist/esm/models/CategoriesResponse.d.ts +2 -7
  71. package/dist/esm/models/CategoriesResponse.js +8 -16
  72. package/dist/esm/models/CategoriesResponseData.d.ts +2 -7
  73. package/dist/esm/models/CategoriesResponseData.js +11 -18
  74. package/dist/esm/models/Category.d.ts +10 -9
  75. package/dist/esm/models/Category.js +61 -61
  76. package/dist/esm/models/CategoryGroup.d.ts +2 -7
  77. package/dist/esm/models/CategoryGroup.js +17 -22
  78. package/dist/esm/models/CategoryGroupWithCategories.d.ts +2 -7
  79. package/dist/esm/models/CategoryGroupWithCategories.js +20 -24
  80. package/dist/esm/models/CategoryResponse.d.ts +2 -7
  81. package/dist/esm/models/CategoryResponse.js +8 -16
  82. package/dist/esm/models/CategoryResponseData.d.ts +2 -7
  83. package/dist/esm/models/CategoryResponseData.js +8 -16
  84. package/dist/esm/models/CurrencyFormat.d.ts +2 -7
  85. package/dist/esm/models/CurrencyFormat.js +29 -30
  86. package/dist/esm/models/DateFormat.d.ts +2 -7
  87. package/dist/esm/models/DateFormat.js +8 -16
  88. package/dist/esm/models/ErrorDetail.d.ts +2 -7
  89. package/dist/esm/models/ErrorDetail.js +14 -20
  90. package/dist/esm/models/ErrorResponse.d.ts +2 -7
  91. package/dist/esm/models/ErrorResponse.js +8 -16
  92. package/dist/esm/models/ExistingTransaction.d.ts +89 -0
  93. package/dist/esm/models/ExistingTransaction.js +56 -0
  94. package/dist/esm/models/HybridTransaction.d.ts +12 -11
  95. package/dist/esm/models/HybridTransaction.js +63 -62
  96. package/dist/esm/models/HybridTransactionAllOf.d.ts +1 -1
  97. package/dist/esm/models/HybridTransactionsResponse.d.ts +2 -7
  98. package/dist/esm/models/HybridTransactionsResponse.js +8 -16
  99. package/dist/esm/models/HybridTransactionsResponseData.d.ts +2 -7
  100. package/dist/esm/models/HybridTransactionsResponseData.js +10 -19
  101. package/dist/esm/models/MonthDetail.d.ts +2 -7
  102. package/dist/esm/models/MonthDetail.js +30 -33
  103. package/dist/esm/models/MonthDetailResponse.d.ts +2 -7
  104. package/dist/esm/models/MonthDetailResponse.js +8 -16
  105. package/dist/esm/models/MonthDetailResponseData.d.ts +2 -7
  106. package/dist/esm/models/MonthDetailResponseData.js +8 -16
  107. package/dist/esm/models/MonthSummariesResponse.d.ts +2 -7
  108. package/dist/esm/models/MonthSummariesResponse.js +8 -16
  109. package/dist/esm/models/MonthSummariesResponseData.d.ts +2 -7
  110. package/dist/esm/models/MonthSummariesResponseData.js +11 -18
  111. package/dist/esm/models/MonthSummary.d.ts +2 -7
  112. package/dist/esm/models/MonthSummary.js +27 -31
  113. package/dist/esm/models/NewTransaction.d.ts +95 -0
  114. package/dist/esm/models/NewTransaction.js +58 -0
  115. package/dist/esm/models/PatchCategoryWrapper.d.ts +2 -7
  116. package/dist/esm/models/PatchCategoryWrapper.js +8 -16
  117. package/dist/esm/models/PatchMonthCategoryWrapper.d.ts +2 -7
  118. package/dist/esm/models/PatchMonthCategoryWrapper.js +8 -16
  119. package/dist/esm/models/PatchPayeeWrapper.d.ts +27 -0
  120. package/dist/esm/models/PatchPayeeWrapper.js +36 -0
  121. package/dist/esm/models/PatchTransactionsWrapper.d.ts +5 -10
  122. package/dist/esm/models/PatchTransactionsWrapper.js +10 -18
  123. package/dist/esm/models/Payee.d.ts +2 -7
  124. package/dist/esm/models/Payee.js +16 -23
  125. package/dist/esm/models/PayeeLocation.d.ts +2 -7
  126. package/dist/esm/models/PayeeLocation.js +20 -24
  127. package/dist/esm/models/PayeeLocationResponse.d.ts +2 -7
  128. package/dist/esm/models/PayeeLocationResponse.js +8 -16
  129. package/dist/esm/models/PayeeLocationResponseData.d.ts +2 -7
  130. package/dist/esm/models/PayeeLocationResponseData.js +8 -16
  131. package/dist/esm/models/PayeeLocationsResponse.d.ts +2 -7
  132. package/dist/esm/models/PayeeLocationsResponse.js +8 -16
  133. package/dist/esm/models/PayeeLocationsResponseData.d.ts +2 -7
  134. package/dist/esm/models/PayeeLocationsResponseData.js +8 -16
  135. package/dist/esm/models/PayeeResponse.d.ts +2 -7
  136. package/dist/esm/models/PayeeResponse.js +8 -16
  137. package/dist/esm/models/PayeeResponseData.d.ts +2 -7
  138. package/dist/esm/models/PayeeResponseData.js +8 -16
  139. package/dist/esm/models/PayeesResponse.d.ts +2 -7
  140. package/dist/esm/models/PayeesResponse.js +8 -16
  141. package/dist/esm/models/PayeesResponseData.d.ts +2 -7
  142. package/dist/esm/models/PayeesResponseData.js +11 -18
  143. package/dist/esm/models/PostAccountWrapper.d.ts +2 -7
  144. package/dist/esm/models/PostAccountWrapper.js +8 -16
  145. package/dist/esm/models/PostScheduledTransactionWrapper.d.ts +27 -0
  146. package/dist/esm/models/PostScheduledTransactionWrapper.js +36 -0
  147. package/dist/esm/models/PostTransactionsWrapper.d.ts +7 -12
  148. package/dist/esm/models/PostTransactionsWrapper.js +10 -20
  149. package/dist/esm/models/PutTransactionWrapper.d.ts +5 -10
  150. package/dist/esm/models/PutTransactionWrapper.js +10 -18
  151. package/dist/esm/models/SaveAccount.d.ts +2 -7
  152. package/dist/esm/models/SaveAccount.js +14 -20
  153. package/dist/esm/models/SaveCategory.d.ts +2 -7
  154. package/dist/esm/models/SaveCategory.js +11 -21
  155. package/dist/esm/models/SaveCategoryResponse.d.ts +2 -7
  156. package/dist/esm/models/SaveCategoryResponse.js +8 -16
  157. package/dist/esm/models/SaveCategoryResponseData.d.ts +2 -7
  158. package/dist/esm/models/SaveCategoryResponseData.js +11 -18
  159. package/dist/esm/models/SaveMonthCategory.d.ts +2 -7
  160. package/dist/esm/models/SaveMonthCategory.js +8 -16
  161. package/dist/esm/models/SavePayee.d.ts +26 -0
  162. package/dist/esm/models/SavePayee.js +33 -0
  163. package/dist/esm/models/SavePayeeResponse.d.ts +27 -0
  164. package/dist/esm/models/SavePayeeResponse.js +36 -0
  165. package/dist/esm/models/SavePayeeResponseData.d.ts +33 -0
  166. package/dist/esm/models/SavePayeeResponseData.js +40 -0
  167. package/dist/esm/models/SaveScheduledTransaction.d.ts +76 -0
  168. package/dist/esm/models/SaveScheduledTransaction.js +55 -0
  169. package/dist/esm/models/SaveSubTransaction.d.ts +2 -7
  170. package/dist/esm/models/SaveSubTransaction.js +16 -25
  171. package/dist/esm/models/SaveTransactionWithIdOrImportId.d.ts +101 -0
  172. package/dist/esm/models/SaveTransactionWithIdOrImportId.js +60 -0
  173. package/dist/esm/models/SaveTransactionWithOptionalFields.d.ts +5 -16
  174. package/dist/esm/models/SaveTransactionWithOptionalFields.js +29 -41
  175. package/dist/esm/models/SaveTransactionsResponse.d.ts +2 -7
  176. package/dist/esm/models/SaveTransactionsResponse.js +8 -16
  177. package/dist/esm/models/SaveTransactionsResponseData.d.ts +2 -7
  178. package/dist/esm/models/SaveTransactionsResponseData.js +17 -25
  179. package/dist/esm/models/ScheduledSubTransaction.d.ts +2 -7
  180. package/dist/esm/models/ScheduledSubTransaction.js +25 -31
  181. package/dist/esm/models/ScheduledTransactionDetail.d.ts +10 -9
  182. package/dist/esm/models/ScheduledTransactionDetail.js +49 -48
  183. package/dist/esm/models/ScheduledTransactionFrequency.d.ts +30 -0
  184. package/dist/esm/models/ScheduledTransactionFrequency.js +46 -0
  185. package/dist/esm/models/ScheduledTransactionResponse.d.ts +2 -7
  186. package/dist/esm/models/ScheduledTransactionResponse.js +8 -16
  187. package/dist/esm/models/ScheduledTransactionResponseData.d.ts +2 -7
  188. package/dist/esm/models/ScheduledTransactionResponseData.js +8 -16
  189. package/dist/esm/models/ScheduledTransactionSummary.d.ts +9 -8
  190. package/dist/esm/models/ScheduledTransactionSummary.js +38 -39
  191. package/dist/esm/models/ScheduledTransactionsResponse.d.ts +2 -7
  192. package/dist/esm/models/ScheduledTransactionsResponse.js +8 -16
  193. package/dist/esm/models/ScheduledTransactionsResponseData.d.ts +2 -7
  194. package/dist/esm/models/ScheduledTransactionsResponseData.js +11 -18
  195. package/dist/esm/models/SubTransaction.d.ts +2 -7
  196. package/dist/esm/models/SubTransaction.js +31 -37
  197. package/dist/esm/models/TransactionClearedStatus.d.ts +3 -7
  198. package/dist/esm/models/TransactionClearedStatus.js +11 -6
  199. package/dist/esm/models/TransactionDetail.d.ts +12 -11
  200. package/dist/esm/models/TransactionDetail.js +62 -61
  201. package/dist/esm/models/TransactionFlagColor.d.ts +3 -7
  202. package/dist/esm/models/TransactionFlagColor.js +11 -6
  203. package/dist/esm/models/TransactionResponse.d.ts +2 -7
  204. package/dist/esm/models/TransactionResponse.js +8 -16
  205. package/dist/esm/models/TransactionResponseData.d.ts +2 -7
  206. package/dist/esm/models/TransactionResponseData.js +8 -16
  207. package/dist/esm/models/TransactionSummary.d.ts +11 -10
  208. package/dist/esm/models/TransactionSummary.js +51 -52
  209. package/dist/esm/models/TransactionsImportResponse.d.ts +2 -7
  210. package/dist/esm/models/TransactionsImportResponse.js +8 -16
  211. package/dist/esm/models/TransactionsImportResponseData.d.ts +2 -7
  212. package/dist/esm/models/TransactionsImportResponseData.js +8 -16
  213. package/dist/esm/models/TransactionsResponse.d.ts +2 -7
  214. package/dist/esm/models/TransactionsResponse.js +8 -16
  215. package/dist/esm/models/TransactionsResponseData.d.ts +2 -7
  216. package/dist/esm/models/TransactionsResponseData.js +11 -18
  217. package/dist/esm/models/User.d.ts +2 -7
  218. package/dist/esm/models/User.js +8 -16
  219. package/dist/esm/models/UserResponse.d.ts +2 -7
  220. package/dist/esm/models/UserResponse.js +8 -16
  221. package/dist/esm/models/UserResponseData.d.ts +2 -7
  222. package/dist/esm/models/UserResponseData.js +8 -16
  223. package/dist/esm/models/index.d.ts +10 -9
  224. package/dist/esm/models/index.js +10 -9
  225. package/dist/esm/runtime.d.ts +12 -17
  226. package/dist/esm/runtime.js +43 -39
  227. package/dist/index.js +17 -2
  228. package/dist/runtime.d.ts +5 -5
  229. package/dist/runtime.js +58 -48
  230. package/package.json +1 -1
@@ -0,0 +1,55 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * YNAB API Endpoints
5
+ * 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.ynab.com
6
+ *
7
+ * Generated by: OpenAPI Generator (https://openapi-generator.tech)
8
+ */
9
+ import { TransactionFlagColorFromJSON, TransactionFlagColorToJSON, } from './TransactionFlagColor';
10
+ import { ScheduledTransactionFrequencyFromJSON, ScheduledTransactionFrequencyToJSON, } from './ScheduledTransactionFrequency';
11
+ /**
12
+ * Check if a given object implements the SaveScheduledTransaction interface.
13
+ */
14
+ export function instanceOfSaveScheduledTransaction(value) {
15
+ if (!('account_id' in value) || value['account_id'] === undefined)
16
+ return false;
17
+ if (!('date' in value) || value['date'] === undefined)
18
+ return false;
19
+ return true;
20
+ }
21
+ export function SaveScheduledTransactionFromJSON(json) {
22
+ return SaveScheduledTransactionFromJSONTyped(json, false);
23
+ }
24
+ export function SaveScheduledTransactionFromJSONTyped(json, ignoreDiscriminator) {
25
+ if (json == null) {
26
+ return json;
27
+ }
28
+ return {
29
+ 'account_id': json['account_id'],
30
+ 'date': json['date'],
31
+ 'amount': json['amount'] == null ? undefined : json['amount'],
32
+ 'payee_id': json['payee_id'] == null ? undefined : json['payee_id'],
33
+ 'payee_name': json['payee_name'] == null ? undefined : json['payee_name'],
34
+ 'category_id': json['category_id'] == null ? undefined : json['category_id'],
35
+ 'memo': json['memo'] == null ? undefined : json['memo'],
36
+ 'flag_color': json['flag_color'] == null ? undefined : TransactionFlagColorFromJSON(json['flag_color']),
37
+ 'frequency': json['frequency'] == null ? undefined : ScheduledTransactionFrequencyFromJSON(json['frequency']),
38
+ };
39
+ }
40
+ export function SaveScheduledTransactionToJSON(value) {
41
+ if (value == null) {
42
+ return value;
43
+ }
44
+ return {
45
+ 'account_id': value['account_id'],
46
+ 'date': value['date'],
47
+ 'amount': value['amount'],
48
+ 'payee_id': value['payee_id'],
49
+ 'payee_name': value['payee_name'],
50
+ 'category_id': value['category_id'],
51
+ 'memo': value['memo'],
52
+ 'flag_color': TransactionFlagColorToJSON(value['flag_color']),
53
+ 'frequency': ScheduledTransactionFrequencyToJSON(value['frequency']),
54
+ };
55
+ }
@@ -2,12 +2,7 @@
2
2
  * YNAB API Endpoints
3
3
  * 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.ynab.com
4
4
  *
5
- * The version of the OpenAPI document: 1.0.0
6
- *
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
5
+ * Generated by: OpenAPI Generator (https://openapi-generator.tech)
11
6
  */
12
7
  /**
13
8
  *
@@ -49,7 +44,7 @@ export interface SaveSubTransaction {
49
44
  /**
50
45
  * Check if a given object implements the SaveSubTransaction interface.
51
46
  */
52
- export declare function instanceOfSaveSubTransaction(value: object): boolean;
47
+ export declare function instanceOfSaveSubTransaction(value: object): value is SaveSubTransaction;
53
48
  export declare function SaveSubTransactionFromJSON(json: any): SaveSubTransaction;
54
49
  export declare function SaveSubTransactionFromJSONTyped(json: any, ignoreDiscriminator: boolean): SaveSubTransaction;
55
50
  export declare function SaveSubTransactionToJSON(value?: SaveSubTransaction | null): any;
@@ -4,49 +4,40 @@
4
4
  * YNAB API Endpoints
5
5
  * 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.ynab.com
6
6
  *
7
- * The version of the OpenAPI document: 1.0.0
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
7
+ * Generated by: OpenAPI Generator (https://openapi-generator.tech)
13
8
  */
14
- import { exists } from '../runtime';
15
9
  /**
16
10
  * Check if a given object implements the SaveSubTransaction interface.
17
11
  */
18
12
  export function instanceOfSaveSubTransaction(value) {
19
- var isInstance = true;
20
- isInstance = isInstance && "amount" in value;
21
- return isInstance;
13
+ if (!('amount' in value) || value['amount'] === undefined)
14
+ return false;
15
+ return true;
22
16
  }
23
17
  export function SaveSubTransactionFromJSON(json) {
24
18
  return SaveSubTransactionFromJSONTyped(json, false);
25
19
  }
26
20
  export function SaveSubTransactionFromJSONTyped(json, ignoreDiscriminator) {
27
- if ((json === undefined) || (json === null)) {
21
+ if (json == null) {
28
22
  return json;
29
23
  }
30
24
  return {
31
25
  'amount': json['amount'],
32
- 'payee_id': !exists(json, 'payee_id') ? undefined : json['payee_id'],
33
- 'payee_name': !exists(json, 'payee_name') ? undefined : json['payee_name'],
34
- 'category_id': !exists(json, 'category_id') ? undefined : json['category_id'],
35
- 'memo': !exists(json, 'memo') ? undefined : json['memo'],
26
+ 'payee_id': json['payee_id'] == null ? undefined : json['payee_id'],
27
+ 'payee_name': json['payee_name'] == null ? undefined : json['payee_name'],
28
+ 'category_id': json['category_id'] == null ? undefined : json['category_id'],
29
+ 'memo': json['memo'] == null ? undefined : json['memo'],
36
30
  };
37
31
  }
38
32
  export function SaveSubTransactionToJSON(value) {
39
- if (value === undefined) {
40
- return undefined;
41
- }
42
- if (value === null) {
43
- return null;
33
+ if (value == null) {
34
+ return value;
44
35
  }
45
36
  return {
46
- 'amount': value.amount,
47
- 'payee_id': value.payee_id,
48
- 'payee_name': value.payee_name,
49
- 'category_id': value.category_id,
50
- 'memo': value.memo,
37
+ 'amount': value['amount'],
38
+ 'payee_id': value['payee_id'],
39
+ 'payee_name': value['payee_name'],
40
+ 'category_id': value['category_id'],
41
+ 'memo': value['memo'],
51
42
  };
52
43
  }
@@ -0,0 +1,101 @@
1
+ /**
2
+ * YNAB API Endpoints
3
+ * 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.ynab.com
4
+ *
5
+ * Generated by: OpenAPI Generator (https://openapi-generator.tech)
6
+ */
7
+ import type { TransactionFlagColor } from './TransactionFlagColor';
8
+ import type { TransactionClearedStatus } from './TransactionClearedStatus';
9
+ import type { SaveSubTransaction } from './SaveSubTransaction';
10
+ /**
11
+ *
12
+ * @export
13
+ * @interface SaveTransactionWithIdOrImportId
14
+ */
15
+ export interface SaveTransactionWithIdOrImportId {
16
+ /**
17
+ *
18
+ * @type {string}
19
+ * @memberof SaveTransactionWithIdOrImportId
20
+ */
21
+ account_id?: string;
22
+ /**
23
+ * The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored.
24
+ * @type {string}
25
+ * @memberof SaveTransactionWithIdOrImportId
26
+ */
27
+ date?: string;
28
+ /**
29
+ * The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored.
30
+ * @type {number}
31
+ * @memberof SaveTransactionWithIdOrImportId
32
+ */
33
+ amount?: number;
34
+ /**
35
+ * The payee for the transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `transfer_payee_id` on the account resource.
36
+ * @type {string}
37
+ * @memberof SaveTransactionWithIdOrImportId
38
+ */
39
+ payee_id?: string | null;
40
+ /**
41
+ * The payee name. If a `payee_name` value is provided and `payee_id` has a null value, the `payee_name` value will be used to resolve the payee by either (1) a matching payee rename rule (only if `import_id` is also specified) or (2) a payee with the same name or (3) creation of a new payee.
42
+ * @type {string}
43
+ * @memberof SaveTransactionWithIdOrImportId
44
+ */
45
+ payee_name?: string | null;
46
+ /**
47
+ * The category for the transaction. To configure a split transaction, you can specify null for `category_id` and provide a `subtransactions` array as part of the transaction object. If an existing transaction is a split, the `category_id` cannot be changed. Credit Card Payment categories are not permitted and will be ignored if supplied.
48
+ * @type {string}
49
+ * @memberof SaveTransactionWithIdOrImportId
50
+ */
51
+ category_id?: string | null;
52
+ /**
53
+ *
54
+ * @type {string}
55
+ * @memberof SaveTransactionWithIdOrImportId
56
+ */
57
+ memo?: string | null;
58
+ /**
59
+ *
60
+ * @type {TransactionClearedStatus}
61
+ * @memberof SaveTransactionWithIdOrImportId
62
+ */
63
+ cleared?: TransactionClearedStatus;
64
+ /**
65
+ * Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default.
66
+ * @type {boolean}
67
+ * @memberof SaveTransactionWithIdOrImportId
68
+ */
69
+ approved?: boolean;
70
+ /**
71
+ *
72
+ * @type {TransactionFlagColor}
73
+ * @memberof SaveTransactionWithIdOrImportId
74
+ */
75
+ flag_color?: TransactionFlagColor | null;
76
+ /**
77
+ * An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported.
78
+ * @type {Array<SaveSubTransaction>}
79
+ * @memberof SaveTransactionWithIdOrImportId
80
+ */
81
+ subtransactions?: Array<SaveSubTransaction>;
82
+ /**
83
+ * If specified, this id will be used to lookup a transaction by its `id` for the purpose of updating the transaction itself. If not specified, an `import_id` should be supplied.
84
+ * @type {string}
85
+ * @memberof SaveTransactionWithIdOrImportId
86
+ */
87
+ id?: string | null;
88
+ /**
89
+ * If specified, this id will be used to lookup a transaction by its `import_id` for the purpose of updating the transaction itself. If not specified, an `id` should be supplied. You may not provide both an `id` and an `import_id` and updating an `import_id` on an existing transaction is not allowed.
90
+ * @type {string}
91
+ * @memberof SaveTransactionWithIdOrImportId
92
+ */
93
+ import_id?: string | null;
94
+ }
95
+ /**
96
+ * Check if a given object implements the SaveTransactionWithIdOrImportId interface.
97
+ */
98
+ export declare function instanceOfSaveTransactionWithIdOrImportId(value: object): value is SaveTransactionWithIdOrImportId;
99
+ export declare function SaveTransactionWithIdOrImportIdFromJSON(json: any): SaveTransactionWithIdOrImportId;
100
+ export declare function SaveTransactionWithIdOrImportIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): SaveTransactionWithIdOrImportId;
101
+ export declare function SaveTransactionWithIdOrImportIdToJSON(value?: SaveTransactionWithIdOrImportId | null): any;
@@ -0,0 +1,60 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * YNAB API Endpoints
5
+ * 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.ynab.com
6
+ *
7
+ * Generated by: OpenAPI Generator (https://openapi-generator.tech)
8
+ */
9
+ import { TransactionFlagColorFromJSON, TransactionFlagColorToJSON, } from './TransactionFlagColor';
10
+ import { TransactionClearedStatusFromJSON, TransactionClearedStatusToJSON, } from './TransactionClearedStatus';
11
+ import { SaveSubTransactionFromJSON, SaveSubTransactionToJSON, } from './SaveSubTransaction';
12
+ /**
13
+ * Check if a given object implements the SaveTransactionWithIdOrImportId interface.
14
+ */
15
+ export function instanceOfSaveTransactionWithIdOrImportId(value) {
16
+ return true;
17
+ }
18
+ export function SaveTransactionWithIdOrImportIdFromJSON(json) {
19
+ return SaveTransactionWithIdOrImportIdFromJSONTyped(json, false);
20
+ }
21
+ export function SaveTransactionWithIdOrImportIdFromJSONTyped(json, ignoreDiscriminator) {
22
+ if (json == null) {
23
+ return json;
24
+ }
25
+ return {
26
+ 'account_id': json['account_id'] == null ? undefined : json['account_id'],
27
+ 'date': json['date'] == null ? undefined : json['date'],
28
+ 'amount': json['amount'] == null ? undefined : json['amount'],
29
+ 'payee_id': json['payee_id'] == null ? undefined : json['payee_id'],
30
+ 'payee_name': json['payee_name'] == null ? undefined : json['payee_name'],
31
+ 'category_id': json['category_id'] == null ? undefined : json['category_id'],
32
+ 'memo': json['memo'] == null ? undefined : json['memo'],
33
+ 'cleared': json['cleared'] == null ? undefined : TransactionClearedStatusFromJSON(json['cleared']),
34
+ 'approved': json['approved'] == null ? undefined : json['approved'],
35
+ 'flag_color': json['flag_color'] == null ? undefined : TransactionFlagColorFromJSON(json['flag_color']),
36
+ 'subtransactions': json['subtransactions'] == null ? undefined : (json['subtransactions'].map(SaveSubTransactionFromJSON)),
37
+ 'id': json['id'] == null ? undefined : json['id'],
38
+ 'import_id': json['import_id'] == null ? undefined : json['import_id'],
39
+ };
40
+ }
41
+ export function SaveTransactionWithIdOrImportIdToJSON(value) {
42
+ if (value == null) {
43
+ return value;
44
+ }
45
+ return {
46
+ 'account_id': value['account_id'],
47
+ 'date': value['date'],
48
+ 'amount': value['amount'],
49
+ 'payee_id': value['payee_id'],
50
+ 'payee_name': value['payee_name'],
51
+ 'category_id': value['category_id'],
52
+ 'memo': value['memo'],
53
+ 'cleared': TransactionClearedStatusToJSON(value['cleared']),
54
+ 'approved': value['approved'],
55
+ 'flag_color': TransactionFlagColorToJSON(value['flag_color']),
56
+ 'subtransactions': value['subtransactions'] == null ? undefined : (value['subtransactions'].map(SaveSubTransactionToJSON)),
57
+ 'id': value['id'],
58
+ 'import_id': value['import_id'],
59
+ };
60
+ }
@@ -2,16 +2,11 @@
2
2
  * YNAB API Endpoints
3
3
  * 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.ynab.com
4
4
  *
5
- * The version of the OpenAPI document: 1.0.0
6
- *
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
5
+ * Generated by: OpenAPI Generator (https://openapi-generator.tech)
11
6
  */
12
- import type { SaveSubTransaction } from './SaveSubTransaction';
13
- import type { TransactionClearedStatus } from './TransactionClearedStatus';
14
7
  import type { TransactionFlagColor } from './TransactionFlagColor';
8
+ import type { TransactionClearedStatus } from './TransactionClearedStatus';
9
+ import type { SaveSubTransaction } from './SaveSubTransaction';
15
10
  /**
16
11
  *
17
12
  * @export
@@ -37,7 +32,7 @@ export interface SaveTransactionWithOptionalFields {
37
32
  */
38
33
  amount?: number;
39
34
  /**
40
- * The payee for the transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `tranfer_payee_id` on the account resource.
35
+ * The payee for the transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `transfer_payee_id` on the account resource.
41
36
  * @type {string}
42
37
  * @memberof SaveTransactionWithOptionalFields
43
38
  */
@@ -78,12 +73,6 @@ export interface SaveTransactionWithOptionalFields {
78
73
  * @memberof SaveTransactionWithOptionalFields
79
74
  */
80
75
  flag_color?: TransactionFlagColor | null;
81
- /**
82
- * If specified, the new transaction will be assigned this `import_id` and considered "imported". We will also attempt to match this imported transaction to an existing "user-entered" transation on the same account, with the same amount, and with a date +/-10 days from the imported transaction date.<br><br>Transactions imported through File Based Import or Direct Import (not through the API) are assigned an import_id in the format: 'YNAB:[milliunit_amount]:[iso_date]:[occurrence]'. For example, a transaction dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of 'YNAB:-294230:2015-12-30:1'. If a second transaction on the same account was imported and had the same date and same amount, its import_id would be 'YNAB:-294230:2015-12-30:2'. Using a consistent format will prevent duplicates through Direct Import and File Based Import.<br><br>If import_id is omitted or specified as null, the transaction will be treated as a "user-entered" transaction. As such, it will be eligible to be matched against transactions later being imported (via DI, FBI, or API).
83
- * @type {string}
84
- * @memberof SaveTransactionWithOptionalFields
85
- */
86
- import_id?: string | null;
87
76
  /**
88
77
  * An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported.
89
78
  * @type {Array<SaveSubTransaction>}
@@ -94,7 +83,7 @@ export interface SaveTransactionWithOptionalFields {
94
83
  /**
95
84
  * Check if a given object implements the SaveTransactionWithOptionalFields interface.
96
85
  */
97
- export declare function instanceOfSaveTransactionWithOptionalFields(value: object): boolean;
86
+ export declare function instanceOfSaveTransactionWithOptionalFields(value: object): value is SaveTransactionWithOptionalFields;
98
87
  export declare function SaveTransactionWithOptionalFieldsFromJSON(json: any): SaveTransactionWithOptionalFields;
99
88
  export declare function SaveTransactionWithOptionalFieldsFromJSONTyped(json: any, ignoreDiscriminator: boolean): SaveTransactionWithOptionalFields;
100
89
  export declare function SaveTransactionWithOptionalFieldsToJSON(value?: SaveTransactionWithOptionalFields | null): any;
@@ -4,65 +4,53 @@
4
4
  * YNAB API Endpoints
5
5
  * 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.ynab.com
6
6
  *
7
- * The version of the OpenAPI document: 1.0.0
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
7
+ * Generated by: OpenAPI Generator (https://openapi-generator.tech)
13
8
  */
14
- import { exists } from '../runtime';
15
- import { SaveSubTransactionFromJSON, SaveSubTransactionToJSON, } from './SaveSubTransaction';
16
- import { TransactionClearedStatusFromJSON, TransactionClearedStatusToJSON, } from './TransactionClearedStatus';
17
9
  import { TransactionFlagColorFromJSON, TransactionFlagColorToJSON, } from './TransactionFlagColor';
10
+ import { TransactionClearedStatusFromJSON, TransactionClearedStatusToJSON, } from './TransactionClearedStatus';
11
+ import { SaveSubTransactionFromJSON, SaveSubTransactionToJSON, } from './SaveSubTransaction';
18
12
  /**
19
13
  * Check if a given object implements the SaveTransactionWithOptionalFields interface.
20
14
  */
21
15
  export function instanceOfSaveTransactionWithOptionalFields(value) {
22
- var isInstance = true;
23
- return isInstance;
16
+ return true;
24
17
  }
25
18
  export function SaveTransactionWithOptionalFieldsFromJSON(json) {
26
19
  return SaveTransactionWithOptionalFieldsFromJSONTyped(json, false);
27
20
  }
28
21
  export function SaveTransactionWithOptionalFieldsFromJSONTyped(json, ignoreDiscriminator) {
29
- if ((json === undefined) || (json === null)) {
22
+ if (json == null) {
30
23
  return json;
31
24
  }
32
25
  return {
33
- 'account_id': !exists(json, 'account_id') ? undefined : json['account_id'],
34
- 'date': !exists(json, 'date') ? undefined : json['date'],
35
- 'amount': !exists(json, 'amount') ? undefined : json['amount'],
36
- 'payee_id': !exists(json, 'payee_id') ? undefined : json['payee_id'],
37
- 'payee_name': !exists(json, 'payee_name') ? undefined : json['payee_name'],
38
- 'category_id': !exists(json, 'category_id') ? undefined : json['category_id'],
39
- 'memo': !exists(json, 'memo') ? undefined : json['memo'],
40
- 'cleared': !exists(json, 'cleared') ? undefined : TransactionClearedStatusFromJSON(json['cleared']),
41
- 'approved': !exists(json, 'approved') ? undefined : json['approved'],
42
- 'flag_color': !exists(json, 'flag_color') ? undefined : TransactionFlagColorFromJSON(json['flag_color']),
43
- 'import_id': !exists(json, 'import_id') ? undefined : json['import_id'],
44
- 'subtransactions': !exists(json, 'subtransactions') ? undefined : (json['subtransactions'].map(SaveSubTransactionFromJSON)),
26
+ 'account_id': json['account_id'] == null ? undefined : json['account_id'],
27
+ 'date': json['date'] == null ? undefined : json['date'],
28
+ 'amount': json['amount'] == null ? undefined : json['amount'],
29
+ 'payee_id': json['payee_id'] == null ? undefined : json['payee_id'],
30
+ 'payee_name': json['payee_name'] == null ? undefined : json['payee_name'],
31
+ 'category_id': json['category_id'] == null ? undefined : json['category_id'],
32
+ 'memo': json['memo'] == null ? undefined : json['memo'],
33
+ 'cleared': json['cleared'] == null ? undefined : TransactionClearedStatusFromJSON(json['cleared']),
34
+ 'approved': json['approved'] == null ? undefined : json['approved'],
35
+ 'flag_color': json['flag_color'] == null ? undefined : TransactionFlagColorFromJSON(json['flag_color']),
36
+ 'subtransactions': json['subtransactions'] == null ? undefined : (json['subtransactions'].map(SaveSubTransactionFromJSON)),
45
37
  };
46
38
  }
47
39
  export function SaveTransactionWithOptionalFieldsToJSON(value) {
48
- if (value === undefined) {
49
- return undefined;
50
- }
51
- if (value === null) {
52
- return null;
40
+ if (value == null) {
41
+ return value;
53
42
  }
54
43
  return {
55
- 'account_id': value.account_id,
56
- 'date': value.date,
57
- 'amount': value.amount,
58
- 'payee_id': value.payee_id,
59
- 'payee_name': value.payee_name,
60
- 'category_id': value.category_id,
61
- 'memo': value.memo,
62
- 'cleared': TransactionClearedStatusToJSON(value.cleared),
63
- 'approved': value.approved,
64
- 'flag_color': TransactionFlagColorToJSON(value.flag_color),
65
- 'import_id': value.import_id,
66
- 'subtransactions': value.subtransactions === undefined ? undefined : (value.subtransactions.map(SaveSubTransactionToJSON)),
44
+ 'account_id': value['account_id'],
45
+ 'date': value['date'],
46
+ 'amount': value['amount'],
47
+ 'payee_id': value['payee_id'],
48
+ 'payee_name': value['payee_name'],
49
+ 'category_id': value['category_id'],
50
+ 'memo': value['memo'],
51
+ 'cleared': TransactionClearedStatusToJSON(value['cleared']),
52
+ 'approved': value['approved'],
53
+ 'flag_color': TransactionFlagColorToJSON(value['flag_color']),
54
+ 'subtransactions': value['subtransactions'] == null ? undefined : (value['subtransactions'].map(SaveSubTransactionToJSON)),
67
55
  };
68
56
  }
@@ -2,12 +2,7 @@
2
2
  * YNAB API Endpoints
3
3
  * 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.ynab.com
4
4
  *
5
- * The version of the OpenAPI document: 1.0.0
6
- *
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
5
+ * Generated by: OpenAPI Generator (https://openapi-generator.tech)
11
6
  */
12
7
  import type { SaveTransactionsResponseData } from './SaveTransactionsResponseData';
13
8
  /**
@@ -26,7 +21,7 @@ export interface SaveTransactionsResponse {
26
21
  /**
27
22
  * Check if a given object implements the SaveTransactionsResponse interface.
28
23
  */
29
- export declare function instanceOfSaveTransactionsResponse(value: object): boolean;
24
+ export declare function instanceOfSaveTransactionsResponse(value: object): value is SaveTransactionsResponse;
30
25
  export declare function SaveTransactionsResponseFromJSON(json: any): SaveTransactionsResponse;
31
26
  export declare function SaveTransactionsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SaveTransactionsResponse;
32
27
  export declare function SaveTransactionsResponseToJSON(value?: SaveTransactionsResponse | null): any;
@@ -4,27 +4,22 @@
4
4
  * YNAB API Endpoints
5
5
  * 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.ynab.com
6
6
  *
7
- * The version of the OpenAPI document: 1.0.0
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
7
+ * Generated by: OpenAPI Generator (https://openapi-generator.tech)
13
8
  */
14
9
  import { SaveTransactionsResponseDataFromJSON, SaveTransactionsResponseDataToJSON, } from './SaveTransactionsResponseData';
15
10
  /**
16
11
  * Check if a given object implements the SaveTransactionsResponse interface.
17
12
  */
18
13
  export function instanceOfSaveTransactionsResponse(value) {
19
- var isInstance = true;
20
- isInstance = isInstance && "data" in value;
21
- return isInstance;
14
+ if (!('data' in value) || value['data'] === undefined)
15
+ return false;
16
+ return true;
22
17
  }
23
18
  export function SaveTransactionsResponseFromJSON(json) {
24
19
  return SaveTransactionsResponseFromJSONTyped(json, false);
25
20
  }
26
21
  export function SaveTransactionsResponseFromJSONTyped(json, ignoreDiscriminator) {
27
- if ((json === undefined) || (json === null)) {
22
+ if (json == null) {
28
23
  return json;
29
24
  }
30
25
  return {
@@ -32,13 +27,10 @@ export function SaveTransactionsResponseFromJSONTyped(json, ignoreDiscriminator)
32
27
  };
33
28
  }
34
29
  export function SaveTransactionsResponseToJSON(value) {
35
- if (value === undefined) {
36
- return undefined;
37
- }
38
- if (value === null) {
39
- return null;
30
+ if (value == null) {
31
+ return value;
40
32
  }
41
33
  return {
42
- 'data': SaveTransactionsResponseDataToJSON(value.data),
34
+ 'data': SaveTransactionsResponseDataToJSON(value['data']),
43
35
  };
44
36
  }
@@ -2,12 +2,7 @@
2
2
  * YNAB API Endpoints
3
3
  * 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.ynab.com
4
4
  *
5
- * The version of the OpenAPI document: 1.0.0
6
- *
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
5
+ * Generated by: OpenAPI Generator (https://openapi-generator.tech)
11
6
  */
12
7
  import type { TransactionDetail } from './TransactionDetail';
13
8
  /**
@@ -50,7 +45,7 @@ export interface SaveTransactionsResponseData {
50
45
  /**
51
46
  * Check if a given object implements the SaveTransactionsResponseData interface.
52
47
  */
53
- export declare function instanceOfSaveTransactionsResponseData(value: object): boolean;
48
+ export declare function instanceOfSaveTransactionsResponseData(value: object): value is SaveTransactionsResponseData;
54
49
  export declare function SaveTransactionsResponseDataFromJSON(json: any): SaveTransactionsResponseData;
55
50
  export declare function SaveTransactionsResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): SaveTransactionsResponseData;
56
51
  export declare function SaveTransactionsResponseDataToJSON(value?: SaveTransactionsResponseData | null): any;
@@ -4,51 +4,43 @@
4
4
  * YNAB API Endpoints
5
5
  * 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.ynab.com
6
6
  *
7
- * The version of the OpenAPI document: 1.0.0
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
7
+ * Generated by: OpenAPI Generator (https://openapi-generator.tech)
13
8
  */
14
- import { exists } from '../runtime';
15
9
  import { TransactionDetailFromJSON, TransactionDetailToJSON, } from './TransactionDetail';
16
10
  /**
17
11
  * Check if a given object implements the SaveTransactionsResponseData interface.
18
12
  */
19
13
  export function instanceOfSaveTransactionsResponseData(value) {
20
- var isInstance = true;
21
- isInstance = isInstance && "transaction_ids" in value;
22
- isInstance = isInstance && "server_knowledge" in value;
23
- return isInstance;
14
+ if (!('transaction_ids' in value) || value['transaction_ids'] === undefined)
15
+ return false;
16
+ if (!('server_knowledge' in value) || value['server_knowledge'] === undefined)
17
+ return false;
18
+ return true;
24
19
  }
25
20
  export function SaveTransactionsResponseDataFromJSON(json) {
26
21
  return SaveTransactionsResponseDataFromJSONTyped(json, false);
27
22
  }
28
23
  export function SaveTransactionsResponseDataFromJSONTyped(json, ignoreDiscriminator) {
29
- if ((json === undefined) || (json === null)) {
24
+ if (json == null) {
30
25
  return json;
31
26
  }
32
27
  return {
33
28
  'transaction_ids': json['transaction_ids'],
34
- 'transaction': !exists(json, 'transaction') ? undefined : TransactionDetailFromJSON(json['transaction']),
35
- 'transactions': !exists(json, 'transactions') ? undefined : (json['transactions'].map(TransactionDetailFromJSON)),
36
- 'duplicate_import_ids': !exists(json, 'duplicate_import_ids') ? undefined : json['duplicate_import_ids'],
29
+ 'transaction': json['transaction'] == null ? undefined : TransactionDetailFromJSON(json['transaction']),
30
+ 'transactions': json['transactions'] == null ? undefined : (json['transactions'].map(TransactionDetailFromJSON)),
31
+ 'duplicate_import_ids': json['duplicate_import_ids'] == null ? undefined : json['duplicate_import_ids'],
37
32
  'server_knowledge': json['server_knowledge'],
38
33
  };
39
34
  }
40
35
  export function SaveTransactionsResponseDataToJSON(value) {
41
- if (value === undefined) {
42
- return undefined;
43
- }
44
- if (value === null) {
45
- return null;
36
+ if (value == null) {
37
+ return value;
46
38
  }
47
39
  return {
48
- 'transaction_ids': value.transaction_ids,
49
- 'transaction': TransactionDetailToJSON(value.transaction),
50
- 'transactions': value.transactions === undefined ? undefined : (value.transactions.map(TransactionDetailToJSON)),
51
- 'duplicate_import_ids': value.duplicate_import_ids,
52
- 'server_knowledge': value.server_knowledge,
40
+ 'transaction_ids': value['transaction_ids'],
41
+ 'transaction': TransactionDetailToJSON(value['transaction']),
42
+ 'transactions': value['transactions'] == null ? undefined : (value['transactions'].map(TransactionDetailToJSON)),
43
+ 'duplicate_import_ids': value['duplicate_import_ids'],
44
+ 'server_knowledge': value['server_knowledge'],
53
45
  };
54
46
  }