ynab
Version:
Official JavaScript client for the YNAB API. API documentation available at https://api.ynab.com. Generated from server specification version 1.85.0
58 lines (57 loc) • 2.41 kB
JavaScript
/* 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 MoneyMovementBase interface.
*/
export function instanceOfMoneyMovementBase(value) {
if (!('id' in value) || value['id'] === undefined)
return false;
if (!('amount' in value) || value['amount'] === undefined)
return false;
return true;
}
export function MoneyMovementBaseFromJSON(json) {
return MoneyMovementBaseFromJSONTyped(json, false);
}
export function MoneyMovementBaseFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'id': json['id'],
'month': json['month'] == null ? undefined : json['month'],
'moved_at': json['moved_at'] == null ? undefined : json['moved_at'],
'note': json['note'] == null ? undefined : json['note'],
'money_movement_group_id': json['money_movement_group_id'] == null ? undefined : json['money_movement_group_id'],
'performed_by_user_id': json['performed_by_user_id'] == null ? undefined : json['performed_by_user_id'],
'from_category_id': json['from_category_id'] == null ? undefined : json['from_category_id'],
'to_category_id': json['to_category_id'] == null ? undefined : json['to_category_id'],
'amount': json['amount'],
};
}
export function MoneyMovementBaseToJSON(json) {
return MoneyMovementBaseToJSONTyped(json, false);
}
export function MoneyMovementBaseToJSONTyped(value, ignoreDiscriminator) {
if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
if (value == null) {
return value;
}
return {
'id': value['id'],
'month': value['month'],
'moved_at': value['moved_at'],
'note': value['note'],
'money_movement_group_id': value['money_movement_group_id'],
'performed_by_user_id': value['performed_by_user_id'],
'from_category_id': value['from_category_id'],
'to_category_id': value['to_category_id'],
'amount': value['amount'],
};
}