Class CfnAssetModel

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-24T21:00:31.285Z") @Stability(Stable) public class CfnAssetModel extends CfnResource implements IInspectable, ITaggable
Creates an asset model from specified property and hierarchy definitions.

You create assets from asset models. With asset models, you can easily create assets of the same type that have standardized definitions. Each asset created from a model inherits the asset model's property and hierarchy definitions. For more information, see Defining asset models in the AWS IoT SiteWise User Guide .

You can create two types of asset models, ASSET_MODEL or COMPONENT_MODEL .

  • ASSET_MODEL – (default) An asset model that you can use to create assets. Can't be included as a component in another asset model.
  • COMPONENT_MODEL – A reusable component that you can include in the composite models of other asset models. You can't create assets directly from this type of asset model.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.iotsitewise.*;
 CfnAssetModel cfnAssetModel = CfnAssetModel.Builder.create(this, "MyCfnAssetModel")
         .assetModelName("assetModelName")
         // the properties below are optional
         .assetModelCompositeModels(List.of(AssetModelCompositeModelProperty.builder()
                 .name("name")
                 .type("type")
                 // the properties below are optional
                 .composedAssetModelId("composedAssetModelId")
                 .compositeModelProperties(List.of(AssetModelPropertyProperty.builder()
                         .dataType("dataType")
                         .name("name")
                         .type(PropertyTypeProperty.builder()
                                 .typeName("typeName")
                                 // the properties below are optional
                                 .attribute(AttributeProperty.builder()
                                         .defaultValue("defaultValue")
                                         .build())
                                 .metric(MetricProperty.builder()
                                         .expression("expression")
                                         .variables(List.of(ExpressionVariableProperty.builder()
                                                 .name("name")
                                                 .value(VariableValueProperty.builder()
                                                         .hierarchyExternalId("hierarchyExternalId")
                                                         .hierarchyId("hierarchyId")
                                                         .hierarchyLogicalId("hierarchyLogicalId")
                                                         .propertyExternalId("propertyExternalId")
                                                         .propertyId("propertyId")
                                                         .propertyLogicalId("propertyLogicalId")
                                                         .propertyPath(List.of(PropertyPathDefinitionProperty.builder()
                                                                 .name("name")
                                                                 .build()))
                                                         .build())
                                                 .build()))
                                         .window(MetricWindowProperty.builder()
                                                 .tumbling(TumblingWindowProperty.builder()
                                                         .interval("interval")
                                                         // the properties below are optional
                                                         .offset("offset")
                                                         .build())
                                                 .build())
                                         .build())
                                 .transform(TransformProperty.builder()
                                         .expression("expression")
                                         .variables(List.of(ExpressionVariableProperty.builder()
                                                 .name("name")
                                                 .value(VariableValueProperty.builder()
                                                         .hierarchyExternalId("hierarchyExternalId")
                                                         .hierarchyId("hierarchyId")
                                                         .hierarchyLogicalId("hierarchyLogicalId")
                                                         .propertyExternalId("propertyExternalId")
                                                         .propertyId("propertyId")
                                                         .propertyLogicalId("propertyLogicalId")
                                                         .propertyPath(List.of(PropertyPathDefinitionProperty.builder()
                                                                 .name("name")
                                                                 .build()))
                                                         .build())
                                                 .build()))
                                         .build())
                                 .build())
                         // the properties below are optional
                         .dataTypeSpec("dataTypeSpec")
                         .externalId("externalId")
                         .id("id")
                         .logicalId("logicalId")
                         .unit("unit")
                         .build()))
                 .description("description")
                 .externalId("externalId")
                 .id("id")
                 .parentAssetModelCompositeModelExternalId("parentAssetModelCompositeModelExternalId")
                 .path(List.of("path"))
                 .build()))
         .assetModelDescription("assetModelDescription")
         .assetModelExternalId("assetModelExternalId")
         .assetModelHierarchies(List.of(AssetModelHierarchyProperty.builder()
                 .childAssetModelId("childAssetModelId")
                 .name("name")
                 // the properties below are optional
                 .externalId("externalId")
                 .id("id")
                 .logicalId("logicalId")
                 .build()))
         .assetModelProperties(List.of(AssetModelPropertyProperty.builder()
                 .dataType("dataType")
                 .name("name")
                 .type(PropertyTypeProperty.builder()
                         .typeName("typeName")
                         // the properties below are optional
                         .attribute(AttributeProperty.builder()
                                 .defaultValue("defaultValue")
                                 .build())
                         .metric(MetricProperty.builder()
                                 .expression("expression")
                                 .variables(List.of(ExpressionVariableProperty.builder()
                                         .name("name")
                                         .value(VariableValueProperty.builder()
                                                 .hierarchyExternalId("hierarchyExternalId")
                                                 .hierarchyId("hierarchyId")
                                                 .hierarchyLogicalId("hierarchyLogicalId")
                                                 .propertyExternalId("propertyExternalId")
                                                 .propertyId("propertyId")
                                                 .propertyLogicalId("propertyLogicalId")
                                                 .propertyPath(List.of(PropertyPathDefinitionProperty.builder()
                                                         .name("name")
                                                         .build()))
                                                 .build())
                                         .build()))
                                 .window(MetricWindowProperty.builder()
                                         .tumbling(TumblingWindowProperty.builder()
                                                 .interval("interval")
                                                 // the properties below are optional
                                                 .offset("offset")
                                                 .build())
                                         .build())
                                 .build())
                         .transform(TransformProperty.builder()
                                 .expression("expression")
                                 .variables(List.of(ExpressionVariableProperty.builder()
                                         .name("name")
                                         .value(VariableValueProperty.builder()
                                                 .hierarchyExternalId("hierarchyExternalId")
                                                 .hierarchyId("hierarchyId")
                                                 .hierarchyLogicalId("hierarchyLogicalId")
                                                 .propertyExternalId("propertyExternalId")
                                                 .propertyId("propertyId")
                                                 .propertyLogicalId("propertyLogicalId")
                                                 .propertyPath(List.of(PropertyPathDefinitionProperty.builder()
                                                         .name("name")
                                                         .build()))
                                                 .build())
                                         .build()))
                                 .build())
                         .build())
                 // the properties below are optional
                 .dataTypeSpec("dataTypeSpec")
                 .externalId("externalId")
                 .id("id")
                 .logicalId("logicalId")
                 .unit("unit")
                 .build()))
         .assetModelType("assetModelType")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnAssetModel

      protected CfnAssetModel(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnAssetModel

      protected CfnAssetModel(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnAssetModel

      @Stability(Stable) public CfnAssetModel(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAssetModelProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrAssetModelArn

      @Stability(Stable) @NotNull public String getAttrAssetModelArn()
      The ARN of the asset model, which has the following format.
    • getAttrAssetModelId

      @Stability(Stable) @NotNull public String getAttrAssetModelId()
      The ID of the asset model.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getAssetModelName

      @Stability(Stable) @NotNull public String getAssetModelName()
      A unique, friendly name for the asset model.
    • setAssetModelName

      @Stability(Stable) public void setAssetModelName(@NotNull String value)
      A unique, friendly name for the asset model.
    • getAssetModelCompositeModels

      @Stability(Stable) @Nullable public Object getAssetModelCompositeModels()
      The composite models that are part of this asset model.
    • setAssetModelCompositeModels

      @Stability(Stable) public void setAssetModelCompositeModels(@Nullable IResolvable value)
      The composite models that are part of this asset model.
    • setAssetModelCompositeModels

      @Stability(Stable) public void setAssetModelCompositeModels(@Nullable List<Object> value)
      The composite models that are part of this asset model.
    • getAssetModelDescription

      @Stability(Stable) @Nullable public String getAssetModelDescription()
      A description for the asset model.
    • setAssetModelDescription

      @Stability(Stable) public void setAssetModelDescription(@Nullable String value)
      A description for the asset model.
    • getAssetModelExternalId

      @Stability(Stable) @Nullable public String getAssetModelExternalId()
      The external ID of the asset model.
    • setAssetModelExternalId

      @Stability(Stable) public void setAssetModelExternalId(@Nullable String value)
      The external ID of the asset model.
    • getAssetModelHierarchies

      @Stability(Stable) @Nullable public Object getAssetModelHierarchies()
      The hierarchy definitions of the asset model.
    • setAssetModelHierarchies

      @Stability(Stable) public void setAssetModelHierarchies(@Nullable IResolvable value)
      The hierarchy definitions of the asset model.
    • setAssetModelHierarchies

      @Stability(Stable) public void setAssetModelHierarchies(@Nullable List<Object> value)
      The hierarchy definitions of the asset model.
    • getAssetModelProperties

      @Stability(Stable) @Nullable public Object getAssetModelProperties()
      The property definitions of the asset model.
    • setAssetModelProperties

      @Stability(Stable) public void setAssetModelProperties(@Nullable IResolvable value)
      The property definitions of the asset model.
    • setAssetModelProperties

      @Stability(Stable) public void setAssetModelProperties(@Nullable List<Object> value)
      The property definitions of the asset model.
    • getAssetModelType

      @Stability(Stable) @Nullable public String getAssetModelType()
      The type of asset model.
    • setAssetModelType

      @Stability(Stable) public void setAssetModelType(@Nullable String value)
      The type of asset model.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      A list of key-value pairs that contain metadata for the asset.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      A list of key-value pairs that contain metadata for the asset.