@getopenpay/client
Version:
OpenPay API TypeScript SDK
100 lines (99 loc) • 5.89 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.instanceOfUpdatePriceRequest = instanceOfUpdatePriceRequest;
exports.UpdatePriceRequestFromJSON = UpdatePriceRequestFromJSON;
exports.UpdatePriceRequestFromJSONTyped = UpdatePriceRequestFromJSONTyped;
exports.UpdatePriceRequestToJSON = UpdatePriceRequestToJSON;
exports.UpdatePriceRequestToJSONTyped = UpdatePriceRequestToJSONTyped;
const PriceTypeEnum_1 = require("./PriceTypeEnum");
const UsageAggMethodEnum_1 = require("./UsageAggMethodEnum");
const CalendarIntervalEnum_1 = require("./CalendarIntervalEnum");
const PriceTierParams_1 = require("./PriceTierParams");
const UsageTypeEnum_1 = require("./UsageTypeEnum");
const CurrencyEnum_1 = require("./CurrencyEnum");
const PricingModel_1 = require("./PricingModel");
/**
* Check if a given object implements the UpdatePriceRequest interface.
*/
function instanceOfUpdatePriceRequest(value) {
return true;
}
function UpdatePriceRequestFromJSON(json) {
return UpdatePriceRequestFromJSONTyped(json, false);
}
function UpdatePriceRequestFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'aggregateUsage': json['aggregate_usage'] == null ? undefined : (0, UsageAggMethodEnum_1.UsageAggMethodEnumFromJSON)(json['aggregate_usage']),
'billingInterval': json['billing_interval'] == null ? undefined : (0, CalendarIntervalEnum_1.CalendarIntervalEnumFromJSON)(json['billing_interval']),
'billingIntervalCount': json['billing_interval_count'] == null ? undefined : json['billing_interval_count'],
'canOnlyBePurchasedWith': json['can_only_be_purchased_with'] == null ? undefined : json['can_only_be_purchased_with'],
'contractAutoRenew': json['contract_auto_renew'] == null ? undefined : json['contract_auto_renew'],
'contractTermMultiple': json['contract_term_multiple'] == null ? undefined : json['contract_term_multiple'],
'currency': json['currency'] == null ? undefined : (0, CurrencyEnum_1.CurrencyEnumFromJSON)(json['currency']),
'customFields': json['custom_fields'] == null ? undefined : json['custom_fields'],
'defaultNetD': json['default_net_d'] == null ? undefined : json['default_net_d'],
'internalDescription': json['internal_description'] == null ? undefined : json['internal_description'],
'isActive': json['is_active'] == null ? undefined : json['is_active'],
'isExclusive': json['is_exclusive'] == null ? undefined : json['is_exclusive'],
'listedExclusivelyForCustomers': json['listed_exclusively_for_customers'] == null ? undefined : json['listed_exclusively_for_customers'],
'meta': json['meta'] == null ? undefined : json['meta'],
'meterId': json['meter_id'] == null ? undefined : json['meter_id'],
'name': json['name'] == null ? undefined : json['name'],
'priceTiers': json['price_tiers'] == null ? undefined : (json['price_tiers'].map(PriceTierParams_1.PriceTierParamsFromJSON)),
'priceType': json['price_type'] == null ? undefined : (0, PriceTypeEnum_1.PriceTypeEnumFromJSON)(json['price_type']),
'pricingModel': json['pricing_model'] == null ? undefined : (0, PricingModel_1.PricingModelFromJSON)(json['pricing_model']),
'transformQuantityDivideBy': json['transform_quantity_divide_by'] == null ? undefined : json['transform_quantity_divide_by'],
'trialPeriodDays': json['trial_period_days'] == null ? undefined : json['trial_period_days'],
'unitAmountAtom': json['unit_amount_atom'] == null ? undefined : json['unit_amount_atom'],
'usageType': json['usage_type'] == null ? undefined : (0, UsageTypeEnum_1.UsageTypeEnumFromJSON)(json['usage_type']),
};
}
function UpdatePriceRequestToJSON(json) {
return UpdatePriceRequestToJSONTyped(json, false);
}
function UpdatePriceRequestToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'aggregate_usage': (0, UsageAggMethodEnum_1.UsageAggMethodEnumToJSON)(value['aggregateUsage']),
'billing_interval': (0, CalendarIntervalEnum_1.CalendarIntervalEnumToJSON)(value['billingInterval']),
'billing_interval_count': value['billingIntervalCount'],
'can_only_be_purchased_with': value['canOnlyBePurchasedWith'],
'contract_auto_renew': value['contractAutoRenew'],
'contract_term_multiple': value['contractTermMultiple'],
'currency': (0, CurrencyEnum_1.CurrencyEnumToJSON)(value['currency']),
'custom_fields': value['customFields'],
'default_net_d': value['defaultNetD'],
'internal_description': value['internalDescription'],
'is_active': value['isActive'],
'is_exclusive': value['isExclusive'],
'listed_exclusively_for_customers': value['listedExclusivelyForCustomers'],
'meta': value['meta'],
'meter_id': value['meterId'],
'name': value['name'],
'price_tiers': value['priceTiers'] == null ? undefined : (value['priceTiers'].map(PriceTierParams_1.PriceTierParamsToJSON)),
'price_type': (0, PriceTypeEnum_1.PriceTypeEnumToJSON)(value['priceType']),
'pricing_model': (0, PricingModel_1.PricingModelToJSON)(value['pricingModel']),
'transform_quantity_divide_by': value['transformQuantityDivideBy'],
'trial_period_days': value['trialPeriodDays'],
'unit_amount_atom': value['unitAmountAtom'],
'usage_type': (0, UsageTypeEnum_1.UsageTypeEnumToJSON)(value['usageType']),
};
}