in src/stepfunctions/inputs/placeholders.py [0:0]
def get(self, name, type):
"""
Create a placeholder variable with an associated type.
Args:
name (str): Name of the placeholder variable.
type (type): Type of the placeholder variable.
Raises:
ValueError: If placeholder variable with the same name but different type already exists.
ValueError: If placeholder variable does not fit into a previously specified schema for the placeholder collection.
Returns:
Placeholder: Placeholder variable.
"""
if not self._is_valid_name(name):
raise ValueError('Key name can only be string or integer')
if name in self.store:
curr_variable = self.store[name]
if curr_variable.type != type:
raise ValueError('Key already exists with a different value type: {current_value_type}'.format(current_value_type=curr_variable.type))
return curr_variable
else:
self.store[name] = self._create_variable(name=name, parent=self, type=type)
return self.store[name]