aria_extension_tosca.simple_v1_0.presentation¶
aria_extension_tosca.simple_v1_0.presentation.extensible¶
-
class
aria_extension_tosca.simple_v1_0.presentation.extensible.ExtensiblePresentation(name=None, raw=None, container=None)¶ Bases:
aria.parser.presentation.presentation.PresentationA presentation that supports an optional
_extensionsdict field.
aria_extension_tosca.simple_v1_0.presentation.field_getters¶
-
aria_extension_tosca.simple_v1_0.presentation.field_getters.data_type_class_getter(cls)¶ Wraps the field value in a specialized data type class.
Can be used with the
field_getter()decorator.
aria_extension_tosca.simple_v1_0.presentation.field_validators¶
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.capability_definition_or_type_validator(field, presentation, context)¶ Makes sure refers to either a capability assignment name in the node template referred to by the
nodefield or a general capability type.If the value refers to a capability type, make sure the
nodefield was not assigned.Used with the
field_validator()decorator for thecapabilityfield inRequirementAssignment.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.constraint_clause_field_validator(field, presentation, context)¶ Makes sure that field contains a valid value for the container type.
Used with the
field_validator()decorator for various field inConstraintClause.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.constraint_clause_in_range_validator(field, presentation, context)¶ Makes sure that the value is a list with exactly two elements, that both lower bound contains a valid value for the container type, and that the upper bound is either “UNBOUNDED” or a valid value for the container type.
Used with the
field_validator()decorator for thein_rangefield inConstraintClause.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.constraint_clause_pattern_validator(field, presentation, context)¶ Makes sure that the value is a valid regular expression.
Used with the
field_validator()decorator for thepatternfield inConstraintClause.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.constraint_clause_valid_values_validator(field, presentation, context)¶ Makes sure that the value is a list of valid values for the container type.
Used with the
field_validator()decorator for thevalid_valuesfield inConstraintClause.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.copy_validator(template_type_name, templates_dict_name)¶ Makes sure that the field refers to an existing template defined in the root presenter.
Use with the
field_validator()decorator for thecopyfield inNodeTemplateandRelationshipTemplate.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.data_type_constraints_validator(field, presentation, context)¶ Makes sure that we do not have constraints if we are a complex type (with no primitive ancestor).
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.data_type_derived_from_validator(field, presentation, context)¶ Makes sure that the field refers to a valid parent data type (complex or primitive).
Used with the
field_validator()decorator for thederived_fromfield inDataType.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.data_type_properties_validator(field, presentation, context)¶ Makes sure that we do not have properties if we have a primitive ancestor.
Used with the
field_validator()decorator for thepropertiesfield inDataType.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.data_type_validator(type_name=’data type’)¶ Makes sure that the field refers to a valid data type, whether complex or primitive.
Used with the
field_validator()decorator for thetypefields inPropertyDefinition,AttributeDefinition,ParameterDefinition, andEntrySchema.Extra behavior beyond validation: generated function returns true if field is a complex data type.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.data_value_validator(field, presentation, context)¶ Makes sure that the field contains a valid value according to data type and constraints.
Used with the
field_validator()decorator for thedefaultfield inPropertyDefinitionandAttributeDefinition.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.entry_schema_validator(field, presentation, context)¶ According to whether the data type supports
entry_schema(e.g., it is or inherits from list or map), make sure that we either have or don’t have a valid data type value.Used with the
field_validator()decorator for theentry_schemafield inPropertyDefinitionandAttributeDefinition.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.list_node_type_or_group_type_validator(field, presentation, context)¶ Makes sure that the field’s elements refer to either node types or a group types.
Used with the
field_validator()decorator for thetargetsfield inPolicyType.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.node_filter_capabilities_validator(field, presentation, context)¶ Makes sure that the field’s elements refer to defined capabilities and properties in the target node type.
Used with the
field_validator()decorator for thecapabilitiesfield inNodeFilter.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.node_filter_properties_validator(field, presentation, context)¶ Makes sure that the field’s elements refer to defined properties in the target node type.
Used with the
field_validator()decorator for thepropertiesfield inNodeFilter.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.node_filter_validator(field, presentation, context)¶ Makes sure that the field has a value only if “node” refers to a node type.
Used with the
field_validator()decorator for thenode_filterfield inRequirementAssignment.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.node_template_or_type_validator(field, presentation, context)¶ Makes sure that the field refers to either a node template or a node type.
Used with the
field_validator()decorator for thenodefield inRequirementAssignment.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.policy_targets_validator(field, presentation, context)¶ Makes sure that the field’s elements refer to either node templates or groups, and that they match the node types and group types declared in the policy type.
Used with the
field_validator()decorator for thetargetsfield inPolicyTemplate.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.relationship_template_or_type_validator(field, presentation, context)¶ Makes sure that the field refers to either a relationship template or a relationship type.
Used with the
field_validator()decorator for thetypefield inRelationshipAssignment.
aria_extension_tosca.simple_v1_0.presentation.types¶
-
aria_extension_tosca.simple_v1_0.presentation.types.convert_shorthand_to_full_type_name(context, name, types_dict)¶ Converts a shorthand type name to its full type name, or else returns it unchanged.
Works by checking for
shorthand_namein the types’_extensionsfield. See alsoaria_extension_tosca.v1_0.presentation.extensible.ExtensiblePresentation.Can be used as the conversion function argument in
type_validatorandderived_from_validator.
-
aria_extension_tosca.simple_v1_0.presentation.types.get_type_by_full_or_shorthand_name(context, name, *types_dict_names)¶ Gets a type either by its full name or its shorthand name.
Works by checking for
shorthand_namein the types’_extensionsfield. See alsoExtensiblePresentation.The arguments from the third onwards are used to locate a nested field under
service_templateunder the root presenter.