Skip to content

Commit

Permalink
Polish documentation and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
KENNYSOFT committed Sep 19, 2024
1 parent 47006b9 commit a892eb8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public static Gson createCamelCase(SlackConfig config) {
.registerTypeAdapter(ContextBlockElement.class, new GsonContextBlockElementFactory(failOnUnknownProps))
.registerTypeAdapter(BlockElement.class, new GsonBlockElementFactory(failOnUnknownProps))
.registerTypeAdapter(RichTextElement.class, new GsonRichTextElementFactory(failOnUnknownProps))
.registerTypeAdapter(MessageChangedEvent.PreviousMessage.class, new GsonMessageChangedEventPreviousMessageFactory(failOnUnknownProps))
.registerTypeAdapter(LogsResponse.DetailsChangedValue.class, new GsonAuditLogsDetailsChangedValueFactory(failOnUnknownProps))
.registerTypeAdapter(MessageChangedEvent.PreviousMessage.class, new GsonMessageChangedEventPreviousMessageFactory(failOnUnknownProps))
.registerTypeAdapter(AppWorkflow.StepInputValue.class, new GsonAppWorkflowStepInputValueFactory(failOnUnknownProps))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.slack.api.model.kotlin_extension.block
import com.slack.api.model.block.ContextBlock
import com.slack.api.model.kotlin_extension.block.container.MultiContextBlockElementContainer
import com.slack.api.model.kotlin_extension.block.dsl.ContextBlockElementDsl
import com.slack.api.model.kotlin_extension.block.element.dsl.BlockElementDsl

@BlockLayoutBuilder
class ContextBlockBuilder private constructor(
Expand All @@ -27,7 +26,7 @@ class ContextBlockBuilder private constructor(
/**
* An array of image elements and text objects. Maximum number of items is 10.
*
* @see BlockElementDsl for the set of supported interactive element objects
* @see ContextBlockElementDsl for the set of supported element objects
* @see <a href="https://api.slack.com/reference/block-kit/blocks#context">Context block documentation</a>
*/
fun elements(builder: ContextBlockElementDsl.() -> Unit) {
Expand All @@ -40,4 +39,4 @@ class ContextBlockBuilder private constructor(
.elements(elementsContainer.underlying)
.build()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ enum class ButtonStyle {
* only be used for one button within a set.
*/
PRIMARY {
override val value: String? = "primary"
override val value = "primary"
},

/**
* Danger gives buttons a red outline and text, and should be used when the action is destructive. Use danger even
* more sparingly than primary.
*/
DANGER {
override val value: String? = "danger"
override val value = "danger"
};

abstract val value: String?
abstract val value: String
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class RichTextInputElementBuilder : Builder<RichTextInputElement> {
* view_submission payload to identify the value of the input element. Should be unique among all other action_ids
* used elsewhere by your app. Maximum length for this field is 255 characters.*
*
* @see <a href="https://api.slack.com/reference/block-kit/block-elements#input">Plain text input documentation</a>
* @see <a href="https://api.slack.com/reference/block-kit/block-elements#rich_text_input">Rich text input documentation</a>
*/
fun actionId(id: String) {
actionId = id
Expand All @@ -32,7 +32,7 @@ class RichTextInputElementBuilder : Builder<RichTextInputElement> {
*
* The placeholder text shown in the plain-text input. Maximum length for the text in this field is 150 characters.
*
* @see <a href="https://api.slack.com/reference/block-kit/block-elements#input">Plain text input documentation</a>
* @see <a href="https://api.slack.com/reference/block-kit/block-elements#rich_text_input">Rich text input documentation</a>
*/
fun placeholder(text: String, emoji: Boolean? = null) {
placeholder = PlainTextObject(text, emoji)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.slack.api.model.kotlin_extension.block.element.dsl.BlockElementDsl
/**
* Supports a BlockElementContainer holding exactly one block element
*/
class SingleBlockElementContainer() : BlockElementDsl {
class SingleBlockElementContainer : BlockElementDsl {
var underlying: BlockElement? = null

override fun button(builder: ButtonElementBuilder.() -> Unit) {
Expand Down Expand Up @@ -127,4 +127,4 @@ class SingleBlockElementContainer() : BlockElementDsl {
override fun usersSelect(builder: UsersSelectElementBuilder.() -> Unit) {
underlying = UsersSelectElementBuilder().apply(builder).build()
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.slack.api.model.kotlin_extension.block.element.dsl

import com.slack.api.model.block.element.FileInputElement
import com.slack.api.model.kotlin_extension.block.BlockLayoutBuilder
import com.slack.api.model.kotlin_extension.block.element.*

Expand Down Expand Up @@ -157,4 +156,4 @@ interface BlockElementInputDsl {
* @see <a href="https://api.slack.com/reference/block-kit/block-elements#checkboxes">Checkboxes element documentation</a>
*/
fun checkboxes(builder: CheckboxesElementBuilder.() -> Unit)
}
}

0 comments on commit a892eb8

Please sign in to comment.