code: public void preparePostUpload(final List<Attachment> attachments) {
          tempParts.clear();
          if (!attachments.isEmpty()) {
              for (Attachment a : attachments) {
                  if (a.getError() != null) {
                      errorParts.add(createErrorPart(a));
                  } else {
                      publicParts.add(createPart(a));
                  }
              }
          }
      }
docs: Replace temporary attachment parts with final parts with upload details or error message.
  
  @param attachments List of attachments details.