Skip to content

[I] SdkUnionType

  • SdkTypeBase
Type ParameterDefault type
TValueType extends SdkTypeBaseSdkType
PropertyTypeDescriptionOverridesInherited from
__accessSet?boolean--SdkTypeBase.__accessSet
__raw?Type--SdkTypeBase.__raw
accessAccessFlagsWhether the type has public or private accessibility.--
baseType?SdkTypeType declared by the union’s extends clause. This constrains the variants but does not imply inheritance. Usage, access, and serialization information propagate to this referenced type.--
crossLanguageDefinitionIdstringUnique ID for the current type.--
decoratorsDecoratorInfo[]Client types sourced from TypeSpec decorated types will have this generic decoratores list. Only decorators in allowed list will be included in this list. Language’s emitter could set additionalDecorators in the option when createSdkContext to extend the allowed list.-SdkTypeBase.decorators
deprecation?stringWhether the type is deprecated.-SdkTypeBase.deprecation
discriminatedOptions?DiscriminatedOptionsInfo to distinguish between different union variants.--
doc?stringDocument for the type.-SdkTypeBase.doc
external?ExternalTypeInfo--SdkTypeBase.external
isExactNamebooleanWhether name should be used exactly as-is, without casing transformations.--
isGeneratedNamebooleanWhether name is created by TCGC.--
kind"union"-SdkTypeBase.kind-
namestring---
namespacestringFull qualified namespace.--
summary?stringSummary for the type.-SdkTypeBase.summary
usageUsageFlagsBitmap of the usage for the type.--
variantsMap<string | symbol, TValueType>Maps variant keys to SDK types, in the same iteration order as variantTypes. Declared alternatives retain TypeSpec source order and their original string or symbol keys. String keys are declared names without casing transformations; symbols identify unnamed/default variants. Synthesized alternatives use new, unique symbol keys. Explicit null alternatives are excluded and represented by an SdkNullableType wrapper. Distinct keys may reference the same SDK type.--
variantTypesTValueType[]SDK types of the alternatives, in the same order as variants.values().--