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

Minor model fixes for v2 beta 4 #190

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/kotlin/com/nylas/models/ComposeMessageRequest.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representing a request to compose a message.
*/
data class ComposeMessageRequest(
/**
* The prompt that smart compose will use to generate a message suggestion.
*/
@Json(name = "prompt")
val prompt: String,
)
3 changes: 3 additions & 0 deletions src/main/kotlin/com/nylas/models/ComposeMessageResponse.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representing a response to a message composition request.
*/
data class ComposeMessageResponse(
/**
* The message suggestion generated by smart compose.
*/
@Json(name = "suggestion")
val suggestion: String,
)
4 changes: 4 additions & 0 deletions src/main/kotlin/com/nylas/models/ContactEmail.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Interface for email addresses in a contact.
*/
data class ContactEmail(
@Json(name = "email")
val email: String? = null,
@Json(name = "type")
val type: ContactType? = null,
) {
class Builder {
Expand Down
8 changes: 8 additions & 0 deletions src/main/kotlin/com/nylas/models/ContactGroup.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representing a contact group.
*/
data class ContactGroup(
@Json(name = "id")
val id: String,
@Json(name = "grant_id")
val grantId: String? = null,
@Json(name = "group_type")
val groupType: GroupType? = null,
@Json(name = "name")
val name: String? = null,
@Json(name = "path")
val path: String? = null,
@Json(name = "object")
private val obj: String = "contact_group",
) {
fun getObject() = obj
Expand Down
6 changes: 6 additions & 0 deletions src/main/kotlin/com/nylas/models/ContactGroupId.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representing an object that points to a contact group ID.
*/
data class ContactGroupId(
/**
* The ID of the contact group.
*/
@Json(name = "id")
val id: String,
)
6 changes: 6 additions & 0 deletions src/main/kotlin/com/nylas/models/CreateFolderRequest.kt
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representation of the Nylas folder creation request.
*/
data class CreateFolderRequest(
/**
* The name of the folder.
*/
@Json(name = "name")
val name: String,
/**
* The parent ID of the folder. (Microsoft only)
*/
@Json(name = "parent_id")
val parentId: String? = null,
/**
* The background color of the folder. (Google only)
*/
@Json(name = "background_color")
val backgroundColor: String? = null,
/**
* The text color of the folder. (Google only)
*/
@Json(name = "text_color")
val textColor: String? = null,
) {
/**
Expand Down
4 changes: 4 additions & 0 deletions src/main/kotlin/com/nylas/models/EmailName.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representing an email address and optional name.
*/
data class EmailName(
/**
* Email address.
*/
@Json(name = "email")
val email: String,
/**
* Full name.
*/
@Json(name = "name")
val name: String? = null,
)
3 changes: 3 additions & 0 deletions src/main/kotlin/com/nylas/models/FindMessageQueryParams.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representing the query parameters for finding a message.
*/
data class FindMessageQueryParams(
/**
* Allows you to specify to the message with headers included.
*/
@Json(name = "fields")
val fields: MessageFields? = null,
)
4 changes: 4 additions & 0 deletions src/main/kotlin/com/nylas/models/InstantMessagingAddress.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representation for an IM address in a contact.
*/
data class InstantMessagingAddress(
@Json(name = "im_address")
val imAddress: String? = null,
@Json(name = "type")
val type: ContactType? = null,
) {
class Builder {
Expand Down
4 changes: 4 additions & 0 deletions src/main/kotlin/com/nylas/models/MessageHeaders.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representing a message header.
*/
data class MessageHeaders(
/**
* The header name.
*/
@Json(name = "name")
val name: String,
/**
* The header value.
*/
@Json(name = "value")
val value: String,
)
5 changes: 5 additions & 0 deletions src/main/kotlin/com/nylas/models/PKCEAuthURL.kt
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representing the object containing the OAuth 2.0 URL as well as the hashed secret.
*/
data class PKCEAuthURL(
/**
* The URL for hosted authentication
*/
@Json(name = "url")
val url: String,
/**
* Server-side challenge used in the OAuth 2.0 flow
*/
@Json(name = "secret")
val secret: String,
/**
* SHA-256 hash of the secret
*/
@Json(name = "secret_hash")
val secretHash: String,
)
4 changes: 4 additions & 0 deletions src/main/kotlin/com/nylas/models/PhoneNumber.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representation for phone numbers in a contact.
*/
data class PhoneNumber(
@Json(name = "number")
val number: String? = null,
@Json(name = "type")
val type: ContactType? = null,
) {
class Builder {
Expand Down
9 changes: 9 additions & 0 deletions src/main/kotlin/com/nylas/models/PhysicalAddress.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representation for a physical address in a contact.
*/
data class PhysicalAddress(
@Json(name = "format")
val format: String? = null,
@Json(name = "street_address")
val streetAddress: String? = null,
@Json(name = "city")
val city: String? = null,
@Json(name = "postal_code")
val postalCode: String? = null,
@Json(name = "state")
val state: String? = null,
@Json(name = "country")
val country: String? = null,
@Json(name = "type")
val type: ContactType? = null,
) {
class Builder {
Expand Down
5 changes: 5 additions & 0 deletions src/main/kotlin/com/nylas/models/ScheduledMessage.kt
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representing information about a scheduled message.
*/
data class ScheduledMessage(
/**
* The unique identifier for the scheduled message.
*/
@Json(name = "scheduled_id")
val scheduleId: Int,
/**
* The status of the scheduled message.
*/
@Json(name = "status")
val status: ScheduledMessageStatus,
/**
* The time the message was sent or failed to send, in epoch time.
*/
@Json(name = "close_time")
val closeTime: Int?,
)
4 changes: 4 additions & 0 deletions src/main/kotlin/com/nylas/models/ScheduledMessageStatus.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representing a scheduled message status.
*/
data class ScheduledMessageStatus(
/**
* The status code the describes the state of the scheduled message
*/
@Json(name = "code")
val code: String,
/**
* A description of the status of the scheduled message
*/
@Json(name = "description")
val description: String,
)
3 changes: 3 additions & 0 deletions src/main/kotlin/com/nylas/models/ScheduledMessagesList.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representing a list of scheduled messages.
*/
data class ScheduledMessagesList(
/**
* The list of scheduled messages.
*/
@Json(name = "schedules")
val schedules: List<ScheduledMessage>,
)
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representing a response after stopping a scheduled message.
*/
data class StopScheduledMessageResponse(
/**
* A message describing the result of the request.
*/
@Json(name = "message")
val message: String,
)
5 changes: 5 additions & 0 deletions src/main/kotlin/com/nylas/models/UpdateConnectorRequest.kt
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representing a Nylas update connector request.
*/
data class UpdateConnectorRequest(
/**
* Custom name of the connector
*/
@Json(name = "name")
val name: String?,
/**
* The OAuth provider credentials and settings
*/
@Json(name = "settings")
val settings: Map<String, Any>?,
/**
* The OAuth scopes
*/
@Json(name = "scope")
val scope: List<String>?,
)
4 changes: 4 additions & 0 deletions src/main/kotlin/com/nylas/models/UpdateCredentialRequest.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representing a request to update a credential
*/
data class UpdateCredentialRequest(
/**
* Unique name of this credential
*/
@Json(name = "name")
val name: String?,
/**
* Data that specifies some special data required for this credential
*/
@Json(name = "credential_data")
val credentialData: CredentialData?,
) {
/**
Expand Down
Loading
Loading