module Aws::Api::Docs::Utils

def compute_recursive_shapes(ref, stack = [], recursive = Set.new)

of the recursive shapes found in tree.
Given a shape reference, this function returns a Set of all
def compute_recursive_shapes(ref, stack = [], recursive = Set.new)
  if ref && !stack.include?(ref.shape)
    stack.push(ref.shape)
    case ref.shape
    when StructureShape
      ref.shape.members.each do |_, member_ref|
        compute_recursive_shapes(member_ref, stack, recursive)
      end
    when ListShape
      compute_recursive_shapes(ref.shape.member, stack, recursive)
    when MapShape
      compute_recursive_shapes(ref.shape.value, stack, recursive)
    end
    stack.pop
  elsif ref
    recursive << ref.shape
  end
  recursive
end