Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for clean messages #226

Merged
merged 9 commits into from
Apr 30, 2024

Conversation

mrashed-dev
Copy link
Contributor

Description

This PR adds support for the /messages/clean endpoint.

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@codecov-commenter
Copy link

codecov-commenter commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.04%. Comparing base (867ac11) to head (dc9f17b).

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #226      +/-   ##
============================================
+ Coverage     79.92%   80.04%   +0.11%     
- Complexity      283      284       +1     
============================================
  Files            30       30              
  Lines           842      847       +5     
  Branches         86       86              
============================================
+ Hits            673      678       +5     
  Misses          120      120              
  Partials         49       49              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@atejada atejada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrashed-dev Just test this but getting this error 😔

Expected BEGIN_OBJECT but was BEGIN_ARRAY at path $.data

at com.nylas.resources.Messages.cleanConversation(Messages.kt:147)

List<String> messagesId = List.of("18f15bb2caed40c6");

CleanMessageRequest requestBody = new CleanMessageRequest.Builder(messagesId).
                ignoreImages(false).
                ignoreLinks(false).
                ignoreTables(true).
                imagesAsMarkdown(true).
                removeConclusionPhrases(true)
                .build();

        Response<CleanMessageResponse> clean = nylas.messages().cleanConversation(dotenv.get("GRANT_ID"), requestBody);

atejada added 2 commits April 30, 2024 15:03
Add ovverrideParamCaptor to fix Linter error message
Copy link
Contributor

@atejada atejada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good! 🚀

@mrashed-dev mrashed-dev merged commit 2f61629 into main Apr 30, 2024
2 checks passed
@mrashed-dev mrashed-dev mentioned this pull request Apr 30, 2024
mrashed-dev added a commit that referenced this pull request Apr 30, 2024
# Changelog
### Added
* Added missing webhook triggers (#220)
* Added provider field to token exchange response (#225)
* Added support for clean messages endpoint (#226, #228)
* Added support for custom headers field for Drafts and Messages (#223)
* Added support for overriding various fields of outgoing requests
(#224)

### Changed
* Fixed issue where attachments < 3mb were not being encoded correctly
(#227, #222)

# License
<!-- Your PR comment must contain the following line for us to merge the
PR. -->
I confirm that this contribution is made under the terms of the MIT
license and that I have the authority necessary to make this
contribution on behalf of its copyright owner.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants