-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
10 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
35 changes: 35 additions & 0 deletions
35
...main/kotlin/com/slack/api/model/kotlin_extension/block/element/FileInputElementBuilder.kt
This file contains 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,35 @@ | ||
package com.slack.api.model.kotlin_extension.block.element | ||
|
||
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.Builder | ||
|
||
@BlockLayoutBuilder | ||
class FileInputElementBuilder : Builder<FileInputElement> { | ||
private var actionId: String? = null | ||
private var filetypes: List<String>? = null | ||
private var maxFiles: Int? = null | ||
|
||
fun actionId(id: String) { | ||
actionId = id | ||
} | ||
|
||
fun filetypes(filetypes: List<String>) { | ||
this.filetypes = filetypes | ||
} | ||
fun filetypes(vararg filetypes: String) { | ||
this.filetypes = filetypes.toList() | ||
} | ||
|
||
fun maxFiles(maxFiles: Int) { | ||
this.maxFiles = maxFiles | ||
} | ||
|
||
override fun build(): FileInputElement { | ||
return FileInputElement.builder() | ||
.actionId(actionId) | ||
.filetypes(filetypes) | ||
.maxFiles(maxFiles) | ||
.build() | ||
} | ||
} |
This file contains 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 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 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 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 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
39 changes: 39 additions & 0 deletions
39
slack-api-model/src/main/java/com/slack/api/model/block/element/FileInputElement.java
This file contains 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.slack.api.model.block.element; | ||
|
||
import lombok.*; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* https://api.slack.com/reference/block-kit/block-elements#file_input | ||
*/ | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@EqualsAndHashCode(callSuper = false) | ||
public class FileInputElement extends BlockElement { | ||
public static final String TYPE = "file_input"; | ||
private final String type = TYPE; | ||
|
||
/** | ||
* An identifier for the input value when the parent modal is submitted. | ||
* You can use this when you receive a view_submission payload to identify the value of the input element. | ||
* Should be unique among all other action_ids in the containing block. Maximum length is 255 characters. | ||
*/ | ||
private String actionId; | ||
|
||
/** | ||
* An array of valid file extensions that will be accepted for this element. | ||
* All file extensions will be accepted if filetypes is not specified. | ||
* This validation is provided for convenience only, | ||
* and you should perform your own file type validation based on what you expect to receive. | ||
*/ | ||
private List<String> filetypes; | ||
|
||
/** | ||
* Maximum number of files that can be uploaded for this file_input element. | ||
* Minimum of 1, maximum of 10. Defaults to 10 if not specified. | ||
*/ | ||
private Integer maxFiles; | ||
} |
This file contains 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 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