Client

public final class Client<Repository> where Repository : EndpointProtocol

This class is used to create instances of Repository that can be used to start requests based on the given endpoint.

Properties

  • Repository configuration

    Declaration

    Swift

    public var configuration: Configuration?
  • Initialize with environment that overrides the one set by Environment.set(_).

    Declaration

    Swift

    public init(environment: EnvironmentProtocol? = nil,
                configuration: Configuration? = nil)
  • Returns a Request that can be used later, e.g. for starting the request in a later time or canceling it.

    Declaration

    Swift

    public func request(for endpoint: Repository) -> Request

    Parameters

    endpoint

    a RepositoryProtocol enum value.