MutableVoucher

@interface MutableVoucher : Voucher

MutableVoucher is the mutable model that represents the bundle of personalizations.

  • vId

    The id of the Voucher. This will be unique for each Voucher and never change.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) long long vId;

    Swift

    var vId: Int64 { get set }
  • The status of the Voucher. See VoucherStatus for all the possible states.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) VoucherStatus status;

    Swift

    var status: VoucherStatus { get set }
  • The amount that is given to the User.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) double amount;

    Swift

    var amount: Double { get set }
  • fee

    The fee associated with the given amount.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) double fee;

    Swift

    var fee: Double { get set }
  • The currency of the Voucher. Eg. USD.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) NSString *currency;

    Swift

    var currency: String? { get set }
  • The merchant associated with the Voucher. Eg. Paypal.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) Merchant *merchant;

    Swift

    var merchant: Merchant? { get set }
  • The payment info provided by the Sender of the Voucher.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) VoucherPayment *paymentInfo;

    Swift

    var paymentInfo: VoucherPayment? { get set }
  • Require a thank you photo to be taken by the claimer of the Voucher before they are able to claim it.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL isThankYouPhotoRequired;

    Swift

    var isThankYouPhotoRequired: Bool { get set }
  • The date the thank you photo was taken for a Voucher.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) NSDate *thankYouDate;

    Swift

    var thankYouDate: Date? { get set }
  • The last date the Voucher was modified. Anytime a value changes in the Voucher, this property will update.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic) NSDate *_Nonnull dateModified;

    Swift

    var dateModified: Date { get set }
  • The date the Voucher was created. This date will never change.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic) NSDate *_Nonnull dateCreated;

    Swift

    var dateCreated: Date { get set }
  • The date the Voucher is first able to be claimed. This date will never change.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic) NSDate *_Nonnull dateClaimable;

    Swift

    var dateClaimable: Date { get set }
  • The Creator of the Voucher.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic) User *_Nonnull creator;

    Swift

    var creator: User { get set }
  • The claimer of the Voucher.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) User *claimer;

    Swift

    var claimer: User? { get set }
  • Any users who are able to view the Voucher.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) NSArray<User *> *viewers;

    Swift

    var viewers: [User]? { get set }
  • Any users who are able to claim the Voucher before it has been claimed.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) NSArray<User *> *recipients;

    Swift

    var recipients: [User]? { get set }
  • Any user ids who have unwrapped the Voucher.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable)
        NSArray<NSNumber *> *unwrappedUsers;

    Swift

    var unwrappedUsers: [NSNumber]? { get set }
  • The title of the Voucher. Customizable by the user when creating the Voucher.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) NSString *title;

    Swift

    var title: String? { get set }
  • TODO: this property

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) NSString *shareImageUrl;

    Swift

    var shareImageUrl: String? { get set }
  • The privacy status of the Voucher. Either Private / Friends / Public.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) VoucherPrivacyStatus privacy;

    Swift

    var privacy: VoucherPrivacyStatus { get set }
  • The game the User must play to claim the Voucher.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic) GameData *_Nonnull gameData;

    Swift

    var gameData: GameData { get set }
  • An array of all media items. This includes pictures, videos, sounds, notes. Customizable by the user when sending the Voucher.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable)
        NSArray<VoucherMedia *> *medias;

    Swift

    var medias: [VoucherMedia]? { get set }
  • The wrapping paper that shows up on the envelope before the Voucher has been claimed.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable)
        WrappingPaperMedia *wrappingPaperMedia;

    Swift

    var wrappingPaperMedia: WrappingPaperMedia? { get set }
  • Default initializer to create a MutableVoucher.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDictionary:(nonnull NSDictionary *)dictionary;

    Swift

    init(dictionary: [AnyHashable : Any])

    Parameters

    dictionary

    - the dictionary representation of the the MutableVoucher.

    Return Value

    instance of MutableVoucher.

  • Static initializer to create a MutableVoucher.

    Declaration

    Objective-C

    + (nonnull instancetype)mutableVoucherWithDictionary:
        (nonnull NSDictionary *)dictionary;

    Parameters

    dictionary

    - the dictionary representation of the the MutableVoucher.

    Return Value

    instance of MutableVoucher.

  • Static initializer to create a MutableVoucher from another Voucher. All properties of the Voucher will be copied to the MutableVoucher.

    Declaration

    Objective-C

    + (nonnull instancetype)mutableVoucherWithVoucher:(nonnull Voucher *)voucher;

    Swift

    convenience init(voucher: Voucher)

    Parameters

    voucher

    - Voucher used to create the MutableVoucher.

    Return Value

    instance of MutableVoucher.

  • Adds a media object to the VoucherMedia array. If no id is set on the VoucherMedia item, an id will be given.

    Declaration

    Objective-C

    - (void)addMedia:(nonnull VoucherMedia *)media;

    Swift

    func addMedia(_ media: VoucherMedia)

    Parameters

    media

    - The media item to add to the array.

  • Removes a media object from the VoucherMedia array. If no id is set on the VoucherMedia item, an id will be given.

    Declaration

    Objective-C

    - (void)removeMedia:(nonnull VoucherMedia *)media;

    Swift

    func removeMedia(_ media: VoucherMedia)

    Parameters

    media

    - The media item to be removed from the array

  • Removes a PersonalizationOption creation item from the Voucher.

    Declaration

    Objective-C

    - (void)removeCreationObjectFromVoucher:
        (nonnull CreationItemImageView *)creationItem;

    Swift

    func removeCreationObject(fromVoucher creationItem: CreationItemImageView)

    Parameters

    creationItem

    - The creation item of a PersonalizationOption to be removed from the Voucher.

  • Clears the PersonalizationOption contents of a MutableVoucher. Does not modify Voucher specific properties such as vId and status.

    Declaration

    Objective-C

    - (void)clearMutableVoucherData;

    Swift

    func clearData()