From a892eb8ba41343126dc0a9b8fd48bdd65cb6b0e7 Mon Sep 17 00:00:00 2001 From: Hyeonmin Park Date: Thu, 19 Sep 2024 14:21:28 +0900 Subject: [PATCH] Polish documentation and imports --- .../src/main/java/com/slack/api/util/json/GsonFactory.java | 1 - .../api/model/kotlin_extension/block/ContextBlockBuilder.kt | 5 ++--- .../api/model/kotlin_extension/block/element/ButtonStyle.kt | 6 +++--- .../block/element/RichTextInputElementBuilder.kt | 4 ++-- .../block/element/container/SingleBlockElementContainer.kt | 4 ++-- .../block/element/dsl/BlockElementInputDsl.kt | 3 +-- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/slack-api-client/src/main/java/com/slack/api/util/json/GsonFactory.java b/slack-api-client/src/main/java/com/slack/api/util/json/GsonFactory.java index db55c5791..9a78511ea 100644 --- a/slack-api-client/src/main/java/com/slack/api/util/json/GsonFactory.java +++ b/slack-api-client/src/main/java/com/slack/api/util/json/GsonFactory.java @@ -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)) diff --git a/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/ContextBlockBuilder.kt b/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/ContextBlockBuilder.kt index 6f0a014b2..a9a662604 100644 --- a/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/ContextBlockBuilder.kt +++ b/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/ContextBlockBuilder.kt @@ -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( @@ -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 Context block documentation */ fun elements(builder: ContextBlockElementDsl.() -> Unit) { @@ -40,4 +39,4 @@ class ContextBlockBuilder private constructor( .elements(elementsContainer.underlying) .build() } -} \ No newline at end of file +} diff --git a/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/ButtonStyle.kt b/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/ButtonStyle.kt index 86d37e8ee..0b7f610fd 100644 --- a/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/ButtonStyle.kt +++ b/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/ButtonStyle.kt @@ -6,7 +6,7 @@ enum class ButtonStyle { * only be used for one button within a set. */ PRIMARY { - override val value: String? = "primary" + override val value = "primary" }, /** @@ -14,8 +14,8 @@ enum class ButtonStyle { * more sparingly than primary. */ DANGER { - override val value: String? = "danger" + override val value = "danger" }; - abstract val value: String? + abstract val value: String } diff --git a/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/RichTextInputElementBuilder.kt b/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/RichTextInputElementBuilder.kt index c2aeb95c7..2e02a1fc8 100644 --- a/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/RichTextInputElementBuilder.kt +++ b/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/RichTextInputElementBuilder.kt @@ -21,7 +21,7 @@ class RichTextInputElementBuilder : Builder { * 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 Plain text input documentation + * @see Rich text input documentation */ fun actionId(id: String) { actionId = id @@ -32,7 +32,7 @@ class RichTextInputElementBuilder : Builder { * * The placeholder text shown in the plain-text input. Maximum length for the text in this field is 150 characters. * - * @see Plain text input documentation + * @see Rich text input documentation */ fun placeholder(text: String, emoji: Boolean? = null) { placeholder = PlainTextObject(text, emoji) diff --git a/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/container/SingleBlockElementContainer.kt b/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/container/SingleBlockElementContainer.kt index 8dfee4577..0e2680ccb 100644 --- a/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/container/SingleBlockElementContainer.kt +++ b/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/container/SingleBlockElementContainer.kt @@ -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) { @@ -127,4 +127,4 @@ class SingleBlockElementContainer() : BlockElementDsl { override fun usersSelect(builder: UsersSelectElementBuilder.() -> Unit) { underlying = UsersSelectElementBuilder().apply(builder).build() } -} \ No newline at end of file +} diff --git a/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/dsl/BlockElementInputDsl.kt b/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/dsl/BlockElementInputDsl.kt index 7d427a779..ed87cd870 100644 --- a/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/dsl/BlockElementInputDsl.kt +++ b/slack-api-model-kotlin-extension/src/main/kotlin/com/slack/api/model/kotlin_extension/block/element/dsl/BlockElementInputDsl.kt @@ -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.* @@ -157,4 +156,4 @@ interface BlockElementInputDsl { * @see Checkboxes element documentation */ fun checkboxes(builder: CheckboxesElementBuilder.() -> Unit) -} \ No newline at end of file +}