AmplifyAPICategory
final public class AmplifyAPICategory
extension AmplifyAPICategory: APICategory
extension AmplifyAPICategory: CategoryTypeable
extension AmplifyAPICategory: APICategoryAuthProviderFactoryBehavior
extension AmplifyAPICategory: APICategoryGraphQLBehavior
extension AmplifyAPICategory: APICategoryInterceptorBehavior
extension AmplifyAPICategory: APICategoryRESTBehavior
extension AmplifyAPICategory: APICategoryReachabilityBehavior
extension AmplifyAPICategory: Resettable
The API category provides a solution for making HTTP requests to REST and GraphQL endpoints.
-
true
if this category has been configured withAmplify.configure()
.Warning
This property is intended for use by plugin developers.Declaration
Swift
public var isConfigured: Bool
-
Adds
plugin
to the list of Plugins that implement functionality for this category.Declaration
Swift
public func add(plugin: APICategoryPlugin) throws
Parameters
plugin
The Plugin to add
-
Returns the added plugin with the specified
key
property.Declaration
Swift
public func getPlugin(for key: PluginKey) throws -> APICategoryPlugin
Parameters
key
The PluginKey (String) of the plugin to retrieve
Return Value
The wrapped plugin
-
Removes the plugin registered for
key
from the list of Plugins that implement functionality for this category. If no plugin has been added forkey
, no action is taken, making this method safe to call multiple times.Declaration
Swift
public func removePlugin(for key: PluginKey)
Parameters
key
The key used to
add
the plugin -
The category type for API
Declaration
Swift
public var categoryType: CategoryType { get }
-
Retrieve the plugin’s auth provider factory
Declaration
Swift
public func apiAuthProviderFactory() -> APIAuthProviderFactory
Return Value
auth provider factory
-
Declaration
Swift
@discardableResult public func query<R: Decodable>(request: GraphQLRequest<R>, listener: GraphQLOperation<R>.ResultListener?) -> GraphQLOperation<R>
-
Declaration
Swift
@discardableResult public func mutate<R: Decodable>(request: GraphQLRequest<R>, listener: GraphQLOperation<R>.ResultListener?) -> GraphQLOperation<R>
-
Declaration
Swift
public func subscribe<R>(request: GraphQLRequest<R>, valueListener: GraphQLSubscriptionOperation<R>.InProcessListener?, completionListener: GraphQLSubscriptionOperation<R>.ResultListener?) -> GraphQLSubscriptionOperation<R>
-
Declaration
Swift
public func add(interceptor: URLRequestInterceptor, for apiName: String) throws
-
Declaration
Swift
@discardableResult public func get(request: RESTRequest, listener: RESTOperation.ResultListener?) -> RESTOperation
-
Declaration
Swift
@discardableResult public func put(request: RESTRequest, listener: RESTOperation.ResultListener?) -> RESTOperation
-
Declaration
Swift
@discardableResult public func post(request: RESTRequest, listener: RESTOperation.ResultListener?) -> RESTOperation
-
Declaration
Swift
@discardableResult public func delete(request: RESTRequest, listener: RESTOperation.ResultListener?) -> RESTOperation
-
Declaration
Swift
@discardableResult public func head(request: RESTRequest, listener: RESTOperation.ResultListener?) -> RESTOperation
-
Declaration
Swift
@discardableResult public func patch(request: RESTRequest, listener: RESTOperation.ResultListener?) -> RESTOperation
-
Default implementation of
reachabilityPublisher
to delegate to plugin’s methodDeclaration
Swift
@available(iOS 13.0, *) public func reachabilityPublisher(for apiName: String?) throws -> AnyPublisher<ReachabilityUpdate, Never>?
-
Default implementation of
reachabilityPublisher
to delegate to plugin’s methodDeclaration
Swift
@available(iOS 13.0, *) public func reachabilityPublisher() throws -> AnyPublisher<ReachabilityUpdate, Never>?
-
Declaration
Swift
public func reset(onComplete: @escaping BasicClosure)