forked from opensearch-project/common-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge changes in the main branch to the 1.x branch. (opensearch-proje…
…ct#42) * Update Release Notes for GA (opensearch-project#36) * Update Release Notes for GA * Update Release Notes for GA include RC1 Changes as well. Signed-off-by: Aditya Jindal <[email protected]> * add method type in CustomWebhook data model (opensearch-project#39) Signed-off-by: Zhongnan Su <[email protected]> * Fix class loader issue for notifications response (opensearch-project#40) * Fix class loader issue for notifications Signed-off-by: Joshua Li <[email protected]> * Fix formatting Signed-off-by: Joshua Li <[email protected]> * Refactor creation of action listener object Signed-off-by: Joshua Li <[email protected]> * Fix indentation Signed-off-by: Joshua Li <[email protected]> * Remove unused suppresses Signed-off-by: Joshua Li <[email protected]> * Add UT for notification API Signed-off-by: Chen Dai <[email protected]> * Add UT for notification API Signed-off-by: Chen Dai <[email protected]> * Add UT for send notification API Signed-off-by: Chen Dai <[email protected]> * Fix Github workflow failure Signed-off-by: Chen Dai <[email protected]> * Fix Github workflow failure Signed-off-by: Chen Dai <[email protected]> * Refactor UT code Signed-off-by: Chen Dai <[email protected]> Co-authored-by: Joshua Li <[email protected]> Co-authored-by: Zhongnan Su <[email protected]> Co-authored-by: Chen Dai <[email protected]> Co-authored-by: Joshua Li <[email protected]> Signed-off-by: AWSHurneyt <[email protected]>
- Loading branch information
1 parent
d05a50e
commit 10ac92e
Showing
7 changed files
with
391 additions
and
14 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
release-notes/opensearch-common-utils.release-notes-1.0.0.0.md
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,29 @@ | ||
## Version 1.0.0.0 2021-07-01 | ||
|
||
Compatible with OpenSearch 1.0.0 | ||
|
||
### Enhancements | ||
|
||
* Notification plugin interface and models ([#31](https://github.com/opensearch-project/common-utils/pull/31)) | ||
|
||
### Infrastructure | ||
|
||
* Support for kotlin and JUnit5 with mockito ([#29](https://github.com/opensearch-project/common-utils/pull/29)) | ||
* Removing Kotlin Runtime library bundled into library ([#30](https://github.com/opensearch-project/common-utils/pull/30)) | ||
* Bump to version 1.0.0.0 #34 ([#34](https://github.com/opensearch-project/common-utils/pull/34)) | ||
|
||
### Documentation | ||
|
||
* Update OpenSearch branch to 1.0 ([#28](https://github.com/opensearch-project/common-utils/pull/28)) | ||
* Cleanup READMEs. ([#32](https://github.com/opensearch-project/common-utils/pull/32)) | ||
|
||
### Maintainence | ||
|
||
* Update issue template with multiple labels ([#18](https://github.com/opensearch-project/common-utils/pull/18)) | ||
* Rename namespaces from OpenDistro to OpenSearch ([#20](https://github.com/opensearch-project/common-utils/pull/20)) | ||
* Rename classes, variables, methods to incorporate OpenSearch ([#21](https://github.com/opensearch-project/common-utils/pull/21)) | ||
* Rename remaining identifiers to OpenSearch ([#23](https://github.com/opensearch-project/common-utils/pull/23)) | ||
* Version changed to rc1 #24 ([#24](https://github.com/opensearch-project/common-utils/pull/24)) | ||
* Rename consts as per changes in security plugin ([#25](https://github.com/opensearch-project/common-utils/pull/25)) | ||
* Move workflow tags to rc1 ([#26](https://github.com/opensearch-project/common-utils/pull/26)) | ||
* Add rc1 release notes ([#27](https://github.com/opensearch-project/common-utils/pull/27)) |
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
36 changes: 36 additions & 0 deletions
36
src/main/kotlin/org/opensearch/commons/notifications/model/HttpMethodType.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,36 @@ | ||
package org.opensearch.commons.notifications.model | ||
|
||
import org.opensearch.commons.utils.EnumParser | ||
|
||
enum class HttpMethodType(val tag: String) { | ||
POST("POST") { | ||
override fun toString(): String { | ||
return tag | ||
} | ||
}, | ||
PUT("PUT") { | ||
override fun toString(): String { | ||
return tag | ||
} | ||
}, | ||
PATCH("PATCH") { | ||
override fun toString(): String { | ||
return tag | ||
} | ||
}; | ||
|
||
companion object { | ||
private val tagMap = values().associateBy { it.tag } | ||
|
||
val enumParser = EnumParser { fromTagOrDefault(it) } | ||
|
||
/** | ||
* Get HttpMethodType from tag or POST if not found | ||
* @param tag the tag | ||
* @return MethodType corresponding to tag. POST if invalid tag. | ||
*/ | ||
fun fromTagOrDefault(tag: String): HttpMethodType { | ||
return tagMap[tag] ?: POST | ||
} | ||
} | ||
} |
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
Oops, something went wrong.