RMCharacter

public struct RMCharacter

Character struct contains all functions to request character(s) information(s).

  • Undocumented

    Declaration

    Swift

    public init(client: RMClient)
  • Request character by id.

    • id: ID of the character.

    Declaration

    Swift

    public func getCharacterByID(id: Int) -> Future<RMCharacterModel, Error>

    Return Value

    Character model struct.

  • Request character by URL.

    • url: URL of the character.

    Declaration

    Swift

    public func getCharacterByURL(url: String) -> Future<RMCharacterModel, Error>

    Return Value

    Character model struct.

  • Request multiple characters by IDs.

    • ids: Character ids.

    Declaration

    Swift

    public func getCharactersByID(ids: [Int]) -> Future<[RMCharacterModel], Error>

    Return Value

    Array of Character model struct.

  • Request characters by page number.

    • page: Number of result page.

    Declaration

    Swift

    public func getCharactersByPageNumber(pageNumber: Int) -> Future<[RMCharacterModel], Error>

    Return Value

    Array of Character model struct.

  • Request all characters.

    Declaration

    Swift

    public func getAllCharacters() -> Future<[RMCharacterModel], Error>

    Return Value

    Array of Character model struct.

  • Request characters with given filter.

    • filter: CharacterFilter struct (provides requestURL with query options).

    Declaration

    Swift

    public func getCharactersByFilter(filter: RMCharacterFilter) -> Future<[RMCharacterModel], Error>

    Return Value

    Array of Character model struct.