Class
RestQueryImpl
public final class RestQueryImpl<Parent, Value>: RestQuery where Parent: Codable, Value: Codable
An implementation of RestQuery protocol.
Relationships
Conforms To
RestQueryThe protocol all rest query implementations should conform to.
Initializers
init(current:params:)
required convenience public init(current: RestQueryImpl<Parent, Value>, params: [String: String])
Creates a copy of the provided current query with a different params component.
Parameters
| Name | Type | Description |
|---|---|---|
| current | RestQueryImpl<Parent, Value> |
The current query. |
| params | [String: String] |
The new params for the query copy. |
Returns
The created copy RestQueryImpl instance.
Properties
projectedValue
public var projectedValue: Binding<Value>
A binding for the wrapped value.
metadata
public var metadata: RestQueryMetadata<Parent, Value>
The metadata associated with this query.
cancellable
public var cancellable: Set<AnyCancellable>
The Set of cancellable query requests.
wrappedValue
public var wrappedValue: Value
The value wrapped by the property attached to this query.
Methods
get(prop:)
public func get(prop: Bool) -> Future<Value, RestQueryError>
Sends a get request based on the metadata associated with this query.
Parameters
| Name | Type | Description |
|---|---|---|
| prop | Bool |
True if the property key should be used on the parent request result to unwrap the value. |
Returns
A future that will resolve to the request result or an error.
post(prop:newValue:)
public func post(prop: Bool, newValue: Value) -> Future<Value, RestQueryError>
Sends a post request based on the metadata associated with this query.
Parameters
| Name | Type | Description |
|---|---|---|
| prop | Bool |
True if the property key should be used on the parent request result to unwrap the value. |
| newValue | Value |
The value that should be send as the body part of the |
Returns
A future that will resolve to the new value or an error.