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
username
value, then all subusers will be returned.Declaration
Swift
public init(page: Page? = nil, username: String? = nil)
Parameters
page
Provides
limit
andoffset
information to paginate the results.username
A 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 forfoo
will return it.
-
Validates that the
limit
value isn’t over 500.Declaration
Swift
public override func validate() throws
-
The
See moreRetrieveSubusers.Parameters
struct holds all the parameters that can be used in theRetrieveSubusers
call.Declaration
Swift
struct Parameters : Codable