- APIServiceContract: it's a protocol that has a func
request()
implemeted by the APIService class. - APIService: it's a singletion class that implements the APIServiceContract protocol to use func
request()
, this func take theURLRequest
and make the request then return acompletionHandler
of type APIResult - APIBuilder: it's a builder class that builds the
URLRequest
to send it to the APIService class to make the request. - APIResult: it's an enum type that has two cases,
success
of type Genereic, anderror
of type APIError. - APIError: it's an enum type that has many custom types of errors like:
decodingFailure
,requestTimeOut
,requestError
,unexpected
, and etc. - NetworkConstants: it's a constant file that contains the constants helps the APIServiceComponent like:
BaseURL
,timeoutIntervalForRequest
,serviceQueue
, and etc. - APIEndPoints: it's an enum type that contains the end points that used to build the URLRequest.
- HTTPMethod: it's an enum type that contains all HTTP Methods that used to build the
URLRequest
. - HTTPHeader: it's a constant file that contains the constants of the request Header.
- ContentType: it's a constant file that contains the constants of the Content Type.
- RequestParameters: it's an enum type that has two cases
body(_: Parameters)
, andquery(_: Parameters)
, to set neither body or query parameters to the request.Parameters
is a typealias for the Dictionary type[String: Any]
.
-
Notifications
You must be signed in to change notification settings - Fork 1
AbdelrhmanKamalEliwa/APIServiceComponent
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published