UNPKG

ynab

Version:

Official JavaScript client for the YNAB API. API documentation available at https://api.ynab.com. Generated from server specification version 1.76.0

61 lines (60 loc) 3.12 kB
/* tslint:disable */ /* eslint-disable */ /** * YNAB API Endpoints * 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 * * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ import { TransactionFlagColorFromJSON, TransactionFlagColorToJSON, } from './TransactionFlagColor'; import { TransactionClearedStatusFromJSON, TransactionClearedStatusToJSON, } from './TransactionClearedStatus'; import { SaveSubTransactionFromJSON, SaveSubTransactionToJSON, } from './SaveSubTransaction'; /** * Check if a given object implements the SaveTransactionWithOptionalFields interface. */ export function instanceOfSaveTransactionWithOptionalFields(value) { return true; } export function SaveTransactionWithOptionalFieldsFromJSON(json) { return SaveTransactionWithOptionalFieldsFromJSONTyped(json, false); } export function SaveTransactionWithOptionalFieldsFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'account_id': json['account_id'] == null ? undefined : json['account_id'], 'date': json['date'] == null ? undefined : json['date'], 'amount': json['amount'] == null ? undefined : json['amount'], 'payee_id': json['payee_id'] == null ? undefined : json['payee_id'], 'payee_name': json['payee_name'] == null ? undefined : json['payee_name'], 'category_id': json['category_id'] == null ? undefined : json['category_id'], 'memo': json['memo'] == null ? undefined : json['memo'], 'cleared': json['cleared'] == null ? undefined : TransactionClearedStatusFromJSON(json['cleared']), 'approved': json['approved'] == null ? undefined : json['approved'], 'flag_color': json['flag_color'] == null ? undefined : TransactionFlagColorFromJSON(json['flag_color']), 'subtransactions': json['subtransactions'] == null ? undefined : (json['subtransactions'].map(SaveSubTransactionFromJSON)), }; } export function SaveTransactionWithOptionalFieldsToJSON(json) { return SaveTransactionWithOptionalFieldsToJSONTyped(json, false); } export function SaveTransactionWithOptionalFieldsToJSONTyped(value, ignoreDiscriminator) { if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; } if (value == null) { return value; } return { 'account_id': value['account_id'], 'date': value['date'], 'amount': value['amount'], 'payee_id': value['payee_id'], 'payee_name': value['payee_name'], 'category_id': value['category_id'], 'memo': value['memo'], 'cleared': TransactionClearedStatusToJSON(value['cleared']), 'approved': value['approved'], 'flag_color': TransactionFlagColorToJSON(value['flag_color']), 'subtransactions': value['subtransactions'] == null ? undefined : (value['subtransactions'].map(SaveSubTransactionToJSON)), }; }