-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get full config reading working from file
- Loading branch information
1 parent
4a73548
commit a3ced81
Showing
25 changed files
with
1,189 additions
and
182 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
52 changes: 52 additions & 0 deletions
52
src/main/java/com/meta/chatbridge/ServiceConfiguration.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,52 @@ | ||
/* | ||
* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
package com.meta.chatbridge; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.google.common.base.Preconditions; | ||
import java.util.Objects; | ||
|
||
public class ServiceConfiguration { | ||
private final String webhookPath; | ||
private final String handler; | ||
private final String store; | ||
private final String plugin; | ||
|
||
@JsonCreator | ||
ServiceConfiguration( | ||
@JsonProperty("webhook_path") String webhookPath, | ||
@JsonProperty("handler") String handler, | ||
@JsonProperty("store") String store, | ||
@JsonProperty("plugin") String plugin) { | ||
Preconditions.checkArgument( | ||
webhookPath != null && webhookPath.startsWith("/"), | ||
"webhook_path must be present and it must start with a forward slash (/)"); | ||
this.webhookPath = webhookPath; | ||
this.handler = Objects.requireNonNull(handler, "handler must be present"); | ||
this.store = Objects.requireNonNull(store, "store must be present"); | ||
this.plugin = Objects.requireNonNull(plugin, "plugin must be present"); | ||
} | ||
|
||
public String webhookPath() { | ||
return webhookPath; | ||
} | ||
|
||
public String handler() { | ||
return handler; | ||
} | ||
|
||
public String store() { | ||
return store; | ||
} | ||
|
||
public String plugin() { | ||
return plugin; | ||
} | ||
} |
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
Oops, something went wrong.