@getopenpay/client
Version:
OpenPay API TypeScript SDK
90 lines (89 loc) • 5.02 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* OpenPay API
* super charge your subscription management.
*
* The version of the OpenAPI document: 1.2.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfInvoiceQueryParams = instanceOfInvoiceQueryParams;
exports.InvoiceQueryParamsFromJSON = InvoiceQueryParamsFromJSON;
exports.InvoiceQueryParamsFromJSONTyped = InvoiceQueryParamsFromJSONTyped;
exports.InvoiceQueryParamsToJSON = InvoiceQueryParamsToJSON;
exports.InvoiceQueryParamsToJSONTyped = InvoiceQueryParamsToJSONTyped;
const CollectionMethodEnum_1 = require("./CollectionMethodEnum");
const BillingReasonEnum_1 = require("./BillingReasonEnum");
const DateTimeFilter_1 = require("./DateTimeFilter");
const IntRangeFilter_1 = require("./IntRangeFilter");
const InvoiceStatusEnum_1 = require("./InvoiceStatusEnum");
const SearchFilter_1 = require("./SearchFilter");
const CurrencyEnum_1 = require("./CurrencyEnum");
/**
* Check if a given object implements the InvoiceQueryParams interface.
*/
function instanceOfInvoiceQueryParams(value) {
return true;
}
function InvoiceQueryParamsFromJSON(json) {
return InvoiceQueryParamsFromJSONTyped(json, false);
}
function InvoiceQueryParamsFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'billingReason': json['billing_reason'] == null ? undefined : (0, BillingReasonEnum_1.BillingReasonEnumFromJSON)(json['billing_reason']),
'collectionMethod': json['collection_method'] == null ? undefined : (0, CollectionMethodEnum_1.CollectionMethodEnumFromJSON)(json['collection_method']),
'couponId': json['coupon_id'] == null ? undefined : json['coupon_id'],
'createdAt': json['created_at'] == null ? undefined : (0, DateTimeFilter_1.DateTimeFilterFromJSON)(json['created_at']),
'currency': json['currency'] == null ? undefined : (0, CurrencyEnum_1.CurrencyEnumFromJSON)(json['currency']),
'customerId': json['customer_id'] == null ? undefined : json['customer_id'],
'expand': json['expand'] == null ? undefined : json['expand'],
'pageNumber': json['page_number'] == null ? undefined : json['page_number'],
'pageSize': json['page_size'] == null ? undefined : json['page_size'],
'periodEnd': json['period_end'] == null ? undefined : (0, DateTimeFilter_1.DateTimeFilterFromJSON)(json['period_end']),
'periodStart': json['period_start'] == null ? undefined : (0, DateTimeFilter_1.DateTimeFilterFromJSON)(json['period_start']),
'search': json['search'] == null ? undefined : (0, SearchFilter_1.SearchFilterFromJSON)(json['search']),
'sortDescending': json['sort_descending'] == null ? undefined : json['sort_descending'],
'sortKey': json['sort_key'] == null ? undefined : json['sort_key'],
'status': json['status'] == null ? undefined : (0, InvoiceStatusEnum_1.InvoiceStatusEnumFromJSON)(json['status']),
'subscriptionId': json['subscription_id'] == null ? undefined : json['subscription_id'],
'totalAmountAtom': json['total_amount_atom'] == null ? undefined : (0, IntRangeFilter_1.IntRangeFilterFromJSON)(json['total_amount_atom']),
'updatedAt': json['updated_at'] == null ? undefined : (0, DateTimeFilter_1.DateTimeFilterFromJSON)(json['updated_at']),
};
}
function InvoiceQueryParamsToJSON(json) {
return InvoiceQueryParamsToJSONTyped(json, false);
}
function InvoiceQueryParamsToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'billing_reason': (0, BillingReasonEnum_1.BillingReasonEnumToJSON)(value['billingReason']),
'collection_method': (0, CollectionMethodEnum_1.CollectionMethodEnumToJSON)(value['collectionMethod']),
'coupon_id': value['couponId'],
'created_at': (0, DateTimeFilter_1.DateTimeFilterToJSON)(value['createdAt']),
'currency': (0, CurrencyEnum_1.CurrencyEnumToJSON)(value['currency']),
'customer_id': value['customerId'],
'expand': value['expand'],
'page_number': value['pageNumber'],
'page_size': value['pageSize'],
'period_end': (0, DateTimeFilter_1.DateTimeFilterToJSON)(value['periodEnd']),
'period_start': (0, DateTimeFilter_1.DateTimeFilterToJSON)(value['periodStart']),
'search': (0, SearchFilter_1.SearchFilterToJSON)(value['search']),
'sort_descending': value['sortDescending'],
'sort_key': value['sortKey'],
'status': (0, InvoiceStatusEnum_1.InvoiceStatusEnumToJSON)(value['status']),
'subscription_id': value['subscriptionId'],
'total_amount_atom': (0, IntRangeFilter_1.IntRangeFilterToJSON)(value['totalAmountAtom']),
'updated_at': (0, DateTimeFilter_1.DateTimeFilterToJSON)(value['updatedAt']),
};
}