-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for custom headers field for drafts and messages (#223)
# Description This PR adds support to the custom headers field used to attach headers to message and draft objects. # 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.
- Loading branch information
1 parent
ded393a
commit 6d4f58d
Showing
6 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.nylas.models | ||
|
||
import com.squareup.moshi.Json | ||
|
||
/** | ||
* Custom headers to be used when drafting or sending an email. | ||
*/ | ||
data class CustomHeader( | ||
/** | ||
* The name of the custom header. | ||
*/ | ||
@Json(name = "name") | ||
val name: String, | ||
/** | ||
* The value of the custom header. | ||
*/ | ||
@Json(name = "value") | ||
val value: String, | ||
) { | ||
/** | ||
* Builder for [CustomHeader]. | ||
* @property name The name of the custom header. | ||
* @property value The value of the custom header. | ||
*/ | ||
data class Builder( | ||
private val name: String, | ||
private val value: String, | ||
) { | ||
/** | ||
* Build the [CustomHeader] object. | ||
*/ | ||
fun build(): CustomHeader { | ||
return CustomHeader(name, value) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters