GreenBookModel

A class derived from DocumentModel containing details pertaining to all green book documents

Declaration

@objc public class GreenBookModel : DocumentModel {
    @objc public var identityNumber: String? { get }
    @objc public var surname: String? { get }
    @objc public var firstNames: String? { get }
    @objc public var countryOfBirth: String? { get }
    @objc public var dateOfBirth: Date? { get }
    @objc public var dateIssued: Date? { get }
    @objc public var bookType: GreenBookType { get }
    
    override public func encode(to encoder: Encoder) throws
}

Only relevant details are shown, boilerplate or standard Swift generated code is omitted

Summary

Public variables

Name

Type

Description

Data source

String?

The identity number of the subject as found on the green book document.

OCR

String?

The surname of the subject as found on the green book document.

OCR

String?

The first names of the subject as found on the green book document.

OCR

String?

The country of birth of the subject as found on the green book document.

OCR

Date?

The date of birth of the subject as found on the green book document.

OCR

Date?

The date issued of the green book document.

OCR

The type of green book document.

OCR

Public methods

Signature

Return Type

Description

Void

Encodes the model using the encoder provided. Used to convert the model to JSON.

Public variables

identityNumber

@objc public var identityNumber: String? { get }

Example: "010203040506"

The identity number of the subject as found on the green book document.

surname

@objc public var surname: String? { get }

Example: "Doe"

The surname of the subject as found on the green book document.

firstNames

@objc public var firstNames: String? { get }

Example: "John"

The first names of the subject as found on the green book document.

countryOfBirth

@objc public var countryOfBirth: String? { get }

Example: "SOUTH AFRICA"

The country of birth of the subject as found on the green book document.

dateOfBirth

@objc public var dateOfBirth: Date? { get }

Example: 1990/01/01

The date of birth of the subject as found on the green book document.

dateIssued

@objc public var dateIssued: Date? { get }

Example: 2005/01/01

The date issued of the green book document.

bookType

@objc public var bookType: GreenBookType { get }

Example: GreenBookType.English

The type of green book document.

Public methods

encode(to encoder: Encoder)

override public func encode(to encoder: Encoder) throws

This function also calls its super function

Encodes the model using the encoder provided. Used to convert the model to JSON.

See also

Where this is used

Last updated