private Resource toResource(UserAuthenticationSourceResponse response, Set<String> requestedIds) {
    final ResourceImpl resource = new ResourceImpl(Resource.Type.UserAuthenticationSource);

    setResourceProperty(resource, AUTHENTICATION_USER_NAME_PROPERTY_ID, response.getUserName(), requestedIds);
    setResourceProperty(resource, AUTHENTICATION_AUTHENTICATION_SOURCE_ID_PROPERTY_ID, response.getSourceId(), requestedIds);
    setResourceProperty(resource, AUTHENTICATION_AUTHENTICATION_TYPE_PROPERTY_ID, response.getAuthenticationType().name(), requestedIds);
    setResourceProperty(resource, AUTHENTICATION_CREATED_PROPERTY_ID, response.getCreateTime(), requestedIds);
    setResourceProperty(resource, AUTHENTICATION_UPDATED_PROPERTY_ID, response.getUpdateTime(), requestedIds);

    // NOTE, AUTHENTICATION_KEY_PROPERTY_ID is not being returned here since we don't want to return
    // any sensitive information.  Once set that data should stay internal to Ambari.

    return resource;
  }
Translate the Response into a Resource

@param response     {@link PrivilegeResponse}
@param requestedIds the relevant request ids
@return a resource
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserAuthenticationSourceResourceProvider.java