     case owner
   }
 
-  public enum RepoType: String, ApiParameter {
+  public enum CurrentUserRepoType: String, ApiParameter {
     public var name: String { return "type" }
 
     case all

    case owner
    case `private`
    case `public`
  }

  public enum Sort: String, ApiParameter {


public class RepositoriesClient: ApiClient {

  public func getAllForCurrentUser(visibility: Visibility? = nil, affiliations: [Affiliation]? = nil, type: CurrentUserRepoType? = nil, sort: Sort? = nil, direction: Direction? = nil) -> Observable<[Repository]> {
    let affiliation = affiliations.map { CustomApiParameter.joinedParameters(fromParameters: $0) }
    return get(apiUrl: .currentUserRepositories, parameters: [visibility, affiliation, type, sort, direction])
  }

  public func getRepositories(forUser username: String, type: UserRepoType? = nil, sort: Sort? = nil, direction: Direction? = nil) -> Observable<[Repository]> {
    return get(apiUrl: .userRepositories(username: username), parameters: [type, sort, direction])
  }

  public func getRepositories(forOrganization organization: String, type: OrgRepoType? = nil) -> Observable<[Repository]> {
    return get(apiUrl: .organizationRepositories(organization: organization), parameters: [type])
  }

  public func getAllRepositories(since repositoryId: Int? = nil) -> Observable<[Repository]> {
    return get(apiUrl: .repositories, parameters: repositoryId.map({ [CustomApiParameter(name: "since", value: $0)] }))
  }

}
