KurozoraKit
public class KurozoraKit
KurozoraKit
is a root object that serves as a provider for single API endpoint. It is used to send and get data from Kurozora.
For more flexibility when using KurozoraKit
you can provide your own endpoint using KurozoraAPI.
You can also provide your own KKServices. This enables you to provide extra functionality such as storing sensetive information in Keychain
.
For further control over the information saved in Keychain
, you can provide your own Keychain
object with your specified properties.
- Tag: KurozoraKit
-
Storage to the current user’s authentication key.
Declaration
Swift
internal var _authenticationKey: String
-
The current user’s authentication key.
Declaration
Swift
public var authenticationKey: String { get set }
-
Most common HTTP headers for the Kurozora API.
Current headers are:
"Content-Type": "application/x-www-form-urlencoded", "Accept": "application/json"
Declaration
Swift
internal let headers: HTTPHeaders
-
The TRON singleton used to perform API requests.
Declaration
Swift
internal var tron: TRON!
-
The KKServices object used to perform API requests.
Declaration
Swift
public var services: KKServices!
-
Initializes
KurozoraKit
with the given API endpoint, user authentication key and services.Declaration
Swift
public init(apiEndpoint: KurozoraAPI = .v1, authenticationKey: String = "", services: KKServices = KKServices())
Parameters
apiEndpoint
The KurozoraAPI endpoint to be used.
authenticationKey
The current signed in user’s authentication key.
services
The desired KKServices to be used.
-
Sets the API endpoint for the Kurozora API.
Declaration
Swift
@discardableResult public func apiEndpoint(_ apiEndpoint: KurozoraAPI) -> Self
Parameters
apiEndpoint
The desired KurozoraAPI endpoint to be used.
Return Value
Reference to
self
. -
Sets the
authenticationKey
property with the given auth key.Declaration
Swift
@discardableResult public func authenticationKey(_ authenticationKey: String) -> Self
Parameters
authenticationKey
The current user’s authentication key.
Return Value
Reference to
self
. -
Sets the
services
property with the given KKServices object.Declaration
Swift
@discardableResult public func services(_ services: KKServices) -> Self
Parameters
services
The KKServices object to be used when performin API requests.
Return Value
Reference to
self
. -
Fetch the cast details for the given cast id.
Declaration
Swift
public func getDetails(forShowCast castIdentity: CastIdentity) -> RequestSender<CastResponse, KKAPIError>
Parameters
castID
The id of the cast for which the details should be fetched.
Return Value
An instance of
RequestSender
with the results of the cast details response. -
Fetch the cast details for the given cast id.
Declaration
Swift
public func getDetails(forLiteratureCast castIdentity: CastIdentity) -> RequestSender<CastResponse, KKAPIError>
Parameters
castID
The id of the cast for which the details should be fetched.
Return Value
An instance of
RequestSender
with the results of the cast details response. -
Fetch the cast details for the given cast id.
Declaration
Swift
public func getDetails(forGameCast castIdentity: CastIdentity) -> RequestSender<CastResponse, KKAPIError>
Parameters
castID
The id of the cast for which the details should be fetched.
Return Value
An instance of
RequestSender
with the results of the cast details response. -
Fetch the characters index.
Declaration
Swift
public func charactersIndex(next: String? = nil, limit: Int = 5, filter: CharacterFilter?) -> RequestSender<CharacterIdentityResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 5 and the maximum value is 25.
filter
The filters to apply on the index list.
Return Value
An instance of
RequestSender
with the results of the characters index response. -
Fetch the character details for the given character identity.
Declaration
Swift
public func getDetails(forCharacter characterIdentity: CharacterIdentity, including relationships: [String] = []) -> RequestSender<CharacterResponse, KKAPIError>
Parameters
characterIdentity
The character identity object of the character for which the details should be fetched.
relationships
The relationships to include in the response.
Return Value
An instance of
RequestSender
with the results of the get character details response. -
Fetch the people for the given character identity.
Declaration
Swift
public func getPeople(forCharacter characterIdentity: CharacterIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<PersonIdentityResponse, KKAPIError>
Parameters
characterIdentity
The character identity object for which the people should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get people response. -
Fetch the shows for the given character identity.
Declaration
Swift
public func getShows(forCharacter characterIdentity: CharacterIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<ShowIdentityResponse, KKAPIError>
Parameters
characterIdentity
The character identity object for which the shows should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get shows response. -
Fetch the literatures for the given character identity.
Declaration
Swift
public func getLiteratures(forCharacter characterIdentity: CharacterIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<LiteratureIdentityResponse, KKAPIError>
Parameters
characterIdentity
The character identity object for which the literatures should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get literatures response. -
Fetch the games for the given character identity.
Declaration
Swift
public func getGames(forCharacter characterIdentity: CharacterIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<GameIdentityResponse, KKAPIError>
Parameters
characterIdentity
The character identity object for which the games should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get games response. -
Fetch the episode details for the given episode identity.
Declaration
Swift
public func getDetails(forEpisode episodeIdentity: EpisodeIdentity, including relationships: [String] = []) -> RequestSender<EpisodeResponse, KKAPIError>
Parameters
episodeIdentity
The episode identity object of the episode for which the details should be fetched.
relationships
The relationships to include in the response.
Return Value
An instance of
RequestSender
with the results of the get episode detail response. -
Update an episode’s watch status.
Declaration
Swift
public func updateEpisodeWatchStatus(_ episodeIdentity: EpisodeIdentity) -> RequestSender<EpisodeUpdateResponse, KKAPIError>
Parameters
episodeIdentity
The episode identity object of the episode that should be marked as watched/unwatched.
Return Value
An instance of
RequestSender
with the results of the update episode watch status response. -
Rate the episode with the given episode identity.
Declaration
Swift
public func rateEpisode(_ episodeIdentity: EpisodeIdentity, with score: Double, description: String?) -> RequestSender<KKSuccess, KKAPIError>
Parameters
episodeIdentity
The episode identity object of the episode which should be rated.
score
The rating to leave.
description
The description of the rating.
Return Value
An instance of
RequestSender
with the results of the rate episode response. -
Fetch the reviews for a the given episode identity.
Declaration
Swift
public func getReviews(forEpisode episodeIdentity: EpisodeIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<ReviewResponse, KKAPIError>
Parameters
episodeIdentity
The episode identity object for which the reviews should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get reviews response. -
Fetch the explore page content. Explore page can be filtered by a specific genre by passing the genre id.
Leaving the
genreID
andthemeID
empty or passingnil
will return the global explore page which contains hand picked and staff curated shows.Declaration
Swift
public func getExplore(genreID: String? = nil, themeID: String? = nil) -> RequestSender<ExploreCategoryResponse, KKAPIError>
Parameters
genreID
The id of a genre by which the explore page should be filtered.
themeID
The id of a theme by which the explore page should be filtered.
Return Value
An instance of
RequestSender
with the results of the get explore response. -
Fetch the content of an explore category.
Declaration
Swift
public func getExplore(_ exploreCategoryIdentity: ExploreCategoryIdentity, next: String? = nil, limit: Int = 5) -> RequestSender<ExploreCategoryResponse, KKAPIError>
Parameters
exploreCategoryIdentity
The id of a explore category for which the content is fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 5 and the maximum value is 25.
Return Value
An instance of
RequestSender
with the results of the get explore response. -
Fetch a list of feed messages for the given user identity.
Declaration
Swift
public func getFeedMessages(forUser userIdentity: UserIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<FeedMessageResponse, KKAPIError>
Parameters
userIdentity
The identity of the user whose feed messages to fetch.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get feed messages response. -
Fetch a list of home feed messages.
Declaration
Swift
public func getFeedHome(next: String? = nil, limit: Int = 25) -> RequestSender<FeedMessageResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get feed home response. -
Fetch a list of explore feed messages.
Declaration
Swift
public func getFeedExplore(next: String? = nil, limit: Int = 25) -> RequestSender<FeedMessageResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get feed explore response. -
Post a new message to the feed.
If the message is a reply or a re-share, then also supply the parent message’s ID.
Declaration
Swift
public func postFeedMessage(_ feedMessageRequest: FeedMessageRequest) -> RequestSender<FeedMessageResponse, KKAPIError>
Parameters
feedMessageRequest
An instance of
FeedMessageRequest
containing the new feed message details.Return Value
An instance of
RequestSender
with the results of the post feed message response. -
Fetch the details of the given feed message id.
Declaration
Swift
public func getDetails(forFeedMessage messageID: String) -> RequestSender<FeedMessageResponse, KKAPIError>
Parameters
messageID
The id of the message for which the details should be fetched.
Return Value
An instance of
RequestSender
with the results of the get feed message details response. -
Fetch the replies for the given feed message id.
Declaration
Swift
public func getReplies(forFeedMessage feedMessageID: String, next: String? = nil, limit: Int = 25) -> RequestSender<FeedMessageResponse, KKAPIError>
Parameters
feedMessageID
The id of the feed message for which the replies should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get feed message replies response. -
Update the details for the given feed message id.
Declaration
Swift
public func updateMessage(_ feedMessageUpdateRequest: FeedMessageUpdateRequest) -> RequestSender<FeedMessageUpdateResponse, KKAPIError>
Parameters
feedMessageUpdateRequest
An instance of
FeedMessageUpdateRequest
containing the updated feed message details.Return Value
An instance of
RequestSender
with the results of the update feed message response. -
Heart or un-heart a feed message.
Declaration
Swift
public func heartMessage(_ messageID: String) -> RequestSender<FeedMessageUpdateResponse, KKAPIError>
Parameters
messageID
The id of the message to heart or un-heart.
Return Value
An instance of
RequestSender
with the results of the heart message response. -
Delete the specified message ID from the user’s messages.
Declaration
Swift
public func deleteMessage(_ messageID: String) -> RequestSender<KKSuccess, KKAPIError>
Parameters
messageID
The message ID to be deleted.
Return Value
An instance of
RequestSender
with the results of the delete message response. -
Fetch the games index.
Declaration
Swift
public func gamesIndex(next: String? = nil, limit: Int = 5, filter: GameFilter?) -> RequestSender<GameIdentityResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 5 and the maximum value is 25.
filter
The filters to apply on the index list.
Return Value
An instance of
RequestSender
with the results of the games index response. -
Fetch the game details for the given game identity.
Declaration
Swift
public func getDetails(forGame gameIdentity: GameIdentity, including relationships: [String] = []) -> RequestSender<GameResponse, KKAPIError>
Parameters
gameIdentity
The identity of the game for which the details should be fetched.
relationships
The relationships to include in the response.
Return Value
An instance of
RequestSender
with the results of the get game detail response. -
Fetch the person details for the given game identity.
Declaration
Swift
public func getPeople(forGame gameIdentity: GameIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<PersonIdentityResponse, KKAPIError>
Parameters
gameIdentity
The game identity object for which the person details should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get people response. -
Fetch the cast details for the given game identity.
Declaration
Swift
public func getCast(forGame gameIdentity: GameIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<CastIdentityResponse, KKAPIError>
Parameters
gameIdentity
The game identity object for which the cast details should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get cast response. -
Fetch the character details for the given game identity.
Declaration
Swift
public func getCharacters(forGame gameIdentity: GameIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<CharacterIdentityResponse, KKAPIError>
Parameters
gameIdentity
The game identity object for which the character details should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get characters response. -
Fetch the related games for a the given game identity.
Declaration
Swift
public func getRelatedGames(forGame gameIdentity: GameIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<RelatedGameResponse, KKAPIError>
Parameters
gameIdentity
The game identity object for which the related games should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get related games response. -
Fetch the related shows for a the given game identity.
Declaration
Swift
public func getRelatedShows(forGame gameIdentity: GameIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<RelatedShowResponse, KKAPIError>
Parameters
gameIdentity
The game identity object for which the related shows should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get related shows response. -
Fetch the related literatures for a the given game identity.
Declaration
Swift
public func getRelatedLiteratures(forGame gameIdentity: GameIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<RelatedLiteratureResponse, KKAPIError>
Parameters
gameIdentity
The game identity object for which the related literatures should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get related literatures response. -
Fetch the reviews for a the given game identity.
Declaration
Swift
public func getReviews(forGame gameIdentity: GameIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<ReviewResponse, KKAPIError>
Parameters
gameIdentity
The game identity object for which the reviews should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get reviews response. -
Fetch the studios for a the given game identity.
Declaration
Swift
public func getStudios(forGame gameIdentity: GameIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<StudioIdentityResponse, KKAPIError>
Parameters
gameIdentity
The game identity object for which the studios should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get studios response. -
Fetch the more by studio section for a the given game identity.
Declaration
Swift
public func getMoreByStudio(forGame gameIdentity: GameIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<GameIdentityResponse, KKAPIError>
Parameters
gameIdentity
The game identity object for which the studio games should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get more by studio response. -
Rate the game with the given game identity.
Declaration
Swift
public func rateGame(_ gameIdentity: GameIdentity, with score: Double, description: String?) -> RequestSender<KKSuccess, KKAPIError>
Parameters
gameID
The id of the game which should be rated.
score
The rating to leave.
description
The description of the rating.
Return Value
An instance of
RequestSender
with the results of the rate game response. -
Fetch the cast details for the given game identity.
Declaration
Swift
public func getUpcomingGames(next: String? = nil, limit: Int = 25) -> RequestSender<GameIdentityResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get upcoming games response. -
Fetch the list of genres.
Declaration
Swift
public func getGenres() -> RequestSender<GenreResponse, KKAPIError>
Return Value
An instance of
RequestSender
with the results of the get genres response. -
Fetch the genre details for the given genre identity.
Declaration
Swift
public func getDetails(forGenre genreIdentity: GenreIdentity) -> RequestSender<GenreResponse, KKAPIError>
Parameters
genreIdentity
The genre identity object of the genre for which the details should be fetched.
Return Value
An instance of
RequestSender
with the results of the get genre detaisl response. -
Fetch a collection of random images.
Declaration
Swift
public func getRandomImages(of kind: MediaKind, from collection: MediaCollection, limit: Int = 1) -> RequestSender<MediaResponse, KKAPIError>
Parameters
type
The type of the images.
collection
The collection the images belong to.
limit
The number of images to fetch. The default value is 1 and the maximum value is 25.
Return Value
An instance of
RequestSender
with the results of the get random images response. -
Fetch the latest Privacy Policy.
Declaration
Swift
public func getPrivacyPolicy() -> RequestSender<LegalResponse, KKAPIError>
Return Value
An instance of
RequestSender
with the results of the privacy policy response. -
Fetch the latest Terms of Use.
Declaration
Swift
public func getTermsOfUse() -> RequestSender<LegalResponse, KKAPIError>
Return Value
An instance of
RequestSender
with the results of the terms of use response. -
Fetch the literatures index.
Declaration
Swift
public func literaturesIndex(next: String? = nil, limit: Int = 5, filter: LiteratureFilter?) -> RequestSender<LiteratureIdentityResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 5 and the maximum value is 25.
filter
The filters to apply on the index list.
Return Value
An instance of
RequestSender
with the results of the literatures index response. -
Fetch the literature details for the given literature identity.
Declaration
Swift
public func getDetails(forLiterature literatureIdentity: LiteratureIdentity, including relationships: [String] = []) -> RequestSender<LiteratureResponse, KKAPIError>
Parameters
literatureIdentity
The identity of the literature for which the details should be fetched.
relationships
The relationships to include in the response.
Return Value
An instance of
RequestSender
with the results of the get literature detail response. -
Fetch the person details for the given literature identity.
Declaration
Swift
public func getPeople(forLiterature literatureIdentity: LiteratureIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<PersonIdentityResponse, KKAPIError>
Parameters
literatureIdentity
The literature identity object for which the person details should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get people response. -
Fetch the cast details for the given literature identity.
Declaration
Swift
public func getCast(forLiterature literatureIdentity: LiteratureIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<CastIdentityResponse, KKAPIError>
Parameters
literatureIdentity
The literature identity object for which the cast details should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get cast response. -
Fetch the character details for the given literature identity.
Declaration
Swift
public func getCharacters(forLiterature literatureIdentity: LiteratureIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<CharacterIdentityResponse, KKAPIError>
Parameters
literatureIdentity
The literature identity object for which the character details should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get characters response. -
Fetch the related literatures for a the given literature identity.
Declaration
Swift
public func getRelatedLiteratures(forLiterature literatureIdentity: LiteratureIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<RelatedLiteratureResponse, KKAPIError>
Parameters
literatureIdentity
The literature identity object for which the related literatures should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get related literatures response. -
Fetch the related shows for a the given literature identity.
Declaration
Swift
public func getRelatedShows(forLiterature literatureIdentity: LiteratureIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<RelatedShowResponse, KKAPIError>
Parameters
literatureIdentity
The literature identity object for which the related shows should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get related shows response. -
Fetch the related games for a the given literature identity.
Declaration
Swift
public func getRelatedGames(forLiterature literatureIdentity: LiteratureIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<RelatedGameResponse, KKAPIError>
Parameters
literatureIdentity
The literature identity object for which the related games should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get related games response. -
Fetch the reviews for a the given literature identity.
Declaration
Swift
public func getReviews(forLiterature literatureIdentity: LiteratureIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<ReviewResponse, KKAPIError>
Parameters
literatureIdentity
The literature identity object for which the reviews should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get reviews response. -
Fetch the studios for a the given literature identity.
Declaration
Swift
public func getStudios(forLiterature literatureIdentity: LiteratureIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<StudioIdentityResponse, KKAPIError>
Parameters
literatureIdentity
The literature identity object for which the studios should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get studios response. -
Fetch the more by studio section for a the given literature identity.
Declaration
Swift
public func getMoreByStudio(forLiterature literatureIdentity: LiteratureIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<LiteratureIdentityResponse, KKAPIError>
Parameters
literatureIdentity
The literature identity object for which the studio literatures should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get more by studio response. -
Rate the literature with the given literature identity.
Declaration
Swift
public func rateLiterature(_ literatureIdentity: LiteratureIdentity, with score: Double, description: String?) -> RequestSender<KKSuccess, KKAPIError>
Parameters
literatureID
The id of the literature which should be rated.
score
The rating to leave.
description
The description of the rating.
Return Value
An instance of
RequestSender
with the results of the rate literature response. -
Fetch the cast details for the given literature identity.
Declaration
Swift
public func getUpcomingLiteratures(next: String? = nil, limit: Int = 25) -> RequestSender<LiteratureIdentityResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get upcoming literatures response. -
Fetches the authenticated user’s profile details.
Declaration
Swift
public func getProfileDetails() -> RequestSender<UserResponse, KKAPIError>
Return Value
An instance of
RequestSender
with the results of the profile details response. -
Updates the authenticated user’s profile information.
Send
nil
if an infomration shouldn’t be updated, otherwise send an empty instance to unset an information.Declaration
Swift
public func updateInformation(_ profileUpdateRequest: ProfileUpdateRequest) -> RequestSender<UserUpdateResponse, KKAPIError>
Parameters
profileUpdateRequest
An instance of
ProfileUpdateRequest
containing the new profile details.Return Value
An instance of
RequestSender
with the results of the update information response. -
Fetch the followers or following list for the authenticated user.
Declaration
Swift
public func getFollowList(_ followList: UsersListType, next: String? = nil, limit: Int = 25) -> RequestSender<UserIdentityResponse, KKAPIError>
Parameters
followList
The follow list value indicating whather to fetch the followers or following list.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get follow list response. -
Fetch meta info.
Declaration
Swift
public func getInfo() -> RequestSender<MetaResponse, KKAPIError>
Return Value
An instance of
RequestSender
with the results of the meta response. -
Fetch settings used to enable additional features in the app.
k
Declaration
Swift
public func getSettings() -> RequestSender<SettingsResponse, KKAPIError>
Return Value
An instance of
RequestSender
with the results of the settings response. -
Fetch the peopel index.
Declaration
Swift
public func peopelIndex(next: String? = nil, limit: Int = 5, filter: PersonFilter?) -> RequestSender<PersonIdentityResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 5 and the maximum value is 25.
filter
The filters to apply on the index list.
Return Value
An instance of
RequestSender
with the results of the peopel index response. -
Fetch the person details for the given person identity.
Declaration
Swift
public func getDetails(forPerson personIdentity: PersonIdentity, including relationships: [String] = []) -> RequestSender<PersonResponse, KKAPIError>
Parameters
personIdentity
The persion identity object of the person for which the details should be fetched.
relationships
The relationships to include in the response.
Return Value
An instance of
RequestSender
with the results of the get person details response. -
Fetch the characters for the given person identity.
Declaration
Swift
public func getCharacters(forPerson personIdentity: PersonIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<CharacterIdentityResponse, KKAPIError>
Parameters
personIdentity
The person identity object for which the characters should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get characters response. -
Fetch the shows for the given person identity.
Declaration
Swift
public func getShows(forPerson personIdentity: PersonIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<ShowIdentityResponse, KKAPIError>
Parameters
personIdentity
The person identity object for which the shows should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get shows response. -
Fetch the literatures for the given person identity.
Declaration
Swift
public func getLiteratures(forPerson personIdentity: PersonIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<LiteratureIdentityResponse, KKAPIError>
Parameters
personIdentity
The person identity object for which the literatures should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get literatures response. -
Fetch the games for the given person identity.
Declaration
Swift
public func getGames(forPerson personIdentity: PersonIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<GameIdentityResponse, KKAPIError>
Parameters
personIdentity
The person identity object for which the games should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get games response. -
Fetch the recap list.
Declaration
Swift
public func getRecaps() -> RequestSender<RecapResponse, KKAPIError>
Return Value
An instance of
RequestSender
with the results of the get recap list response. -
Fetch recaps for the specified year.
Declaration
Swift
public func getRecap(for year: String) -> RequestSender<RecapItemResponse, KKAPIError>
Parameters
year
The year for which the recaps are fetched.
Return Value
An instance of
RequestSender
with the results of the get recap item response. -
Fetch a list of resources matching the search query.
Declaration
Swift
public func search(_ scope: KKSearchScope, of types: [KKSearchType], for query: String, next: String? = nil, limit: Int = 5, filter: KKSearchFilter?) -> RequestSender<SearchResponse, KKAPIError>
Parameters
scope
The scope of the search.
types
The types of the search.
query
The search query.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 5 and the maximum value is 25.
Return Value
An instance of
RequestSender
with the results of the search response. -
Fetch a list of resources matching the search query.
Declaration
Swift
public func getSearchSuggestions(_ scope: KKSearchScope, of types: [KKSearchType], for query: String) -> RequestSender<SearchSuggestionsResponse, KKAPIError>
Parameters
scope
The scope of the search.
types
The types of the search.
query
The search query.
Return Value
An instance of
RequestSender
with the results of the search suggestions response. -
Fetch the season details for the given season identity.
Declaration
Swift
public func getDetails(forSeason seasonIdentity: SeasonIdentity, including relationships: [String] = []) -> RequestSender<SeasonResponse, KKAPIError>
Parameters
seasonIdentity
The season identity object for which the details should be fetched.
relationships
The relationships to include in the response.
Return Value
An instance of
RequestSender
with the results of the get season details response. -
Fetch the episodes for the given season identity.
Declaration
Swift
public func getEpisodes(forSeason seasonIdentity: SeasonIdentity, next: String? = nil, limit: Int = 25, hideFillers: Bool = false) -> RequestSender<EpisodeIdentityResponse, KKAPIError>
Parameters
seasonIdentity
The season identity object of the season for which the episodes should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
hideFillers
A boolean indicating whether fillers should be included in the request.
Return Value
An instance of
RequestSender
with the results of the get season episodes response. -
Update an season’s watch status.
Declaration
Swift
public func updateSeasonWatchStatus(_ seasonIdentity: SeasonIdentity) -> RequestSender<SeasonUpdateResponse, KKAPIError>
Parameters
seasonIdentity
The season identity object of the season that should be marked as watched/unwatched.
Return Value
An instance of
RequestSender
with the results of the update season watch status response. -
Fetch the shows index.
Declaration
Swift
public func showsIndex(next: String? = nil, limit: Int = 5, filter: ShowFilter?) -> RequestSender<ShowIdentityResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 5 and the maximum value is 25.
filter
The filters to apply on the index list.
Return Value
An instance of
RequestSender
with the results of the shows index response. -
Fetch the show details for the given show identity.
Declaration
Swift
public func getDetails(forShow showIdentity: ShowIdentity, including relationships: [String] = []) -> RequestSender<ShowResponse, KKAPIError>
Parameters
showIdentity
The identity of the show for which the details should be fetched.
relationships
The relationships to include in the response.
Return Value
An instance of
RequestSender
with the results of the get show detail response. -
Fetch the person details for the given show identity.
Declaration
Swift
public func getPeople(forShow showIdentity: ShowIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<PersonIdentityResponse, KKAPIError>
Parameters
showIdentity
The show identity object for which the person details should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get people response. -
Fetch the cast details for the given show identity.
Declaration
Swift
public func getCast(forShow showIdentity: ShowIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<CastIdentityResponse, KKAPIError>
Parameters
showIdentity
The show identity object for which the cast details should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get cast response. -
Fetch the character details for the given show identity.
Declaration
Swift
public func getCharacters(forShow showIdentity: ShowIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<CharacterIdentityResponse, KKAPIError>
Parameters
showIdentity
The show identity object for which the character details should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get charaters response. -
Fetch the related shows for a the given show identity.
Declaration
Swift
public func getRelatedShows(forShow showIdentity: ShowIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<RelatedShowResponse, KKAPIError>
Parameters
showIdentity
The show identity object for which the related shows should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get related shows response. -
Fetch the related literatures for a the given show identity.
Declaration
Swift
public func getRelatedLiteratures(forShow showIdentity: ShowIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<RelatedLiteratureResponse, KKAPIError>
Parameters
showIdentity
The show identity object for which the related literatures should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get related literatures response. -
Fetch the related games for a the given show identity.
Declaration
Swift
public func getRelatedGames(forShow showIdentity: ShowIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<RelatedGameResponse, KKAPIError>
Parameters
showIdentity
The show identity object for which the related games should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get related games response. -
Fetch the reviews for a the given show identity.
Declaration
Swift
public func getReviews(forShow showIdentity: ShowIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<ReviewResponse, KKAPIError>
Parameters
showIdentity
The show identity object for which the reviews should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get reviews response. -
Fetch the seasons for a the given show identity.
Declaration
Swift
public func getSeasons(forShow showIdentity: ShowIdentity, reversed: Bool = false, next: String? = nil, limit: Int = 25) -> RequestSender<SeasonIdentityResponse, KKAPIError>
Parameters
showIdentity
The show identity object for which the seasons should be fetched.
reversed
Whethert the list is reversed in order. Default is
false
.next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get seasons response. -
Fetch the songs for a the given show identity.
Declaration
Swift
public func getSongs(forShow showIdentity: ShowIdentity, limit: Int = 25) -> RequestSender<ShowSongResponse, KKAPIError>
Parameters
showIdentity
The show identity object for which the songs should be fetched.
limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get songs response. -
Fetch the studios for a the given show identity.
Declaration
Swift
public func getStudios(forShow showIdentity: ShowIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<StudioIdentityResponse, KKAPIError>
Parameters
showIdentity
The show identity object for which the studios should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get studios response. -
Fetch the more by studio section for a the given show identity.
Declaration
Swift
public func getMoreByStudio(forShow showIdentity: ShowIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<ShowIdentityResponse, KKAPIError>
Parameters
showIdentity
The show identity object for which the studio shows should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get more by studio response. -
Rate the show with the given show identity.
Declaration
Swift
public func rateShow(_ showIdentity: ShowIdentity, with score: Double, description: String?) -> RequestSender<KKSuccess, KKAPIError>
Parameters
showID
The id of the show which should be rated.
score
The rating to leave.
description
The description of the rating.
Return Value
An instance of
RequestSender
with the results of the rate show response. -
Fetch the cast details for the given show identity.
Declaration
Swift
public func getUpcomingShows(next: String? = nil, limit: Int = 25) -> RequestSender<ShowIdentityResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get upcoming shows response. -
Fetch the songs index.
Declaration
Swift
public func songsIndex(next: String? = nil, limit: Int = 5, filter: SongFilter?) -> RequestSender<SongIdentityResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 5 and the maximum value is 25.
filter
The filters to apply on the index list.
Return Value
An instance of
RequestSender
with the results of the songs index response. -
Fetch the song details for the given song identity.
Declaration
Swift
public func getDetails(forSong songIdentity: SongIdentity, including relationships: [String] = []) -> RequestSender<SongResponse, KKAPIError>
Parameters
songIdentity
The identity of the song for which the details should be fetched.
relationships
The relationships to include in the response.
Return Value
An instance of
RequestSender
with the results of the get song details response. -
Fetch the shows for the given song identity.
Declaration
Swift
public func getShows(forSong songIdentity: SongIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<ShowIdentityResponse, KKAPIError>
Parameters
songIdentity
The song identity object for which the shows should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get song shows response. -
Fetch the games for the given song identity.
Declaration
Swift
public func getGames(forSong songIdentity: SongIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<GameIdentityResponse, KKAPIError>
Parameters
songIdentity
The song identity object for which the games should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get song games response. -
Rate the song with the given song identity.
Declaration
Swift
public func rateSong(_ songIdentity: SongIdentity, with score: Double, description: String?) -> RequestSender<KKSuccess, KKAPIError>
Parameters
songID
The id of the song which should be rated.
score
The rating to leave.
description
The description of the rating.
Return Value
An instance of
RequestSender
with the results of the rate song response. -
Fetch the reviews for a the given song identity.
Declaration
Swift
public func getReviews(forSong songIdentity: SongIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<ReviewResponse, KKAPIError>
Parameters
songIdentity
The song identity object for which the reviews should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get reviews response. -
Verify the user’s transaction receipt.
Declaration
Swift
public func verifyReceipt(_ receipt: String) -> RequestSender<ReceiptResponse, KKAPIError>
Parameters
receipt
The Base64 encoded receipt data.
Return Value
An instance of
RequestSender
with the results of the auth token response. -
Fetch the studios index.
Declaration
Swift
public func studiosIndex(next: String? = nil, limit: Int = 5, filter: StudioFilter?) -> RequestSender<StudioIdentityResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 5 and the maximum value is 25.
filter
The filters to apply on the index list.
Return Value
An instance of
RequestSender
with the results of the studios index response. -
Fetch the studio details for the given studio identiry.
Declaration
Swift
public func getDetails(forStudio studioIdentity: StudioIdentity, including relationships: [String] = [], limit: Int? = nil) -> RequestSender<StudioResponse, KKAPIError>
Parameters
studioIdentity
The studio identity ibject of the studio for which the details should be fetched.
relationships
The relationships to include in the response.
Return Value
An instance of
RequestSender
with the results of the get studio detail response. -
Fetch the shows for the given studio identity.
Declaration
Swift
public func getShows(forStudio studioIdentity: StudioIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<ShowIdentityResponse, KKAPIError>
Parameters
studioIdentity
The studio identity object for which the shows should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get shows response. -
Fetch the literatures for the given studio identity.
Declaration
Swift
public func getLiteratures(forStudio studioIdentity: StudioIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<LiteratureIdentityResponse, KKAPIError>
Parameters
studioIdentity
The studio identity object for which the literatures should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get literatures response. -
Fetch the games for the given studio identity.
Declaration
Swift
public func getGames(forStudio studioIdentity: StudioIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<GameIdentityResponse, KKAPIError>
Parameters
studioIdentity
The studio identity object for which the games should be fetched.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get games response. -
Fetch the list of themes.
Declaration
Swift
public func getThemes() -> RequestSender<ThemeResponse, KKAPIError>
Return Value
An instance of
RequestSender
with the results of the get themes response. -
Fetch the theme details for the given theme identity.
Declaration
Swift
public func getDetails(forTheme themeIdentity: ThemeIdentity) -> RequestSender<ThemeResponse, KKAPIError>
Parameters
themeIdentity
The theme identity object of the theme for which the details should be fetched.
Return Value
An instance of
RequestSender
with the results of the get theme detaisl response. -
Fetch the list of app themes from AppTheme Store.
Declaration
Swift
public func getThemeStore() -> RequestSender<AppThemeResponse, KKAPIError>
Return Value
An instance of
RequestSender
with the results of the get theme store response. -
Fetch the app theme details for the given app theme id.
Declaration
Swift
public func getDetails(forAppThemeID appThemeID: String) -> RequestSender<AppThemeResponse, KKAPIError>
Parameters
themeID
The id of the theme for which the details should be fetched.
Return Value
An instance of
RequestSender
with the results of the get theme details response. -
Sign up a new account with the given details.
Declaration
Swift
public func signUp(withUsername username: String, emailAddress: String, password: String, profileImage: UIImage?) -> RequestSender<KKSuccess, KKAPIError>
Parameters
username
The new user’s username.
password
The new user’s password.
emailAddress
The new user’s email address.
profileImage
The new user’s profile image.
Return Value
An instance of
RequestSender
with the results of the sign up response. -
Sign in with the given
email
andpassword
.This endpoint is used for signing in a user to their account. If the sign in was successful then a Kurozora authentication token is returned in the success closure.
Declaration
Swift
@discardableResult public func signIn(_ email: String, _ password: String, completion completionHandler: @escaping (_ result: Result<String, KKAPIError>) -> Void) -> DataRequest
Parameters
email
The email address of the user to be signed in.
password
The password of the user to be signed in.
completionHandler
A closure returning a value that represents either a success or a failure, including an associated value in each case.
result
A value that represents either a success or a failure, including an associated value in each case.
-
Sign in or up an account using the details from Sign in with Apple.
If a new account is created, the response will ask for the user to provide a username.
If an account exists, the user is signed in and a notification with the
KUserIsSignedInDidChange
name is posted. This notification can be observed to perform UI changes regarding the user’s sign in status. For example you can remove buttons the user should not have access to if not signed in.Declaration
Swift
@discardableResult public func signIn(withAppleID token: String, completion completionHandler: @escaping (_ result: Result<OAuthResponse, KKAPIError>) -> Void) -> DataRequest
Parameters
token
A JSON Web Token (JWT) that securely communicates information about the user to the server.
completionHandler
A closure returning a value that represents either a success or a failure, including an associated value in each case.
result
A value that represents either a success or a failure, including an associated value in each case.
-
Request a password reset link for the given email address.
Declaration
Swift
public func resetPassword(withEmailAddress emailAddress: String) -> RequestSender<KKSuccess, KKAPIError>
Parameters
emailAddress
The email address to which the reset link should be sent.
Return Value
An instance of
RequestSender
with the results of the reset password response. -
Fetch the followers or following list for the given user identity.
Declaration
Swift
public func getFollowList(forUser userIdentity: UserIdentity, _ followList: UsersListType, next: String? = nil, limit: Int = 25) -> RequestSender<UserIdentityResponse, KKAPIError>
Parameters
userIdentity
The identity of the user whose follower or following list should be fetched.
followList
The follow list value indicating whather to fetch the followers or following list.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get follow list response. -
Follow or unfollow a user with the given user identity.
Declaration
Swift
public func updateFollowStatus(forUser userIdentity: UserIdentity) -> RequestSender<FollowUpdateResponse, KKAPIError>
Parameters
userIdentity
The identity of the user to follow/unfollow.
Return Value
An instance of
RequestSender
with the results of the update follow status response. -
Fetch the favorites list for the given user identity.
Declaration
Swift
public func getFavorites(forUser userIdentity: UserIdentity, libraryKind: KKLibrary.Kind, next: String? = nil, limit: Int = 25) -> RequestSender<FavoriteLibraryResponse, KKAPIError>
Parameters
userIdentity
The identity of the user whose favorites list will be fetched.
libraryKind
From which library to get the favorites.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get favorites response. -
Fetch the library entries with the given status in the given user identity library.
Declaration
Swift
public func getLibrary(forUser userIdentity: UserIdentity, libraryKind: KKLibrary.Kind, withLibraryStatus libraryStatus: KKLibrary.Status, withSortType sortType: KKLibrary.SortType, withSortOption sortOption: KKLibrary.SortType.Option, next: String? = nil, limit: Int = 25) -> RequestSender<LibraryResponse, KKAPIError>
Parameters
userIdentity
The identity of the user whose favorites list will be fetched.
libraryKind
In which library the item should be added.
libraryStatus
The library status to retrieve the library items for.
sortType
The sort value by which the retrived items should be sorted.
sortOption
The sort option value by which the retrived items should be sorted.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get library response. -
Fetch the reviews list for the given user identity.
Declaration
Swift
public func getReviewsList(forUser userIdentity: UserIdentity, next: String? = nil, limit: Int = 25) -> RequestSender<ReviewResponse, KKAPIError>
Parameters
userIdentity
The identity of the user whose reviews list will be fetched.
libraryKind
From which library to get the reviews
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get reviews response. -
Fetch the profile details of the given user identity.
Declaration
Swift
public func getDetails(forUser userIdentity: UserIdentity) -> RequestSender<UserResponse, KKAPIError>
Parameters
userIdentity
The identity of the user whose profile details should be fetched.
Return Value
An instance of
RequestSender
with the results of the get user details response. -
Search for a user using the given username.
Declaration
Swift
public func searchUsers(for username: String) -> RequestSender<UserIdentityResponse, KKAPIError>
Parameters
username
The username to search for.
-
Deletes the authenticated user’s account.
Declaration
Swift
public func deleteUser(password: String) -> RequestSender<KKSuccess, KKAPIError>
Parameters
password
The authenticated user’s password.
Return Value
An instance of
RequestSender
with the results of the delete user response. -
Fetch the list of access tokens for the authenticated user.
Declaration
Swift
public func getAccessTokens(next: String? = nil, limit: Int = 25) -> RequestSender<AccessTokenResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get access tokens response. -
Fetch the access token details for the given access token.
Declaration
Swift
public func getDetails(forAccessToken accessToken: String) -> RequestSender<AccessTokenResponse, KKAPIError>
Parameters
accessToken
The access token for which the details should be fetched.
Return Value
An instance of
RequestSender
with the results of the get access token details response. -
Update a access token with the specified data.
Declaration
Swift
public func updateAccessToken(withAPNToken apnDeviceToken: String) -> RequestSender<KKSuccess, KKAPIError>
Parameters
apnDeviceToken
The updated APN Device Token.
Return Value
An instance of
RequestSender
with the results of the update access token response. -
Delete the specified access token from the user’s active access tokens.
Declaration
Swift
public func deleteAccessToken(_ accessToken: String) -> RequestSender<KKSuccess, KKAPIError>
Parameters
accessToken
The access token to be deleted.
Return Value
An instance of
RequestSender
with the results of the delete access token response. -
Sign out the given user access token.
Declaration
Swift
public func signOut() -> RequestSender<KKSuccess, KKAPIError>
Return Value
An instance of
RequestSender
with the results of the sign out response. -
Fetch the favorites list for the authenticated user.
Declaration
Swift
public func getFavorites(from libraryKind: KKLibrary.Kind, next: String? = nil, limit: Int = 25) -> RequestSender<FavoriteLibraryResponse, KKAPIError>
Parameters
libraryKind
From which library to get the favorites.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get favorites response. -
Update the
FavoriteStatus
value of a model in the authenticated user’s library.Declaration
Swift
public func updateFavoriteStatus(inLibrary libraryKind: KKLibrary.Kind, modelID: String) -> RequestSender<FavoriteResponse, KKAPIError>
Parameters
libraryKind
To which library the model belongs.
modelID
The id of the model whose favorite status should be updated.
Return Value
An instance of
RequestSender
with the results of the update favorite status response. -
Fetch a list of authenticated user’s feed messages.
Declaration
Swift
public func getFeedMessages(next: String? = nil, limit: Int = 25) -> RequestSender<FeedMessageResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get feed messages response. -
Fetch the library entries with the given status in the authenticated user’s library.
Declaration
Swift
public func getLibrary(_ libraryKind: KKLibrary.Kind, withLibraryStatus libraryStatus: KKLibrary.Status, withSortType sortType: KKLibrary.SortType, withSortOption sortOption: KKLibrary.SortType.Option, next: String? = nil, limit: Int = 25) -> RequestSender<LibraryResponse, KKAPIError>
Parameters
libraryKind
In which library the item should be added.
libraryStatus
The library status to retrieve the library items for.
sortType
The sort value by which the retrived items should be sorted.
sortOption
The sort option value by which the retrived items should be sorted.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get library response. -
Add an item with the given show id to the authenticated user’s library.
Declaration
Swift
public func addToLibrary(_ libraryKind: KKLibrary.Kind, withLibraryStatus libraryStatus: KKLibrary.Status, modelID: String) -> RequestSender<LibraryUpdateResponse, KKAPIError>
Parameters
libraryKind
In which library the item should be added.
libraryStatus
The library status to assign to the item.
modelID
The id of the model to add.
Return Value
An instance of
RequestSender
with the results of the add to library response. -
Update an item with the given item id in the authenticated user’s library.
Declaration
Swift
public func updateInLibrary(_ libraryKind: KKLibrary.Kind, modelID: String, rewatchCount: Int?, isHidden: Bool?) -> RequestSender<LibraryUpdateResponse, KKAPIError>
Parameters
libraryKind
From which library to delete the item.
modelID
The id of the model to be deleted.
rewatchCount
The rewatch count of the item.
isHidden
Wehther the item is marked as hidden.
Return Value
An instance of
RequestSender
with the results of the update in library response. -
Remove an item with the given item id from the authenticated user’s library.
Declaration
Swift
public func removeFromLibrary(_ libraryKind: KKLibrary.Kind, modelID: String) -> RequestSender<LibraryUpdateResponse, KKAPIError>
Parameters
libraryKind
From which library to delete the item.
modelID
The id of the model to be deleted.
Return Value
An instance of
RequestSender
with the results of the remove from library response. -
Import an exported library file into the authenticated user’s library.
Declaration
Swift
public func importToLibrary(_ libraryKind: KKLibrary.Kind, importService service: LibraryImport.Service, importBehavior behavior: LibraryImport.Behavior, filePath: URL) -> RequestSender<KKSuccess, KKAPIError>
Parameters
libraryKind
To which library to import the file.
service
The preferred service for importing the file.
behavior
The preferred behavior of importing the file.
filePath
The path to the file to be imported.
Return Value
An instance of
RequestSender
with the results of the import to library response. -
Fetch the list of notifications for the authenticated user.
Declaration
Swift
public func getNotifications() -> RequestSender<UserNotificationResponse, KKAPIError>
Return Value
An instance of
RequestSender
with the results of the get notifications response. -
Fetch the notification details for the given notification id.
Declaration
Swift
public func getDetails(forNotificationID notificationID: String) -> RequestSender<UserNotificationResponse, KKAPIError>
Parameters
notificationID
The id of the notification for which the details should be fetched.
Return Value
An instance of
RequestSender
with the results of the get notification details response. -
Update the read status for the given notification id.
Declaration
Swift
public func updateNotification(_ notificationID: String, withReadStatus readStatus: ReadStatus) -> RequestSender<UserNotificationUpdateResponse, KKAPIError>
Parameters
notificationID
The id of the notification to be updated. Accepts array of id’s or
all
.readStatus
The
ReadStatus
value the specified notification should be updated with.Return Value
An instance of
RequestSender
with the results of the update notification response. -
Delete the notification for the given notification id.
Declaration
Swift
public func deleteNotification(_ notificationID: String) -> RequestSender<KKSuccess, KKAPIError>
Parameters
notificationID
The id of the notification to be deleted.
Return Value
An instance of
RequestSender
with the results of the delete notification response. -
Fetch the list of reminders for the authenticated user.
Declaration
Swift
public func getReminders(for libraryKind: KKLibrary.Kind, next: String? = nil, limit: Int = 25) -> RequestSender<ReminderLibraryResponse, KKAPIError>
Parameters
libraryKind
From which library to get the reminders.
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get reminders response. -
Update the
ReminderStatus
value of a model in the authenticated user’s library.Declaration
Swift
public func updateReminderStatus(inLibrary libraryKind: KKLibrary.Kind, modelID: String) -> RequestSender<ReminderResponse, KKAPIError>
Parameters
libraryKind
To which library the model belongs.
modelID
The id of the model whose reminder status should be updated.
Return Value
An instance of
RequestSender
with the results of the update reminder status response. -
The reminder subscription url of the authenticated user.
Declaration
Swift
public var reminderSubscriptionURL: URL { get }
-
Fetch the list of sessions for the authenticated user.
Declaration
Swift
public func getSessions(next: String? = nil, limit: Int = 25) -> RequestSender<SessionIdentityResponse, KKAPIError>
Parameters
next
The URL string of the next page in the paginated response. Use
nil
to get first page.limit
The limit on the number of objects, or number of objects in the specified relationship, that are returned. The default value is 25 and the maximum value is 100.
Return Value
An instance of
RequestSender
with the results of the get sessions response. -
Fetch the session details for the given session id.
Declaration
Swift
public func getDetails(forSession sessionIdentity: SessionIdentity) -> RequestSender<SessionResponse, KKAPIError>
Parameters
sessionIdentity
The
SessionIdentity
object for which the details should be fetched.Return Value
An instance of
RequestSender
with the results of the get session detail response. -
Delete the specified session from the user’s active sessions.
Declaration
Swift
public func deleteSession(_ sessionIdentity: SessionIdentity) -> RequestSender<KKSuccess, KKAPIError>
Parameters
sessionIdentity
The
SessionIdentity
object to be deleted.Return Value
An instance of
RequestSender
with the results of the delete session response.