Skip to content

Commit

Permalink
Update Update Grant to fix scope (#211)
Browse files Browse the repository at this point in the history
Update Grant Request is using scope whereas it should be scope

https://nylas.atlassian.net/browse/TW-2577

# 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.
  • Loading branch information
atejada authored Feb 21, 2024
1 parent d5fb9f8 commit 7e03603
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/main/kotlin/com/nylas/models/UpdateGrantRequest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ data class UpdateGrantRequest(
/**
* List of integration scopes for the grant.
*/
@Json(name = "scopes")
val scopes: List<String>? = null,
@Json(name = "scope")
val scope: List<String>? = null,
) {
/**
* Builder for [UpdateGrantRequest].
*/
class Builder {
private var settings: Map<String, Any>? = null
private var scopes: List<String>? = null
private var scope: List<String>? = null

/**
* Update the settings required by provider.
Expand All @@ -36,12 +36,12 @@ data class UpdateGrantRequest(
* @param scopes List of scopes
* @return This builder
*/
fun scopes(scopes: List<String>) = apply { this.scopes = scopes }
fun scopes(scopes: List<String>) = apply { this.scope = scopes }

/**
* Build the [UpdateGrantRequest].
* @return The built [UpdateGrantRequest]
*/
fun build() = UpdateGrantRequest(settings, scopes)
fun build() = UpdateGrantRequest(settings, scope)
}
}
2 changes: 1 addition & 1 deletion src/test/kotlin/com/nylas/resources/GrantsTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class GrantsTests {
settings = mapOf(
"key" to "value",
),
scopes = listOf(
scope = listOf(
"Mail.Read",
"User.Read",
"offline_access",
Expand Down

0 comments on commit 7e03603

Please sign in to comment.