SwivelAdminAPIResponse Documentation

From Swivel Knowledgebase
Jump to: navigation, search

Overview

Class name: SwivelAdminAPIResponse

Namespace: swivelsecure.client

Encapsulation of the response received from the Swivel server.

This class is incomplete, in that only results from a Report request can be extracted in a convenient form. For other requests, the raw XML returned must be examined. It is hoped that this will change in the future.

Constructors

NOTE: typically, you do not need to use any of these constructors. An instance of this class is available from SwivelAdminAPIRequest instances after calling Send().

SwivelAdminAPIResponse(string response)

Constructor for successful request.
response: The XML response received from the Swivel server

SwivelAdminAPIResponse(string response, HttpStatusCode code, string message)

Constructor for failed request.
response: The XML response received from the Swivel server
code: The status code received from the Swivel server
message: The status message received from the Swivel server

SwivelAdminAPIResponse(HttpStatusCode code, string message)

Constructor for failed request with no response body.
code: The status code received from the Swivel server
message: The status message received from the Swivel server

SwivelAdminAPIResponse(Exception x)

Constructor for failed request that throws an Exception
x: The Exception thrown on request submission

Methods

ReadResponseUser ReadSingleUser()

Returns details of the first user from the response to a Read request, or null if no users were returned.

IEnumerable<ReadResponseUser> ReadUsers()

Returns details of all the users retrieved by a Read request.

ReadResponseUser ReadNamedUser(string name)

Returns details of the named user, or null if no matching user found.

Properties

string ResponseText

The response received from the Swivel server as text.

XmlDocument ResponseDoc

The response received from the Swivel server as a XmlDocument. Null if the response was not a valid XML document.

Exception Exception

The Exception thrown when the request was submitted. Null if no Exception thrown.

string ErrorText

The error message received from the Swivel server, or the Exception message if no error message.

HttpStatusCode StatusCode

The HTTP status code returned by PINsafe.

List<string> LockedUsers

The list of locked users returned by a report request.

List<string> DisabledUsers

The list of disabled users returned by a report request.

List<string> InactiveUsers

The list of inactive users returned by a report request.

List<string> AllUsers

The list of all users returned by a report request.