class OAuth2AuthorizationResolversImpl implements OAuth2AuthorizationResolvers {

    @Override
    public DataFetcher<OAuth2Authorization> createOAuth2AuthorizationDataFetcher() {
        return environment -> {
            long companyId = util.getLongArg(environment, "companyId");
            long userId = util.getLongArg(environment, "userId", util.getDefaultUserId());
            String userName = util.getStringArg(environment, "userName");
            long oAuth2ApplicationId = util.getLongArg(environment, "oAuth2ApplicationId");
            long oAuth2ApplicationScopeAliasesId = util.getLongArg(environment, "oAuth2ApplicationScopeAliasesId");
            String accessTokenContent = util.getStringArg(environment, "accessTokenContent");
            Date accessTokenCreateDate = util.getDateArg(environment, "accessTokenCreateDate");
            Date accessTokenExpirationDate = util.getDateArg(environment, "accessTokenExpirationDate");
            String remoteIPInfo = util.getStringArg(environment, "remoteIPInfo");
            String refreshTokenContent = util.getStringArg(environment, "refreshTokenContent");
            Date refreshTokenCreateDate = util.getDateArg(environment, "refreshTokenCreateDate");
            Date refreshTokenExpirationDate = util.getDateArg(environment, "refreshTokenExpirationDate");

            return oAuth2AuthorizationLocalService.addOAuth2Authorization(
                    companyId,
                    userId,
                    userName,
                    oAuth2ApplicationId,
                    oAuth2ApplicationScopeAliasesId,
                    accessTokenContent,
                    accessTokenCreateDate,
                    accessTokenExpirationDate,
                    remoteIPInfo,
                    refreshTokenContent,
                    refreshTokenCreateDate,
                    refreshTokenExpirationDate);
        };
    }

}