-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
48 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
Sources/APIClientGenerator/Networking/APIRequest+Networking.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
import Foundation | ||
import PromiseKit | ||
|
||
public extension APIRequest where Self.ResponseType: Decodable { | ||
func execute(with networking: Networking) -> Promise<ResponseType> { | ||
public extension APIRequest where Self.ResponseBody: Decodable { | ||
func execute(with networking: Networking) -> Promise<ResponseBody> { | ||
return networking.call(self) | ||
} | ||
} | ||
|
||
public extension APIRequest where Self.ResponseType == Void { | ||
func execute(with networking: Networking) -> Promise<ResponseType> { | ||
public extension APIRequest where Self.ResponseBody == Void { | ||
func execute(with networking: Networking) -> Promise<ResponseBody> { | ||
return networking.call(self) | ||
} | ||
} | ||
|
||
public extension Array where Element: APIRequest, Element.ResponseType: Decodable { | ||
func executeAll(with networking: Networking) -> Promise<[Element.ResponseType]> { | ||
public extension Array where Element: APIRequest, Element.ResponseBody: Decodable { | ||
func executeAll(with networking: Networking) -> Promise<[Element.ResponseBody]> { | ||
return when(fulfilled: self.map(networking.call)) | ||
} | ||
} | ||
|
||
public extension Array where Element: APIRequest, Element.ResponseType == Void { | ||
func executeAll(with networking: Networking) -> Promise<[Element.ResponseType]> { | ||
public extension Array where Element: APIRequest, Element.ResponseBody == Void { | ||
func executeAll(with networking: Networking) -> Promise<[Element.ResponseBody]> { | ||
return when(fulfilled: self.map(networking.call)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters