code: public static Domain create(final BandwidthClient client, final Map<String, Object>params) throws AppPlatformException, ParseException, Exception {
          assert (client!= null && params != null);
          final String domainsUri =  client.getUserResourceUri(BandwidthConstants.DOMAINS_URI_PATH);
          final RestResponse response = client.post(domainsUri, params);
          final JSONObject callObj = toJSONObject(client.get(response.getLocation(), null));
          return new Domain(client, callObj);
      }
docs: Convenience factory method to create a Domain.
  @param client the client.
  @param params the request parameters.
  @return the created domain.
  @throws AppPlatformException API Exception
  @throws ParseException Error parsing data
  @throws Exception error