All Downloads are FREE. Search and download functionalities are using the official Maven repository.

notion.api.v1.request.blocks.RetrieveBlockChildrenRequest.kt Maven / Gradle / Ivy

package notion.api.v1.request.blocks

import notion.api.v1.request.common.Pagination

// var is intentional here (for the easiness in other JVM languages)
data class RetrieveBlockChildrenRequest(
    val blockId: String,
    override var startCursor: String? = null,
    override var pageSize: Int? = null,
) : Pagination {

    // For other JVM languages
    constructor(blockId: String) : this(blockId, null, null)

    fun toQuery(): Map {
        val body = mutableMapOf()
        if (startCursor != null) {
            body["start_cursor"] = startCursor!!
        }
        if (pageSize != null) {
            body["page_size"] = pageSize.toString()
        }
        return body
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy