RetrieveSubusers
public class RetrieveSubusers : ModeledRequest<[Subuser], RetrieveSubusers.Parameters>
This class is used to make the get subusers API call.
You can provide pagination information, and also search by username. If
you partial searches are allowed, so for instance if you had a subuser
with username foobar, searching for foo would return it.
do {
let search = RetrieveSubusers(username: "foo")
try Session.shared.send(modeledRequest: search) { result in
switch result {
case .success(_, let list):
// The `list` variable will be an array of
// `Subuser` instances.
list.forEach { print($0.username) }
case .failure(let err):
print(err)
}
}
} catch {
print(error)
}
-
Initializes the request with pagination info and a username search. If you don’t specify a
usernamevalue, then all subusers will be returned.Declaration
Swift
public init(page: Page? = nil, username: String? = nil)Parameters
pageProvides
limitandoffsetinformation to paginate the results.usernameA basic search applied against the subusers’ usernames. You can provide a partial username. For instance, if you have a subuser with the username
foobar, searching forfoowill return it.
-
Validates that the
limitvalue isn’t over 500.Declaration
Swift
public override func validate() throws
-
The
See moreRetrieveSubusers.Parametersstruct holds all the parameters that can be used in theRetrieveSubuserscall.Declaration
Swift
struct Parameters : Codable
View on GitHub
RetrieveSubusers Class Reference