UNPKG

@getopenpay/client

Version:

OpenPay API TypeScript SDK

78 lines (77 loc) 3.84 kB
"use strict"; /* 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.instanceOfCouponQueryParams = instanceOfCouponQueryParams; exports.CouponQueryParamsFromJSON = CouponQueryParamsFromJSON; exports.CouponQueryParamsFromJSONTyped = CouponQueryParamsFromJSONTyped; exports.CouponQueryParamsToJSON = CouponQueryParamsToJSON; exports.CouponQueryParamsToJSONTyped = CouponQueryParamsToJSONTyped; const CouponDuration_1 = require("./CouponDuration"); const DateTimeFilter_1 = require("./DateTimeFilter"); const IntRangeFilter_1 = require("./IntRangeFilter"); const SearchFilter_1 = require("./SearchFilter"); const CurrencyEnum_1 = require("./CurrencyEnum"); /** * Check if a given object implements the CouponQueryParams interface. */ function instanceOfCouponQueryParams(value) { return true; } function CouponQueryParamsFromJSON(json) { return CouponQueryParamsFromJSONTyped(json, false); } function CouponQueryParamsFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'createdAt': json['created_at'] == null ? undefined : (0, DateTimeFilter_1.DateTimeFilterFromJSON)(json['created_at']), 'currency': json['currency'] == null ? undefined : (0, CurrencyEnum_1.CurrencyEnumFromJSON)(json['currency']), 'duration': json['duration'] == null ? undefined : (0, CouponDuration_1.CouponDurationFromJSON)(json['duration']), 'expand': json['expand'] == null ? undefined : json['expand'], 'isActive': json['is_active'] == null ? undefined : json['is_active'], 'maxRedemptions': json['max_redemptions'] == null ? undefined : (0, IntRangeFilter_1.IntRangeFilterFromJSON)(json['max_redemptions']), 'pageNumber': json['page_number'] == null ? undefined : json['page_number'], 'pageSize': json['page_size'] == null ? undefined : json['page_size'], 'redeemBy': json['redeem_by'] == null ? undefined : (0, DateTimeFilter_1.DateTimeFilterFromJSON)(json['redeem_by']), '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'], 'updatedAt': json['updated_at'] == null ? undefined : (0, DateTimeFilter_1.DateTimeFilterFromJSON)(json['updated_at']), }; } function CouponQueryParamsToJSON(json) { return CouponQueryParamsToJSONTyped(json, false); } function CouponQueryParamsToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'created_at': (0, DateTimeFilter_1.DateTimeFilterToJSON)(value['createdAt']), 'currency': (0, CurrencyEnum_1.CurrencyEnumToJSON)(value['currency']), 'duration': (0, CouponDuration_1.CouponDurationToJSON)(value['duration']), 'expand': value['expand'], 'is_active': value['isActive'], 'max_redemptions': (0, IntRangeFilter_1.IntRangeFilterToJSON)(value['maxRedemptions']), 'page_number': value['pageNumber'], 'page_size': value['pageSize'], 'redeem_by': (0, DateTimeFilter_1.DateTimeFilterToJSON)(value['redeemBy']), 'search': (0, SearchFilter_1.SearchFilterToJSON)(value['search']), 'sort_descending': value['sortDescending'], 'sort_key': value['sortKey'], 'updated_at': (0, DateTimeFilter_1.DateTimeFilterToJSON)(value['updatedAt']), }; }