-
Notifications
You must be signed in to change notification settings - Fork 19
TW-5374 Add missing admin API resources #327
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
223dc69
TW-5374 Add missing admin API resources
AaronDDM ff68117
TW-5374 Fix CI lint
AaronDDM 026beb2
TW-5374 Align workspace schema with source
AaronDDM f9bafaa
TW-5374 Fix rules list test stubs
AaronDDM 071c6dd
TW-5374 Validate workspace auto-group domain
AaronDDM 607da36
Add lists admin API support
AaronDDM 4192f40
Fix rules list response parsing
AaronDDM 69f4a06
Add service account signing for domains
AaronDDM 5ce8bbf
Add workspace list pagination params
AaronDDM 66d868c
Support callback URIs in application updates
AaronDDM a157d87
Canonicalize signed domain request bodies
AaronDDM 20cbcfd
Address Java admin API review feedback
AaronDDM 13f4293
Make workspace policy detach explicit
AaronDDM 7f23105
Unwrap nested rules list response
AaronDDM 2f155cc
Support flat and nested rules list responses
AaronDDM 7f3f68e
Address Java list and callback URI feedback
AaronDDM 6047079
Complete Java domains parity fixes
AaronDDM 2869c28
Split domain verification request types
AaronDDM 999315c
Keep rules list wrapper internal
AaronDDM 0e5ae03
Remove unsupported domain list filters
AaronDDM cd53b18
Restore RequestOverrides JVM constructor
AaronDDM ee9b088
Keep RequestOverrides data class ABI stable
AaronDDM 0a4114a
Address application and workspace review feedback
AaronDDM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,13 @@ | ||
| package com.nylas.models | ||
|
|
||
| import com.squareup.moshi.Json | ||
|
|
||
| /** | ||
| * Class representation of a Nylas create domain request. | ||
| */ | ||
| data class CreateDomainRequest( | ||
| @Json(name = "name") | ||
| val name: String, | ||
| @Json(name = "domain_address") | ||
| val domainAddress: String, | ||
| ) |
This file contains hidden or 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
38 changes: 38 additions & 0 deletions
38
src/main/kotlin/com/nylas/models/CreateWorkspaceRequest.kt
This file contains hidden or 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,38 @@ | ||
| package com.nylas.models | ||
|
|
||
| import com.squareup.moshi.Json | ||
|
|
||
| /** | ||
| * Class representation of a Nylas create workspace request. | ||
| */ | ||
| data class CreateWorkspaceRequest( | ||
| @Json(name = "name") | ||
| val name: String, | ||
| @Json(name = "domain") | ||
| val domain: String? = null, | ||
| @Json(name = "auto_group") | ||
| val autoGroup: Boolean? = null, | ||
| @Json(name = "policy_id") | ||
| val policyId: String? = null, | ||
| @Json(name = "rule_ids") | ||
| val ruleIds: List<String>? = null, | ||
| ) { | ||
| init { | ||
| require(autoGroup != true || !domain.isNullOrBlank()) { | ||
| "domain is required when autoGroup is true" | ||
| } | ||
| } | ||
|
|
||
| data class Builder(private val name: String) { | ||
| private var domain: String? = null | ||
| private var autoGroup: Boolean? = null | ||
| private var policyId: String? = null | ||
| private var ruleIds: List<String>? = null | ||
|
|
||
| fun domain(domain: String?) = apply { this.domain = domain } | ||
| fun autoGroup(autoGroup: Boolean?) = apply { this.autoGroup = autoGroup } | ||
| fun policyId(policyId: String?) = apply { this.policyId = policyId } | ||
| fun ruleIds(ruleIds: List<String>?) = apply { this.ruleIds = ruleIds } | ||
| fun build() = CreateWorkspaceRequest(name, domain, autoGroup, policyId, ruleIds) | ||
| } | ||
| } | ||
This file contains hidden or 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,39 @@ | ||
| package com.nylas.models | ||
|
|
||
| import com.squareup.moshi.Json | ||
|
|
||
| /** | ||
| * Class representation of a Nylas managed email domain. | ||
| */ | ||
| data class Domain( | ||
| @Json(name = "id") | ||
| val id: String? = null, | ||
| @Json(name = "name") | ||
| val name: String? = null, | ||
| @Json(name = "domain_address") | ||
| val domainAddress: String? = null, | ||
| @Json(name = "organization_id") | ||
| val organizationId: String? = null, | ||
| @Json(name = "branded") | ||
| val branded: Boolean? = null, | ||
| @Json(name = "region") | ||
| val region: String? = null, | ||
| @Json(name = "verified_ownership") | ||
| val verifiedOwnership: Boolean? = null, | ||
| @Json(name = "verified_mx") | ||
| val verifiedMx: Boolean? = null, | ||
| @Json(name = "verified_spf") | ||
| val verifiedSpf: Boolean? = null, | ||
| @Json(name = "verified_feedback") | ||
| val verifiedFeedback: Boolean? = null, | ||
| @Json(name = "verified_dkim") | ||
| val verifiedDkim: Boolean? = null, | ||
| @Json(name = "verified_dmarc") | ||
| val verifiedDmarc: Boolean? = null, | ||
| @Json(name = "verified_arc") | ||
| val verifiedArc: Boolean? = null, | ||
| @Json(name = "created_at") | ||
| val createdAt: Long? = null, | ||
| @Json(name = "updated_at") | ||
| val updatedAt: Long? = null, | ||
| ) |
This file contains hidden or 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,123 @@ | ||
| package com.nylas.models | ||
|
|
||
| import com.squareup.moshi.Json | ||
|
|
||
| /** | ||
| * DNS verification types accepted by the Manage Domains API. | ||
| */ | ||
| enum class DomainVerificationType { | ||
| @Json(name = "ownership") | ||
| OWNERSHIP, | ||
|
|
||
| @Json(name = "mx") | ||
| MX, | ||
|
|
||
| @Json(name = "spf") | ||
| SPF, | ||
|
|
||
| @Json(name = "dkim") | ||
| DKIM, | ||
|
|
||
| @Json(name = "feedback") | ||
| FEEDBACK, | ||
|
|
||
| @Json(name = "dmarc") | ||
| DMARC, | ||
|
|
||
| @Json(name = "arc") | ||
| ARC, | ||
|
AaronDDM marked this conversation as resolved.
|
||
| } | ||
|
|
||
| /** | ||
| * DNS verification types accepted by Manage Domains verification requests. | ||
| */ | ||
| enum class DomainVerificationRequestType { | ||
|
AaronDDM marked this conversation as resolved.
|
||
| @Json(name = "ownership") | ||
| OWNERSHIP, | ||
|
|
||
| @Json(name = "mx") | ||
| MX, | ||
|
|
||
| @Json(name = "spf") | ||
| SPF, | ||
|
|
||
| @Json(name = "dkim") | ||
| DKIM, | ||
|
|
||
| @Json(name = "feedback") | ||
| FEEDBACK, | ||
| } | ||
|
|
||
| /** | ||
| * Status values returned by domain DNS verification attempts. | ||
| */ | ||
| enum class DomainVerificationStatus { | ||
| @Json(name = "pending") | ||
| PENDING, | ||
|
|
||
| @Json(name = "done") | ||
| DONE, | ||
|
|
||
| @Json(name = "failed") | ||
| FAILED, | ||
| } | ||
|
|
||
| /** | ||
| * Class representation of a domain DNS verification request. | ||
| */ | ||
| data class DomainVerificationRequest( | ||
| @Json(name = "type") | ||
| val type: DomainVerificationRequestType, | ||
| @Json(name = "options") | ||
| val options: Map<String, Any>? = null, | ||
| ) { | ||
| /** | ||
| * Builder for [DomainVerificationRequest]. | ||
| */ | ||
| data class Builder(private val type: DomainVerificationRequestType) { | ||
| private var options: Map<String, Any>? = null | ||
|
|
||
| /** | ||
| * Set verification options. | ||
| * @param options Verification options. | ||
| * @return This builder. | ||
| */ | ||
| fun options(options: Map<String, Any>?) = apply { this.options = options } | ||
|
|
||
| /** | ||
| * Build the [DomainVerificationRequest]. | ||
| * @return The built [DomainVerificationRequest]. | ||
| */ | ||
| fun build() = DomainVerificationRequest(type, options) | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Class representation of a verification attempt returned by the API. | ||
| */ | ||
| data class DomainVerificationAttempt( | ||
| @Json(name = "type") | ||
| val type: DomainVerificationType? = null, | ||
| @Json(name = "options") | ||
| val options: Map<String, Any>? = null, | ||
| ) | ||
|
|
||
| /** | ||
| * Class representation of a domain verification result. | ||
| */ | ||
| data class DomainVerificationResult( | ||
| @Json(name = "domain_id") | ||
| val domainId: String? = null, | ||
| @Json(name = "attempt") | ||
| val attempt: DomainVerificationAttempt? = null, | ||
| @Json(name = "status") | ||
| val status: DomainVerificationStatus? = null, | ||
| @Json(name = "created_at") | ||
| val createdAt: Long? = null, | ||
| @Json(name = "expires_at") | ||
| val expiresAt: Long? = null, | ||
| @Json(name = "details") | ||
| val details: Map<String, Any>? = null, | ||
| @Json(name = "message") | ||
| val message: String? = null, | ||
| ) | ||
22 changes: 22 additions & 0 deletions
22
src/main/kotlin/com/nylas/models/ListDomainsQueryParams.kt
This file contains hidden or 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,22 @@ | ||
| package com.nylas.models | ||
|
|
||
| import com.squareup.moshi.Json | ||
|
|
||
| /** | ||
| * Class representation of the query parameters for listing domains. | ||
| */ | ||
| data class ListDomainsQueryParams( | ||
| @Json(name = "limit") | ||
| val limit: Int? = null, | ||
| @Json(name = "page_token") | ||
| val pageToken: String? = null, | ||
| ) : IQueryParams { | ||
| class Builder { | ||
| private var limit: Int? = null | ||
| private var pageToken: String? = null | ||
|
|
||
| fun limit(limit: Int?) = apply { this.limit = limit } | ||
| fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } | ||
| fun build() = ListDomainsQueryParams(limit, pageToken) | ||
| } | ||
| } |
22 changes: 22 additions & 0 deletions
22
src/main/kotlin/com/nylas/models/ListRuleEvaluationsQueryParams.kt
This file contains hidden or 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,22 @@ | ||
| package com.nylas.models | ||
|
|
||
| import com.squareup.moshi.Json | ||
|
|
||
| /** | ||
| * Class representation of the query parameters for listing rule evaluations. | ||
| */ | ||
| data class ListRuleEvaluationsQueryParams( | ||
| @Json(name = "limit") | ||
| val limit: Int? = null, | ||
| @Json(name = "page_token") | ||
| val pageToken: String? = null, | ||
| ) : IQueryParams { | ||
| class Builder { | ||
| private var limit: Int? = null | ||
| private var pageToken: String? = null | ||
|
|
||
| fun limit(limit: Int?) = apply { this.limit = limit } | ||
| fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } | ||
| fun build() = ListRuleEvaluationsQueryParams(limit, pageToken) | ||
| } | ||
| } |
47 changes: 47 additions & 0 deletions
47
src/main/kotlin/com/nylas/models/ListWorkspacesQueryParams.kt
This file contains hidden or 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,47 @@ | ||
| package com.nylas.models | ||
|
|
||
| import com.squareup.moshi.Json | ||
|
|
||
| /** | ||
| * Class representation of the query parameters for listing workspaces. | ||
| */ | ||
| data class ListWorkspacesQueryParams( | ||
| /** | ||
| * The maximum number of objects to return. | ||
| */ | ||
| @Json(name = "limit") | ||
| val limit: Int? = null, | ||
| /** | ||
| * Cursor for pagination. Pass the value of [ListResponse.nextCursor] to get the next page. | ||
| */ | ||
| @Json(name = "page_token") | ||
| val pageToken: String? = null, | ||
| ) : IQueryParams { | ||
| /** | ||
| * Builder for [ListWorkspacesQueryParams]. | ||
| */ | ||
| class Builder { | ||
| private var limit: Int? = null | ||
| private var pageToken: String? = null | ||
|
|
||
| /** | ||
| * Set the maximum number of objects to return. | ||
| * @param limit The maximum number of objects to return. | ||
| * @return The builder. | ||
| */ | ||
| fun limit(limit: Int) = apply { this.limit = limit } | ||
|
|
||
| /** | ||
| * Set the pagination cursor. | ||
| * @param pageToken Cursor for pagination. Pass the value of [ListResponse.nextCursor]. | ||
| * @return The builder. | ||
| */ | ||
| fun pageToken(pageToken: String) = apply { this.pageToken = pageToken } | ||
|
|
||
| /** | ||
| * Build the [ListWorkspacesQueryParams]. | ||
| * @return A [ListWorkspacesQueryParams] with the provided values. | ||
| */ | ||
| fun build() = ListWorkspacesQueryParams(limit, pageToken) | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.