Enumerations
The following enumerations are available globally.
-
Copyright
Copyright © 2020 by Paul Schmiedmayer
The
See moreAuthorizationclass 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 morePasswordTypeimplements the Base64 encoding of the credentials.Declaration
Swift
public enum PasswordType : CustomStringConvertible -
See moreTokenTypeis 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:FilterStrategyexample: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
See moreAttention
You can only define the operations array where allKeyPathsare 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:SortStrategyexample: 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
View on GitHub
Enumerations Reference