public EmailResponse sendEmail(String template, Integer template_id, EmailRequest body) throws ApiException { // create path and map variables String path = serviceName.replaceAll("\\{format\\}", "json"); // query params Map<String, String> queryParams = new HashMap<String, String>(); Map<String, String> headerParams = new HashMap<String, String>(); if (!"null".equals(String.valueOf(template))) queryParams.put("template", String.valueOf(template)); if (!"null".equals(String.valueOf(template_id))) queryParams.put("template_id", String.valueOf(template_id)); String contentType = "application/json"; try { String response = apiInvoker.invokeAPI( basePath, path, "POST", queryParams, body, headerParams, contentType); if (response != null) { return (EmailResponse) ApiInvoker.deserialize(response, "", EmailResponse.class); } else { return null; } } catch (ApiException ex) { if (ex.getCode() == 404) { return null; } else { throw ex; } } }
public Records getRecords( String table_name, String ids, String filter, Integer limit, Integer offset, String order, String fields, String related, Boolean include_count, Boolean include_schema, String id_field) throws ApiException { // verify required params are set if (table_name == null) { throw new ApiException(400, "missing required params"); } // create path and map variables String path = "/db/{table_name}" .replaceAll("\\{format\\}", "json") .replaceAll( "\\{" + "table_name" + "\\}", apiInvoker.escapeString(table_name.toString())); // query params Map<String, String> queryParams = new HashMap<String, String>(); Map<String, String> headerParams = new HashMap<String, String>(); if (!"null".equals(String.valueOf(ids))) queryParams.put("ids", String.valueOf(ids)); if (!"null".equals(String.valueOf(filter))) queryParams.put("filter", String.valueOf(filter)); if (!"null".equals(String.valueOf(limit))) queryParams.put("limit", String.valueOf(limit)); if (!"null".equals(String.valueOf(offset))) queryParams.put("offset", String.valueOf(offset)); if (!"null".equals(String.valueOf(order))) queryParams.put("order", String.valueOf(order)); if (!"null".equals(String.valueOf(fields))) queryParams.put("fields", String.valueOf(fields)); if (!"null".equals(String.valueOf(related))) queryParams.put("related", String.valueOf(related)); if (!"null".equals(String.valueOf(include_count))) queryParams.put("include_count", String.valueOf(include_count)); if (!"null".equals(String.valueOf(include_schema))) queryParams.put("include_schema", String.valueOf(include_schema)); if (!"null".equals(String.valueOf(id_field))) queryParams.put("id_field", String.valueOf(id_field)); String contentType = "application/json"; try { String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, contentType); if (response != null) { return (Records) ApiInvoker.deserialize(response, "", Records.class); } else { return null; } } catch (ApiException ex) { if (ex.getCode() == 404) { return null; } else { throw ex; } } }
public Resources getResources() throws ApiException { // create path and map variables String path = "/db".replaceAll("\\{format\\}", "json"); // query params Map<String, String> queryParams = new HashMap<String, String>(); Map<String, String> headerParams = new HashMap<String, String>(); String contentType = "application/json"; try { String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, contentType); if (response != null) { return (Resources) ApiInvoker.deserialize(response, "", Resources.class); } else { return null; } } catch (ApiException ex) { if (ex.getCode() == 404) { return null; } else { throw ex; } } }
public Tables getTables(String names) throws ApiException { // verify required params are set if (names == null) { throw new ApiException(400, "missing required params"); } // create path and map variables String path = "/db".replaceAll("\\{format\\}", "json"); // query params Map<String, String> queryParams = new HashMap<String, String>(); Map<String, String> headerParams = new HashMap<String, String>(); if (!"null".equals(String.valueOf(names))) queryParams.put("names", String.valueOf(names)); String contentType = "application/json"; try { String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, contentType); if (response != null) { return (Tables) ApiInvoker.deserialize(response, "", Tables.class); } else { return null; } } catch (ApiException ex) { if (ex.getCode() == 404) { return null; } else { throw ex; } } }
public Records createRecords( String table_name, Records body, String id_field, String fields, String related, String XHTTPMETHOD) throws ApiException { // verify required params are set if (table_name == null || body == null) { throw new ApiException(400, "missing required params"); } // create path and map variables String path = "/db/{table_name}" .replaceAll("\\{format\\}", "json") .replaceAll( "\\{" + "table_name" + "\\}", apiInvoker.escapeString(table_name.toString())); // query params Map<String, String> queryParams = new HashMap<String, String>(); Map<String, String> headerParams = new HashMap<String, String>(); if (!"null".equals(String.valueOf(id_field))) queryParams.put("id_field", String.valueOf(id_field)); if (!"null".equals(String.valueOf(fields))) queryParams.put("fields", String.valueOf(fields)); if (!"null".equals(String.valueOf(related))) queryParams.put("related", String.valueOf(related)); headerParams.put("X-HTTP-METHOD", XHTTPMETHOD); String contentType = "application/json"; try { String response = apiInvoker.invokeAPI( basePath, path, "POST", queryParams, body, headerParams, contentType); if (response != null) { return (Records) ApiInvoker.deserialize(response, "", Records.class); } else { return null; } } catch (ApiException ex) { if (ex.getCode() == 404) { return null; } else { throw ex; } } }