Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
GetCreationAttributes.cs
1
using
System
;
2
using
System.Collections.Generic
;
3
using
System.Threading.Tasks;
4
using
System.Xml;
5
using
Waher.Content
;
6
using
Waher.IoTGateway.Setup
;
7
using
Waher.Networking.HTTP
;
8
using
Waher.Runtime.IO
;
9
using
Waher.Script
;
10
using
Waher.Script.Abstraction.Elements
;
11
using
Waher.Service.IoTBroker.Marketplace
;
12
13
namespace
Waher.Service.IoTBroker.WebServices.Agent.Tokens
14
{
18
public
class
GetCreationAttributes
:
AgentPostResource
19
{
23
public
GetCreationAttributes
()
24
: base(
"Tokens/GetCreationAttributes"
,
25
new KeyValuePair<Type,
Expression
>(typeof(Dictionary<string, object>), new
Expression
(jsonPattern)),
26
new KeyValuePair<Type,
Expression
>(typeof(XmlDocument), new
Expression
(xmlPattern)))
27
{
28
}
29
30
private
static
readonly
string
jsonPattern =
Resources
.
LoadResourceAsText
(typeof(
GetCreationAttributes
).Namespace +
".JSON.GetCreationAttributes.req"
);
31
private
static
readonly
string
xmlPattern =
Resources
.
LoadResourceAsText
(typeof(
GetCreationAttributes
).Namespace +
".XML.GetCreationAttributes.req"
);
32
41
public
override
async Task
POST
(
HttpRequest
Request,
HttpResponse
Response, Dictionary<string, IElement> Parameters)
42
{
43
AssertUserAuthenticated
(Request);
44
45
await Response.
Return
(
new
NamedDictionary<string, object>
(
"CreationAttributes"
,
AgentNamespace
)
46
{
47
{
"currency"
, await
XmppServerModule
.EDaler.GetDefaultCurrency() },
48
{
"commission"
, await
MarketplaceProcessor
.GetMinCommission() },
49
{
"trustProvider"
, LegalIdentityConfiguration.HasApprovedLegalIdentities ?LegalIdentityConfiguration.LatestApprovedLegalIdentityId :
null
}
50
});
51
}
52
}
53
}
Waher.Content.NamedDictionary
A Named dictionary is a dictionary, with a local name and a namespace. Use it to return content that ...
Definition:
NamedDictionary.cs:14
Waher.Networking.HTTP.HttpRequest
Represents an HTTP request.
Definition:
HttpRequest.cs:22
Waher.Networking.HTTP.HttpResponse
Represets a response of an HTTP client request.
Definition:
HttpResponse.cs:23
Waher.Networking.HTTP.HttpResponse.Return
Task Return(Exception ex)
Returns an error to the client.
Definition:
HttpResponse.cs:1144
Waher.Runtime.IO.Resources
Static class managing loading of resources stored as embedded resources or in content files.
Definition:
Resources.cs:13
Waher.Runtime.IO.Resources.LoadResourceAsText
static string LoadResourceAsText(string ResourceName)
Loads a text resource from an embedded resource.
Definition:
Resources.cs:55
Waher.Script.Expression
Class managing a script expression.
Definition:
Expression.cs:41
Waher.Service.IoTBroker.Marketplace.MarketplaceProcessor
Marketplace processor, brokering sales of items via tenders and offers defined in smart contracts.
Definition:
MarketplaceProcessor.cs:34
Waher.Service.IoTBroker.WebServices.Agent.AgentPostResource
Abstract base class for agent resources supporting the POST method.
Definition:
AgentPostResource.cs:14
Waher.Service.IoTBroker.WebServices.Agent.AgentResource.AssertUserAuthenticated
static AccountUser AssertUserAuthenticated(HttpRequest Request)
Makes sure the request is made by an authenticated API user.
Definition:
AgentResource.cs:256
Waher.Service.IoTBroker.WebServices.Agent.AgentResource.AgentNamespace
const string AgentNamespace
https://waher.se/Schema/BrokerAgent.xsd
Definition:
AgentResource.cs:31
Waher.Service.IoTBroker.WebServices.Agent.Tokens.GetCreationAttributes
Gets current creation attributes.
Definition:
GetCreationAttributes.cs:19
Waher.Service.IoTBroker.WebServices.Agent.Tokens.GetCreationAttributes.GetCreationAttributes
GetCreationAttributes()
Gets current creation attributes.
Definition:
GetCreationAttributes.cs:23
Waher.Service.IoTBroker.WebServices.Agent.Tokens.GetCreationAttributes.POST
override async Task POST(HttpRequest Request, HttpResponse Response, Dictionary< string, IElement > Parameters)
Executes the POST method on the resource.
Definition:
GetCreationAttributes.cs:41
Waher.Service.IoTBroker.XmppServerModule
Service Module hosting the XMPP broker and its components.
Definition:
XmppServerModule.cs:136
System.Collections.Generic
Definition:
ImplTypes.g.cs:4970
System
Definition:
Adapters.g.cs:58
Waher.Content
Definition:
Array.cs:6
Waher.IoTGateway.Setup
Definition:
App.xaml.cs:22
Waher.Networking.HTTP
Definition:
BrotliContentEncoding.cs:10
Waher.Runtime.IO
Definition:
Certificates.cs:7
Waher.Script.Abstraction.Elements
Definition:
AbelianGroupElement.cs:4
Waher.Script
Definition:
App.xaml.cs:4
Waher.Service.IoTBroker.Marketplace
Definition:
AuctionItem.cs:7
Waher.Service.IoTBroker.WebServices.Agent.Tokens
Definition:
AddTextNote.cs:20
Waher.Service.IoTBroker
WebServices
Agent
Tokens
GetCreationAttributes.cs
Generated by
1.9.5