MCPcopy Create free account
hub / github.com/aws/aws-cli / get_shape_by_name

Method get_shape_by_name

awscli/botocore/model.py:764–779  ·  view source on GitHub ↗
(self, shape_name, member_traits=None)

Source from the content-addressed store, hash-verified

762 self._shape_cache = {}
763
764 def get_shape_by_name(self, shape_name, member_traits=None):
765 try:
766 shape_model = self._shape_map[shape_name]
767 except KeyError:
768 raise NoShapeFoundError(shape_name)
769 try:
770 shape_cls = self.SHAPE_CLASSES.get(shape_model['type'], Shape)
771 except KeyError:
772 raise InvalidShapeError(
773 f"Shape is missing required key 'type': {shape_model}"
774 )
775 if member_traits:
776 shape_model = shape_model.copy()
777 shape_model.update(member_traits)
778 result = shape_cls(shape_name, shape_model, self)
779 return result
780
781 def resolve_shape_ref(self, shape_ref):
782 # A shape_ref is a dict that has a 'shape' key that

Callers 15

test_shape_overridesMethod · 0.95
test_shape_metadataMethod · 0.95
test_shape_listMethod · 0.95
test_missing_type_keyMethod · 0.95
test_bad_shape_refMethod · 0.95

Calls 4

NoShapeFoundErrorClass · 0.85
InvalidShapeErrorClass · 0.85
copyMethod · 0.45
updateMethod · 0.45

Tested by 15

test_shape_overridesMethod · 0.76
test_shape_metadataMethod · 0.76
test_shape_listMethod · 0.76
test_missing_type_keyMethod · 0.76
test_bad_shape_refMethod · 0.76