A $n$-variable function $f$ is a symmetric function if $$f(x_1,x_2, \ldots, x_n) = f(x_{\sigma(1)}, x_{\sigma(2)}, \ldots, x_{\sigma(n)})$$ for every permutation $\sigma \in S_n$. In particular, if $f$ is a polynomial, then $f$ is a symmetric polynomial. These objects have been studied extensively.

I wonder if the following generalization has been studied. A $n^2$-variable function $f$ is an $S_n$-symmetric function if $$f(x_{11}, x_{12}, \ldots, x_{1n}, \ldots, x_{nn}) = f(x_{\sigma(1)\sigma(1)}, x_{\sigma(1)\sigma(2)}, \ldots, x_{\sigma(1)\sigma(n)}, \ldots, x_{\sigma(n)\sigma(n)})$$ for every permutation $\sigma \in S_n$.

I think such objects must have been studied as they are so natural. But I don't know the keywords and couldn't find the literature.

I'm very grateful if anyone could provide information on them. Thanks in advance.