/**
   * Adds a File Attachment to a Comment
   *
   * @param id Comment ID
   * @param file File and metadata to be attached to Comment
   * @param fileName The name and extension of the File Attachment
   * @param contentType The MIME type of the File Attachment
   * @param fileCategoryId The category of the File Attachment, if it has been assigned to one
   * @return APIFileAttachment
   */
  public APIFileAttachment addFileAttachment(
      Long id, File file, String fileName, String contentType, Integer fileCategoryId)
      throws ApiException {
    Object postBody = null;
    byte[] postBinaryBody = null;

    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(
          400, "Missing the required parameter 'id' when calling addFileAttachment");
    }

    // verify the required parameter 'file' is set
    if (file == null) {
      throw new ApiException(
          400, "Missing the required parameter 'file' when calling addFileAttachment");
    }

    // create path and map variables
    String path =
        "/Comments/{id}/FileAttachments"
            .replaceAll("\\{format\\}", "json")
            .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List<Pair> queryParams = new ArrayList<Pair>();
    Map<String, String> headerParams = new HashMap<String, String>();
    Map<String, Object> formParams = new HashMap<String, Object>();

    if (file != null) formParams.put("file", file);
    if (fileName != null) formParams.put("file_name", fileName);
    if (contentType != null) formParams.put("content_type", contentType);
    if (fileCategoryId != null) formParams.put("file_category_id", fileCategoryId);

    final String[] accepts = {"application/json", "text/json"};
    final String accept = apiClient.selectHeaderAccept(accepts);

    final String[] contentTypes = {"multipart/form-data"};
    final String contentType1 = apiClient.selectHeaderContentType(contentTypes);

    String[] authNames = new String[] {};

    TypeRef returnType = new TypeRef<APIFileAttachment>() {};
    return apiClient.invokeAPI(
        path,
        "POST",
        queryParams,
        postBody,
        postBinaryBody,
        headerParams,
        formParams,
        accept,
        contentType1,
        authNames,
        returnType);
  }
  /**
   * Gets a Comments&#39;s File Attachments
   *
   * @param id A Comments&#39;s ID (COMMENT_ID)
   * @param updatedAfterUtc Optional, earliest date when file attachment was last updated.
   * @param skip Optional, number of file attachments to skip.
   * @param top Optional, maximum number of file attachments to return in the response.
   * @param countTotal true if total number of records should be returned in the response headers.
   * @return List<APIFileAttachment>
   */
  public List<APIFileAttachment> getFileAttachments(
      Long id, Date updatedAfterUtc, Integer skip, Integer top, Boolean countTotal)
      throws ApiException {
    Object postBody = null;
    byte[] postBinaryBody = null;

    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(
          400, "Missing the required parameter 'id' when calling getFileAttachments");
    }

    // create path and map variables
    String path =
        "/Comments/{id}/FileAttachments"
            .replaceAll("\\{format\\}", "json")
            .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List<Pair> queryParams = new ArrayList<Pair>();
    Map<String, String> headerParams = new HashMap<String, String>();
    Map<String, Object> formParams = new HashMap<String, Object>();

    queryParams.addAll(apiClient.parameterToPairs("", "updated_after_utc", updatedAfterUtc));

    queryParams.addAll(apiClient.parameterToPairs("", "skip", skip));

    queryParams.addAll(apiClient.parameterToPairs("", "top", top));

    queryParams.addAll(apiClient.parameterToPairs("", "count_total", countTotal));

    final String[] accepts = {"application/json"};
    final String accept = apiClient.selectHeaderAccept(accepts);

    final String[] contentTypes = {"application/json"};
    final String contentType = apiClient.selectHeaderContentType(contentTypes);

    String[] authNames = new String[] {};

    TypeRef returnType = new TypeRef<List<APIFileAttachment>>() {};
    return apiClient.invokeAPI(
        path,
        "GET",
        queryParams,
        postBody,
        postBinaryBody,
        headerParams,
        formParams,
        accept,
        contentType,
        authNames,
        returnType);
  }
  /**
   * Gets a Comment
   *
   * @param id A Comments&#39;s ID
   * @return APIComment
   */
  public APIComment getComment(Long id) throws ApiException {
    Object postBody = null;
    byte[] postBinaryBody = null;

    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling getComment");
    }

    // create path and map variables
    String path =
        "/Comments/{id}"
            .replaceAll("\\{format\\}", "json")
            .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List<Pair> queryParams = new ArrayList<Pair>();
    Map<String, String> headerParams = new HashMap<String, String>();
    Map<String, Object> formParams = new HashMap<String, Object>();

    final String[] accepts = {"application/json"};
    final String accept = apiClient.selectHeaderAccept(accepts);

    final String[] contentTypes = {"application/json"};
    final String contentType = apiClient.selectHeaderContentType(contentTypes);

    String[] authNames = new String[] {};

    TypeRef returnType = new TypeRef<APIComment>() {};
    return apiClient.invokeAPI(
        path,
        "GET",
        queryParams,
        postBody,
        postBinaryBody,
        headerParams,
        formParams,
        accept,
        contentType,
        authNames,
        returnType);
  }