docs: public ServiceCall<DocumentAccepted> addDocument(AddDocumentOptions addDocumentOptions) {
      Validator.notNull(addDocumentOptions, "addDocumentOptions cannot be null");
      Validator.isTrue((addDocumentOptions.file() != null) || (addDocumentOptions.metadata() != null),
          "At least one of file or metadata must be supplied.");
      String[] pathSegments = { "v1/environments", "collections", "documents" };
      String[] pathParameters = { addDocumentOptions.environmentId(), addDocumentOptions.collectionId() };
      RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
          pathParameters));
      builder.query("version", versionDate);
      Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "addDocument");
      for (Entry<String, String> header : sdkHeaders.entrySet()) {
        builder.header(header.getKey(), header.getValue());
      }
      builder.header("Accept", "application/json");
      MultipartBody.Builder multipartBuilder = new MultipartBody.Builder();
      multipartBuilder.setType(MultipartBody.FORM);
      if (addDocumentOptions.file() != null) {
        RequestBody fileBody = RequestUtils.inputStreamBody(addDocumentOptions.file(), addDocumentOptions
            .fileContentType());
        multipartBuilder.addFormDataPart("file", addDocumentOptions.filename(), fileBody);
      }
      if (addDocumentOptions.metadata() != null) {
        multipartBuilder.addFormDataPart("metadata", addDocumentOptions.metadata());
      }
      builder.body(multipartBuilder.build());
      return createServiceCall(builder.build(), ResponseConverterUtils.getObject(DocumentAccepted.class));
    }