ynab 2.0.0 → 2.2.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 (90) hide show
  1. package/README.md +2 -2
  2. package/dist/apis/CategoriesApi.d.ts +16 -1
  3. package/dist/apis/CategoriesApi.js +42 -0
  4. package/dist/apis/CustomTransactionsApi.d.ts +1 -1
  5. package/dist/apis/TransactionsApi.d.ts +4 -4
  6. package/dist/apis/index.d.ts +0 -1
  7. package/dist/apis/index.js +5 -2
  8. package/dist/browser/ynab.js +1 -1
  9. package/dist/esm/apis/CategoriesApi.d.ts +16 -1
  10. package/dist/esm/apis/CategoriesApi.js +65 -1
  11. package/dist/esm/apis/CustomTransactionsApi.d.ts +1 -1
  12. package/dist/esm/apis/index.d.ts +0 -1
  13. package/dist/esm/apis/index.js +0 -1
  14. package/dist/esm/models/Category.d.ts +0 -1
  15. package/dist/esm/models/Category.js +0 -1
  16. package/dist/esm/models/CategoryGoalType.d.ts +25 -0
  17. package/dist/esm/models/CategoryGoalType.js +29 -0
  18. package/dist/esm/models/HybridTransaction.d.ts +9 -30
  19. package/dist/esm/models/HybridTransaction.js +7 -26
  20. package/dist/esm/models/PatchCategoryWrapper.d.ts +32 -0
  21. package/dist/esm/models/PatchCategoryWrapper.js +44 -0
  22. package/dist/esm/models/SaveCategory.d.ts +43 -0
  23. package/dist/esm/models/SaveCategory.js +47 -0
  24. package/dist/esm/models/SaveTransaction.d.ts +8 -28
  25. package/dist/esm/models/SaveTransaction.js +6 -24
  26. package/dist/esm/models/SaveTransactionWithId.d.ts +8 -28
  27. package/dist/esm/models/SaveTransactionWithId.js +6 -24
  28. package/dist/esm/models/SaveTransactionWithOptionalFields.d.ts +8 -28
  29. package/dist/esm/models/SaveTransactionWithOptionalFields.js +6 -24
  30. package/dist/esm/models/SaveTransactionWithOptionalFieldsFlagColor.d.ts +25 -0
  31. package/dist/esm/models/SaveTransactionWithOptionalFieldsFlagColor.js +29 -0
  32. package/dist/esm/models/ScheduledTransactionDetail.d.ts +4 -16
  33. package/dist/esm/models/ScheduledTransactionDetail.js +3 -14
  34. package/dist/esm/models/ScheduledTransactionSummary.d.ts +4 -16
  35. package/dist/esm/models/ScheduledTransactionSummary.js +3 -14
  36. package/dist/esm/models/ScheduledTransactionSummaryFlagColor.d.ts +25 -0
  37. package/dist/esm/models/ScheduledTransactionSummaryFlagColor.js +29 -0
  38. package/dist/esm/models/TransactionClearedStatus.d.ts +24 -0
  39. package/dist/esm/models/TransactionClearedStatus.js +31 -0
  40. package/dist/esm/models/TransactionDetail.d.ts +9 -30
  41. package/dist/esm/models/TransactionDetail.js +7 -26
  42. package/dist/esm/models/TransactionFlagColor.d.ts +27 -0
  43. package/dist/esm/models/TransactionFlagColor.js +34 -0
  44. package/dist/esm/models/TransactionSummary.d.ts +9 -30
  45. package/dist/esm/models/TransactionSummary.js +7 -26
  46. package/dist/esm/models/TransactionSummaryDebtTransactionType.d.ts +25 -0
  47. package/dist/esm/models/TransactionSummaryDebtTransactionType.js +29 -0
  48. package/dist/esm/models/index.d.ts +4 -0
  49. package/dist/esm/models/index.js +4 -0
  50. package/dist/index.js +5 -1
  51. package/dist/models/AccountType.d.ts +1 -1
  52. package/dist/models/Category.d.ts +1 -2
  53. package/dist/models/Category.js +0 -1
  54. package/dist/models/CategoryGoalType.d.ts +25 -0
  55. package/dist/models/CategoryGoalType.js +36 -0
  56. package/dist/models/HybridTransaction.d.ts +11 -32
  57. package/dist/models/HybridTransaction.js +8 -27
  58. package/dist/models/HybridTransactionAllOf.d.ts +1 -1
  59. package/dist/models/PatchCategoryWrapper.d.ts +32 -0
  60. package/dist/models/PatchCategoryWrapper.js +51 -0
  61. package/dist/models/SaveCategory.d.ts +43 -0
  62. package/dist/models/SaveCategory.js +54 -0
  63. package/dist/models/SaveTransaction.d.ts +8 -28
  64. package/dist/models/SaveTransaction.js +7 -25
  65. package/dist/models/SaveTransactionWithId.d.ts +8 -28
  66. package/dist/models/SaveTransactionWithId.js +7 -25
  67. package/dist/models/SaveTransactionWithOptionalFields.d.ts +8 -28
  68. package/dist/models/SaveTransactionWithOptionalFields.js +7 -25
  69. package/dist/models/SaveTransactionWithOptionalFieldsFlagColor.d.ts +25 -0
  70. package/dist/models/SaveTransactionWithOptionalFieldsFlagColor.js +36 -0
  71. package/dist/models/ScheduledTransactionDetail.d.ts +5 -17
  72. package/dist/models/ScheduledTransactionDetail.js +4 -15
  73. package/dist/models/ScheduledTransactionSummary.d.ts +5 -17
  74. package/dist/models/ScheduledTransactionSummary.js +4 -15
  75. package/dist/models/ScheduledTransactionSummaryFlagColor.d.ts +25 -0
  76. package/dist/models/ScheduledTransactionSummaryFlagColor.js +36 -0
  77. package/dist/models/TransactionClearedStatus.d.ts +24 -0
  78. package/dist/models/TransactionClearedStatus.js +37 -0
  79. package/dist/models/TransactionDetail.d.ts +10 -31
  80. package/dist/models/TransactionDetail.js +8 -27
  81. package/dist/models/TransactionFlagColor.d.ts +27 -0
  82. package/dist/models/TransactionFlagColor.js +40 -0
  83. package/dist/models/TransactionSummary.d.ts +10 -31
  84. package/dist/models/TransactionSummary.js +8 -27
  85. package/dist/models/TransactionSummaryDebtTransactionType.d.ts +25 -0
  86. package/dist/models/TransactionSummaryDebtTransactionType.js +36 -0
  87. package/dist/models/index.d.ts +4 -0
  88. package/dist/models/index.js +9 -1
  89. package/dist/runtime.d.ts +9 -9
  90. package/package.json +6 -7
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { CategoriesResponse, CategoryResponse, PatchMonthCategoryWrapper, SaveCategoryResponse } from '../models/index';
13
+ import type { CategoriesResponse, CategoryResponse, PatchCategoryWrapper, PatchMonthCategoryWrapper, SaveCategoryResponse } from '../models/index';
14
14
  export interface GetCategoriesRequest {
15
15
  budgetId: string;
16
16
  lastKnowledgeOfServer?: number;
@@ -24,6 +24,11 @@ export interface GetMonthCategoryByIdRequest {
24
24
  month: string;
25
25
  categoryId: string;
26
26
  }
27
+ export interface UpdateCategoryRequest {
28
+ budgetId: string;
29
+ categoryId: string;
30
+ data: PatchCategoryWrapper;
31
+ }
27
32
  export interface UpdateMonthCategoryRequest {
28
33
  budgetId: string;
29
34
  month: string;
@@ -64,6 +69,16 @@ export declare class CategoriesApi extends runtime.BaseAPI {
64
69
  * Single category for a specific budget month
65
70
  */
66
71
  getMonthCategoryById(budgetId: string, month: string, categoryId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CategoryResponse>;
72
+ /**
73
+ * Update a category
74
+ * Update a category
75
+ */
76
+ updateCategoryRaw(requestParameters: UpdateCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SaveCategoryResponse>>;
77
+ /**
78
+ * Update a category
79
+ * Update a category
80
+ */
81
+ updateCategory(budgetId: string, categoryId: string, data: PatchCategoryWrapper, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SaveCategoryResponse>;
67
82
  /**
68
83
  * Update a category for a specific month. Only `budgeted` amount can be updated.
69
84
  * Update a category for a specific month
@@ -63,7 +63,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
63
63
  }
64
64
  };
65
65
  import * as runtime from '../runtime';
66
- import { CategoriesResponseFromJSON, CategoryResponseFromJSON, PatchMonthCategoryWrapperToJSON, SaveCategoryResponseFromJSON, } from '../models/index';
66
+ import { CategoriesResponseFromJSON, CategoryResponseFromJSON, PatchCategoryWrapperToJSON, PatchMonthCategoryWrapperToJSON, SaveCategoryResponseFromJSON, } from '../models/index';
67
67
  /**
68
68
  *
69
69
  */
@@ -252,6 +252,70 @@ var CategoriesApi = /** @class */ (function (_super) {
252
252
  });
253
253
  });
254
254
  };
255
+ /**
256
+ * Update a category
257
+ * Update a category
258
+ */
259
+ CategoriesApi.prototype.updateCategoryRaw = function (requestParameters, initOverrides) {
260
+ return __awaiter(this, void 0, void 0, function () {
261
+ var queryParameters, headerParameters, token, tokenString, response;
262
+ return __generator(this, function (_a) {
263
+ switch (_a.label) {
264
+ case 0:
265
+ if (requestParameters.budgetId === null || requestParameters.budgetId === undefined) {
266
+ throw new runtime.RequiredError('budgetId', 'Required parameter requestParameters.budgetId was null or undefined when calling updateCategory.');
267
+ }
268
+ if (requestParameters.categoryId === null || requestParameters.categoryId === undefined) {
269
+ throw new runtime.RequiredError('categoryId', 'Required parameter requestParameters.categoryId was null or undefined when calling updateCategory.');
270
+ }
271
+ if (requestParameters.data === null || requestParameters.data === undefined) {
272
+ throw new runtime.RequiredError('data', 'Required parameter requestParameters.data was null or undefined when calling updateCategory.');
273
+ }
274
+ queryParameters = {};
275
+ headerParameters = {};
276
+ headerParameters['Accept'] = 'application/json';
277
+ headerParameters['Content-Type'] = 'application/json';
278
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
279
+ token = this.configuration.accessToken;
280
+ return [4 /*yield*/, token("bearer", [])];
281
+ case 1:
282
+ tokenString = _a.sent();
283
+ if (tokenString) {
284
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
285
+ }
286
+ _a.label = 2;
287
+ case 2: return [4 /*yield*/, this.request({
288
+ path: "/budgets/{budget_id}/categories/{category_id}".replace("{".concat("budget_id", "}"), encodeURIComponent(String(requestParameters.budgetId))).replace("{".concat("category_id", "}"), encodeURIComponent(String(requestParameters.categoryId))),
289
+ method: 'PATCH',
290
+ headers: headerParameters,
291
+ query: queryParameters,
292
+ body: PatchCategoryWrapperToJSON(requestParameters.data),
293
+ }, initOverrides)];
294
+ case 3:
295
+ response = _a.sent();
296
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return SaveCategoryResponseFromJSON(jsonValue); })];
297
+ }
298
+ });
299
+ });
300
+ };
301
+ /**
302
+ * Update a category
303
+ * Update a category
304
+ */
305
+ CategoriesApi.prototype.updateCategory = function (budgetId, categoryId, data, initOverrides) {
306
+ return __awaiter(this, void 0, void 0, function () {
307
+ var response;
308
+ return __generator(this, function (_a) {
309
+ switch (_a.label) {
310
+ case 0: return [4 /*yield*/, this.updateCategoryRaw({ budgetId: budgetId, categoryId: categoryId, data: data }, initOverrides)];
311
+ case 1:
312
+ response = _a.sent();
313
+ return [4 /*yield*/, response.value()];
314
+ case 2: return [2 /*return*/, _a.sent()];
315
+ }
316
+ });
317
+ });
318
+ };
255
319
  /**
256
320
  * Update a category for a specific month. Only `budgeted` amount can be updated.
257
321
  * Update a category for a specific month
@@ -25,7 +25,7 @@ export declare class CustomTransactionsApi extends TransactionsApi {
25
25
  * @throws {RequiredError}
26
26
  * @memberof TransactionsApi
27
27
  */
28
- getTransactionsByType(budgetId: string, type: "uncategorized" | "unapproved", lastKnowledgeOfServer?: number, options?: any): Promise<import("..").TransactionsResponse>;
28
+ getTransactionsByType(budgetId: string, type: "uncategorized" | "unapproved" | undefined, lastKnowledgeOfServer?: number, options?: any): Promise<import("..").TransactionsResponse>;
29
29
  /**
30
30
  * Creates multiple transactions. Provide a body containing a 'transactions' array, multiple transactions will be created.
31
31
  * @summary Create a single transaction or multiple transactions
@@ -1,7 +1,6 @@
1
1
  export * from './AccountsApi';
2
2
  export * from './BudgetsApi';
3
3
  export * from './CategoriesApi';
4
- export * from './DeprecatedApi';
5
4
  export * from './MonthsApi';
6
5
  export * from './PayeeLocationsApi';
7
6
  export * from './PayeesApi';
@@ -3,7 +3,6 @@
3
3
  export * from './AccountsApi';
4
4
  export * from './BudgetsApi';
5
5
  export * from './CategoriesApi';
6
- export * from './DeprecatedApi';
7
6
  export * from './MonthsApi';
8
7
  export * from './PayeeLocationsApi';
9
8
  export * from './PayeesApi';
@@ -163,7 +163,6 @@ export declare const CategoryGoalTypeEnum: {
163
163
  readonly Mf: "MF";
164
164
  readonly Need: "NEED";
165
165
  readonly Debt: "DEBT";
166
- readonly Null: "null";
167
166
  };
168
167
  export declare type CategoryGoalTypeEnum = typeof CategoryGoalTypeEnum[keyof typeof CategoryGoalTypeEnum];
169
168
  /**
@@ -21,7 +21,6 @@ export var CategoryGoalTypeEnum = {
21
21
  Mf: 'MF',
22
22
  Need: 'NEED',
23
23
  Debt: 'DEBT',
24
- Null: 'null'
25
24
  };
26
25
  /**
27
26
  * Check if a given object implements the Category interface.
@@ -0,0 +1,25 @@
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
+ * 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.
11
+ */
12
+ /**
13
+ * The type of goal, if the category has a goal (TB='Target Category Balance', TBD='Target Category Balance by Date', MF='Monthly Funding', NEED='Plan Your Spending')
14
+ * @export
15
+ * @interface CategoryGoalType
16
+ */
17
+ export interface CategoryGoalType {
18
+ }
19
+ /**
20
+ * Check if a given object implements the CategoryGoalType interface.
21
+ */
22
+ export declare function instanceOfCategoryGoalType(value: object): boolean;
23
+ export declare function CategoryGoalTypeFromJSON(json: any): CategoryGoalType;
24
+ export declare function CategoryGoalTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): CategoryGoalType;
25
+ export declare function CategoryGoalTypeToJSON(value?: CategoryGoalType | null): any;
@@ -0,0 +1,29 @@
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
+ * 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.
13
+ */
14
+ /**
15
+ * Check if a given object implements the CategoryGoalType interface.
16
+ */
17
+ export function instanceOfCategoryGoalType(value) {
18
+ var isInstance = true;
19
+ return isInstance;
20
+ }
21
+ export function CategoryGoalTypeFromJSON(json) {
22
+ return CategoryGoalTypeFromJSONTyped(json, false);
23
+ }
24
+ export function CategoryGoalTypeFromJSONTyped(json, ignoreDiscriminator) {
25
+ return json;
26
+ }
27
+ export function CategoryGoalTypeToJSON(value) {
28
+ return value;
29
+ }
@@ -9,6 +9,8 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { TransactionClearedStatus } from './TransactionClearedStatus';
13
+ import type { TransactionFlagColor } from './TransactionFlagColor';
12
14
  /**
13
15
  *
14
16
  * @export
@@ -40,11 +42,11 @@ export interface HybridTransaction {
40
42
  */
41
43
  memo?: string | null;
42
44
  /**
43
- * The cleared status of the transaction
44
- * @type {string}
45
+ *
46
+ * @type {TransactionClearedStatus}
45
47
  * @memberof HybridTransaction
46
48
  */
47
- cleared: HybridTransactionClearedEnum;
49
+ cleared: TransactionClearedStatus;
48
50
  /**
49
51
  * Whether or not the transaction is approved
50
52
  * @type {boolean}
@@ -52,11 +54,11 @@ export interface HybridTransaction {
52
54
  */
53
55
  approved: boolean;
54
56
  /**
55
- * The transaction flag
56
- * @type {string}
57
+ *
58
+ * @type {TransactionFlagColor}
57
59
  * @memberof HybridTransaction
58
60
  */
59
- flag_color?: HybridTransactionFlagColorEnum;
61
+ flag_color?: TransactionFlagColor | null;
60
62
  /**
61
63
  *
62
64
  * @type {string}
@@ -154,28 +156,6 @@ export interface HybridTransaction {
154
156
  */
155
157
  category_name?: string;
156
158
  }
157
- /**
158
- * @export
159
- */
160
- export declare const HybridTransactionClearedEnum: {
161
- readonly Cleared: "cleared";
162
- readonly Uncleared: "uncleared";
163
- readonly Reconciled: "reconciled";
164
- };
165
- export declare type HybridTransactionClearedEnum = typeof HybridTransactionClearedEnum[keyof typeof HybridTransactionClearedEnum];
166
- /**
167
- * @export
168
- */
169
- export declare const HybridTransactionFlagColorEnum: {
170
- readonly Red: "red";
171
- readonly Orange: "orange";
172
- readonly Yellow: "yellow";
173
- readonly Green: "green";
174
- readonly Blue: "blue";
175
- readonly Purple: "purple";
176
- readonly Null: "null";
177
- };
178
- export declare type HybridTransactionFlagColorEnum = typeof HybridTransactionFlagColorEnum[keyof typeof HybridTransactionFlagColorEnum];
179
159
  /**
180
160
  * @export
181
161
  */
@@ -185,10 +165,9 @@ export declare const HybridTransactionDebtTransactionTypeEnum: {
185
165
  readonly Fee: "fee";
186
166
  readonly Interest: "interest";
187
167
  readonly Escrow: "escrow";
188
- readonly BalancedAdjustment: "balancedAdjustment";
168
+ readonly BalanceAdjustment: "balanceAdjustment";
189
169
  readonly Credit: "credit";
190
170
  readonly Charge: "charge";
191
- readonly Null: "null";
192
171
  };
193
172
  export declare type HybridTransactionDebtTransactionTypeEnum = typeof HybridTransactionDebtTransactionTypeEnum[keyof typeof HybridTransactionDebtTransactionTypeEnum];
194
173
  /**
@@ -12,26 +12,8 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  import { exists } from '../runtime';
15
- /**
16
- * @export
17
- */
18
- export var HybridTransactionClearedEnum = {
19
- Cleared: 'cleared',
20
- Uncleared: 'uncleared',
21
- Reconciled: 'reconciled'
22
- };
23
- /**
24
- * @export
25
- */
26
- export var HybridTransactionFlagColorEnum = {
27
- Red: 'red',
28
- Orange: 'orange',
29
- Yellow: 'yellow',
30
- Green: 'green',
31
- Blue: 'blue',
32
- Purple: 'purple',
33
- Null: 'null'
34
- };
15
+ import { TransactionClearedStatusFromJSON, TransactionClearedStatusToJSON, } from './TransactionClearedStatus';
16
+ import { TransactionFlagColorFromJSON, TransactionFlagColorToJSON, } from './TransactionFlagColor';
35
17
  /**
36
18
  * @export
37
19
  */
@@ -41,10 +23,9 @@ export var HybridTransactionDebtTransactionTypeEnum = {
41
23
  Fee: 'fee',
42
24
  Interest: 'interest',
43
25
  Escrow: 'escrow',
44
- BalancedAdjustment: 'balancedAdjustment',
26
+ BalanceAdjustment: 'balanceAdjustment',
45
27
  Credit: 'credit',
46
28
  Charge: 'charge',
47
- Null: 'null'
48
29
  };
49
30
  /**
50
31
  * @export
@@ -81,9 +62,9 @@ export function HybridTransactionFromJSONTyped(json, ignoreDiscriminator) {
81
62
  'date': json['date'],
82
63
  'amount': json['amount'],
83
64
  'memo': !exists(json, 'memo') ? undefined : json['memo'],
84
- 'cleared': json['cleared'],
65
+ 'cleared': TransactionClearedStatusFromJSON(json['cleared']),
85
66
  'approved': json['approved'],
86
- 'flag_color': !exists(json, 'flag_color') ? undefined : json['flag_color'],
67
+ 'flag_color': !exists(json, 'flag_color') ? undefined : TransactionFlagColorFromJSON(json['flag_color']),
87
68
  'account_id': json['account_id'],
88
69
  'payee_id': !exists(json, 'payee_id') ? undefined : json['payee_id'],
89
70
  'category_id': !exists(json, 'category_id') ? undefined : json['category_id'],
@@ -114,9 +95,9 @@ export function HybridTransactionToJSON(value) {
114
95
  'date': value.date,
115
96
  'amount': value.amount,
116
97
  'memo': value.memo,
117
- 'cleared': value.cleared,
98
+ 'cleared': TransactionClearedStatusToJSON(value.cleared),
118
99
  'approved': value.approved,
119
- 'flag_color': value.flag_color,
100
+ 'flag_color': TransactionFlagColorToJSON(value.flag_color),
120
101
  'account_id': value.account_id,
121
102
  'payee_id': value.payee_id,
122
103
  'category_id': value.category_id,
@@ -0,0 +1,32 @@
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
+ * 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.
11
+ */
12
+ import type { SaveCategory } from './SaveCategory';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface PatchCategoryWrapper
17
+ */
18
+ export interface PatchCategoryWrapper {
19
+ /**
20
+ *
21
+ * @type {SaveCategory}
22
+ * @memberof PatchCategoryWrapper
23
+ */
24
+ category: SaveCategory;
25
+ }
26
+ /**
27
+ * Check if a given object implements the PatchCategoryWrapper interface.
28
+ */
29
+ export declare function instanceOfPatchCategoryWrapper(value: object): boolean;
30
+ export declare function PatchCategoryWrapperFromJSON(json: any): PatchCategoryWrapper;
31
+ export declare function PatchCategoryWrapperFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchCategoryWrapper;
32
+ export declare function PatchCategoryWrapperToJSON(value?: PatchCategoryWrapper | null): any;
@@ -0,0 +1,44 @@
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
+ * 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.
13
+ */
14
+ import { SaveCategoryFromJSON, SaveCategoryToJSON, } from './SaveCategory';
15
+ /**
16
+ * Check if a given object implements the PatchCategoryWrapper interface.
17
+ */
18
+ export function instanceOfPatchCategoryWrapper(value) {
19
+ var isInstance = true;
20
+ isInstance = isInstance && "category" in value;
21
+ return isInstance;
22
+ }
23
+ export function PatchCategoryWrapperFromJSON(json) {
24
+ return PatchCategoryWrapperFromJSONTyped(json, false);
25
+ }
26
+ export function PatchCategoryWrapperFromJSONTyped(json, ignoreDiscriminator) {
27
+ if ((json === undefined) || (json === null)) {
28
+ return json;
29
+ }
30
+ return {
31
+ 'category': SaveCategoryFromJSON(json['category']),
32
+ };
33
+ }
34
+ export function PatchCategoryWrapperToJSON(value) {
35
+ if (value === undefined) {
36
+ return undefined;
37
+ }
38
+ if (value === null) {
39
+ return null;
40
+ }
41
+ return {
42
+ 'category': SaveCategoryToJSON(value.category),
43
+ };
44
+ }
@@ -0,0 +1,43 @@
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
+ * 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.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface SaveCategory
16
+ */
17
+ export interface SaveCategory {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof SaveCategory
22
+ */
23
+ name?: string | null;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof SaveCategory
28
+ */
29
+ note?: string | null;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof SaveCategory
34
+ */
35
+ category_group_id?: string;
36
+ }
37
+ /**
38
+ * Check if a given object implements the SaveCategory interface.
39
+ */
40
+ export declare function instanceOfSaveCategory(value: object): boolean;
41
+ export declare function SaveCategoryFromJSON(json: any): SaveCategory;
42
+ export declare function SaveCategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): SaveCategory;
43
+ export declare function SaveCategoryToJSON(value?: SaveCategory | null): any;
@@ -0,0 +1,47 @@
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
+ * 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.
13
+ */
14
+ import { exists } from '../runtime';
15
+ /**
16
+ * Check if a given object implements the SaveCategory interface.
17
+ */
18
+ export function instanceOfSaveCategory(value) {
19
+ var isInstance = true;
20
+ return isInstance;
21
+ }
22
+ export function SaveCategoryFromJSON(json) {
23
+ return SaveCategoryFromJSONTyped(json, false);
24
+ }
25
+ export function SaveCategoryFromJSONTyped(json, ignoreDiscriminator) {
26
+ if ((json === undefined) || (json === null)) {
27
+ return json;
28
+ }
29
+ return {
30
+ 'name': !exists(json, 'name') ? undefined : json['name'],
31
+ 'note': !exists(json, 'note') ? undefined : json['note'],
32
+ 'category_group_id': !exists(json, 'category_group_id') ? undefined : json['category_group_id'],
33
+ };
34
+ }
35
+ export function SaveCategoryToJSON(value) {
36
+ if (value === undefined) {
37
+ return undefined;
38
+ }
39
+ if (value === null) {
40
+ return null;
41
+ }
42
+ return {
43
+ 'name': value.name,
44
+ 'note': value.note,
45
+ 'category_group_id': value.category_group_id,
46
+ };
47
+ }
@@ -10,6 +10,8 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import type { SaveSubTransaction } from './SaveSubTransaction';
13
+ import type { TransactionClearedStatus } from './TransactionClearedStatus';
14
+ import type { TransactionFlagColor } from './TransactionFlagColor';
13
15
  /**
14
16
  *
15
17
  * @export
@@ -59,11 +61,11 @@ export interface SaveTransaction {
59
61
  */
60
62
  memo?: string | null;
61
63
  /**
62
- * The cleared status of the transaction
63
- * @type {string}
64
+ *
65
+ * @type {TransactionClearedStatus}
64
66
  * @memberof SaveTransaction
65
67
  */
66
- cleared?: SaveTransactionClearedEnum;
68
+ cleared?: TransactionClearedStatus;
67
69
  /**
68
70
  * Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default.
69
71
  * @type {boolean}
@@ -71,11 +73,11 @@ export interface SaveTransaction {
71
73
  */
72
74
  approved?: boolean;
73
75
  /**
74
- * The transaction flag
75
- * @type {string}
76
+ *
77
+ * @type {TransactionFlagColor}
76
78
  * @memberof SaveTransaction
77
79
  */
78
- flag_color?: SaveTransactionFlagColorEnum;
80
+ flag_color?: TransactionFlagColor | null;
79
81
  /**
80
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).
81
83
  * @type {string}
@@ -89,28 +91,6 @@ export interface SaveTransaction {
89
91
  */
90
92
  subtransactions?: Array<SaveSubTransaction>;
91
93
  }
92
- /**
93
- * @export
94
- */
95
- export declare const SaveTransactionClearedEnum: {
96
- readonly Cleared: "cleared";
97
- readonly Uncleared: "uncleared";
98
- readonly Reconciled: "reconciled";
99
- };
100
- export declare type SaveTransactionClearedEnum = typeof SaveTransactionClearedEnum[keyof typeof SaveTransactionClearedEnum];
101
- /**
102
- * @export
103
- */
104
- export declare const SaveTransactionFlagColorEnum: {
105
- readonly Red: "red";
106
- readonly Orange: "orange";
107
- readonly Yellow: "yellow";
108
- readonly Green: "green";
109
- readonly Blue: "blue";
110
- readonly Purple: "purple";
111
- readonly Null: "null";
112
- };
113
- export declare type SaveTransactionFlagColorEnum = typeof SaveTransactionFlagColorEnum[keyof typeof SaveTransactionFlagColorEnum];
114
94
  /**
115
95
  * Check if a given object implements the SaveTransaction interface.
116
96
  */
@@ -13,26 +13,8 @@
13
13
  */
14
14
  import { exists } from '../runtime';
15
15
  import { SaveSubTransactionFromJSON, SaveSubTransactionToJSON, } from './SaveSubTransaction';
16
- /**
17
- * @export
18
- */
19
- export var SaveTransactionClearedEnum = {
20
- Cleared: 'cleared',
21
- Uncleared: 'uncleared',
22
- Reconciled: 'reconciled'
23
- };
24
- /**
25
- * @export
26
- */
27
- export var SaveTransactionFlagColorEnum = {
28
- Red: 'red',
29
- Orange: 'orange',
30
- Yellow: 'yellow',
31
- Green: 'green',
32
- Blue: 'blue',
33
- Purple: 'purple',
34
- Null: 'null'
35
- };
16
+ import { TransactionClearedStatusFromJSON, TransactionClearedStatusToJSON, } from './TransactionClearedStatus';
17
+ import { TransactionFlagColorFromJSON, TransactionFlagColorToJSON, } from './TransactionFlagColor';
36
18
  /**
37
19
  * Check if a given object implements the SaveTransaction interface.
38
20
  */
@@ -55,9 +37,9 @@ export function SaveTransactionFromJSONTyped(json, ignoreDiscriminator) {
55
37
  'payee_name': !exists(json, 'payee_name') ? undefined : json['payee_name'],
56
38
  'category_id': !exists(json, 'category_id') ? undefined : json['category_id'],
57
39
  'memo': !exists(json, 'memo') ? undefined : json['memo'],
58
- 'cleared': !exists(json, 'cleared') ? undefined : json['cleared'],
40
+ 'cleared': !exists(json, 'cleared') ? undefined : TransactionClearedStatusFromJSON(json['cleared']),
59
41
  'approved': !exists(json, 'approved') ? undefined : json['approved'],
60
- 'flag_color': !exists(json, 'flag_color') ? undefined : json['flag_color'],
42
+ 'flag_color': !exists(json, 'flag_color') ? undefined : TransactionFlagColorFromJSON(json['flag_color']),
61
43
  'import_id': !exists(json, 'import_id') ? undefined : json['import_id'],
62
44
  'subtransactions': !exists(json, 'subtransactions') ? undefined : (json['subtransactions'].map(SaveSubTransactionFromJSON)),
63
45
  };
@@ -77,9 +59,9 @@ export function SaveTransactionToJSON(value) {
77
59
  'payee_name': value.payee_name,
78
60
  'category_id': value.category_id,
79
61
  'memo': value.memo,
80
- 'cleared': value.cleared,
62
+ 'cleared': TransactionClearedStatusToJSON(value.cleared),
81
63
  'approved': value.approved,
82
- 'flag_color': value.flag_color,
64
+ 'flag_color': TransactionFlagColorToJSON(value.flag_color),
83
65
  'import_id': value.import_id,
84
66
  'subtransactions': value.subtransactions === undefined ? undefined : (value.subtransactions.map(SaveSubTransactionToJSON)),
85
67
  };