@maxio-com/advanced-billing-sdk
Version:
Ultimate billing and pricing flexibility for B2B SaaS. Maxio integrates directly into your product, so you can seamlessly manage your product catalog, bill customers, and collect payments.
505 lines • 36 kB
JavaScript
"use strict";
/**
* AdvancedBilling
*
* This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ComponentsController = void 0;
var tslib_1 = require("tslib");
var core_js_1 = require("../core.js");
var basicDateField_js_1 = require("../models/basicDateField.js");
var component_js_1 = require("../models/component.js");
var componentResponse_js_1 = require("../models/componentResponse.js");
var createEBBComponent_js_1 = require("../models/createEBBComponent.js");
var createMeteredComponent_js_1 = require("../models/createMeteredComponent.js");
var createOnOffComponent_js_1 = require("../models/createOnOffComponent.js");
var createPrepaidComponent_js_1 = require("../models/createPrepaidComponent.js");
var createQuantityBasedComponent_js_1 = require("../models/createQuantityBasedComponent.js");
var listComponentsFilter_js_1 = require("../models/listComponentsFilter.js");
var updateComponentRequest_js_1 = require("../models/updateComponentRequest.js");
var schema_js_1 = require("../schema.js");
var baseController_js_1 = require("./baseController.js");
var core_1 = require("@apimatic/core");
var errorListResponseError_js_1 = require("../errors/errorListResponseError.js");
var ComponentsController = /** @class */ (function (_super) {
tslib_1.__extends(ComponentsController, _super);
function ComponentsController() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* This request will create a component definition of kind **metered_component** under the specified
* product family. Metered component can then be added and “allocated” for a subscription.
*
* Metered components are used to bill for any type of unit that resets to 0 at the end of the billing
* period (think daily Google Adwords clicks or monthly cell phone minutes). This is most commonly
* associated with usage-based billing and many other pricing schemes.
*
* Note that this is different from recurring quantity-based components, which DO NOT reset to zero at
* the start of every billing period. If you want to bill for a quantity of something that does not
* change unless you change it, then you want quantity components, instead.
*
* For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-
* us/articles/24261141522189-Components-Overview).
*
* @param productFamilyId Either the product family's id or its handle prefixed
* with `handle:`
* @param body
* @return Response from the API call
*/
ComponentsController.prototype.createMeteredComponent = function (productFamilyId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST');
mapped = req.prepareArgs({
productFamilyId: [productFamilyId, (0, schema_js_1.string)()],
body: [body, (0, schema_js_1.optional)(createMeteredComponent_js_1.createMeteredComponentSchema)],
});
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.appendTemplatePath(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["/product_families/", "/metered_components.json"], ["/product_families/", "/metered_components.json"])), mapped.productFamilyId);
req.throwOn(404, core_1.ApiError, true, "Not Found:'{$response.body}'");
req.throwOn(422, errorListResponseError_js_1.ErrorListResponseError, true, "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'.");
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(componentResponse_js_1.componentResponseSchema, requestOptions)];
});
});
};
/**
* This request will create a component definition of kind **quantity_based_component** under the
* specified product family. Quantity Based component can then be added and “allocated” for a
* subscription.
*
* When defining Quantity Based component, You can choose one of 2 types:
* #### Recurring
* Recurring quantity-based components are used to bill for the number of some unit (think monthly
* software user licenses or the number of pairs of socks in a box-a-month club). This is most commonly
* associated with billing for user licenses, number of users, number of employees, etc.
*
* #### One-time
* One-time quantity-based components are used to create ad hoc usage charges that do not recur. For
* example, at the time of signup, you might want to charge your customer a one-time fee for onboarding
* or other services.
*
* The allocated quantity for one-time quantity-based components immediately gets reset back to zero
* after the allocation is made.
*
* For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-
* us/articles/24261141522189-Components-Overview).
*
* @param productFamilyId Either the product family's id or its handle
* prefixed with `handle:`
* @param body
* @return Response from the API call
*/
ComponentsController.prototype.createQuantityBasedComponent = function (productFamilyId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST');
mapped = req.prepareArgs({
productFamilyId: [productFamilyId, (0, schema_js_1.string)()],
body: [body, (0, schema_js_1.optional)(createQuantityBasedComponent_js_1.createQuantityBasedComponentSchema)],
});
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.appendTemplatePath(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["/product_families/", "/quantity_based_components.json"], ["/product_families/", "/quantity_based_components.json"])), mapped.productFamilyId);
req.throwOn(404, core_1.ApiError, true, "Not Found:'{$response.body}'");
req.throwOn(422, errorListResponseError_js_1.ErrorListResponseError, true, "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'.");
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(componentResponse_js_1.componentResponseSchema, requestOptions)];
});
});
};
/**
* This request will create a component definition of kind **on_off_component** under the specified
* product family. On/Off component can then be added and “allocated” for a subscription.
*
* On/off components are used for any flat fee, recurring add on (think $99/month for tech support or a
* flat add on shipping fee).
*
* For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-
* us/articles/24261141522189-Components-Overview).
*
* @param productFamilyId Either the product family's id or its handle prefixed
* with `handle:`
* @param body
* @return Response from the API call
*/
ComponentsController.prototype.createOnOffComponent = function (productFamilyId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST');
mapped = req.prepareArgs({
productFamilyId: [productFamilyId, (0, schema_js_1.string)()],
body: [body, (0, schema_js_1.optional)(createOnOffComponent_js_1.createOnOffComponentSchema)],
});
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.appendTemplatePath(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["/product_families/", "/on_off_components.json"], ["/product_families/", "/on_off_components.json"])), mapped.productFamilyId);
req.throwOn(404, core_1.ApiError, true, "Not Found:'{$response.body}'");
req.throwOn(422, errorListResponseError_js_1.ErrorListResponseError, true, "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'.");
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(componentResponse_js_1.componentResponseSchema, requestOptions)];
});
});
};
/**
* This request will create a component definition of kind **prepaid_usage_component** under the
* specified product family. Prepaid component can then be added and “allocated” for a subscription.
*
* Prepaid components allow customers to pre-purchase units that can be used up over time on their
* subscription. In a sense, they are the mirror image of metered components; while metered components
* charge at the end of the period for the amount of units used, prepaid components are charged for at
* the time of purchase, and we subsequently keep track of the usage against the amount purchased.
*
* For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-
* us/articles/24261141522189-Components-Overview).
*
* @param productFamilyId Either the product family's id or its handle prefixed
* with `handle:`
* @param body
* @return Response from the API call
*/
ComponentsController.prototype.createPrepaidUsageComponent = function (productFamilyId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST');
mapped = req.prepareArgs({
productFamilyId: [productFamilyId, (0, schema_js_1.string)()],
body: [body, (0, schema_js_1.optional)(createPrepaidComponent_js_1.createPrepaidComponentSchema)],
});
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.appendTemplatePath(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["/product_families/", "/prepaid_usage_components.json"], ["/product_families/", "/prepaid_usage_components.json"])), mapped.productFamilyId);
req.throwOn(404, core_1.ApiError, true, "Not Found:'{$response.body}'");
req.throwOn(422, errorListResponseError_js_1.ErrorListResponseError, true, "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'.");
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(componentResponse_js_1.componentResponseSchema, requestOptions)];
});
});
};
/**
* This request will create a component definition of kind **event_based_component** under the
* specified product family. Event-based component can then be added and “allocated” for a subscription.
*
* Event-based components are similar to other component types, in that you define the component
* parameters (such as name and taxability) and the pricing. A key difference for the event-based
* component is that it must be attached to a metric. This is because the metric provides the component
* with the actual quantity used in computing what and how much will be billed each period for each
* subscription.
*
* So, instead of reporting usage directly for each component (as you would with metered components),
* the usage is derived from analysis of your events.
*
* For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-
* us/articles/24261141522189-Components-Overview).
*
* @param productFamilyId Either the product family's id or its handle prefixed with
* `handle:`
* @param body
* @return Response from the API call
*/
ComponentsController.prototype.createEventBasedComponent = function (productFamilyId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST');
mapped = req.prepareArgs({
productFamilyId: [productFamilyId, (0, schema_js_1.string)()],
body: [body, (0, schema_js_1.optional)(createEBBComponent_js_1.createEBBComponentSchema)],
});
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.appendTemplatePath(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["/product_families/", "/event_based_components.json"], ["/product_families/", "/event_based_components.json"])), mapped.productFamilyId);
req.throwOn(404, core_1.ApiError, true, "Not Found:'{$response.body}'");
req.throwOn(422, errorListResponseError_js_1.ErrorListResponseError, true, "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'.");
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(componentResponse_js_1.componentResponseSchema, requestOptions)];
});
});
};
/**
* This request will return information regarding a component having the handle you provide. You can
* identify your components with a handle so you don't have to save or reference the IDs we generate.
*
* @param handle The handle of the component to find
* @return Response from the API call
*/
ComponentsController.prototype.findComponent = function (handle, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('GET', '/components/lookup.json');
mapped = req.prepareArgs({ handle: [handle, (0, schema_js_1.string)()] });
req.query('handle', mapped.handle, core_js_1.commaPrefix);
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(componentResponse_js_1.componentResponseSchema, requestOptions)];
});
});
};
/**
* Returns information regarding a component from a specific product family.
*
* You can read the component by either the component's id or handle. When using the handle, it must be
* prefixed with `handle:`.
*
* @param productFamilyId The Advanced Billing id of the product family to which the component belongs
* @param componentId Either the Advanced Billing id of the component or the handle for the
* component prefixed with `handle:`
* @return Response from the API call
*/
ComponentsController.prototype.readComponent = function (productFamilyId, componentId, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('GET');
mapped = req.prepareArgs({
productFamilyId: [productFamilyId, (0, schema_js_1.number)()],
componentId: [componentId, (0, schema_js_1.string)()],
});
req.appendTemplatePath(templateObject_6 || (templateObject_6 = tslib_1.__makeTemplateObject(["/product_families/", "/components/", ".json"], ["/product_families/", "/components/", ".json"])), mapped.productFamilyId, mapped.componentId);
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(componentResponse_js_1.componentResponseSchema, requestOptions)];
});
});
};
/**
* This request will update a component from a specific product family.
*
* You may read the component by either the component's id or handle. When using the handle, it must be
* prefixed with `handle:`.
*
* @param productFamilyId The Advanced Billing id of the product family to which
* the component belongs
* @param componentId Either the Advanced Billing id of the component or the
* handle for the component prefixed with `handle:`
* @param body
* @return Response from the API call
*/
ComponentsController.prototype.updateProductFamilyComponent = function (productFamilyId, componentId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('PUT');
mapped = req.prepareArgs({
productFamilyId: [productFamilyId, (0, schema_js_1.number)()],
componentId: [componentId, (0, schema_js_1.string)()],
body: [body, (0, schema_js_1.optional)(updateComponentRequest_js_1.updateComponentRequestSchema)],
});
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.appendTemplatePath(templateObject_7 || (templateObject_7 = tslib_1.__makeTemplateObject(["/product_families/", "/components/", ".json"], ["/product_families/", "/components/", ".json"])), mapped.productFamilyId, mapped.componentId);
req.throwOn(422, errorListResponseError_js_1.ErrorListResponseError, true, "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'.");
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(componentResponse_js_1.componentResponseSchema, requestOptions)];
});
});
};
/**
* Sending a DELETE request to this endpoint will archive the component. All current subscribers will
* be unffected; their subscription/purchase will continue to be charged as usual.
*
* @param productFamilyId The Advanced Billing id of the product family to which the component belongs
* @param componentId Either the Advanced Billing id of the component or the handle for the
* component prefixed with `handle:`
* @return Response from the API call
*/
ComponentsController.prototype.archiveComponent = function (productFamilyId, componentId, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('DELETE');
mapped = req.prepareArgs({
productFamilyId: [productFamilyId, (0, schema_js_1.number)()],
componentId: [componentId, (0, schema_js_1.string)()],
});
req.appendTemplatePath(templateObject_8 || (templateObject_8 = tslib_1.__makeTemplateObject(["/product_families/", "/components/", ".json"], ["/product_families/", "/components/", ".json"])), mapped.productFamilyId, mapped.componentId);
req.throwOn(422, errorListResponseError_js_1.ErrorListResponseError, true, "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'.");
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(component_js_1.componentSchema, requestOptions)];
});
});
};
/**
* This request will return a list of components for a site.
*
* @param dateField The type of filter you would like to apply to your search.
* @param startDate The start date (format YYYY-MM-DD) with which to filter
* the date_field. Returns components with a timestamp at or
* after midnight (12:00:00 AM) in your site’s time zone on
* the date specified.
* @param endDate The end date (format YYYY-MM-DD) with which to filter the
* date_field. Returns components with a timestamp up to and
* including 11:59:59PM in your site’s time zone on the date
* specified.
* @param startDatetime The start date and time (format YYYY-MM-DD HH:MM:SS) with
* which to filter the date_field. Returns components with a
* timestamp at or after exact time provided in query. You can
* specify timezone in query - otherwise your site's time zone
* will be used. If provided, this parameter will be used
* instead of start_date.
* @param endDatetime The end date and time (format YYYY-MM-DD HH:MM:SS) with
* which to filter the date_field. Returns components with a
* timestamp at or before exact time provided in query. You
* can specify timezone in query - otherwise your site's time
* zone will be used. If provided, this parameter will be used
* instead of end_date. optional
* @param includeArchived Include archived items
* @param page Result records are organized in pages. By default, the
* first page of results is displayed. The page parameter
* specifies a page number of results to fetch. You can start
* navigating through the pages to consume the results. You do
* this by passing in a page parameter. Retrieve the next page
* by adding ?page=2 to the query string. If there are no
* results to return, then an empty result set will be
* returned. Use in query `page=1`.
* @param perPage This parameter indicates how many records to fetch in each
* request. Default value is 20. The maximum allowed values is
* 200; any per_page value over 200 will be changed to 200.
* Use in query `per_page=200`.
* @param filter Filter to use for List Components operations
* @return Response from the API call
*/
ComponentsController.prototype.listComponents = function (_a, requestOptions_1) {
return tslib_1.__awaiter(this, arguments, void 0, function (_b, requestOptions) {
var req, mapped;
var dateField = _b.dateField, startDate = _b.startDate, endDate = _b.endDate, startDatetime = _b.startDatetime, endDatetime = _b.endDatetime, includeArchived = _b.includeArchived, page = _b.page, perPage = _b.perPage, filter = _b.filter;
return tslib_1.__generator(this, function (_c) {
req = this.createRequest('GET', '/components.json');
mapped = req.prepareArgs({
dateField: [dateField, (0, schema_js_1.optional)(basicDateField_js_1.basicDateFieldSchema)],
startDate: [startDate, (0, schema_js_1.optional)((0, schema_js_1.string)())],
endDate: [endDate, (0, schema_js_1.optional)((0, schema_js_1.string)())],
startDatetime: [startDatetime, (0, schema_js_1.optional)((0, schema_js_1.string)())],
endDatetime: [endDatetime, (0, schema_js_1.optional)((0, schema_js_1.string)())],
includeArchived: [includeArchived, (0, schema_js_1.optional)((0, schema_js_1.boolean)())],
page: [page, (0, schema_js_1.optional)((0, schema_js_1.number)())],
perPage: [perPage, (0, schema_js_1.optional)((0, schema_js_1.number)())],
filter: [filter, (0, schema_js_1.optional)(listComponentsFilter_js_1.listComponentsFilterSchema)],
});
req.query('date_field', mapped.dateField, core_js_1.commaPrefix);
req.query('start_date', mapped.startDate, core_js_1.commaPrefix);
req.query('end_date', mapped.endDate, core_js_1.commaPrefix);
req.query('start_datetime', mapped.startDatetime, core_js_1.commaPrefix);
req.query('end_datetime', mapped.endDatetime, core_js_1.commaPrefix);
req.query('include_archived', mapped.includeArchived, core_js_1.commaPrefix);
req.query('page', mapped.page, core_js_1.commaPrefix);
req.query('per_page', mapped.perPage, core_js_1.commaPrefix);
req.query('filter', mapped.filter, core_js_1.commaPrefix);
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson((0, schema_js_1.array)(componentResponse_js_1.componentResponseSchema), requestOptions)];
});
});
};
/**
* This request will update a component.
*
* You may read the component by either the component's id or handle. When using the handle, it must be
* prefixed with `handle:`.
*
* @param componentId The id or handle of the component
* @param body
* @return Response from the API call
*/
ComponentsController.prototype.updateComponent = function (componentId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('PUT');
mapped = req.prepareArgs({
componentId: [componentId, (0, schema_js_1.string)()],
body: [body, (0, schema_js_1.optional)(updateComponentRequest_js_1.updateComponentRequestSchema)],
});
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.appendTemplatePath(templateObject_9 || (templateObject_9 = tslib_1.__makeTemplateObject(["/components/", ".json"], ["/components/", ".json"])), mapped.componentId);
req.throwOn(422, errorListResponseError_js_1.ErrorListResponseError, true, "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'.");
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(componentResponse_js_1.componentResponseSchema, requestOptions)];
});
});
};
/**
* This request will return a list of components for a particular product family.
*
* @param productFamilyId The Advanced Billing id of the product family
* @param includeArchived Include archived items.
* @param page Result records are organized in pages. By default, the
* first page of results is displayed. The page parameter
* specifies a page number of results to fetch. You can start
* navigating through the pages to consume the results. You
* do this by passing in a page parameter. Retrieve the next
* page by adding ?page=2 to the query string. If there are
* no results to return, then an empty result set will be
* returned. Use in query `page=1`.
* @param perPage This parameter indicates how many records to fetch in
* each request. Default value is 20. The maximum allowed
* values is 200; any per_page value over 200 will be changed
* to 200. Use in query `per_page=200`.
* @param filter Filter to use for List Components operations
* @param dateField The type of filter you would like to apply to your search.
* Use in query `date_field=created_at`.
* @param endDate The end date (format YYYY-MM-DD) with which to filter the
* date_field. Returns components with a timestamp up to and
* including 11:59:59PM in your site’s time zone on the date
* specified.
* @param endDatetime The end date and time (format YYYY-MM-DD HH:MM:SS) with
* which to filter the date_field. Returns components with a
* timestamp at or before exact time provided in query. You
* can specify timezone in query - otherwise your site's time
* zone will be used. If provided, this parameter will be
* used instead of end_date. optional.
* @param startDate The start date (format YYYY-MM-DD) with which to filter
* the date_field. Returns components with a timestamp at or
* after midnight (12:00:00 AM) in your site’s time zone on
* the date specified.
* @param startDatetime The start date and time (format YYYY-MM-DD HH:MM:SS) with
* which to filter the date_field. Returns components with a
* timestamp at or after exact time provided in query. You
* can specify timezone in query - otherwise your site's time
* zone will be used. If provided, this parameter will be
* used instead of start_date.
* @return Response from the API call
*/
ComponentsController.prototype.listComponentsForProductFamily = function (_a, requestOptions_1) {
return tslib_1.__awaiter(this, arguments, void 0, function (_b, requestOptions) {
var req, mapped;
var productFamilyId = _b.productFamilyId, includeArchived = _b.includeArchived, page = _b.page, perPage = _b.perPage, filter = _b.filter, dateField = _b.dateField, endDate = _b.endDate, endDatetime = _b.endDatetime, startDate = _b.startDate, startDatetime = _b.startDatetime;
return tslib_1.__generator(this, function (_c) {
req = this.createRequest('GET');
mapped = req.prepareArgs({
productFamilyId: [productFamilyId, (0, schema_js_1.number)()],
includeArchived: [includeArchived, (0, schema_js_1.optional)((0, schema_js_1.boolean)())],
page: [page, (0, schema_js_1.optional)((0, schema_js_1.number)())],
perPage: [perPage, (0, schema_js_1.optional)((0, schema_js_1.number)())],
filter: [filter, (0, schema_js_1.optional)(listComponentsFilter_js_1.listComponentsFilterSchema)],
dateField: [dateField, (0, schema_js_1.optional)(basicDateField_js_1.basicDateFieldSchema)],
endDate: [endDate, (0, schema_js_1.optional)((0, schema_js_1.string)())],
endDatetime: [endDatetime, (0, schema_js_1.optional)((0, schema_js_1.string)())],
startDate: [startDate, (0, schema_js_1.optional)((0, schema_js_1.string)())],
startDatetime: [startDatetime, (0, schema_js_1.optional)((0, schema_js_1.string)())],
});
req.query('include_archived', mapped.includeArchived, core_js_1.commaPrefix);
req.query('page', mapped.page, core_js_1.commaPrefix);
req.query('per_page', mapped.perPage, core_js_1.commaPrefix);
req.query('filter', mapped.filter, core_js_1.commaPrefix);
req.query('date_field', mapped.dateField, core_js_1.commaPrefix);
req.query('end_date', mapped.endDate, core_js_1.commaPrefix);
req.query('end_datetime', mapped.endDatetime, core_js_1.commaPrefix);
req.query('start_date', mapped.startDate, core_js_1.commaPrefix);
req.query('start_datetime', mapped.startDatetime, core_js_1.commaPrefix);
req.appendTemplatePath(templateObject_10 || (templateObject_10 = tslib_1.__makeTemplateObject(["/product_families/", "/components.json"], ["/product_families/", "/components.json"])), mapped.productFamilyId);
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson((0, schema_js_1.array)(componentResponse_js_1.componentResponseSchema), requestOptions)];
});
});
};
return ComponentsController;
}(baseController_js_1.BaseController));
exports.ComponentsController = ComponentsController;
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
//# sourceMappingURL=componentsController.js.map