@getopenpay/client
Version:
OpenPay API TypeScript SDK
80 lines (79 loc) • 4.17 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.instanceOfSubscriptionQueryParams = instanceOfSubscriptionQueryParams;
exports.SubscriptionQueryParamsFromJSON = SubscriptionQueryParamsFromJSON;
exports.SubscriptionQueryParamsFromJSONTyped = SubscriptionQueryParamsFromJSONTyped;
exports.SubscriptionQueryParamsToJSON = SubscriptionQueryParamsToJSON;
exports.SubscriptionQueryParamsToJSONTyped = SubscriptionQueryParamsToJSONTyped;
const DateTimeFilter_1 = require("./DateTimeFilter");
const SearchFilter_1 = require("./SearchFilter");
const SubscriptionStatusEnum_1 = require("./SubscriptionStatusEnum");
/**
* Check if a given object implements the SubscriptionQueryParams interface.
*/
function instanceOfSubscriptionQueryParams(value) {
return true;
}
function SubscriptionQueryParamsFromJSON(json) {
return SubscriptionQueryParamsFromJSONTyped(json, false);
}
function SubscriptionQueryParamsFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'couponId': json['coupon_id'] == null ? undefined : json['coupon_id'],
'createdAt': json['created_at'] == null ? undefined : (0, DateTimeFilter_1.DateTimeFilterFromJSON)(json['created_at']),
'currentPeriodEnd': json['current_period_end'] == null ? undefined : (0, DateTimeFilter_1.DateTimeFilterFromJSON)(json['current_period_end']),
'currentPeriodStart': json['current_period_start'] == null ? undefined : (0, DateTimeFilter_1.DateTimeFilterFromJSON)(json['current_period_start']),
'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'],
'priceId': json['price_id'] == null ? undefined : json['price_id'],
'productId': json['product_id'] == null ? undefined : json['product_id'],
'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'],
'statuses': json['statuses'] == null ? undefined : (json['statuses'].map(SubscriptionStatusEnum_1.SubscriptionStatusEnumFromJSON)),
'updatedAt': json['updated_at'] == null ? undefined : (0, DateTimeFilter_1.DateTimeFilterFromJSON)(json['updated_at']),
};
}
function SubscriptionQueryParamsToJSON(json) {
return SubscriptionQueryParamsToJSONTyped(json, false);
}
function SubscriptionQueryParamsToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'coupon_id': value['couponId'],
'created_at': (0, DateTimeFilter_1.DateTimeFilterToJSON)(value['createdAt']),
'current_period_end': (0, DateTimeFilter_1.DateTimeFilterToJSON)(value['currentPeriodEnd']),
'current_period_start': (0, DateTimeFilter_1.DateTimeFilterToJSON)(value['currentPeriodStart']),
'customer_id': value['customerId'],
'expand': value['expand'],
'page_number': value['pageNumber'],
'page_size': value['pageSize'],
'price_id': value['priceId'],
'product_id': value['productId'],
'search': (0, SearchFilter_1.SearchFilterToJSON)(value['search']),
'sort_descending': value['sortDescending'],
'sort_key': value['sortKey'],
'statuses': value['statuses'] == null ? undefined : (value['statuses'].map(SubscriptionStatusEnum_1.SubscriptionStatusEnumToJSON)),
'updated_at': (0, DateTimeFilter_1.DateTimeFilterToJSON)(value['updatedAt']),
};
}