-
Notifications
You must be signed in to change notification settings - Fork 14
Endpoint
Endpoint
is an abstraction around making REST requests. It
includes a Request
type, representing the data needed to
make the request, and a Response
type, representing the
expected response from the server.
public struct Endpoint<Request: EndpointRequest, Response: Codable>
Endpoint
s are defined via property wrapped (@GET, @POST, etc...)
properties on an EndpointGroup
.
Endpoint
s are intended to be used on either client or server for
requesting external endpoints or on server for providing and
validating endpoints. There are partner libraries
(PapyrusAlamofire
and Alchemy
) for requesting or
validating endpoints on client or server platforms.
The method, or verb, of this endpoint.
let method: EndpointMethod
The path of this endpoint, relative to self.baseURL
var path: String
The baseURL
of this endpoint.
var baseURL: String = ""
Gets any information that may be needed to request this
Endpoint
.
public func parameters(dto: Request) throws -> RequestComponents
- dto: An instance of
Endpoint.Request
.
any errors that may occur when parsing out data from the Endpoint
.
A struct containing any information needed to request this endpoint with the provided instance of Request
.
Creates a copy of this Endpoint
with the provided baseURL
.
public func with(baseURL: String) -> Self
- baseURL: The baseURL for the
Endpoint
.
A copy of this Endpoint
with the baseURL
.
Generated 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