Enumerations
The following enumerations are available globally.
-
Copyright
Copyright © 2020 by Paul Schmiedmayer
The
See moreAuthorization
class represents three different authorization methods, none for no authentication, credentials for a basic authentication, and over the bearer token, or a custom token.Declaration
Swift
public enum Authorization
-
See morePasswordType
implements the Base64 encoding of the credentials.Declaration
Swift
public enum PasswordType : CustomStringConvertible
-
See moreTokenType
is used for token authentication over a bearer token or a custom defined token.Declaration
Swift
public enum TokenType : CustomStringConvertible
-
represents the filter strategy with the different options client, server and none filter
How to define a
FilterStrategy
:FilterStrategy
example:basic structure:
.strategy(FilterStrategy.Filter(operations: operation1, operation2, ...)))
client example:
let clientStrategy = .client(FilterStrategy.Filter(operations: [.lte(\Account.id!, 100), .gte(\Account.id!, )])))
defines a filter strategy where a fictional account class is filtered for 1 <= ID <= 100
Attention
You can only define the operations array where allKeyPaths
are from the same data typeDeclaration
Swift
public enum FilterStrategy<K, V> where K : Reflectable, K : Comparable, K : Decodable, K : Encodable, K : Hashable, K : Identifiable, V : Reflectable, V : ReflectionDecodable, V : Comparable, V : CustomStringConvertible, V : Decodable, V : Encodable
-
represents possible sorting strategies on the server, client or none strategy How to define a
FilterStrategy
:SortStrategy
example: basic structure:.strategy(SortStrategy.Sorter(direction: .direction, property: KeyPath))
server example:
let serverStrategy = .server(SortStrategy.Sorter(direction: .asc, property: \Account.name))
defines a sort strategy where a fictional account class is sorted ascending by the name
See moreDeclaration
Swift
public enum SortStrategy<K, V> where K : Reflectable, K : Comparable, K : Decodable, K : Encodable, K : Hashable, K : Identifiable, V : Reflectable, V : ReflectionDecodable, V : Comparable, V : CustomStringConvertible, V : Decodable, V : Encodable