2using System.Threading.Tasks;
22 private bool accountCreated =
true;
23 private bool accountDeleted =
true;
24 private bool legalIdReceived =
true;
25 private bool otherLegalIds =
true;
26 private bool peerReviewApproved =
true;
27 private bool legalIdAutoApproved =
true;
28 private bool legalIdAutoRejected =
true;
29 private bool contractProposalReceived =
true;
30 private bool accountRecoveryRequest =
true;
31 private bool apiKeyCreated =
true;
32 private bool feedbackReceived =
true;
33 private bool accountRequested =
true;
34 private bool apiKeyRequested =
true;
44 public override string Resource =>
"/Settings/BrokerNotifications.md";
57 get => this.accountCreated;
58 set => this.accountCreated = value;
67 get => this.accountDeleted;
68 set => this.accountDeleted = value;
77 get => this.legalIdReceived;
78 set => this.legalIdReceived = value;
88 get => this.otherLegalIds;
89 set => this.otherLegalIds = value;
99 get => this.peerReviewApproved;
100 set => this.peerReviewApproved = value;
110 get => this.legalIdAutoApproved;
111 set => this.legalIdAutoApproved = value;
121 get => this.legalIdAutoRejected;
122 set => this.legalIdAutoRejected = value;
131 get => this.contractProposalReceived;
132 set => this.contractProposalReceived = value;
142 get => this.accountRecoveryRequest;
143 set => this.accountRecoveryRequest = value;
152 get => this.apiKeyCreated;
153 set => this.apiKeyCreated = value;
162 get => this.feedbackReceived;
163 set => this.feedbackReceived = value;
172 get => this.accountRequested;
173 set => this.accountRequested = value;
182 get => this.apiKeyRequested;
183 set => this.apiKeyRequested = value;
201 return Task.CompletedTask;
219 this.setRegistration = WebServer.
Register(
"/Settings/SetBrokerNotifications",
220 null, this.SetRegistration,
true,
false,
true);
222 return base.InitSetup(WebServer);
242 !(Content.
Decoded is Dictionary<string, object> Parameters))
248 if (!Parameters.TryGetValue(
"accountCreated", out
object Obj) || !(Obj is
bool AccountCreated) ||
249 !Parameters.TryGetValue(
"accountDeleted", out Obj) || !(Obj is
bool AccountDeleted) ||
250 !Parameters.TryGetValue(
"legalIdReceived", out Obj) || !(Obj is
bool LegalIdReceived) ||
251 !Parameters.TryGetValue(
"otherLegalIds", out Obj) || !(Obj is
bool OtherLegalIds) ||
252 !Parameters.TryGetValue(
"peerReviewApproved", out Obj) || !(Obj is
bool PeerReviewApproved) ||
253 !Parameters.TryGetValue(
"legalIdAutoApproved", out Obj) || !(Obj is
bool LegalIdAutoApproved) ||
254 !Parameters.TryGetValue(
"legalIdAutoRejected", out Obj) || !(Obj is
bool LegalIdAutoRejected) ||
257 !Parameters.TryGetValue(
"apiKeyCreated", out Obj) || !(Obj is
bool ApiKeyCreated) ||
258 !Parameters.TryGetValue(
"feedbackReceived", out Obj) || !(Obj is
bool FeedbackReceived) ||
259 !Parameters.TryGetValue(
"accountRequested", out Obj) || !(Obj is
bool AccountRequested) ||
260 !Parameters.TryGetValue(
"apiKeyRequested", out Obj) || !(Obj is
bool ApiKeyRequested))
280 Response.StatusCode = 200;
281 Response.StatusMessage =
"OK";
294 return base.UnregisterSetup(WebServer);
303 this.accountCreated =
true;
304 this.accountDeleted =
true;
305 this.legalIdReceived =
true;
306 this.otherLegalIds =
true;
307 this.peerReviewApproved =
true;
308 this.legalIdAutoApproved =
true;
309 this.legalIdAutoRejected =
true;
310 this.contractProposalReceived =
true;
311 this.accountRecoveryRequest =
true;
312 this.apiKeyCreated =
true;
313 this.feedbackReceived =
true;
314 this.accountRequested =
true;
315 this.apiKeyRequested =
true;
317 return Task.FromResult(
true);
410 return Task.FromResult(
false);
413 return Task.FromResult(
true);
Contains information about a response to a content request.
bool HasError
If an error occurred.
object Decoded
Decoded object.
Static class managing the runtime environment of the IoT Gateway.
static IUser AssertUserAuthenticated(HttpRequest Request, string Privilege)
Makes sure a request is being made from a session with a successful user login.
Abstract base class for system configurations.
bool TryGetEnvironmentVariable(string VariableName, bool Required, out string Value)
Tries to get a string-valued environment variable.
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repe...
Represents an HTTP request.
bool HasData
If the request has data.
async Task< ContentResponse > DecodeDataAsync()
Decodes data sent in request.
Base class for all HTTP resources.
Represets a response of an HTTP client request.
async Task SendResponse()
Sends the response back to the client. If the resource is synchronous, there's no need to call this m...
Implements an HTTP server.
HttpResource Register(HttpResource Resource)
Registers a resource with the server.
bool Unregister(HttpResource Resource)
Unregisters a resource from the server.
Static interface for database persistence. In order to work, a database provider has to be assigned t...
static async Task Update(object Object)
Updates an object in the database.
Contains information about a language.
Task< string > GetStringAsync(Type Type, int Id, string Default)
Gets the string value of a string ID. If no such string exists, a string is created with the default ...
Provides the user with options to control notifications from the Broker.
string BROKER_NOT_API_KEY_CREATED
true or 1 if a notification should be sent when an API key has been created.
string BROKER_NOT_PEER_REVIEW_APPROVED
true or 1 if a notification should be sent when a peer review of a Legal ID has been approved.
bool AccountCreated
If a notification should be sent when a new account is created.
string BROKER_NOT_API_KEY_REQUESTED
true or 1 if a notification should be sent when an API key has been requested.
string BROKER_NOT_ACCOUNT_REQUESTED
true or 1 if a notification should be sent when an account has been requested.
string BROKER_NOT_FEEDBACK_RECEIVED
true or 1 if a notification should be sent when feedback has been received.
override Task ConfigureSystem()
Is called during startup to configure the system.
static BrokerNotificationConfiguration Instance
Current instance of configuration.
override Task< bool > SimplifiedConfiguration()
Simplified configuration by configuring simple default values.
bool PeerReviewApproved
If a notification should be sent when a peer review of a Legal ID has been approved.
override Task< string > Title(Language Language)
Gets a title for the system configuration.
override Task< bool > EnvironmentConfiguration()
Environment configuration by configuring values available in environment variables.
bool OtherLegalIds
If a notification should be sent for every existing valid Legal ID that exists when a new Legal ID ap...
bool AccountRequested
If a notification should be sent when an account has been requested.
override Task UnregisterSetup(HttpServer WebServer)
Unregisters the setup object.
string BROKER_NOT_CONTRACT_PROPOSAL_RECEIVED
true or 1 if a notification should be sent when a contract proposal has been received.
string BROKER_NOT_ACCOUNT_RECOVERY_REQUEST
true or 1 if a notification should be sent when an account recovery request has been received.
string BROKER_NOT_ACCOUNT_CREATED
true or 1 if a notification should be sent when a new account is created.
bool LegalIdAutoRejected
If a notification should be sent when a Legal ID application has been automatically rejected.
bool LegalIdAutoApproved
If a notification should be sent when a Legal ID application has been automatically approved.
bool LegalIdReceived
If a notification should be sent when a new a Legal ID application is received.
bool ApiKeyRequested
If a notification should be sent when an API key has been requested.
bool ContractProposalReceived
If a notification should be sent when a contract proposal has been received.
string BROKER_NOT_OTHER_LEGAL_IDS
true or 1 if a notification should be sent for every existing valid Legal ID that exists when a new L...
string BROKER_NOT_LEGAL_ID_AUTO_APPROVED
true or 1 if a notification should be sent when a Legal ID application has been automatically approve...
bool AccountRecoveryRequest
If a notification should be sent when an account recovery request has been received.
override Task InitSetup(HttpServer WebServer)
Initializes the setup object.
string BROKER_NOT_ACCOUNT_DELETED
true or 1 if a notification should be sent when a new account is deleted.
override int Priority
Priority of the setting. Configurations are sorted in ascending order.
string BROKER_NOT_LEGAL_ID_RECEIVED
true or 1 if a notification should be sent when a new a Legal ID application is received.
bool ApiKeyCreated
If a notification should be sent when an API key has been created.
bool AccountDeleted
If a notification should be sent when a new account is deleted.
override void SetStaticInstance(ISystemConfiguration Configuration)
Sets the static instance of the configuration.
override string ConfigPrivilege
Minimum required privilege for a user to be allowed to change the configuration defined by the class.
bool FeedbackReceived
If a notification should be sent when feedback has been received.
string BROKER_NOT_LEGAL_ID_AUTO_REJECTED
true or 1 if a notification should be sent when a Legal ID application has been automatically rejecte...
Service Module hosting the XMPP broker and its components.
Interface for system configurations. The gateway will scan all module for system configuration classe...