Swagger Property
General info
Label |
Swagger |
Description |
Indicates whether the Web API Swagger help page is available for everyone, login is required or disabled. |
Data type |
UInt32 |
Default value |
1 (syslib.model.codes.Swagger.ANONYMOUS) |
Type |
CodingGroup |
Code |
3053 |
Symbolic name |
MODEL_PROP_SWAGGER |
Lua access code |
syslib.model.properties.Swagger |
Available since |
1.38 |
- Parent classes
Attributes
| Name | Tooltip |
|---|---|
| PROP_CONFIGURABLE | The property is configurable and can be changed with DataStudio and the various inmation APIs. |
| PROP_VISIBLE | The property is visible in DataStudio and can be read by the inmation APIs. |
| PROP_HAS_DEFAULT | The property has a default value as standard. |
Codings
Coding group: Swagger
| Name | Code | Label | Tooltip |
|---|---|---|---|
ANONYMOUS |
1 |
Anonymous |
The Web API Swagger help page is available for everyone. |
AUTHENTICATE |
2 |
Authenticate |
Login is required for the Web API Swagger help page. |
DISABLED |
3 |
Disabled |
The Web API Swagger help page is disabled. |
Examples
Read from or write to the Swagger property.
-- Read from the Swagger
syslib.getvalue("<OBJECT FULL PATH>.Swagger")
-- Write to the Swagger
syslib.setvalue("<OBJECT FULL PATH>.Swagger",
syslib.model.codes.Swagger.ANONYMOUS)
TcpConfig tcpcfg = new TcpConfig() { HostNameOrIp = "localhost", Port = 6512 };
SecurityCredentials sc = new SecurityCredentials() { ProfileName = "<username>", Password = "<password>" };
StatelessInterface sli = new StatelessInterface(tcpcfg);
// Read from the Swagger
Result result = sli.ReadValue(sc, new ReadItem("<OBJECT FULL PATH>.Swagger"));
// Write to the Swagger
Result result = sli.WriteValue(sc, new WriteItem(Swagger.ANONYMOUS, "<OBJECT FULL PATH>.Swagger"));
A switch-like function of the codings.
function get_coding_name(code)
local _s = syslib.model.codes.Swagger
if _s.ANONYMOUS==code then return 'ANONYMOUS'
elseif _s.AUTHENTICATE==code then return 'AUTHENTICATE'
elseif _s.DISABLED==code then return 'DISABLED'
end
end
return get_coding_name(syslib.model.codes.Swagger.ANONYMOUS)