Skip to content

Commit

Permalink
Update Update Grant to fix scope
Browse files Browse the repository at this point in the history
Update Grant Request is using scope whereas it should be scope
  • Loading branch information
atejada committed Feb 15, 2024
1 parent d5fb9f8 commit 39165b2
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 39165b2

Please sign in to comment.