iOS SDK: Request Constructor Framework
IDS
is a collection used to pass IDs that are [String: String]
values. To pass the MindboxID, use an init that accepts a [String: String]
value and MindboxID: Int.
You can also handle IDS as an ordinary collection:
let ids: IDS = ["someId": "someValue"]
let someValue = ids["someId"] // "someValue"
CustomFields
is an object that accepts [String:Any]
and is used to pass various custom parameters and accepts. Its value is currently inaccessible and it is used for requests only.
let customFields: CustomFields = ["someId": 1, "someId2": "2"]
DateOnly
is a class used to pass "yyyy-MM-dd"
date values to the server.
Creating and using the class:
let date = Date()
// option 1
let only = DateOnly(date)
// option 2
date.asDateOnly()
DateTime
is a class used to pass a date & time to the server.
Creating and using the class:
let date = Date()
// option 1
let dateTime = DateTime(date)
// option 2
date.asDateTime()
The CustomerRequest
class is built with the constructor and applied to create or update customer data.
The DiscountRequest
class is used for discounts, and whether you specify promoCode
or externalPromoAction
defines which of the two of its constructors you should use.
The LineRequest
class, with one constructor only, contains a quantityType
field of the enum class. The quantityType
is defined at initialization.
The ProductListItemRequest
class uses several constructors and contains various fields that define which constructor to apply.
The ViewProductRequest
class contains various fields that define which of its four constructors you should apply.
Updated about 1 year ago