code: private Observable<Attachment> upload(RxComapiClient client, Attachment a) {
          return client.service().messaging().uploadContent(a.getFolder(), a.getData())
                  .map(response -> a.updateWithUploadDetails(response.getResult()))
                  .doOnError(t -> log.e("Error uploading attachment. " + t.getLocalizedMessage()))
                  .onErrorReturn(a::setError);
      }
docs: Upload single attachment and update the details in it from the response.