CharacterResource

final public class CharacterResource: ResourceUpdating

A class representing a Character on the Giant Bomb wiki. Examples include Solid Snake and Mario.

To retrieve extended info for a character, call fetchExtendedInfo(_:) upon it.

  • The resource type.

    Declaration

    Swift

    public let resourceType = ResourceType.character
  • Array of aliases the character is known by.

    Declaration

    Swift

    public fileprivate(set) var aliases: [String]?
  • URL pointing to the character detail resource.

    Declaration

    Swift

    public fileprivate(set) var api_detail_url: URL?
  • Birthday of the character.

    Declaration

    Swift

    public fileprivate(set) var birthday: Date?
  • Date the character was added to Giant Bomb.

    Declaration

    Swift

    public fileprivate(set) var date_added: Date?
  • Date the character was last updated on Giant Bomb.

    Declaration

    Swift

    public fileprivate(set) var date_last_updated: Date?
  • Brief summary of the character.

    Declaration

    Swift

    public fileprivate(set) var deck: String?
  • Description of the character.

    Declaration

    Swift

    public fileprivate(set) var description: String?
  • Game where the character made its first appearance.

    Declaration

    Swift

    public fileprivate(set) var first_appeared_in_game: GameResource?
  • Gender of the character.

    Declaration

    Swift

    public fileprivate(set) var gender: Gender?
  • id

    Unique ID of the character.

    Declaration

    Swift

    public let id: Int?
  • Main image of the character.

    Declaration

    Swift

    public fileprivate(set) var image: ImageURLs?
  • Name of the character.

    Declaration

    Swift

    public fileprivate(set) var name: String?
  • Last name of the character.

    Declaration

    Swift

    public fileprivate(set) var last_name: String?
  • Real name of the character.

    Declaration

    Swift

    public fileprivate(set) var real_name: String?
  • URL pointing to the character on Giant Bomb.

    Declaration

    Swift

    public fileprivate(set) var site_detail_url: URL?
  • Extended info.

    Declaration

    Swift

    public var extendedInfo: CharacterExtendedInfo?
  • Used to create a CharacterResource from JSON.

    Declaration

    Swift

    public init(json: [String: AnyObject])
  • Pretty description of the character.

    Declaration

    Swift

    public var prettyDescription: String
  • Fetches extended info for this character. Also re-populates base data in the case where this object is a stub from another parent resource.

    Declaration

    Swift

    public func fetchExtendedInfo(_ fields: [String]? = nil, completion: @escaping (_ error: RequestError?) -> Void)

    Parameters

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-4. Pass nil to return everything.

    completion

    A closure containing an optional RequestError if the request failed.