http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/docs/Classes/UsergridResponse.html ---------------------------------------------------------------------- diff --git a/sdks/swift/docs/Classes/UsergridResponse.html b/sdks/swift/docs/Classes/UsergridResponse.html new file mode 100644 index 0000000..0d8b6fe --- /dev/null +++ b/sdks/swift/docs/Classes/UsergridResponse.html @@ -0,0 +1,961 @@ + + + + UsergridResponse Class Reference + + + + + + + + + + +
+
+

UsergridSDK Docs (100% documented)

+
+
+
+ +
+
+ +
+
+
+

UsergridResponse

+
+
+
public class UsergridResponse: NSObject
+ +
+
+

UsergridResponse is the core class that handles both successful and unsuccessful HTTP responses from Usergrid.

+ +

If a request is successful, any entities returned in the response will be automatically parsed into UsergridEntity objects and pushed to the entities property.

+ +

If a request fails, the errorName and errorDescription will contain information about the problem encountered.

+ +
+
+
+ +
    +
  • +
    + + + + client + +
    +
    +
    +
    +
    +
    +

    The client that was responsible for the request.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public weak var client: UsergridClient?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + responseJSON + +
    +
    +
    +
    +
    +
    +

    The raw response JSON.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    internal(set) public var responseJSON: [String:AnyObject]?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + query + +
    +
    +
    +
    +
    +
    +

    The query used on the request.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    internal(set) public var query: UsergridQuery?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cursor + +
    +
    +
    +
    +
    +
    +

    The cursor from the response.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    internal(set) public var cursor: String?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + entities + +
    +
    +
    +
    +
    +
    +

    The entities created from the response JSON.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    internal(set) public var entities: [UsergridEntity]?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + headers + +
    +
    +
    +
    +
    +
    +

    The response headers.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    internal(set) public var headers: [String:String]?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + statusCode + +
    +
    +
    +
    +
    +
    +

    The response status code.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    internal(set) public var statusCode: Int?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + error + +
    +
    +
    +
    +
    +
    +

    The error object containing error information if one occurred.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    internal(set) public var error: UsergridResponseError?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ok + +
    +
    +
    +
    +
    +
    +

    Returns true if the HTTP status code from the response is less than 400.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var ok : Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + count + +
    +
    +
    +
    +
    +
    +

    The count of entities.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var count: Int { return self.entities?.count ?? 0 }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + first + +
    +
    +
    +
    +
    +
    +

    The first entity in entities.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var first: UsergridEntity? { return self.entities?.first }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + last + +
    +
    +
    +
    +
    +
    +

    The last entity in entities.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var last: UsergridEntity? { return self.entities?.last }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + entity + +
    +
    +
    +
    +
    +
    +

    The first entity in entities.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var entity: UsergridEntity? { return self.first }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + user + +
    +
    +
    +
    +
    +
    +

    The UsergridUser entity.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var user: UsergridUser? { return self.entities?.first as? UsergridUser }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + users + +
    +
    +
    +
    +
    +
    +

    An array of UsergridUser entities.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var users: [UsergridUser]? { return self.entities as? [UsergridUser] }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + hasNextPage + +
    +
    +
    +
    +
    +
    +

    Does the response have a cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var hasNextPage: Bool { return self.cursor != nil }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + stringValue + +
    +
    +
    +
    +
    +
    +

    The string value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var stringValue : String?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    +

    The description.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override var description : String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    +

    The debug description.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override var debugDescription : String
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Designated initializer for UsergridResponse objects that contain errors.

    + +

    These types of responses are usually created because request conditions are not met.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(client: UsergridClient?, errorName: String, errorDescription: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + client + + +
    +

    The client responsible for the request.

    + +
    +
    + + errorName + + +
    +

    The error name.

    + +
    +
    + + errorDescription + + +
    +

    The error description.

    + +
    +
    +
    +
    +

    Return Value

    +

    A new instance of UsergridResponse.

    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Designated initializer for UsergridResponse objects finished but still may contain errors.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(client:UsergridClient?, data:NSData?, response:NSHTTPURLResponse?, error:NSError?, query:UsergridQuery? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + client + + +
    +

    The client responsible for the request.

    + +
    +
    + + data + + +
    +

    The response data.

    + +
    +
    + + response + + +
    +

    The NSHTTPURLResponse object.

    + +
    +
    + + error + + +
    +

    The NSError object.

    + +
    +
    + + query + + +
    +

    The query when making the request.

    + +
    +
    +
    +
    +

    Return Value

    +

    A new instance of UsergridResponse.

    + +
    +
    +
    +
  • +
+
+
+ +
    +
  • +
    + + + + loadNextPage(_:) + +
    +
    +
    +
    +
    +
    +

    Attempts to load the next page of UsergridEntity objects.

    + +

    This requires a cursor to be valid as well as a path key within the response JSON.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func loadNextPage(completion: UsergridResponseCompletion)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + completion + + +
    +

    The completion block that is called once the request for the next page has finished.

    + +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/docs/Classes/UsergridResponseError.html ---------------------------------------------------------------------- diff --git a/sdks/swift/docs/Classes/UsergridResponseError.html b/sdks/swift/docs/Classes/UsergridResponseError.html new file mode 100644 index 0000000..7e8b749 --- /dev/null +++ b/sdks/swift/docs/Classes/UsergridResponseError.html @@ -0,0 +1,465 @@ + + + + UsergridResponseError Class Reference + + + + + + + + + + +
+
+

UsergridSDK Docs (100% documented)

+
+
+
+ +
+
+ +
+
+
+

UsergridResponseError

+
+
+
public class UsergridResponseError: NSObject
+ +
+
+

A standard error object that contains details about a request failure.

+ +
+
+
+ +
    +
  • +
    + + + + errorName + +
    +
    +
    +
    +
    +
    +

    The error’s name.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let errorName : String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + errorDescription + +
    +
    +
    +
    +
    +
    +

    The error’s description.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let errorDescription: String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + exception + +
    +
    +
    +
    +
    +
    +

    The exception.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var exception: String?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    +

    The description.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override var description : String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + debugDescription + +
    +
    +
    +
    +
    +
    +

    The debug description.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override var debugDescription : String
    + +
    +
    +
    +
    +
  • +
+
+
+ +
    +
  • + +
    +
    +
    +
    +
    +

    Designated initializer for UsergridResponseError.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(errorName:String, errorDescription:String, exception:String? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + errorName + + +
    +

    The error’s name.

    + +
    +
    + + errorDescription + + +
    +

    The error’s description.

    + +
    +
    + + exception + + +
    +

    The exception.

    + +
    +
    +
    +
    +

    Return Value

    +

    A new instance of UsergridResponseError

    + +
    +
    +
    +
  • +
  • +
    + + + + init(jsonDictionary:) + +
    +
    +
    +
    +
    +
    +

    Convenience initializer for UsergridResponseError that determines if the given jsonDictionary contains an error.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init?(jsonDictionary:[String:AnyObject])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + jsonDictionary + + +
    +

    The JSON dictionary that may contain error information.

    + +
    +
    +
    +
    +

    Return Value

    +

    A new instance of UsergridResponseError if the JSON dictionary did indeed contain error information.

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + +