import { EntityFromIntegration } from '../../persister'; import { ResourceTagList, ResourceTagMap } from './tagging'; /** * Properties required to build a valid `EntityFromIntegration`. * * These properties are more strict (than their counterpart definitions on * `EntityFromIntegration`) to prevent literal assignments of `undefined` * values. */ declare type RequiredEntityProperties = { _class: string | string[]; _type: string; }; /** * Allows assignment of any additional properties without being forced to use * specific types where that isn't helpful. * * During development, schema validation prevents failures to provide properties * required by the entity `_class`. Combined with automatic transfer of many * properties from the `ProviderSourceData`, there may be no strong case to be * made for referencing specific TypeScript types. In those cases, it should be * possible to provide additional literal entity properties. */ declare type AdditionalEntityProperties = { [key: string]: any; }; /** * Properties to be assigned to a generated entity which are declared in code * literals. * * Many values can be transferred from the `ProviderSourceData` without any * additional effort. Other properties must transferred by using code to specify * the property value. These properties can be any name/value, but the list * certainly includes those of `EntityFromIntegration`, and some properties * *must* be provided. */ declare type LiteralAssignments = Partial & RequiredEntityProperties & AdditionalEntityProperties; /** * A type representing entity data from a provider. */ declare type ProviderSourceData = { /** * Some providers include a collection of `tags` that will be stored on the * generated entity as `tag.propertyName`, `propertyName` when the tag is * registered in `tagProperties` or is known to be a common tag property name, * and the tag values will be collected in the generated entity as `tags` (a * `string[]`); */ tags?: ResourceTagList | ResourceTagMap; [key: string]: any; }; /** * Data used to generate an `EntityFromIntegration`. */ export declare type IntegrationEntityData = { /** * Data from a provider API that will be selectively transferred to an * `EntityFromIntegration`. * * The common properties defined by data model schemas, selected by the * `assign._class`, will be found and transferred to the generated entity. */ source: ProviderSourceData; /** * Literal property assignments. These values will override anything * transferred from the `source` data. */ assign: LiteralAssignments; /** * The names of properties that will be assigned directly to the entity from * tags with matching names. See `assignTags`. */ tagProperties?: string[]; }; /** * A generated `EntityFromIntegration` that includes additional properties * specific to the entity class and some properties are guaranteed. */ declare type GeneratedEntityFromIntegration = EntityFromIntegration & AdditionalEntityProperties & { _key: string; _class: string[]; }; export declare type IntegrationEntityBuilderInput = { /** * Data used to generate an `EntityFromIntegration`. */ entityData: IntegrationEntityData; }; /** * Generates an `EntityFromIntegration` using the provided `entityData`. * * WARNING: This is a work in progress. Only certain schemas are supported as * the API is worked out in the Azure integration. */ export declare function createIntegrationEntity(input: IntegrationEntityBuilderInput): GeneratedEntityFromIntegration; export {};