Skip to content

Commit

Permalink
Automated commit message (#34)
Browse files Browse the repository at this point in the history
Co-authored-by: maxio-sdk <maxio-sdk@maxio.com>
  • Loading branch information
alberto-blacutt-maxio and maxio-sdk authored Dec 18, 2023
1 parent 880f2a2 commit bccb3eb
Show file tree
Hide file tree
Showing 30 changed files with 187 additions and 77 deletions.
4 changes: 2 additions & 2 deletions doc/controllers/coupons.md
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ async updateCouponCurrencyPrices(
couponId: number,
body?: CouponCurrencyRequest,
requestOptions?: RequestOptions
): Promise<ApiResponse<CouponCurrency[]>>
): Promise<ApiResponse<CouponCurrencyResponse>>
```

## Parameters
Expand All @@ -951,7 +951,7 @@ async updateCouponCurrencyPrices(

## Response Type

[`CouponCurrency[]`](../../doc/models/coupon-currency.md)
[`CouponCurrencyResponse`](../../doc/models/coupon-currency-response.md)

## Example Usage

Expand Down
21 changes: 4 additions & 17 deletions doc/models/component-price-point-item.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
| `name` | `string \| undefined` | Optional | - |
| `handle` | `string \| undefined` | Optional | - |
| `pricingScheme` | [`PricingScheme \| undefined`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. |
| `interval` | `number \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. |
| `intervalUnit` | [`IntervalUnit \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. |
| `prices` | [`Price[] \| undefined`](../../doc/models/price.md) | Optional | - |

## Example (as JSON)
Expand All @@ -21,23 +23,8 @@
"name": "name6",
"handle": "handle2",
"pricing_scheme": "per_unit",
"prices": [
{
"starting_quantity": 242,
"ending_quantity": 40,
"unit_price": 23.26
},
{
"starting_quantity": 242,
"ending_quantity": 40,
"unit_price": 23.26
},
{
"starting_quantity": 242,
"ending_quantity": 40,
"unit_price": 23.26
}
]
"interval": 196,
"interval_unit": "day"
}
```

2 changes: 2 additions & 0 deletions doc/models/component-price-point.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
| `useSiteExchangeRate` | `boolean \| undefined` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site.<br>**Default**: `true` |
| `subscriptionId` | `number \| undefined` | Optional | (only used for Custom Pricing - ie. when the price point's type is `custom`) The id of the subscription that the custom price point is for. |
| `taxIncluded` | `boolean \| undefined` | Optional | - |
| `interval` | `number \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. |
| `intervalUnit` | [`IntervalUnit \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. |

## Example (as JSON)

Expand Down
2 changes: 2 additions & 0 deletions doc/models/component.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
| `useSiteExchangeRate` | `boolean \| null \| undefined` | Optional | - |
| `accountingCode` | `string \| null \| undefined` | Optional | E.g. Internal ID or SKU Number |
| `eventBasedBillingMetricId` | `number \| undefined` | Optional | (Only for Event Based Components) This is an ID of a metric attached to the component. This metric is used to bill upon collected events. |
| `interval` | `number \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. |
| `intervalUnit` | [`IntervalUnit \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. |

## Example (as JSON)

Expand Down
36 changes: 36 additions & 0 deletions doc/models/coupon-currency-response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

# Coupon Currency Response

## Structure

`CouponCurrencyResponse`

## Fields

| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `offers` | [`CurrencyPrice[] \| undefined`](../../doc/models/currency-price.md) | Optional | - |

## Example (as JSON)

```json
{
"offers": [
{
"id": 12,
"currency": "currency4",
"price": 134.28,
"formatted_price": "formatted_price2",
"product_price_point_id": 134
},
{
"id": 12,
"currency": "currency4",
"price": 134.28,
"formatted_price": "formatted_price2",
"product_price_point_id": 134
}
]
}
```

27 changes: 0 additions & 27 deletions doc/models/coupon-currency.md

This file was deleted.

4 changes: 3 additions & 1 deletion doc/models/create-component-price-point-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
}
],
"use_site_exchange_rate": true,
"handle": "handle6"
"handle": "handle6",
"interval": 24,
"interval_unit": "day"
}
}
```
Expand Down
6 changes: 5 additions & 1 deletion doc/models/create-component-price-point.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
| `pricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. |
| `prices` | [`Price[]`](../../doc/models/price.md) | Required | - |
| `useSiteExchangeRate` | `boolean \| undefined` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site.<br>**Default**: `true` |
| `interval` | `number \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. |
| `intervalUnit` | [`IntervalUnit \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this price point, either month or day. This property is only available for sites with Multifrequency enabled. |

## Example (as JSON)

Expand All @@ -29,7 +31,9 @@
}
],
"use_site_exchange_rate": true,
"handle": "handle6"
"handle": "handle6",
"interval": 24,
"interval_unit": "day"
}
```

8 changes: 6 additions & 2 deletions doc/models/create-component-price-points-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
"unit_price": 23.26
}
],
"use_site_exchange_rate": false
"use_site_exchange_rate": false,
"interval": 24,
"interval_unit": "day"
},
{
"name": "name0",
Expand All @@ -60,7 +62,9 @@
"unit_price": 23.26
}
],
"use_site_exchange_rate": false
"use_site_exchange_rate": false,
"interval": 24,
"interval_unit": "day"
}
]
}
Expand Down
2 changes: 2 additions & 0 deletions doc/models/ebb-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
| `hideDateRangeOnInvoice` | `boolean \| undefined` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. |
| `priceInCents` | `string \| undefined` | Optional | deprecated May 2011 - use unit_price instead |
| `eventBasedBillingMetricId` | `number` | Required | The ID of an event based billing metric that will be attached to this component. |
| `interval` | `number \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. |
| `intervalUnit` | [`IntervalUnit \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. |

## Example (as JSON)

Expand Down
2 changes: 2 additions & 0 deletions doc/models/metered-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
| `displayOnHostedPage` | `boolean \| undefined` | Optional | - |
| `allowFractionalQuantities` | `boolean \| undefined` | Optional | - |
| `publicSignupPageIds` | `number[] \| undefined` | Optional | - |
| `interval` | `number \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. |
| `intervalUnit` | [`IntervalUnit \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. |

## Example (as JSON)

Expand Down
2 changes: 2 additions & 0 deletions doc/models/on-off-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
| `displayOnHostedPage` | `boolean \| undefined` | Optional | - |
| `allowFractionalQuantities` | `boolean \| undefined` | Optional | - |
| `publicSignupPageIds` | `number[] \| undefined` | Optional | - |
| `interval` | `number \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. |
| `intervalUnit` | [`IntervalUnit \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. |

## Example (as JSON)

Expand Down
2 changes: 2 additions & 0 deletions doc/models/price-point.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
| `pricingScheme` | [`PricingScheme \| undefined`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. |
| `prices` | [`Price[] \| undefined`](../../doc/models/price.md) | Optional | - |
| `useSiteExchangeRate` | `boolean \| undefined` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site.<br>**Default**: `true` |
| `interval` | `number \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. |
| `intervalUnit` | [`IntervalUnit \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this price point, either month or day. This property is only available for sites with Multifrequency enabled. |
| `overagePricing` | [`OveragePricing \| undefined`](../../doc/models/overage-pricing.md) | Optional | - |
| `rolloverPrepaidRemainder` | `boolean \| undefined` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period |
| `renewPrepaidAllocation` | `boolean \| undefined` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period |
Expand Down
2 changes: 2 additions & 0 deletions doc/models/quantity-based-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
| `displayOnHostedPage` | `boolean \| undefined` | Optional | - |
| `allowFractionalQuantities` | `boolean \| undefined` | Optional | - |
| `publicSignupPageIds` | `number[] \| undefined` | Optional | - |
| `interval` | `number \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. |
| `intervalUnit` | [`IntervalUnit \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. |

## Example (as JSON)

Expand Down
2 changes: 2 additions & 0 deletions doc/models/update-component-price-point-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
{
"price_point": {
"name": "name0",
"interval": 44,
"interval_unit": "day",
"prices": [
{
"id": 18,
Expand Down
4 changes: 4 additions & 0 deletions doc/models/update-component-price-point.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@
| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `name` | `string \| undefined` | Optional | - |
| `interval` | `number \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. |
| `intervalUnit` | [`IntervalUnit \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. |
| `prices` | [`UpdatePrice[] \| undefined`](../../doc/models/update-price.md) | Optional | - |

## Example (as JSON)

```json
{
"name": "name2",
"interval": 216,
"interval_unit": "day",
"prices": [
{
"id": 18,
Expand Down
9 changes: 6 additions & 3 deletions src/controllers/couponsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ import {
SingleStringErrorResponseError,
} from '../errors/singleStringErrorResponseError';
import { BasicDateField, basicDateFieldSchema } from '../models/basicDateField';
import { CouponCurrency, couponCurrencySchema } from '../models/couponCurrency';
import {
CouponCurrencyRequest,
couponCurrencyRequestSchema,
} from '../models/couponCurrencyRequest';
import {
CouponCurrencyResponse,
couponCurrencyResponseSchema,
} from '../models/couponCurrencyResponse';
import { CouponResponse, couponResponseSchema } from '../models/couponResponse';
import { CouponSubcodes, couponSubcodesSchema } from '../models/couponSubcodes';
import {
Expand Down Expand Up @@ -571,7 +574,7 @@ export class CouponsController extends BaseController {
couponId: number,
body?: CouponCurrencyRequest,
requestOptions?: RequestOptions
): Promise<ApiResponse<CouponCurrency[]>> {
): Promise<ApiResponse<CouponCurrencyResponse>> {
const req = this.createRequest('PUT');
const mapped = req.prepareArgs({
couponId: [couponId, number()],
Expand All @@ -580,7 +583,7 @@ export class CouponsController extends BaseController {
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.appendTemplatePath`/coupons/${mapped.couponId}/currency_prices.json`;
return req.callAsJson(array(couponCurrencySchema), requestOptions);
return req.callAsJson(couponCurrencyResponseSchema, requestOptions);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ export { CompoundingStrategy } from './models/compoundingStrategy';
export type { ConsolidatedInvoice } from './models/consolidatedInvoice';
export type { CountResponse } from './models/countResponse';
export type { Coupon } from './models/coupon';
export type { CouponCurrency } from './models/couponCurrency';
export type { CouponCurrencyRequest } from './models/couponCurrencyRequest';
export type { CouponCurrencyResponse } from './models/couponCurrencyResponse';
export type { CouponResponse } from './models/couponResponse';
export type { CouponRestriction } from './models/couponRestriction';
export type { CouponSubcodes } from './models/couponSubcodes';
Expand Down
7 changes: 7 additions & 0 deletions src/models/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
componentPricingSchemeSchema,
} from './containers/componentPricingScheme';
import { CreditType, creditTypeSchema } from './creditType';
import { IntervalUnit, intervalUnitSchema } from './intervalUnit';
import { ItemCategory, itemCategorySchema } from './itemCategory';

export interface Component {
Expand Down Expand Up @@ -88,6 +89,10 @@ export interface Component {
accountingCode?: string | null;
/** (Only for Event Based Components) This is an ID of a metric attached to the component. This metric is used to bill upon collected events. */
eventBasedBillingMetricId?: number;
/** The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. */
interval?: number;
/** A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. */
intervalUnit?: IntervalUnit;
}

export const componentSchema: Schema<Component> = object({
Expand Down Expand Up @@ -140,4 +145,6 @@ export const componentSchema: Schema<Component> = object({
'event_based_billing_metric_id',
optional(number()),
],
interval: ['interval', optional(number())],
intervalUnit: ['interval_unit', optional(intervalUnitSchema)],
});
7 changes: 7 additions & 0 deletions src/models/componentPricePoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
ComponentPricePointPrice,
componentPricePointPriceSchema,
} from './componentPricePointPrice';
import { IntervalUnit, intervalUnitSchema } from './intervalUnit';
import { PricePointType, pricePointTypeSchema } from './pricePointType';
import { PricingScheme, pricingSchemeSchema } from './pricingScheme';

Expand Down Expand Up @@ -47,6 +48,10 @@ export interface ComponentPricePoint {
/** (only used for Custom Pricing - ie. when the price point's type is `custom`) The id of the subscription that the custom price point is for. */
subscriptionId?: number;
taxIncluded?: boolean;
/** The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. */
interval?: number;
/** A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. */
intervalUnit?: IntervalUnit;
}

export const componentPricePointSchema: Schema<ComponentPricePoint> = object({
Expand All @@ -67,4 +72,6 @@ export const componentPricePointSchema: Schema<ComponentPricePoint> = object({
useSiteExchangeRate: ['use_site_exchange_rate', optional(boolean())],
subscriptionId: ['subscription_id', optional(number())],
taxIncluded: ['tax_included', optional(boolean())],
interval: ['interval', optional(number())],
intervalUnit: ['interval_unit', optional(intervalUnitSchema)],
});
17 changes: 16 additions & 1 deletion src/models/componentPricePointItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
* This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/

import { array, lazy, object, optional, Schema, string } from '../schema';
import {
array,
lazy,
number,
object,
optional,
Schema,
string,
} from '../schema';
import { IntervalUnit, intervalUnitSchema } from './intervalUnit';
import { Price, priceSchema } from './price';
import { PricingScheme, pricingSchemeSchema } from './pricingScheme';

Expand All @@ -13,6 +22,10 @@ export interface ComponentPricePointItem {
handle?: string;
/** The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. */
pricingScheme?: PricingScheme;
/** The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. */
interval?: number;
/** A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. */
intervalUnit?: IntervalUnit;
prices?: Price[];
}

Expand All @@ -21,6 +34,8 @@ export const componentPricePointItemSchema: Schema<ComponentPricePointItem> = ob
name: ['name', optional(string())],
handle: ['handle', optional(string())],
pricingScheme: ['pricing_scheme', optional(pricingSchemeSchema)],
interval: ['interval', optional(number())],
intervalUnit: ['interval_unit', optional(intervalUnitSchema)],
prices: ['prices', optional(array(lazy(() => priceSchema)))],
}
);
Loading

0 comments on commit bccb3eb

Please sign in to comment.