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

66 lines (65 loc) 2.74 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) */ /** * Check if a given object implements the SubTransaction interface. */ export function instanceOfSubTransaction(value) { if (!('id' in value) || value['id'] === undefined) return false; if (!('transaction_id' in value) || value['transaction_id'] === undefined) return false; if (!('amount' in value) || value['amount'] === undefined) return false; if (!('deleted' in value) || value['deleted'] === undefined) return false; return true; } export function SubTransactionFromJSON(json) { return SubTransactionFromJSONTyped(json, false); } export function SubTransactionFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'id': json['id'], 'transaction_id': json['transaction_id'], 'amount': json['amount'], 'memo': json['memo'] == null ? undefined : json['memo'], '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'], 'category_name': json['category_name'] == null ? undefined : json['category_name'], 'transfer_account_id': json['transfer_account_id'] == null ? undefined : json['transfer_account_id'], 'transfer_transaction_id': json['transfer_transaction_id'] == null ? undefined : json['transfer_transaction_id'], 'deleted': json['deleted'], }; } export function SubTransactionToJSON(json) { return SubTransactionToJSONTyped(json, false); } export function SubTransactionToJSONTyped(value, ignoreDiscriminator) { if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; } if (value == null) { return value; } return { 'id': value['id'], 'transaction_id': value['transaction_id'], 'amount': value['amount'], 'memo': value['memo'], 'payee_id': value['payee_id'], 'payee_name': value['payee_name'], 'category_id': value['category_id'], 'category_name': value['category_name'], 'transfer_account_id': value['transfer_account_id'], 'transfer_transaction_id': value['transfer_transaction_id'], 'deleted': value['deleted'], }; }