Skip to content

Commit

Permalink
Merge branch 'main' into config/DE-612-codegenignore-config
Browse files Browse the repository at this point in the history
  • Loading branch information
alberto-blacutt-maxio authored Nov 23, 2023
2 parents 8780cb6 + 5de2f5f commit 11923c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class Client implements ClientInterface {
? this._config.httpClientOptions.timeout
: this._config.timeout;
this._userAgent = updateUserAgent(
'AB SDK TypeScript:0.0.4 on OS {os-info}'
'AB SDK TypeScript:0.0.4 on OS {os-info}',
);
this._requestBuilderFactory = createRequestHandlerFactory(
(server) => getBaseUri(server, this._config),
Expand Down
10 changes: 4 additions & 6 deletions src/controllers/productPricePointsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { ApiError } from '@apimatic/core';
import { ApiResponse, commaPrefix, RequestOptions } from '../core';
import { ErrorListResponseError } from '../errors/errorListResponseError';
import { ErrorMapResponseError } from '../errors/errorMapResponseError';
import { ProductPricePointErrorResponseError } from '../errors/productPricePointErrorResponseError';
import {
ProductPricePointErrorResponseError,
} from '../errors/productPricePointErrorResponseError';
import { BasicDateField, basicDateFieldSchema } from '../models/basicDateField';
import {
BulkCreateProductPricePointsRequest,
Expand Down Expand Up @@ -81,11 +83,7 @@ export class ProductPricePointsController extends BaseController {
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.appendTemplatePath`/products/${mapped.productId}/price_points.json`;
req.throwOn(
422,
ProductPricePointErrorResponseError,
'Unprocessable Entity (WebDAV)'
);
req.throwOn(422, ProductPricePointErrorResponseError, 'Unprocessable Entity (WebDAV)');
return req.callAsJson(productPricePointResponseSchema, requestOptions);
}

Expand Down
9 changes: 6 additions & 3 deletions src/models/productPricePointErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ export interface ProductPricePointErrors {
priceInCents?: string[];
}

export const productPricePointErrorsSchema: Schema<ProductPricePointErrors> =
object({

export const productPricePointErrorsSchema: Schema<ProductPricePointErrors> = object(
{
pricePoint: ['price_point', optional(string())],
interval: ['interval', optional(array(string()))],
intervalUnit: ['interval_unit', optional(array(string()))],
name: ['name', optional(array(string()))],
price: ['price', optional(array(string()))],
priceInCents: ['price_in_cents', optional(array(string()))],
});
}
);

0 comments on commit 11923c6

Please sign in to comment.