-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jean-Baptiste Bianchi <[email protected]>
- Loading branch information
Showing
15 changed files
with
726 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2021-Present The Serverless Workflow Specification Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/***************************************************************************************** | ||
* | ||
* /!\ This file is computer generated. Any manual modification can and will be lost. /!\ | ||
* | ||
*****************************************************************************************/ | ||
|
||
import { builder, Builder, BuildOptions } from '../../builder'; | ||
import { Classes } from '../classes'; | ||
import { Specification } from '../definitions'; | ||
|
||
/** | ||
* The internal function used by the builder proxy to validate and return its underlying object | ||
* @param {Specification.Catalog} model The proxied object | ||
* @param {BuildOptions} options The build options to use | ||
* @returns {Specification.Catalog} The built object | ||
*/ | ||
function buildingFn(model: Specification.Catalog, options: BuildOptions): Specification.Catalog { | ||
const instance = new Classes.Catalog(model); | ||
if (options.validate) instance.validate(); | ||
return (options.normalize ? instance.normalize() : instance) as Specification.Catalog; | ||
} | ||
|
||
/** | ||
* A factory to create a builder proxy for the type `Specification.Catalog` | ||
* @returns {Builder<Specification.Catalog>} A builder for `Specification.Catalog` | ||
*/ | ||
export const catalogBuilder = (model?: Partial<Specification.Catalog>): Builder<Specification.Catalog> => | ||
builder<Specification.Catalog>(model, buildingFn); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2021-Present The Serverless Workflow Specification Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/***************************************************************************************** | ||
* | ||
* /!\ This file is computer generated. Any manual modification can and will be lost. /!\ | ||
* | ||
*****************************************************************************************/ | ||
|
||
import { builder, Builder, BuildOptions } from '../../builder'; | ||
import { Classes } from '../classes'; | ||
import { Specification } from '../definitions'; | ||
|
||
/** | ||
* The internal function used by the builder proxy to validate and return its underlying object | ||
* @param {Specification.UriTemplate} model The proxied object | ||
* @param {BuildOptions} options The build options to use | ||
* @returns {Specification.UriTemplate} The built object | ||
*/ | ||
function buildingFn(model: Specification.UriTemplate, options: BuildOptions): Specification.UriTemplate { | ||
const instance = new Classes.UriTemplate(model); | ||
if (options.validate) instance.validate(); | ||
return (options.normalize ? instance.normalize() : instance) as Specification.UriTemplate; | ||
} | ||
|
||
/** | ||
* A factory to create a builder proxy for the type `Specification.UriTemplate` | ||
* @returns {Builder<Specification.UriTemplate>} A builder for `Specification.UriTemplate` | ||
*/ | ||
export const uriTemplateBuilder = (model?: Partial<Specification.UriTemplate>): Builder<Specification.UriTemplate> => | ||
builder<Specification.UriTemplate>(model, buildingFn); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2021-Present The Serverless Workflow Specification Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/***************************************************************************************** | ||
* | ||
* /!\ This file is computer generated. Any manual modification can and will be lost. /!\ | ||
* | ||
*****************************************************************************************/ | ||
|
||
import { builder, Builder, BuildOptions } from '../../builder'; | ||
import { Classes } from '../classes'; | ||
import { Specification } from '../definitions'; | ||
|
||
/** | ||
* The internal function used by the builder proxy to validate and return its underlying object | ||
* @param {Specification.UseCatalogs} model The proxied object | ||
* @param {BuildOptions} options The build options to use | ||
* @returns {Specification.UseCatalogs} The built object | ||
*/ | ||
function buildingFn(model: Specification.UseCatalogs, options: BuildOptions): Specification.UseCatalogs { | ||
const instance = new Classes.UseCatalogs(model); | ||
if (options.validate) instance.validate(); | ||
return (options.normalize ? instance.normalize() : instance) as Specification.UseCatalogs; | ||
} | ||
|
||
/** | ||
* A factory to create a builder proxy for the type `Specification.UseCatalogs` | ||
* @returns {Builder<Specification.UseCatalogs>} A builder for `Specification.UseCatalogs` | ||
*/ | ||
export const useCatalogsBuilder = (model?: Partial<Specification.UseCatalogs>): Builder<Specification.UseCatalogs> => | ||
builder<Specification.UseCatalogs>(model, buildingFn); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Copyright 2021-Present The Serverless Workflow Specification Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/***************************************************************************************** | ||
* | ||
* /!\ This file is computer generated. Any manual modification can and will be lost. /!\ | ||
* | ||
*****************************************************************************************/ | ||
|
||
import { _Endpoint } from './endpoint'; | ||
import { ObjectHydrator } from '../../hydrator'; | ||
import { Specification } from '../definitions'; | ||
import { getLifecycleHooks } from '../../lifecycle-hooks'; | ||
import { validate } from '../../validation'; | ||
import { isObject } from '../../utils'; | ||
|
||
/** | ||
* Represents the intersection between the Catalog class and type | ||
*/ | ||
export type CatalogIntersection = Catalog & Specification.Catalog; | ||
|
||
/** | ||
* Represents a constructor for the intersection of the Catalog class and type | ||
*/ | ||
export interface CatalogConstructor { | ||
new (model?: Partial<Specification.Catalog>): CatalogIntersection; | ||
} | ||
|
||
/** | ||
* Represents a Catalog with methods for validation and normalization. | ||
* Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model. | ||
*/ | ||
export class Catalog extends ObjectHydrator<Specification.Catalog> { | ||
/** | ||
* Instanciates a new instance of the Catalog class. | ||
* Initializes properties based on the provided model if it is an object. | ||
* | ||
* @param model - Optional partial model object to initialize the Catalog. | ||
*/ | ||
constructor(model?: Partial<Specification.Catalog>) { | ||
super(model); | ||
const self = this as unknown as Specification.Catalog & object; | ||
if (isObject(model)) { | ||
if (typeof model.endpoint === 'object') self.endpoint = new _Endpoint(model.endpoint); | ||
} | ||
getLifecycleHooks('Catalog')?.constructor?.(this); | ||
} | ||
|
||
/** | ||
* Validates the current instance of the Catalog. | ||
* Throws if invalid. | ||
*/ | ||
validate(workflow?: Partial<Specification.Workflow>) { | ||
const copy = new Catalog(this as any) as CatalogIntersection; | ||
validate('Catalog', copy, workflow); | ||
} | ||
|
||
/** | ||
* Normalizes the current instance of the Catalog. | ||
* Creates a copy of the Catalog, invokes normalization hooks if available, and returns the normalized copy. | ||
* | ||
* @returns A normalized version of the Catalog instance. | ||
*/ | ||
normalize(): Catalog & Specification.Catalog { | ||
const copy = new Catalog(this as any) as CatalogIntersection; | ||
return getLifecycleHooks('Catalog')?.normalize?.(copy) || copy; | ||
} | ||
} | ||
|
||
export const _Catalog = Catalog as CatalogConstructor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Copyright 2021-Present The Serverless Workflow Specification Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/***************************************************************************************** | ||
* | ||
* /!\ This file is computer generated. Any manual modification can and will be lost. /!\ | ||
* | ||
*****************************************************************************************/ | ||
|
||
import { ObjectHydrator } from '../../hydrator'; | ||
import { Specification } from '../definitions'; | ||
import { getLifecycleHooks } from '../../lifecycle-hooks'; | ||
import { validate } from '../../validation'; | ||
|
||
/** | ||
* Represents the intersection between the UriTemplate class and type | ||
*/ | ||
export type UriTemplateIntersection = UriTemplate & Specification.UriTemplate; | ||
|
||
/** | ||
* Represents a constructor for the intersection of the UriTemplate class and type | ||
*/ | ||
export interface UriTemplateConstructor { | ||
new (model?: Partial<Specification.UriTemplate>): UriTemplateIntersection; | ||
} | ||
|
||
/** | ||
* Represents a UriTemplate with methods for validation and normalization. | ||
* Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model. | ||
*/ | ||
export class UriTemplate extends ObjectHydrator<Specification.UriTemplate> { | ||
/** | ||
* Instanciates a new instance of the UriTemplate class. | ||
* Initializes properties based on the provided model if it is an object. | ||
* | ||
* @param model - Optional partial model object to initialize the UriTemplate. | ||
*/ | ||
constructor(model?: Partial<Specification.UriTemplate>) { | ||
super(model); | ||
|
||
getLifecycleHooks('UriTemplate')?.constructor?.(this); | ||
} | ||
|
||
/** | ||
* Validates the current instance of the UriTemplate. | ||
* Throws if invalid. | ||
*/ | ||
validate(workflow?: Partial<Specification.Workflow>) { | ||
const copy = new UriTemplate(this as any) as UriTemplateIntersection; | ||
validate('UriTemplate', copy, workflow); | ||
} | ||
|
||
/** | ||
* Normalizes the current instance of the UriTemplate. | ||
* Creates a copy of the UriTemplate, invokes normalization hooks if available, and returns the normalized copy. | ||
* | ||
* @returns A normalized version of the UriTemplate instance. | ||
*/ | ||
normalize(): UriTemplate & Specification.UriTemplate { | ||
const copy = new UriTemplate(this as any) as UriTemplateIntersection; | ||
return getLifecycleHooks('UriTemplate')?.normalize?.(copy) || copy; | ||
} | ||
} | ||
|
||
export const _UriTemplate = UriTemplate as UriTemplateConstructor; |
Oops, something went wrong.