|
22 | 22 |
|
23 | 23 | import { builder, Builder, BuildOptions } from '../../builder';
|
24 | 24 | import { Classes } from '../classes';
|
25 |
| -import { WithAsyncAPIPayloadIntersection } from '../classes/with-async-api-payload'; |
| 25 | +import { AnyEventUntilConsumedIntersection } from '../classes/any-event-until-consumed'; |
26 | 26 | import { Specification } from '../definitions';
|
27 | 27 |
|
28 | 28 | /**
|
29 | 29 | * The internal function used by the builder proxy to validate and return its underlying object
|
30 |
| - * @param {Specification.WithAsyncAPIPayload} model The proxied object |
| 30 | + * @param {Specification.AnyEventUntilConsumed} model The proxied object |
31 | 31 | * @param {BuildOptions} options The build options to use
|
32 |
| - * @returns {WithAsyncAPIPayloadIntersection} The built object |
| 32 | + * @returns {AnyEventUntilConsumedIntersection} The built object |
33 | 33 | */
|
34 |
| -function buildingFn(model: Specification.WithAsyncAPIPayload, options: BuildOptions): WithAsyncAPIPayloadIntersection { |
35 |
| - const instance = new Classes.WithAsyncAPIPayload(model); |
| 34 | +function buildingFn( |
| 35 | + model: Specification.AnyEventUntilConsumed, |
| 36 | + options: BuildOptions, |
| 37 | +): AnyEventUntilConsumedIntersection { |
| 38 | + const instance = new Classes.AnyEventUntilConsumed(model); |
36 | 39 | if (options.validate) instance.validate();
|
37 |
| - return (options.normalize ? instance.normalize() : instance) as WithAsyncAPIPayloadIntersection; |
| 40 | + return (options.normalize ? instance.normalize() : instance) as AnyEventUntilConsumedIntersection; |
38 | 41 | }
|
39 | 42 |
|
40 | 43 | /**
|
41 |
| - * A factory to create a builder proxy for the type `WithAsyncAPIPayloadIntersection` |
42 |
| - * @returns {Builder<WithAsyncAPIPayloadIntersection, WithAsyncAPIPayloadIntersection>} A builder for `WithAsyncAPIPayloadIntersection` |
| 44 | + * A factory to create a builder proxy for the type `AnyEventUntilConsumedIntersection` |
| 45 | + * @returns {Builder<AnyEventUntilConsumedIntersection, AnyEventUntilConsumedIntersection>} A builder for `AnyEventUntilConsumedIntersection` |
43 | 46 | */
|
44 |
| -export const withAsyncAPIPayloadBuilder = ( |
45 |
| - model?: Partial<Specification.WithAsyncAPIPayload>, |
46 |
| -): Builder<Partial<Specification.WithAsyncAPIPayload>, WithAsyncAPIPayloadIntersection> => |
47 |
| - builder<Specification.WithAsyncAPIPayload, WithAsyncAPIPayloadIntersection>(model, buildingFn); |
| 47 | +export const anyEventUntilConsumedBuilder = ( |
| 48 | + model?: Partial<Specification.AnyEventUntilConsumed>, |
| 49 | +): Builder<Partial<Specification.AnyEventUntilConsumed>, AnyEventUntilConsumedIntersection> => |
| 50 | + builder<Specification.AnyEventUntilConsumed, AnyEventUntilConsumedIntersection>(model, buildingFn); |
0 commit comments