UNPKG

pesco-karavan-core

Version:
1,196 lines (1,031 loc) 182 kB
/** * Generated by karavan build tools - do NOT edit this file! */ import {CamelElement} from "../model/IntegrationDefinition"; import { ProcessorDefinition, BeansDeserializer, ErrorHandlerBuilderDeserializer, NamedBeanDefinition, OutputAwareFromDefinition, AggregateDefinition, BeanDefinition, CatchDefinition, ChoiceDefinition, CircuitBreakerDefinition, ClaimCheckDefinition, ContextScanDefinition, ConvertBodyDefinition, DataFormatDefinition, DelayDefinition, DescriptionDefinition, DynamicRouterDefinition, EnrichDefinition, ErrorHandlerDefinition, ExpressionSubElementDefinition, FaultToleranceConfigurationDefinition, FilterDefinition, FinallyDefinition, FromDefinition, GlobalOptionDefinition, GlobalOptionsDefinition, IdempotentConsumerDefinition, InOnlyDefinition, InOutDefinition, InputTypeDefinition, InterceptDefinition, InterceptFromDefinition, InterceptSendToEndpointDefinition, KameletDefinition, LoadBalanceDefinition, LogDefinition, LoopDefinition, MarshalDefinition, MulticastDefinition, OnCompletionDefinition, OnExceptionDefinition, OnFallbackDefinition, OptimisticLockRetryPolicyDefinition, OtherwiseDefinition, OutputDefinition, OutputTypeDefinition, PackageScanDefinition, PausableDefinition, PipelineDefinition, PolicyDefinition, PollEnrichDefinition, ProcessDefinition, PropertyDefinition, PropertyExpressionDefinition, RecipientListDefinition, RedeliveryPolicyDefinition, RemoveHeaderDefinition, RemoveHeadersDefinition, RemovePropertiesDefinition, RemovePropertyDefinition, ResequenceDefinition, Resilience4jConfigurationDefinition, RestContextRefDefinition, ResumableDefinition, RollbackDefinition, RouteBuilderDefinition, RouteConfigurationContextRefDefinition, RouteConfigurationDefinition, RouteContextRefDefinition, RouteDefinition, RouteTemplateBeanDefinition, RouteTemplateDefinition, RouteTemplateParameterDefinition, RoutingSlipDefinition, SagaActionUriDefinition, SagaDefinition, SamplingDefinition, ScriptDefinition, SetBodyDefinition, SetExchangePatternDefinition, SetHeaderDefinition, SetPropertyDefinition, SortDefinition, SplitDefinition, StepDefinition, StopDefinition, TemplatedRouteBeanDefinition, TemplatedRouteDefinition, TemplatedRouteParameterDefinition, ThreadPoolProfileDefinition, ThreadsDefinition, ThrottleDefinition, ThrowExceptionDefinition, ToDefinition, ToDynamicDefinition, TransactedDefinition, TransformDefinition, TryDefinition, UnmarshalDefinition, ValidateDefinition, WhenDefinition, WhenSkipSendToEndpointDefinition, WireTapDefinition, BlacklistServiceCallServiceFilterConfiguration, CachingServiceCallServiceDiscoveryConfiguration, CombinedServiceCallServiceDiscoveryConfiguration, CombinedServiceCallServiceFilterConfiguration, ConsulServiceCallServiceDiscoveryConfiguration, CustomServiceCallServiceFilterConfiguration, DefaultServiceCallServiceLoadBalancerConfiguration, DnsServiceCallServiceDiscoveryConfiguration, HealthyServiceCallServiceFilterConfiguration, KubernetesServiceCallServiceDiscoveryConfiguration, PassThroughServiceCallServiceFilterConfiguration, ServiceCallConfigurationDefinition, ServiceCallDefinition, ServiceCallExpressionConfiguration, ServiceCallServiceChooserConfiguration, ServiceCallServiceDiscoveryConfiguration, ServiceCallServiceFilterConfiguration, ServiceCallServiceLoadBalancerConfiguration, StaticServiceCallServiceDiscoveryConfiguration, ZooKeeperServiceCallServiceDiscoveryConfiguration, BatchResequencerConfig, StreamResequencerConfig, ASN1DataFormat, Any23DataFormat, AvroDataFormat, BarcodeDataFormat, Base64DataFormat, BindyDataFormat, CBORDataFormat, CryptoDataFormat, CsvDataFormat, CustomDataFormat, DataFormatsDefinition, FhirJsonDataFormat, FhirXmlDataFormat, FlatpackDataFormat, GrokDataFormat, GzipDeflaterDataFormat, HL7DataFormat, IcalDataFormat, JacksonXMLDataFormat, JaxbDataFormat, JsonApiDataFormat, JsonDataFormat, LZFDataFormat, MimeMultipartDataFormat, PGPDataFormat, ProtobufDataFormat, RssDataFormat, SoapDataFormat, SyslogDataFormat, TarFileDataFormat, ThriftDataFormat, TidyMarkupDataFormat, UniVocityCsvDataFormat, UniVocityFixedDataFormat, UniVocityHeader, UniVocityTsvDataFormat, XMLSecurityDataFormat, XStreamDataFormat, YAMLDataFormat, YAMLTypeFilterDefinition, ZipDeflaterDataFormat, ZipFileDataFormat, DeadLetterChannelDefinition, DefaultErrorHandlerDefinition, ErrorHandlerRefDefinition, JtaTransactionErrorHandlerDefinition, NoErrorHandlerDefinition, SpringTransactionErrorHandlerDefinition, CSimpleExpression, ConstantExpression, DatasonnetExpression, ExchangePropertyExpression, ExpressionDefinition, GroovyExpression, HeaderExpression, Hl7TerserExpression, JoorExpression, JqExpression, JsonPathExpression, LanguageExpression, MethodCallExpression, MvelExpression, OgnlExpression, RefExpression, SimpleExpression, SpELExpression, TokenizerExpression, XMLTokenizerExpression, XPathExpression, XQueryExpression, CustomLoadBalancerDefinition, FailoverLoadBalancerDefinition, RandomLoadBalancerDefinition, RoundRobinLoadBalancerDefinition, StickyLoadBalancerDefinition, TopicLoadBalancerDefinition, WeightedLoadBalancerDefinition, ApiKeyDefinition, BasicAuthDefinition, BearerTokenDefinition, DeleteDefinition, GetDefinition, HeadDefinition, MutualTLSDefinition, OAuth2Definition, OpenIdConnectDefinition, ParamDefinition, PatchDefinition, PostDefinition, PutDefinition, ResponseHeaderDefinition, ResponseMessageDefinition, RestBindingDefinition, RestConfigurationDefinition, RestDefinition, RestPropertyDefinition, RestSecuritiesDefinition, RestsDefinition, SecurityDefinition, CustomTransformerDefinition, DataFormatTransformerDefinition, EndpointTransformerDefinition, TransformersDefinition, CustomValidatorDefinition, EndpointValidatorDefinition, PredicateValidatorDefinition, ValidatorsDefinition, } from '../model/CamelDefinition'; import {CamelUtil} from './CamelUtil'; export class CamelDefinitionApi { static createProcessorDefinition = (element: any): ProcessorDefinition => { const def = element ? new ProcessorDefinition({...element}) : new ProcessorDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; if (element?.idempotentConsumer !== undefined) { def.idempotentConsumer = CamelDefinitionApi.createIdempotentConsumerDefinition(element.idempotentConsumer); } if (element?.resumable !== undefined) { def.resumable = CamelDefinitionApi.createResumableDefinition(element.resumable); } if (element?.doTry !== undefined) { def.doTry = CamelDefinitionApi.createTryDefinition(element.doTry); } if (element?.convertBodyTo !== undefined) { def.convertBodyTo = CamelDefinitionApi.createConvertBodyDefinition(element.convertBodyTo); } if (element?.recipientList !== undefined) { def.recipientList = CamelDefinitionApi.createRecipientListDefinition(element.recipientList); } if (element?.when !== undefined) { def.when = CamelDefinitionApi.createWhenDefinition(element.when); } if (element?.setHeader !== undefined) { def.setHeader = CamelDefinitionApi.createSetHeaderDefinition(element.setHeader); } if (element?.inOnly !== undefined) { def.inOnly = CamelDefinitionApi.createInOnlyDefinition(element.inOnly); } if (element?.inOut !== undefined) { def.inOut = CamelDefinitionApi.createInOutDefinition(element.inOut); } if (element?.split !== undefined) { def.split = CamelDefinitionApi.createSplitDefinition(element.split); } if (element?.interceptSendToEndpoint !== undefined) { def.interceptSendToEndpoint = CamelDefinitionApi.createInterceptSendToEndpointDefinition(element.interceptSendToEndpoint); } if (element?.loop !== undefined) { def.loop = CamelDefinitionApi.createLoopDefinition(element.loop); } if (element?.setExchangePattern !== undefined) { def.setExchangePattern = CamelDefinitionApi.createSetExchangePatternDefinition(element.setExchangePattern); } if (element?.marshal !== undefined) { def.marshal = CamelDefinitionApi.createMarshalDefinition(element.marshal); } if (element?.onFallback !== undefined) { def.onFallback = CamelDefinitionApi.createOnFallbackDefinition(element.onFallback); } if (element?.circuitBreaker !== undefined) { def.circuitBreaker = CamelDefinitionApi.createCircuitBreakerDefinition(element.circuitBreaker); } if (element?.enrich !== undefined) { def.enrich = CamelDefinitionApi.createEnrichDefinition(element.enrich); } if (element?.kamelet !== undefined) { def.kamelet = CamelDefinitionApi.createKameletDefinition(element.kamelet); } if (element?.saga !== undefined) { def.saga = CamelDefinitionApi.createSagaDefinition(element.saga); } if (element?.bean !== undefined) { def.bean = CamelDefinitionApi.createBeanDefinition(element.bean); } if (element?.otherwise !== undefined) { def.otherwise = CamelDefinitionApi.createOtherwiseDefinition(element.otherwise); } if (element?.sort !== undefined) { def.sort = CamelDefinitionApi.createSortDefinition(element.sort); } if (element?.loadBalance !== undefined) { def.loadBalance = CamelDefinitionApi.createLoadBalanceDefinition(element.loadBalance); } if (element?.script !== undefined) { def.script = CamelDefinitionApi.createScriptDefinition(element.script); } if (element?.removeHeader !== undefined) { def.removeHeader = CamelDefinitionApi.createRemoveHeaderDefinition(element.removeHeader); } if (element?.delay !== undefined) { def.delay = CamelDefinitionApi.createDelayDefinition(element.delay); } if (element?.stop !== undefined) { def.stop = CamelDefinitionApi.createStopDefinition(element.stop); } if (element?.serviceCall !== undefined) { def.serviceCall = CamelDefinitionApi.createServiceCallDefinition(element.serviceCall); } if (element?.intercept !== undefined) { def.intercept = CamelDefinitionApi.createInterceptDefinition(element.intercept); } if (element?.whenSkipSendToEndpoint !== undefined) { def.whenSkipSendToEndpoint = CamelDefinitionApi.createWhenSkipSendToEndpointDefinition(element.whenSkipSendToEndpoint); } if (element?.setProperty !== undefined) { def.setProperty = CamelDefinitionApi.createSetPropertyDefinition(element.setProperty); } if (element?.removeProperty !== undefined) { def.removeProperty = CamelDefinitionApi.createRemovePropertyDefinition(element.removeProperty); } if (element?.interceptFrom !== undefined) { def.interceptFrom = CamelDefinitionApi.createInterceptFromDefinition(element.interceptFrom); } if (element?.onCompletion !== undefined) { def.onCompletion = CamelDefinitionApi.createOnCompletionDefinition(element.onCompletion); } if (element?.pausable !== undefined) { def.pausable = CamelDefinitionApi.createPausableDefinition(element.pausable); } if (element?.throttle !== undefined) { def.throttle = CamelDefinitionApi.createThrottleDefinition(element.throttle); } if (element?.doFinally !== undefined) { def.doFinally = CamelDefinitionApi.createFinallyDefinition(element.doFinally); } if (element?.log !== undefined) { def.log = CamelDefinitionApi.createLogDefinition(element.log); } if (element?.doCatch !== undefined) { def.doCatch = CamelDefinitionApi.createCatchDefinition(element.doCatch); } if (element?.transacted !== undefined) { def.transacted = CamelDefinitionApi.createTransactedDefinition(element.transacted); } if (element?.claimCheck !== undefined) { def.claimCheck = CamelDefinitionApi.createClaimCheckDefinition(element.claimCheck); } if (element?.pollEnrich !== undefined) { def.pollEnrich = CamelDefinitionApi.createPollEnrichDefinition(element.pollEnrich); } if (element?.removeHeaders !== undefined) { def.removeHeaders = CamelDefinitionApi.createRemoveHeadersDefinition(element.removeHeaders); } if (element?.aggregate !== undefined) { def.aggregate = CamelDefinitionApi.createAggregateDefinition(element.aggregate); } if (element?.resequence !== undefined) { def.resequence = CamelDefinitionApi.createResequenceDefinition(element.resequence); } if (element?.routingSlip !== undefined) { def.routingSlip = CamelDefinitionApi.createRoutingSlipDefinition(element.routingSlip); } if (element?.transform !== undefined) { def.transform = CamelDefinitionApi.createTransformDefinition(element.transform); } if (element?.removeProperties !== undefined) { def.removeProperties = CamelDefinitionApi.createRemovePropertiesDefinition(element.removeProperties); } if (element?.policy !== undefined) { def.policy = CamelDefinitionApi.createPolicyDefinition(element.policy); } if (element?.validate !== undefined) { def.validate = CamelDefinitionApi.createValidateDefinition(element.validate); } if (element?.rollback !== undefined) { def.rollback = CamelDefinitionApi.createRollbackDefinition(element.rollback); } if (element?.process !== undefined) { def.process = CamelDefinitionApi.createProcessDefinition(element.process); } if (element?.threads !== undefined) { def.threads = CamelDefinitionApi.createThreadsDefinition(element.threads); } if (element?.setBody !== undefined) { def.setBody = CamelDefinitionApi.createSetBodyDefinition(element.setBody); } if (element?.sample !== undefined) { def.sample = CamelDefinitionApi.createSamplingDefinition(element.sample); } if (element?.throwException !== undefined) { def.throwException = CamelDefinitionApi.createThrowExceptionDefinition(element.throwException); } if (element?.dynamicRouter !== undefined) { def.dynamicRouter = CamelDefinitionApi.createDynamicRouterDefinition(element.dynamicRouter); } if (element?.multicast !== undefined) { def.multicast = CamelDefinitionApi.createMulticastDefinition(element.multicast); } if (element?.filter !== undefined) { def.filter = CamelDefinitionApi.createFilterDefinition(element.filter); } if (element?.pipeline !== undefined) { def.pipeline = CamelDefinitionApi.createPipelineDefinition(element.pipeline); } if (element?.unmarshal !== undefined) { def.unmarshal = CamelDefinitionApi.createUnmarshalDefinition(element.unmarshal); } if (element?.wireTap !== undefined) { def.wireTap = CamelDefinitionApi.createWireTapDefinition(element.wireTap); } if (element?.step !== undefined) { def.step = CamelDefinitionApi.createStepDefinition(element.step); } if (element?.choice !== undefined) { def.choice = CamelDefinitionApi.createChoiceDefinition(element.choice); } return def; } static createBeansDeserializer = (element: any): BeansDeserializer => { const def = element ? new BeansDeserializer({...element}) : new BeansDeserializer(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createErrorHandlerBuilderDeserializer = (element: any): ErrorHandlerBuilderDeserializer => { const def = element ? new ErrorHandlerBuilderDeserializer({...element}) : new ErrorHandlerBuilderDeserializer(); def.uuid = element?.uuid ? element.uuid : def.uuid; if (element?.deadLetterChannel !== undefined) { def.deadLetterChannel = CamelDefinitionApi.createDeadLetterChannelDefinition(element.deadLetterChannel); } if (element?.log !== undefined) { def.log = CamelDefinitionApi.createDefaultErrorHandlerDefinition(element.log); } if (element?.none !== undefined) { def.none = CamelDefinitionApi.createNoErrorHandlerDefinition(element.none); } return def; } static createNamedBeanDefinition = (element: any): NamedBeanDefinition => { const def = element ? new NamedBeanDefinition({...element}) : new NamedBeanDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createOutputAwareFromDefinition = (element: any): OutputAwareFromDefinition => { const def = element ? new OutputAwareFromDefinition({...element}) : new OutputAwareFromDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createAggregateDefinition = (element: any): AggregateDefinition => { const def = element ? new AggregateDefinition({...element}) : new AggregateDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; if (element?.completionTimeoutExpression !== undefined) { def.completionTimeoutExpression = CamelDefinitionApi.createExpressionSubElementDefinition(element.completionTimeoutExpression); } if (element?.correlationExpression !== undefined) { def.correlationExpression = CamelDefinitionApi.createExpressionSubElementDefinition(element.correlationExpression); } if (element?.completionPredicate !== undefined) { def.completionPredicate = CamelDefinitionApi.createExpressionSubElementDefinition(element.completionPredicate); } if (element?.optimisticLockRetryPolicy !== undefined) { def.optimisticLockRetryPolicy = CamelDefinitionApi.createOptimisticLockRetryPolicyDefinition(element.optimisticLockRetryPolicy); } def.steps = CamelDefinitionApi.createSteps(element?.steps); if (element?.completionSizeExpression !== undefined) { def.completionSizeExpression = CamelDefinitionApi.createExpressionSubElementDefinition(element.completionSizeExpression); } return def; } static createBeanDefinition = (element: any): BeanDefinition => { const def = element ? new BeanDefinition({...element}) : new BeanDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createCatchDefinition = (element: any): CatchDefinition => { const def = element ? new CatchDefinition({...element}) : new CatchDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; if (element?.onWhen !== undefined) { def.onWhen = CamelDefinitionApi.createWhenDefinition(element.onWhen); } def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createChoiceDefinition = (element: any): ChoiceDefinition => { const def = element ? new ChoiceDefinition({...element}) : new ChoiceDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; if (element?.otherwise !== undefined) { def.otherwise = CamelDefinitionApi.createOtherwiseDefinition(element.otherwise); } def.when = element && element?.when ? element?.when.map((x:any) => CamelDefinitionApi.createWhenDefinition(x)) :[]; return def; } static createCircuitBreakerDefinition = (element: any): CircuitBreakerDefinition => { const def = element ? new CircuitBreakerDefinition({...element}) : new CircuitBreakerDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; if (element?.faultToleranceConfiguration !== undefined) { def.faultToleranceConfiguration = CamelDefinitionApi.createFaultToleranceConfigurationDefinition(element.faultToleranceConfiguration); } if (element?.resilience4jConfiguration !== undefined) { def.resilience4jConfiguration = CamelDefinitionApi.createResilience4jConfigurationDefinition(element.resilience4jConfiguration); } if (element?.onFallback !== undefined) { def.onFallback = CamelDefinitionApi.createOnFallbackDefinition(element.onFallback); } def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createClaimCheckDefinition = (element: any): ClaimCheckDefinition => { const def = element ? new ClaimCheckDefinition({...element}) : new ClaimCheckDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createContextScanDefinition = (element: any): ContextScanDefinition => { const def = element ? new ContextScanDefinition({...element}) : new ContextScanDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createConvertBodyDefinition = (element: any): ConvertBodyDefinition => { if (element && typeof element === 'string') element = {type: element}; const def = element ? new ConvertBodyDefinition({...element}) : new ConvertBodyDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createDataFormatDefinition = (element: any): DataFormatDefinition => { const def = element ? new DataFormatDefinition({...element}) : new DataFormatDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createDelayDefinition = (element: any): DelayDefinition => { const def = element ? new DelayDefinition({...element}) : new DelayDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression); return def; } static createDescriptionDefinition = (element: any): DescriptionDefinition => { const def = element ? new DescriptionDefinition({...element}) : new DescriptionDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createDynamicRouterDefinition = (element: any): DynamicRouterDefinition => { const def = element ? new DynamicRouterDefinition({...element}) : new DynamicRouterDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression); return def; } static createEnrichDefinition = (element: any): EnrichDefinition => { const def = element ? new EnrichDefinition({...element}) : new EnrichDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression); return def; } static createErrorHandlerDefinition = (element: any): ErrorHandlerDefinition => { const def = element ? new ErrorHandlerDefinition({...element}) : new ErrorHandlerDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; if (element?.deadLetterChannel !== undefined) { def.deadLetterChannel = CamelDefinitionApi.createDeadLetterChannelDefinition(element.deadLetterChannel); } if (element?.noErrorHandler !== undefined) { def.noErrorHandler = CamelDefinitionApi.createNoErrorHandlerDefinition(element.noErrorHandler); } if (element?.jtaTransactionErrorHandler !== undefined) { def.jtaTransactionErrorHandler = CamelDefinitionApi.createJtaTransactionErrorHandlerDefinition(element.jtaTransactionErrorHandler); } if (element?.defaultErrorHandler !== undefined) { def.defaultErrorHandler = CamelDefinitionApi.createDefaultErrorHandlerDefinition(element.defaultErrorHandler); } if (element?.springTransactionErrorHandler !== undefined) { def.springTransactionErrorHandler = CamelDefinitionApi.createSpringTransactionErrorHandlerDefinition(element.springTransactionErrorHandler); } return def; } static createExpressionSubElementDefinition = (element: any): ExpressionSubElementDefinition => { const def = element ? new ExpressionSubElementDefinition({...element}) : new ExpressionSubElementDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; if (element?.ognl !== undefined) { def.ognl = CamelDefinitionApi.createOgnlExpression(element.ognl); } if (element?.constant !== undefined) { def.constant = CamelDefinitionApi.createConstantExpression(element.constant); } if (element?.mvel !== undefined) { def.mvel = CamelDefinitionApi.createMvelExpression(element.mvel); } if (element?.method !== undefined) { def.method = CamelDefinitionApi.createMethodCallExpression(element.method); } if (element?.xquery !== undefined) { def.xquery = CamelDefinitionApi.createXQueryExpression(element.xquery); } if (element?.datasonnet !== undefined) { def.datasonnet = CamelDefinitionApi.createDatasonnetExpression(element.datasonnet); } if (element?.jq !== undefined) { def.jq = CamelDefinitionApi.createJqExpression(element.jq); } if (element?.language !== undefined) { def.language = CamelDefinitionApi.createLanguageExpression(element.language); } if (element?.simple !== undefined) { def.simple = CamelDefinitionApi.createSimpleExpression(element.simple); } if (element?.hl7terser !== undefined) { def.hl7terser = CamelDefinitionApi.createHl7TerserExpression(element.hl7terser); } if (element?.tokenize !== undefined) { def.tokenize = CamelDefinitionApi.createTokenizerExpression(element.tokenize); } if (element?.spel !== undefined) { def.spel = CamelDefinitionApi.createSpELExpression(element.spel); } if (element?.ref !== undefined) { def.ref = CamelDefinitionApi.createRefExpression(element.ref); } if (element?.xpath !== undefined) { def.xpath = CamelDefinitionApi.createXPathExpression(element.xpath); } if (element?.groovy !== undefined) { def.groovy = CamelDefinitionApi.createGroovyExpression(element.groovy); } if (element?.csimple !== undefined) { def.csimple = CamelDefinitionApi.createCSimpleExpression(element.csimple); } if (element?.exchangeProperty !== undefined) { def.exchangeProperty = CamelDefinitionApi.createExchangePropertyExpression(element.exchangeProperty); } if (element?.jsonpath !== undefined) { def.jsonpath = CamelDefinitionApi.createJsonPathExpression(element.jsonpath); } if (element?.header !== undefined) { def.header = CamelDefinitionApi.createHeaderExpression(element.header); } if (element?.joor !== undefined) { def.joor = CamelDefinitionApi.createJoorExpression(element.joor); } if (element?.xtokenize !== undefined) { def.xtokenize = CamelDefinitionApi.createXMLTokenizerExpression(element.xtokenize); } return def; } static createFaultToleranceConfigurationDefinition = (element: any): FaultToleranceConfigurationDefinition => { const def = element ? new FaultToleranceConfigurationDefinition({...element}) : new FaultToleranceConfigurationDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createFilterDefinition = (element: any): FilterDefinition => { const def = element ? new FilterDefinition({...element}) : new FilterDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression); def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createFinallyDefinition = (element: any): FinallyDefinition => { const def = element ? new FinallyDefinition({...element}) : new FinallyDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createFromDefinition = (element: any): FromDefinition => { if (element && typeof element === 'string') element = { uri: element}; const def = element ? new FromDefinition({...element}) : new FromDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createGlobalOptionDefinition = (element: any): GlobalOptionDefinition => { const def = element ? new GlobalOptionDefinition({...element}) : new GlobalOptionDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createGlobalOptionsDefinition = (element: any): GlobalOptionsDefinition => { const def = element ? new GlobalOptionsDefinition({...element}) : new GlobalOptionsDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.globalOption = element && element?.globalOption ? element?.globalOption.map((x:any) => CamelDefinitionApi.createGlobalOptionDefinition(x)) :[]; return def; } static createIdempotentConsumerDefinition = (element: any): IdempotentConsumerDefinition => { const def = element ? new IdempotentConsumerDefinition({...element}) : new IdempotentConsumerDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression); def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createInOnlyDefinition = (element: any): InOnlyDefinition => { if (element && typeof element === 'string') element = {uri: element}; const def = element ? new InOnlyDefinition({...element}) : new InOnlyDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createInOutDefinition = (element: any): InOutDefinition => { if (element && typeof element === 'string') element = {uri: element}; const def = element ? new InOutDefinition({...element}) : new InOutDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createInputTypeDefinition = (element: any): InputTypeDefinition => { const def = element ? new InputTypeDefinition({...element}) : new InputTypeDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createInterceptDefinition = (element: any): InterceptDefinition => { const def = element ? new InterceptDefinition({...element}) : new InterceptDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createInterceptFromDefinition = (element: any): InterceptFromDefinition => { const def = element ? new InterceptFromDefinition({...element}) : new InterceptFromDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createInterceptSendToEndpointDefinition = (element: any): InterceptSendToEndpointDefinition => { if (element && typeof element === 'string') element = {uri: element}; const def = element ? new InterceptSendToEndpointDefinition({...element}) : new InterceptSendToEndpointDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createKameletDefinition = (element: any): KameletDefinition => { if (element && typeof element === 'string') element = {name: element}; const def = element ? new KameletDefinition({...element}) : new KameletDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createLoadBalanceDefinition = (element: any): LoadBalanceDefinition => { const def = element ? new LoadBalanceDefinition({...element}) : new LoadBalanceDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; if (element?.random !== undefined) { def.random = CamelDefinitionApi.createRandomLoadBalancerDefinition(element.random); } if (element?.customLoadBalancer !== undefined) { def.customLoadBalancer = CamelDefinitionApi.createCustomLoadBalancerDefinition(element.customLoadBalancer); } if (element?.failover !== undefined) { def.failover = CamelDefinitionApi.createFailoverLoadBalancerDefinition(element.failover); } if (element?.sticky !== undefined) { def.sticky = CamelDefinitionApi.createStickyLoadBalancerDefinition(element.sticky); } if (element?.topic !== undefined) { def.topic = CamelDefinitionApi.createTopicLoadBalancerDefinition(element.topic); } def.steps = CamelDefinitionApi.createSteps(element?.steps); if (element?.weighted !== undefined) { def.weighted = CamelDefinitionApi.createWeightedLoadBalancerDefinition(element.weighted); } if (element?.roundRobin !== undefined) { def.roundRobin = CamelDefinitionApi.createRoundRobinLoadBalancerDefinition(element.roundRobin); } return def; } static createLogDefinition = (element: any): LogDefinition => { if (element && typeof element === 'string') element = {message: element}; const def = element ? new LogDefinition({...element}) : new LogDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createLoopDefinition = (element: any): LoopDefinition => { const def = element ? new LoopDefinition({...element}) : new LoopDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression); def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createMarshalDefinition = (element: any): MarshalDefinition => { const def = element ? new MarshalDefinition({...element}) : new MarshalDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; if (element?.univocityCsv !== undefined) { def.univocityCsv = CamelDefinitionApi.createUniVocityCsvDataFormat(element.univocityCsv); } if (element?.protobuf !== undefined) { def.protobuf = CamelDefinitionApi.createProtobufDataFormat(element.protobuf); } if (element?.tarFile !== undefined) { def.tarFile = CamelDefinitionApi.createTarFileDataFormat(element.tarFile); } if (element?.tidyMarkup !== undefined) { def.tidyMarkup = CamelDefinitionApi.createTidyMarkupDataFormat(element.tidyMarkup); } if (element?.csv !== undefined) { def.csv = CamelDefinitionApi.createCsvDataFormat(element.csv); } if (element?.base64 !== undefined) { def.base64 = CamelDefinitionApi.createBase64DataFormat(element.base64); } if (element?.zipDeflater !== undefined) { def.zipDeflater = CamelDefinitionApi.createZipDeflaterDataFormat(element.zipDeflater); } if (element?.bindy !== undefined) { def.bindy = CamelDefinitionApi.createBindyDataFormat(element.bindy); } if (element?.syslog !== undefined) { def.syslog = CamelDefinitionApi.createSyslogDataFormat(element.syslog); } if (element?.zipFile !== undefined) { def.zipFile = CamelDefinitionApi.createZipFileDataFormat(element.zipFile); } if (element?.jaxb !== undefined) { def.jaxb = CamelDefinitionApi.createJaxbDataFormat(element.jaxb); } if (element?.rss !== undefined) { def.rss = CamelDefinitionApi.createRssDataFormat(element.rss); } if (element?.mimeMultipart !== undefined) { def.mimeMultipart = CamelDefinitionApi.createMimeMultipartDataFormat(element.mimeMultipart); } if (element?.asn1 !== undefined) { def.asn1 = CamelDefinitionApi.createASN1DataFormat(element.asn1); } if (element?.pgp !== undefined) { def.pgp = CamelDefinitionApi.createPGPDataFormat(element.pgp); } if (element?.thrift !== undefined) { def.thrift = CamelDefinitionApi.createThriftDataFormat(element.thrift); } if (element?.json !== undefined) { def.json = CamelDefinitionApi.createJsonDataFormat(element.json); } if (element?.lzf !== undefined) { def.lzf = CamelDefinitionApi.createLZFDataFormat(element.lzf); } if (element?.fhirXml !== undefined) { def.fhirXml = CamelDefinitionApi.createFhirXmlDataFormat(element.fhirXml); } if (element?.barcode !== undefined) { def.barcode = CamelDefinitionApi.createBarcodeDataFormat(element.barcode); } if (element?.avro !== undefined) { def.avro = CamelDefinitionApi.createAvroDataFormat(element.avro); } if (element?.yaml !== undefined) { def.yaml = CamelDefinitionApi.createYAMLDataFormat(element.yaml); } if (element?.fhirJson !== undefined) { def.fhirJson = CamelDefinitionApi.createFhirJsonDataFormat(element.fhirJson); } if (element?.any23 !== undefined) { def.any23 = CamelDefinitionApi.createAny23DataFormat(element.any23); } if (element?.custom !== undefined) { def.custom = CamelDefinitionApi.createCustomDataFormat(element.custom); } if (element?.flatpack !== undefined) { def.flatpack = CamelDefinitionApi.createFlatpackDataFormat(element.flatpack); } if (element?.cbor !== undefined) { def.cbor = CamelDefinitionApi.createCBORDataFormat(element.cbor); } if (element?.crypto !== undefined) { def.crypto = CamelDefinitionApi.createCryptoDataFormat(element.crypto); } if (element?.univocityTsv !== undefined) { def.univocityTsv = CamelDefinitionApi.createUniVocityTsvDataFormat(element.univocityTsv); } if (element?.hl7 !== undefined) { def.hl7 = CamelDefinitionApi.createHL7DataFormat(element.hl7); } if (element?.jsonApi !== undefined) { def.jsonApi = CamelDefinitionApi.createJsonApiDataFormat(element.jsonApi); } if (element?.xmlSecurity !== undefined) { def.xmlSecurity = CamelDefinitionApi.createXMLSecurityDataFormat(element.xmlSecurity); } if (element?.ical !== undefined) { def.ical = CamelDefinitionApi.createIcalDataFormat(element.ical); } if (element?.univocityFixed !== undefined) { def.univocityFixed = CamelDefinitionApi.createUniVocityFixedDataFormat(element.univocityFixed); } if (element?.jacksonXml !== undefined) { def.jacksonXml = CamelDefinitionApi.createJacksonXMLDataFormat(element.jacksonXml); } if (element?.grok !== undefined) { def.grok = CamelDefinitionApi.createGrokDataFormat(element.grok); } if (element?.xstream !== undefined) { def.xstream = CamelDefinitionApi.createXStreamDataFormat(element.xstream); } if (element?.gzipDeflater !== undefined) { def.gzipDeflater = CamelDefinitionApi.createGzipDeflaterDataFormat(element.gzipDeflater); } if (element?.soap !== undefined) { def.soap = CamelDefinitionApi.createSoapDataFormat(element.soap); } return def; } static createMulticastDefinition = (element: any): MulticastDefinition => { const def = element ? new MulticastDefinition({...element}) : new MulticastDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createOnCompletionDefinition = (element: any): OnCompletionDefinition => { const def = element ? new OnCompletionDefinition({...element}) : new OnCompletionDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; if (element?.onWhen !== undefined) { def.onWhen = CamelDefinitionApi.createWhenDefinition(element.onWhen); } def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createOnExceptionDefinition = (element: any): OnExceptionDefinition => { const def = element ? new OnExceptionDefinition({...element}) : new OnExceptionDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; if (element?.retryWhile !== undefined) { def.retryWhile = CamelDefinitionApi.createExpressionSubElementDefinition(element.retryWhile); } if (element?.redeliveryPolicy !== undefined) { def.redeliveryPolicy = CamelDefinitionApi.createRedeliveryPolicyDefinition(element.redeliveryPolicy); } if (element?.handled !== undefined) { def.handled = CamelDefinitionApi.createExpressionSubElementDefinition(element.handled); } if (element?.onWhen !== undefined) { def.onWhen = CamelDefinitionApi.createWhenDefinition(element.onWhen); } if (element?.continued !== undefined) { def.continued = CamelDefinitionApi.createExpressionSubElementDefinition(element.continued); } def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createOnFallbackDefinition = (element: any): OnFallbackDefinition => { const def = element ? new OnFallbackDefinition({...element}) : new OnFallbackDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createOptimisticLockRetryPolicyDefinition = (element: any): OptimisticLockRetryPolicyDefinition => { const def = element ? new OptimisticLockRetryPolicyDefinition({...element}) : new OptimisticLockRetryPolicyDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createOtherwiseDefinition = (element: any): OtherwiseDefinition => { const def = element ? new OtherwiseDefinition({...element}) : new OtherwiseDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createOutputDefinition = (element: any): OutputDefinition => { const def = element ? new OutputDefinition({...element}) : new OutputDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createOutputTypeDefinition = (element: any): OutputTypeDefinition => { const def = element ? new OutputTypeDefinition({...element}) : new OutputTypeDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createPackageScanDefinition = (element: any): PackageScanDefinition => { const def = element ? new PackageScanDefinition({...element}) : new PackageScanDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createPausableDefinition = (element: any): PausableDefinition => { const def = element ? new PausableDefinition({...element}) : new PausableDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createPipelineDefinition = (element: any): PipelineDefinition => { const def = element ? new PipelineDefinition({...element}) : new PipelineDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createPolicyDefinition = (element: any): PolicyDefinition => { const def = element ? new PolicyDefinition({...element}) : new PolicyDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.steps = CamelDefinitionApi.createSteps(element?.steps); return def; } static createPollEnrichDefinition = (element: any): PollEnrichDefinition => { const def = element ? new PollEnrichDefinition({...element}) : new PollEnrichDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression); return def; } static createProcessDefinition = (element: any): ProcessDefinition => { const def = element ? new ProcessDefinition({...element}) : new ProcessDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createPropertyDefinition = (element: any): PropertyDefinition => { const def = element ? new PropertyDefinition({...element}) : new PropertyDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createPropertyExpressionDefinition = (element: any): PropertyExpressionDefinition => { const def = element ? new PropertyExpressionDefinition({...element}) : new PropertyExpressionDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression); return def; } static createRecipientListDefinition = (element: any): RecipientListDefinition => { const def = element ? new RecipientListDefinition({...element}) : new RecipientListDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression); return def; } static createRedeliveryPolicyDefinition = (element: any): RedeliveryPolicyDefinition => { const def = element ? new RedeliveryPolicyDefinition({...element}) : new RedeliveryPolicyDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createRemoveHeaderDefinition = (element: any): RemoveHeaderDefinition => { if (element && typeof element === 'string') element = {name: element}; const def = element ? new RemoveHeaderDefinition({...element}) : new RemoveHeaderDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; return def; } static createRemoveHeadersDefinition =