BrandRequest
public class BrandRequest : MoltinRequest
An entry point to make API calls relating to Brand
-
The API endpoint for this resource.
Declaration
Swift
public var endpoint: String
-
A typealias which allows automatic casting of a collection to
[Brand]
.Declaration
Swift
public typealias DefaultCollectionRequestHandler = CollectionRequestHandler<[Brand]>
-
A typealias which allows automatic casting of an object to
Brand
.Declaration
Swift
public typealias DefaultObjectRequestHandler = ObjectRequestHandler<Brand>
-
Return all instances of type
Brand
Declaration
Swift
@discardableResult public func all(completionHandler: @escaping DefaultCollectionRequestHandler) -> MoltinRequest
Parameters
completionHandler
The handler to be called on success or failure
Return Value
A instance of
MoltinRequest
which encapsulates the request. -
Return all instances of type
Brand
, cast to typeT
, which must beCodable
.Declaration
Swift
@discardableResult public func all<T: Codable>(completionHandler: @escaping CollectionRequestHandler<[T]>) -> MoltinRequest
Parameters
completionHandler
The handler to be called on success or failure
Return Value
A instance of
MoltinRequest
which encapsulates the request. -
Return all instances of type
Brand
byid
Declaration
Swift
@discardableResult public func get(forID id: String, completionHandler: @escaping DefaultObjectRequestHandler) -> MoltinRequest
Parameters
forID
The ID of the object
completionHandler
The handler to be called on success or failure
Return Value
A instance of
MoltinRequest
which encapsulates the request. -
Return all instances of type
Brand
byid
, cast to typeT
, which must beCodable
.Declaration
Swift
@discardableResult public func get<T: Codable>(forID id: String, completionHandler: @escaping ObjectRequestHandler<T>) -> MoltinRequest
Parameters
forID
The ID of the object
completionHandler
The handler to be called on success or failure
Return Value
A instance of
MoltinRequest
which encapsulates the request. -
Return the tree of
Brand
Declaration
Swift
@discardableResult public func tree(completionHandler: @escaping DefaultCollectionRequestHandler) -> MoltinRequest
Parameters
completionHandler
The handler to be called on success or failure
Return Value
A instance of
MoltinRequest
which encapsulates the request. -
Return the tree of
Brand
, cast to typeT
, which must beCodable
.Declaration
Swift
@discardableResult public func tree<T: Codable>(completionHandler: @escaping CollectionRequestHandler<[T]>) -> MoltinRequest
Parameters
completionHandler
The handler to be called on success or failure
Return Value
A instance of
MoltinRequest
which encapsulates the request.