-
Couldn't load subscription status.
- Fork 14
EndpointGroup
An EndpointGroup represents a collection of endpoints from the
same host.
open class EndpointGroupThe baseURL represents the shared base URL of all endpoints in
this group. An Endpoint must be defined as a property of an
EndpointGroup in order to properly inherit its baseURL.
Usage:
final class UsersService: EndpointGroup {
@POST("/users")
var createUser: Endpoint<CreateUserRequest, UserDTO>
@GET("/users/:userID")
var getUser: Endpoint<GetUserRequest, UserDTO>
@GET("/users/friends")
var getFriends: Endpoint<Empty, [UserDTO]>
}
let users = UsersService(baseURL: "https://api.my-app.com")
// The baseURL of this request is inferred to be
// `https://api.my-app.com`
users.createUser.request(CreateUserRequest(...))
... // platform specific code for handling the response of
// type `UserDTO`In this example, all the endpoints above will be requested from
the baseURL of the UsersService isntance, in this case
https://api.my-app.com.
Ensure that all defined Endpoints are properties of an
EndpointGroup type so that their baseURL can be
automatically inferred when they are requested.
Initialize a group with a base url.
public init(baseURL: String)- baseURL: The
baseURLfor allEndpoints defined in this group.
The base URL for all Endpoints defined in this group.
let baseURL: StringGenerated at 2021-01-13T22:24:59-0800 using swift-doc 1.0.0-beta.5.
Alchemy
Types
- AlterTableBuilder
- BCryptDigest
- BasicAuthMiddleware
- BcryptError
- BelongsToRelationship
- CORSMiddleware
- CORSMiddleware.AllowOriginSetting
- CORSMiddleware.Configuration
- ColumnType
- CreateColumn
- CreateColumnBuilder
- CreateIndex
- CreateTableBuilder
- DatabaseConfig
- DatabaseError
- DatabaseField
- DatabaseKeyMappingStrategy
- DatabaseValue
- DayUnit
- Env
- FrequencyTyped
- Grammar
- HTTPAuth
- HTTPAuth.Basic
- HTTPAuth.Bearer
- HTTPBody
- HTTPError
- HasManyRelationship
- HasOneRelationship
- HasRelationship
- HourUnit
- JoinClause
- JoinType
- Launch
- Log
- MIMEType
- MinuteUnit
- ModelQuery
- MySQLDatabase
- Operator
- OrderClause
- OrderClause.Sort
- OrderedDictionary
- PapyrusClientError
- PathParameter
- PathParameter.DecodingError
- PostgresDatabase
- Query
- Request
- Response
- Router
- RuneError
- SQL
- SQLJSON
- Scheduler
- Schema
- SecondUnit
- Services
- Socket
- StaticFileMiddleware
- StringLength
- Thread
- TokenAuthMiddleware
- WeekUnit
- Weekday
- WhereBoolean
- WhereColumn
- WhereIn
- WhereIn.InType
- WhereNested
- WhereRaw
- WhereValue