code: def set(self, logicalId, resource):
          
  
          resource_dict = resource
          if isinstance(resource, SamResource):
              resource_dict = resource.to_dict()
  
          self.resources[logicalId] = resource_dict
docs: Adds the resource to dictionary with given logical Id. It will overwrite, if the logicalId is already used.
  
          :param string logicalId: Logical Id to set to
          :param SamResource or dict resource: The actual resource data