|
| 1 | +/* |
| 2 | + * Copyright 2021-Present The Serverless Workflow Specification Authors |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +/***************************************************************************************** |
| 18 | + * |
| 19 | + * /!\ This file is computer generated. Any manual modification can and will be lost. /!\ |
| 20 | + * |
| 21 | + *****************************************************************************************/ |
| 22 | + |
| 23 | +import { builder, Builder, BuildOptions } from '../../builder'; |
| 24 | +import { Classes } from '../classes'; |
| 25 | +import { Specification } from '../definitions'; |
| 26 | + |
| 27 | +/** |
| 28 | + * The internal function used by the builder proxy to validate and return its underlying object |
| 29 | + * @param {Specification.BasicAuthenticationPolicyConfiguration} model The proxied object |
| 30 | + * @param {BuildOptions} options The build options to use |
| 31 | + * @returns {Specification.BasicAuthenticationPolicyConfiguration} The built object |
| 32 | + */ |
| 33 | +function buildingFn( |
| 34 | + model: Specification.BasicAuthenticationPolicyConfiguration, |
| 35 | + options: BuildOptions, |
| 36 | +): Specification.BasicAuthenticationPolicyConfiguration { |
| 37 | + const instance = new Classes.BasicAuthenticationPolicyConfiguration(model); |
| 38 | + if (options.validate) instance.validate(); |
| 39 | + return (options.normalize ? instance.normalize() : instance) as Specification.BasicAuthenticationPolicyConfiguration; |
| 40 | +} |
| 41 | + |
| 42 | +/** |
| 43 | + * A factory to create a builder proxy for the type `Specification.BasicAuthenticationPolicyConfiguration` |
| 44 | + * @returns {Builder<Specification.BasicAuthenticationPolicyConfiguration>} A builder for `Specification.BasicAuthenticationPolicyConfiguration` |
| 45 | + */ |
| 46 | +export const basicAuthenticationPolicyConfigurationBuilder = ( |
| 47 | + model?: Partial<Specification.BasicAuthenticationPolicyConfiguration>, |
| 48 | +): Builder<Specification.BasicAuthenticationPolicyConfiguration> => |
| 49 | + builder<Specification.BasicAuthenticationPolicyConfiguration>(model, buildingFn); |
0 commit comments