ScannerVision Web Server

<back to all web services

PostConnections

The following routes are available for this service:
POST/connections
import Foundation
import ServiceStack

public class PostConnections : Codable
{
    public var loginCommand:String
    public var logoutCommand:String
    public var password:String
    public var saveCommand:String
    public var userName:String

    required public init(){}
}

public class GetConnectionsResponse : Codable
{
    public var connections:[IConnectorConnection] = []
    public var isAuthenticated:Bool

    required public init(){}
}

public protocol IConnectorConnection : IStatus
{
    var connectorId:String { get set }
    var Description:String { get set }
    var id:String { get set }
    var maxConnections:Int { get set }
    var name:String { get set }
    var permissions:ReadOnlyCollection<IConnectionPermission> { get set }
    var propertyDescriptions:ReadOnlyCollection<IConnectionPropertyDescription> { get set }
    //setupUser:IUser ignored. Swift doesn't support interface properties

}

public protocol IConnectionPermission : IInterface
{
    var allow:Bool { get set }
    //connection:IConnectorConnection ignored. Swift doesn't support interface properties
    var type:PermissionType { get set }

}

public enum PermissionType : String, Codable
{
    case Group
    case User
}

public protocol IConnectionPropertyDescription : IInterface
{
    var Description:String { get set }
    var name:String { get set }
    var propertyId:String { get set }
    var propertyType:PropertyType { get set }

}

public enum PropertyType : Int, Codable
{
    case Binary = 1
    case Boolean = 2
    case ConnectionString = 3
    case Credential = 4
    case Integer = 5
    case Picklist = 6
    case String = 7
    case OAuth2 = 8
    case Certificate = 9
}

public protocol IUser : IIdTemplatesItem
{
    var groups:ReadOnlyCollection<IUserGroup> { get set }
    var emailAddress:String { get set }
    var hasPassword:Bool { get set }
    var homeFolder:String { get set }
    var password:String { get set }
    var sbcUser:Bool? { get set }

}

public protocol IUserGroup : IIdTemplatesItem, IGroup
{
    var users:ReadOnlyCollection<IUser> { get set }

}


Swift PostConnections DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /connections HTTP/1.1 
Host: buildmax.org 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"LoginCommand":"String","LogoutCommand":"String","Password":"String","SaveCommand":"String","UserName":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{Unable to show example output for type 'GetConnectionsResponse' using the custom 'csv' filter}No parameterless constructor defined for this object.