... | ... | @@ -334,7 +334,7 @@ Please use `swift5` generator because Swift 4.x is deprecated. |
|
|
|
|
|
class BearerRequestBuilder<T>: URLSessionRequestBuilder<T> {
|
|
|
@discardableResult
|
|
|
override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (Result<Response<T>, ErrorResponse>) -> Void) -> OpenApiRequestCancellable {
|
|
|
override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (Result<Response<T>, ErrorResponse>) -> Void) -> RequestTask {
|
|
|
|
|
|
// Before making the request, we can validate if we have a bearer token to be able to make a request
|
|
|
BearerTokenHandler.refreshTokenIfDoesntExist {
|
... | ... | @@ -376,13 +376,13 @@ Please use `swift5` generator because Swift 4.x is deprecated. |
|
|
}
|
|
|
}
|
|
|
|
|
|
return requestCancellable
|
|
|
return requestTask
|
|
|
}
|
|
|
}
|
|
|
|
|
|
class BearerDecodableRequestBuilder<T: Decodable>: URLSessionDecodableRequestBuilder<T> {
|
|
|
@discardableResult
|
|
|
override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (Result<Response<T>, ErrorResponse>) -> Void) -> OpenApiRequestCancellable {
|
|
|
override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (Result<Response<T>, ErrorResponse>) -> Void) -> RequestTask {
|
|
|
// Before making the request, we can validate if we have a bearer token to be able to make a request
|
|
|
BearerTokenHandler.refreshTokenIfDoesntExist {
|
|
|
|
... | ... | @@ -423,7 +423,7 @@ Please use `swift5` generator because Swift 4.x is deprecated. |
|
|
}
|
|
|
}
|
|
|
|
|
|
return requestCancellable
|
|
|
return requestTask
|
|
|
}
|
|
|
}
|
|
|
|
... | ... | |