code: public static BoxCollaborationWhitelist.Info create(final BoxAPIConnection api, String domain,
                                                          WhitelistDirection direction) {
  
          URL url = COLLABORATION_WHITELIST_ENTRIES_URL_TEMPLATE.build(api.getBaseURL());
          BoxJSONRequest request = new BoxJSONRequest(api, url, HttpMethod.POST);
          JsonObject requestJSON = new JsonObject()
                  .add("domain", domain)
                  .add("direction", direction.toString());
  
          request.setBody(requestJSON.toString());
          BoxJSONResponse response = (BoxJSONResponse) request.send();
          JsonObject responseJSON = JsonObject.readFrom(response.getJSON());
          BoxCollaborationWhitelist domainWhitelist =
                  new BoxCollaborationWhitelist(api, responseJSON.get("id").asString());
  
          return domainWhitelist.new Info(responseJSON);
      }
docs: Creates a new Collaboration Whitelist for a domain.
  @param   api                     the API connection to be used by the resource.
  @param   domain                  the domain to be added to a collaboration whitelist for a Box Enterprise.
  @param   direction               an enum representing the direction of the collaboration whitelist. Can be set to
  inbound, outbound, or both.
  @return                          information about the collaboration whitelist created.